58ada3bc410cb2ee88828d95f2be1168328bc0d9
braney
  Tue Feb 7 10:11:53 2017 -0800
more tweaks to label support for big* files.   Added defaultLabelFields
and labelSeparator.  Also support "none" for both labelFields and
defaultLabelFields.

diff --git src/hg/lib/hui.c src/hg/lib/hui.c
index 3661eb6..dbb4428 100644
--- src/hg/lib/hui.c
+++ src/hg/lib/hui.c
@@ -5792,71 +5792,79 @@
 
 printf("<p><b>Color track based on chromosome:</b> ");
 safef(colorVar, sizeof(colorVar), "%s.color", tdb->track);
 colorSetting = cartUsualString(cart, colorVar, colorDefault);
 cgiMakeRadioButton(colorVar, "on", sameString(colorSetting, "on"));
 printf(" on ");
 cgiMakeRadioButton(colorVar, "off", sameString(colorSetting, "off"));
 printf(" off ");
 printf("<br><br>");
 filterByChromCfgUi(cart,tdb);
 }
 
 struct slPair *buildFieldList(struct trackDb *tdb, char *trackDbVar, struct asObject *as)
 /* Build up a hash of a list of fields in an AS file. */
 {
-struct slPair *list = NULL;
 char *fields = trackDbSettingClosestToHome(tdb, trackDbVar);
 
-if (fields != NULL)
-    {
+if (fields == NULL)
+    return NULL;
+
+if (sameString(fields, "none"))
+    return slPairNew("none", NULL);
+
+struct slPair *list = NULL;
 struct slName *thisField, *fieldList = slNameListFromComma(fields);
 for(thisField = fieldList; thisField; thisField = thisField->next)
     {
     char *trimLabel = trimSpaces(thisField->name);
     unsigned colNum = asColumnFindIx(as->columnList, trimLabel);
     if (colNum == -1)
-            errAbort("cannot find field named '%s' in as file '%s'", 
+        errAbort("cannot find field named '%s' in AS file '%s'", 
             trimLabel, as->name);
 
     slAddHead(&list, slPairNew(trimLabel, NULL + colNum));
     }
-    }
 
 slReverse(&list);
 return list;
 }
 
 void labelCfgUi(char *db, struct cart *cart, struct trackDb *tdb)
 /* If there is a labelFields for a bigBed, this routine is called to put up the label options. */
 {
+if (trackDbSettingClosestToHomeOn(tdb, "linkIdInName"))
+    return;
+
 struct asObject *as = asForDb(tdb, db);  
 struct slPair *labelList = buildFieldList(tdb, "labelFields",  as);
 struct slPair *defaultLabelList = buildFieldList(tdb, "defaultLabelFields",  as);
 char varName[1024];
 
-if (labelList == NULL)
+if ((labelList == NULL) || sameString(labelList->name, "none"))
     return;
 
 printf("<B>Label:</B> ");
 struct slPair *thisLabel = labelList;
 for(; thisLabel; thisLabel = thisLabel->next)
     {
     safef(varName, sizeof(varName), "%s.label.%s", tdb->track, thisLabel->name);
     boolean isDefault = FALSE;
     if (defaultLabelList == NULL)
         isDefault = (thisLabel == labelList);
+    else if (sameString(defaultLabelList->name, "none"))
+        isDefault = FALSE;
     else
         isDefault = (slPairFind(defaultLabelList, thisLabel->name) != NULL);
 
     boolean option = cartUsualBoolean(cart, varName, isDefault);
     cgiMakeCheckBox(varName, option);
 
     // find comment for the column listed
     struct asColumn *col = as->columnList;
     unsigned num = ptToInt(thisLabel->val);
     for(; col && num--; col = col->next)
         ;
     assert(col);
     printf(" %s&nbsp;&nbsp;&nbsp;", col->comment);
     }
 }