e9860a7ad658ba7e411f5ea1472198f280652cc9 max Mon Apr 30 10:17:10 2012 -0700 added one missing file to theme commit (config option dialog) diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c index 35f17ea..8d2c51b 100644 --- src/hg/hgTracks/config.c +++ src/hg/hgTracks/config.c @@ -5,30 +5,62 @@ #include "cheapcgi.h" #include "htmshell.h" #include "hdb.h" #include "hCommon.h" #include "cart.h" #include "web.h" #include "customTrack.h" #include "hgTracks.h" #include "hgConfig.h" #include "jsHelper.h" #include "imageV2.h" #include "search.h" #include "hubConnect.h" #include "fileUi.h" +static void themeDropDown(struct cart* cart) +/* Create drop down for UI themes. + * specfied in hg.conf like this + * browser.theme.modern=background.png,HGStyle + * */ +{ +struct slName* themes = cfgNamesWithPrefix("browser.theme."); +//struct slName* themes = cfgNames(); +if (themes==NULL) + return; + +hPrintf("website style:"); +hPrintf(""); + +char *labels[50]; +struct slName* el; +int i = 0; +el = themes; +for (el = themes; el != NULL && i<50; el = el->next) + { + char* name = el->name; + name = chopPrefix(name); // chop off first two words + name = chopPrefix(name); + labels[i] = name; + i++; + } +char* currentTheme = cartOptionalString(cart, "classic"); // default value is classic +hDropList("theme", labels, i, currentTheme); +slFreeList(themes); +hPrintf(""); +} + static void textSizeDropDown() /* Create drop down for font size. */ { static char *sizes[] = {"6", "8", "10", "12", "14", "18", "24", "34"}; hDropList(textSizeVar, sizes, ArraySize(sizes), tl.textSize); } static void trackConfig(struct track *trackList, struct group *groupList, char *groupTarget, int changeVis) /* Put up track configurations. If groupTarget is * NULL then set visibility for tracks in all groups. Otherwise, * just set it for the given group. If vis is -2, then visibility is * unchanged. If -1 then set visibility to default, otherwise it should * be tvHide, tvDense, etc. */ { @@ -366,31 +398,33 @@ hPrintf("text size:"); hPrintf(""); textSizeDropDown(); hPrintf(""); if (trackLayoutInclFontExtras()) { char *defaultStyle = cartUsualString(cart, "fontType", "medium"); cartMakeRadioButton(cart, "fontType", "medium", defaultStyle); hPrintf(" medium "); cartMakeRadioButton(cart, "fontType", "fixed", defaultStyle); hPrintf(" fixed "); cartMakeRadioButton(cart, "fontType", "bold", defaultStyle); hPrintf(" bold "); hPrintf(" "); } -hPrintf("
"); + +themeDropDown(cart); + hTableStart(); if (ideoTrack != NULL) { hPrintf(""); hCheckBox("ideogram", cartUsualBoolean(cart, "ideogram", TRUE)); hPrintf(""); hPrintf("Display chromosome ideogram above main graphic"); hPrintf("\n"); } hPrintf(""); hCheckBox("guidelines", cartUsualBoolean(cart, "guidelines", TRUE)); hPrintf(""); hPrintf("Show light blue vertical guidelines"); hPrintf("\n"); @@ -448,22 +482,21 @@ hPrintf(" "); cgiMakeButtonWithMsg(configDefaultAll, "default","Display only default tracks"); hPrintf("   Groups: "); hButtonWithOnClick("hgt.collapseGroups", "collapse all", "Collapse all track groups", "return vis.expandAllGroups(false)"); hPrintf(" "); hButtonWithOnClick("hgt.expandGroups", "expand all", "Expand all track groups", "return vis.expandAllGroups(true)"); hPrintf("
Control track and group visibility more selectively below.
"); trackConfig(trackList, groupList, groupTarget, vis); dyStringFree(&title); freez(&groupTarget); webEndSectionTables(); hPrintf(""); } - void configPage() /* Put up configuration page. */ { configPageSetTrackVis(-2); }