1758abf67337a0da83715097a7ace1f3e8f7bfd6
galt
Thu Feb 14 23:42:40 2019 -0800
changing it to clear out the name-to-use for the downloaded archive.
diff --git src/hg/hgSession/backup.c src/hg/hgSession/backup.c
index f7b58a6..ea89aaf 100644
--- src/hg/hgSession/backup.c
+++ src/hg/hgSession/backup.c
@@ -610,31 +610,30 @@
char greek[32];
sprintWithGreekByte(greek, sizeof(greek), trackDataToDownload);
if (trackDataToDownload == 0) // suppress 0.0 B
greek[0] = 0; // empty string
printf("
%s
%s
\n", extra->name, greek); // track name
totalDataToDownload += trackDataToDownload;
}
printf("\n");
}
printf(" \n");
printf("%d custom tracks found. \n", ctCount);
-printf("%d custom tracks stored at UCSC. \n", nonBigDataUrlCount);
char greek[32];
sprintWithGreekByte(greek, sizeof(greek), totalDataToDownload);
printf("Total custom track data to backup: %s ", greek);
cgiMakeButton(hgsMakeDownloadPrefix, "create custom tracks backup archive");
printf(" \n");
printf(" \n");
}
void showDownloadSessionCtData(struct hashEl *downloadList)
/* Show download page for the given session */
@@ -1092,33 +1091,40 @@
// check the file name, make sure it is not blank
char js[1024];
safef(js, sizeof js,
"var textVar = document.getElementById('%s');"
"if (textVar.value != '')"
" return true;"
"alert('Please enter a filename for the backup archive');"
"return false;"
, hgsSaveLocalBackupFileName);
jsOnEventById("click", downButName, js);
// Add a button that just returns to the saved sessions list.
// because after pressing download and it will go into the users downloads folder,
// the browser remains sitting on this page and needs a way to return
-// to the saved sessions list.
+// to the saved sessions list. Also clear the download name field.
printf(" ");
-printf("");
+printf("");
+safef(js, sizeof js,
+"var textVar = document.getElementById('%s');"
+"textVar.value = '';"
+"return true;"
+, hgsSaveLocalBackupFileName);
+
+jsOnEventById("click", "hgsReturn", js);
printf(" \n");
printf(" \n");
hDisconnectCentral(&conn);
printf("\n");
htmlClose();
fflush(stdout);
}
void doDownloadSessionCtData(struct hashEl *downloadPathList)
/* Download given table to browser to save. */
{
@@ -1147,17 +1153,19 @@
long remaining = fSize;
int bufSize = 65536;
char *buf = needMem(bufSize);
while (remaining)
{
int bufRemain = bufSize;
if (bufRemain > remaining)
bufRemain = remaining;
mustRead(f, buf, bufRemain); // mustRead OK since we are reading from disk
mustWrite(stdout, buf, bufRemain);
remaining -= bufRemain;
lazarusLives(20 * 60); // extend keep-alive time. for big downloads on slow connections.
}
carefulClose(&f);
+cartRemove(cart, hgsSaveLocalBackupFileName);
+
}