4fa0e7161f5d0aa6068807e41c2bf935cdc6865f
braney
  Tue Jul 12 18:40:16 2011 -0700
make it so unlisted hubs don't disappear when you deselect them, and add the ability to disconnect them
diff --git src/hg/inc/hubConnect.h src/hg/inc/hubConnect.h
index 5c428cf..6b17d41 100644
--- src/hg/inc/hubConnect.h
+++ src/hg/inc/hubConnect.h
@@ -44,60 +44,68 @@
 /* Return TRUE if it's an unlisted hub */
 
 void hubConnectStatusFree(struct hubConnectStatus **pHub);
 /* Free hubConnectStatus */
 
 void hubConnectStatusFreeList(struct hubConnectStatus **pList);
 /* Free a list of dynamically allocated hubConnectStatus's */
 
 struct hubConnectStatus *hubConnectStatusForId(struct cart *cart,
     struct sqlConnection *conn, int id);
 /* Given a hub ID return associated status. */
 
 struct hubConnectStatus *hubConnectStatusListFromCart(struct cart *cart);
 /* Return list of track hubs that are turned on by user in cart. */
 
+struct hubConnectStatus *hubConnectStatusListFromCartAll(struct cart *cart);
+/* Return list of all track hubs that are referenced by cart. */
+
 #define hubConnectTrackHubsVarName "trackHubs"
 /* Name of cart variable with list of track hubs. */
 
 #define hgHubConnectCgiDestUrl "hgHubConnect.destUrl"
 /* Cart variable to tell hgHubConnect where to go on submit. */
 
 #define hgHubConnectRemakeTrackHub "hgHubConnect.remakeTrackHub"
 /* Cart variable to indicate trackHub cart variable needs refreshing. */
 
 #define hgHubConnectHubVarPrefix "hgHubConnect.hub."
 /* Prefix to temporary variable holding selected cart names. */
 
 boolean hubConnectTableExists();
 /* Return TRUE if the hubConnect table exists. */
 
 struct slName  *hubConnectHubsInCart(struct cart *cart);
 /* Return list of track hub ids that are turned on by user. */
 
+int hubIdFromCartName(char *trackName);
+/* Given something like "hgHubConnect.hub.123" return 123 */
+
 int hubIdFromTrackName(char *trackName);
 /* Given something like "hub_123_myWig" return 123 */
 
 struct trackDb *hubConnectAddHubForTrackAndFindTdb(struct cart *cart,
     char *database, char *trackName, struct trackDb **pTdbList, 
     struct hash *trackHash);
 /* Go find hub for trackName (which will begin with hub_), and load the tracks
  * for it, appending to end of list and adding to trackHash.  Return the
  * trackDb associated with trackName. */
 
 char *hubFileVar();
 /* return the name of the cart variable that holds the name of the
  * file in trash that has private hubs */
 
 boolean hubWriteToFile(FILE *f, struct hubConnectStatus *el);
 /* write out a hubConnectStatus structure to a file */
 
 unsigned hubFindOrAddUrlInStatusTable(char *database, struct cart *cart,
     char *url, char **errorMessage);
 /* find or add a URL to the status table */
 
 void hubClearStatus(char *url);
 /* delete the status for this hub from the status table */
 
+void hubDisconnect(struct cart *cart, char *url);
+/* disconnect this hub (remove from status and cart) */
 void hubCheckForNew(char *database, struct cart *cart);
 /* see if the user just typed in a new hub url */
 #endif /* HUBCONNECT_H */