45958cde3c4826c519dc71d4cbf9bf6afdb28f74 braney Fri Oct 7 08:52:25 2011 -0700 fix a weirdness with the display caused by a pause when the track hubs are collected. The behavior was that the window would paint one way, and then repaint correctly. diff --git src/hg/hgHubConnect/hgHubConnect.c src/hg/hgHubConnect/hgHubConnect.c index 0f7aacd..9015da2 100644 --- src/hg/hgHubConnect/hgHubConnect.c +++ src/hg/hgHubConnect/hgHubConnect.c @@ -42,50 +42,50 @@ puts("<TD>"); } static void ourCellEnd() { puts("</TD>"); } static void ourPrintCell(char *str) { ourCellStart(); puts(str); ourCellEnd(); } -static void hgHubConnectUnlisted() +static void hgHubConnectUnlisted(struct hubConnectStatus *hubList) /* Put up the list of unlisted hubs and other controls for the page. */ { // put out the top of our page printf("<div id=\"unlistedHubs\" class=\"hubList\"> " "<table id=\"unlistedHubsTable\"> " "<thead><tr> " "<th colspan=\"5\" id=\"addHubBar\"><label>URL:</label> " "<input name=\"hubText\" id=\"hubUrl\" class=\"hubField\"" "type=\"text\" size=\"65\"> " "<input name=\"hubAddButton\"" "onClick=\"document.addHubForm.elements['hubUrl'].value=hubText.value;" "document.addHubForm.submit();return true;\" " "class=\"hubField\" type=\"button\" value=\"Add Hub\">" "</th> " "</tr> "); // count up the number of unlisted hubs we currently have int count = 0; -struct hubConnectStatus *hub, *hubList = hubConnectStatusListFromCartAll(cart); +struct hubConnectStatus *hub; for(hub = hubList; hub; hub = hub->next) { if (isHubUnlisted(hub) && ((hub->trackHub == NULL) || trackHubHasDatabase(hub->trackHub, database) )) count++; } if (count == 0) { // nothing to see here printf( "<tr><td>No Track Hubs for this genome assembly</td></tr>" "</td></table>"); printf("</thead></div>"); return; } @@ -372,30 +372,33 @@ "bar and label underneath the main browser graphic, and in the " "configure page. For more information, see the " "<A HREF=\"../goldenPath/help/hgTrackHubHelp.html\" TARGET=_blank>" "User's Guide</A>.</P>\n" "<P><B>NOTE: Because Track Hubs are created and maintained by external sources," " UCSC cannot be held responsible for their content.</B></P>" ); printf("</div>\n"); // figure out and print out genome name makeGenomePrint(); // check to see if we have any new hubs hubCheckForNew(database, cart); +// grab all the hubs that are listed in the cart +struct hubConnectStatus *hubList = hubConnectStatusListFromCartAll(cart); + // here's a little form for the add new hub button printf("<FORM ACTION=\"%s\" NAME=\"addHubForm\">\n", "../cgi-bin/hgHubConnect"); cgiMakeHiddenVar("hubUrl", ""); cgiMakeHiddenVar(hgHubConnectRemakeTrackHub, "on"); puts("</FORM>"); // this the form for the disconnect hub button printf("<FORM ACTION=\"%s\" NAME=\"disconnectHubForm\">\n", "../cgi-bin/hgHubConnect"); cgiMakeHiddenVar("hubId", ""); cgiMakeHiddenVar(hgHubDoDisconnect, "on"); cgiMakeHiddenVar(hgHubConnectRemakeTrackHub, "on"); puts("</FORM>"); // this the form for the reset hub button printf("<FORM ACTION=\"%s\" NAME=\"resetHubForm\">\n", "../cgi-bin/hgHubConnect"); @@ -406,31 +409,31 @@ // ... and now the main form if (cartVarExists(cart, hgHubConnectCgiDestUrl)) destUrl = cartOptionalString(cart, hgHubConnectCgiDestUrl); printf("<FORM ACTION=\"%s\" METHOD=\"POST\" NAME=\"mainForm\">\n", destUrl); cartSaveSession(cart); // we have two tabs for the public and unlisted hubs printf("<div id=\"tabs\">" "<ul> <li><a href=\"#publicHubs\">Public Hubs</a></li>" "<li><a href=\"#unlistedHubs\">My Hubs</a></li> " "</ul> "); hgHubConnectPublic(); -hgHubConnectUnlisted(); +hgHubConnectUnlisted(hubList); printf("</div>"); printf("<div class=\"tabFooter\">"); cgiMakeButton("Submit", "Load Selected Hubs"); char *emailAddress = cfgOptionDefault("hub.emailAddress","genome@soe.ucsc.edu"); printf("<span class=\"small\">" "Contact <A HREF=\"mailto:%s\">%s</A> to add a public hub." "</span>\n", emailAddress,emailAddress); printf("</div>"); cgiMakeHiddenVar(hgHubConnectRemakeTrackHub, "on"); printf("</div>\n"); puts("</FORM>");