ce35e717129dc543a902e935c86ddecbe762f557
tdreszer
Fri Aug 27 14:12:50 2010 -0700
Checking in work on making hgTrackUi subtrack cfg work by popup just as right-click does. This is ifdef'd out.
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index b0582a1..0c26581 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -46,6 +46,7 @@
#define ENCODE_DCC_DOWNLOADS "encodeDCC"
+//#define SUBTRACK_CFG_POPUP
struct trackDb *wgEncodeDownloadDirKeeper(char *db, struct trackDb *tdb, struct hash *trackHash)
/* Look up through self and parents, looking for someone responsible for handling
@@ -3830,7 +3831,12 @@
else
{
eCfgType cType = cfgTypeFromTdb(subtrack,FALSE);
+#ifdef SUBTRACK_CFG_POPUP
+ // Turn this off only if configurable explicitly set to off
+ if (trackDbSettingClosestToHome(subtrack, "configurable") && trackDbSettingClosestToHomeOn(subtrack, "configurable") == FALSE)
+#else///ifndef SUBTRACK_CFG_POPUP
if(trackDbSettingClosestToHomeOn(subtrack, "configurable") == FALSE)
+#endif///ndef SUBTRACK_CFG_POPUP
cType = cfgNone;
membership_t *membership = subgroupMembershipGet(subtrack);
{
@@ -3871,6 +3877,14 @@
printf("
| ",
subtrack->colorR, subtrack->colorG, subtrack->colorB);
}
+#ifdef SUBTRACK_CFG_POPUP
+ #define CFG_SUBTRACK_LINK "%s\n"
+ #define MAKE_CFG_SUBTRACK_LINK(table,label,title) printf(CFG_SUBTRACK_LINK, (table),(table),(label),(label),(title))
+ struct dyString *dyLabel = newDyString(128);
+#else///ifndef SUBTRACK_CFG_POPUP
+ #define CFG_SUBTRACK_LINK "%s\n"
+ #define MAKE_CFG_SUBTRACK_LINK(table,title) printf(CFG_SUBTRACK_LINK, (table),(table),(title))
+#endif///ndef SUBTRACK_CFG_POPUP
if(sortOrder != NULL)
{
int sIx=0;
@@ -3880,12 +3894,18 @@
if(ix >= 0)
{
char *titleRoot=labelRoot(membership->titles[ix],NULL);
-
-#define CFG_SUBTRACK_LINK "%s\n"
-#define MAKE_CFG_SUBTRACK_LINK(table,title) printf(CFG_SUBTRACK_LINK, (table),(table),(title))
printf (" ",sortOrder->column[sIx],membership->membership[ix]);
+#ifdef SUBTRACK_CFG_POPUP
+ dyStringPrintf(dyLabel,"%s ",titleRoot);
+ if (cType != cfgNone && sameString("view",sortOrder->column[sIx]))
+ {
+ dyStringAppend(dyLabel,"Configuration");
+ MAKE_CFG_SUBTRACK_LINK(subtrack->track,dyStringContents(dyLabel),titleRoot);
+ }
+#else///ifndef SUBTRACK_CFG_POPUP
if(cType != cfgNone && sameString("view",sortOrder->column[sIx]))
MAKE_CFG_SUBTRACK_LINK(subtrack->track,titleRoot); // FIXME: Currently configurable under sort only supported when multiview
+#endif///ndef SUBTRACK_CFG_POPUP
else
printf("%s\n",titleRoot);
puts (" | ");
@@ -3897,18 +3917,27 @@
{
printf (" ");
indentIfNeeded(hierarchy,membership);
+#ifdef SUBTRACK_CFG_POPUP
+ if (cType != cfgNone && cType != cfgWigMaf) // FIXME: wigMaf restriction is temporary unto configurable off is set
+ MAKE_CFG_SUBTRACK_LINK(subtrack->track,subtrack->shortLabel,subtrack->shortLabel);
+#else///ifndef SUBTRACK_CFG_POPUP
if(cType != cfgNone)
MAKE_CFG_SUBTRACK_LINK(subtrack->track,subtrack->shortLabel);
+#endif///ndef SUBTRACK_CFG_POPUP
else
printf("%s\n",subtrack->shortLabel);
puts (" | ");
}
+#ifdef SUBTRACK_CFG_POPUP
+ dyStringFree(&dyLabel);
+#endif///def SUBTRACK_CFG_POPUP
printf (" %s", subtrack->longLabel);
if(trackDbSetting(parentTdb, "wgEncode") && trackDbSetting(subtrack, "accession"))
printf (" [GEO:%s]", trackDbSetting(subtrack, "accession"));
compositeMetadataToggle(db,subtrack,"...",TRUE,FALSE, trackHash);
printf(" ");
+#ifndef SUBTRACK_CFG_POPUP
if(cType != cfgNone)
{
dependentCfgsNeedBinding = TRUE; // configurable subtrack needs to be bound to composite settings
@@ -3921,6 +3950,7 @@
cfgByCfgType(cType,db,cart,subtrack,htmlIdentifier,"Subtrack",TRUE);
puts("\n");
}
+#endif///ndef SUBTRACK_CFG_POPUP
printf(" | ");
makeSchemaLink(db,subtrack,"schema");
puts(" ");
@@ -6428,6 +6458,10 @@
}
jsIncludeFile("hui.js",NULL);
+#ifdef SUBTRACK_CFG_POPUP
+printf("");
+cgiMakeHiddenVar("db", db);
+#endif
puts(" ");
if (trackDbCountDescendantLeaves(tdb) < MANY_SUBTRACKS && !hasSubgroups)
{
|