90575b28d8d97732503671e4c5c80f7fbf2d3ac2
tdreszer
Tue Oct 11 13:57:16 2011 -0700
With subCfg, when only one subtrack, highlevel shouuld show subtrack controls, so that rightClick and subCfg work together.
diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 2d7277f..d62ee79 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -3704,45 +3704,67 @@
safef(htmlIdentifier, sizeof(htmlIdentifier), "%s.priority", tdb->track);
char *cartHas = cartOptionalString(cart,htmlIdentifier);
if(cartHas != NULL)
{
tdb->priority = atof(cartHas);
cartPriorities = TRUE;
}
}
slSort(tdbRefList, trackDbRefCmp);
return cartPriorities;
}
void cfgByCfgType(eCfgType cType,char *db, struct cart *cart, struct trackDb *tdb,char *prefix, char *title, boolean boxed)
// Methods for putting up type specific cfgs used by composites/subtracks in hui.c and exported for common use
{
+#ifdef SUBTRACK_CFG
+// When only one subtrack, then show it's cfg settings instead of composite/view level settings
+// This simplifies the UI where hgTrackUi won't have 2 levels of cfg,
+// while hgTracks still supports rightClick cfg of the subtrack.
+if (configurableByAjax(tdb,cType) > 0) // Only if subtrack's configurable by ajax do we consider this option
+ {
+ if (tdbIsComposite(tdb) // called for the composite
+ && !tdbIsCompositeView(tdb->subtracks) // and there is no view level
+ && slCount(tdb->subtracks) == 1) // and there is only one subtrack
+ {
+ //warn("What do you mean by having a composite (%s) with only one subtrack (%s) ???",tdb->track,tdb->subtracks->track);
+ tdb = tdb->subtracks; // show subtrack cfg instead
+ prefix = tdb->track;
+ }
+ else if (tdb->parent != NULL
+ && tdbIsCompositeView(tdb->parent) // subtrack has view
+ && differentString(prefix,tdb->track) // and this has been called for the view
+ && slCount(tdb->parent->subtracks) == 1) // and there is only one subtrack
+ prefix = tdb->track; // removes reference to view level
+ }
+#endif///def SUBTRACK_CFG
switch(cType)
{
case cfgBedScore:
{
char *scoreMax = trackDbSettingClosestToHome(tdb, SCORE_FILTER _MAX);
int maxScore = (scoreMax ? sqlUnsigned(scoreMax):1000);
scoreCfgUi(db, cart,tdb,prefix,title,maxScore,boxed);
}
break;
case cfgPeak:
encodePeakCfgUi(cart,tdb,prefix,title,boxed);
break;
case cfgWig: wigCfgUi(cart,tdb,prefix,title,boxed);
break;
- case cfgWigMaf: wigMafCfgUi(cart,tdb,prefix,title,boxed, db);
+ case cfgWigMaf: // NOTE: wigMaf is using non-standard view level naming methods so isn't configurable by ajax
+ wigMafCfgUi(cart,tdb,prefix,title,boxed, db);
break;
case cfgGenePred: genePredCfgUi(cart,tdb,prefix,title,boxed);
break;
case cfgChain: chainCfgUi(db,cart,tdb,prefix,title,boxed, NULL);
break;
case cfgNetAlign: netAlignCfgUi(db,cart,tdb,prefix,title,boxed);
break;
case cfgBedFilt: bedUi(tdb,cart,title, boxed);
break;
#ifdef USE_BAM
case cfgBam: bamCfgUi(cart, tdb, prefix, title, boxed);
break;
#endif
case cfgVcf: vcfCfgUi(cart, tdb, prefix, title, boxed);
break;
@@ -4004,32 +4026,32 @@
int ix;
// Determine whether subtrack is checked, visible, configurable, has group membership, etc.
int fourState = subtrackFourStateChecked(subtrack,cart);
boolean checkedCB = fourStateChecked(fourState);
boolean enabledCB = fourStateEnabled(fourState);
boolean visibleCB = fourStateVisible(fourState);
membership_t *membership = subgroupMembershipGet(subtrack);
eCfgType cType = cfgNone;
if (!tdbIsMultiTrack(parentTdb)) // MultiTracks never have configurable subtracks!
cType = cfgTypeFromTdb(subtrack,FALSE);
if (cType != cfgNone)
{
#ifdef SUBTRACK_CFG
// Turn off configuring for certain track type or if explicitly turned off
- int cfgSubterack = configurableByPopup(subtrack,cType);
- if (cfgSubterack <= 0)
+ int cfgSubterack = configurableByAjax(subtrack,cType);
+ if (cfgSubterack <= cfgNone)
cType = cfgNone;
else if (membersForAll->members[dimV]) // subtrack only configurable if more than one subtrack in view
{ // find "view" in subgroup membership: e.g. "signal"
if (-1 != (ix = stringArrayIx(membersForAll->members[dimV]->groupTag, membership->subgroups, membership->count)))
{
int ix2; // find "signal" in set of all views
if (-1 != (ix2 = stringArrayIx(membership->membership[ix], membersForAll->members[dimV]->tags, membersForAll->members[dimV]->count)))
{
if (membersForAll->members[dimV]->subtrackCount[ix2] < 2)
cType = cfgNone;
}
}
}
else if (slCount(subtrackRefList) < 2 && cfgTypeFromTdb(parentTdb,FALSE) != cfgNone)
cType = cfgNone; // don't bother if there is a single subtrack but the composite is configurable.
@@ -4175,32 +4197,31 @@
// How to make this thing float to the left? Container is overflow:visible
// and contained (made in js) is position:relative; left: -{some pixels}
#define CFG_SUBTRACK_DIV "