494ba676944a710a244db32fdc74f8ba01ff5148
tdreszer
Thu Sep 9 10:40:02 2010 -0700
Cleaned up a lot of obsolete ifdefs, now that dragReorder and flatTracks are on the RR
diff --git src/hg/hgTracks/config.c src/hg/hgTracks/config.c
index 4163a83..617982b 100644
--- src/hg/hgTracks/config.c
+++ src/hg/hgTracks/config.c
@@ -1,516 +1,512 @@
/* config - put up track and display configuration page. */
#include "common.h"
#include "dystring.h"
#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 "searchTracks.h"
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);
}
-#ifndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
static void printGroupListHtml(char *groupCgiName, struct group *groupList, char *defaultGroup)
/* Make an HTML select input listing the groups. */
{
char *groups[128];
char *labels[128];
char *defaultLabel = NULL;
int numGroups = 0;
struct group *group = NULL;
for (group = groupList; group != NULL; group = group->next)
{
groups[numGroups] = group->name;
labels[numGroups] = group->name;
if (sameWord(defaultGroup, groups[numGroups]))
defaultLabel = groups[numGroups];
numGroups++;
if (numGroups >= ArraySize(groups))
internalErr();
}
cgiMakeDropListFull(groupCgiName, labels, groups, numGroups,
defaultLabel, NULL);
}
-#endif///ndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
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. */
{
-#ifndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
char pname[512];
char gname[512];
-#endif///ndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
struct group *group;
boolean showedRuler = FALSE;
setRulerMode();
changeTrackVis(groupList, groupTarget, changeVis);
/* Set up ruler mode according to changeVis. */
#ifdef BOB_DOESNT_LIKE
if (changeVis != -2)
{
if (groupTarget == NULL ||
(groupList != NULL && sameString(groupTarget, groupList->name)))
{
if (changeVis == -1)
rulerMode = tvFull;
else
rulerMode = changeVis;
}
}
#endif /* BOB_DOESNT_LIKE */
jsInit();
cgiMakeHiddenVar(configGroupTarget, "none");
boolean isFirstNotCtGroup = TRUE;
for (group = groupList; group != NULL; group = group->next)
{
struct trackRef *tr;
if (group->trackList == NULL)
continue;
/* check if group section should be displayed */
char *otherState;
char *indicator;
char *indicatorImg;
boolean isOpen = !isCollapsedGroup(group);
collapseGroupGoodies(isOpen, FALSE, &indicatorImg,
&indicator, &otherState);
hTableStart();
hPrintf("
");
hPrintf("
");
hPrintf("\n",group->name);
hPrintf("",
collapseGroupVar(group->name),collapseGroupVar(group->name), (isOpen?0:1));
hPrintf(" ",
hgTracksName(), cartSidUrlString(cart),collapseGroupVar(group->name),
otherState, group->name, group->name, group->name, indicatorImg, indicator);
hPrintf(" %s ", wrapWhiteFont(group->label));
hPrintf(" ");
hPrintf("",
configHideAll, "hide all", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
hPrintf("",
configShowAll, "show all", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
hPrintf("",
configDefaultAll, "default", configGroupTarget, group->name,
jsSetVerticalPosition("mainForm"));
hPrintf(" ");
/* do not want all the submit buttons named the same. It is
* confusing to the javascript submit() function.
*/
char submitName[256];
safef(submitName, sizeof(submitName), "%sSubmit", group->name);
cgiMakeButton(submitName, "submit");
-#ifndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf(" ");
hPrintf(" ");
hPrintf(" ");
hPrintf("%s", wrapWhiteFont("Group Order: "));
}
-#endif///ndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#endif///def PRIORITY_CHANGES_IN_CONFIG_UI
hPrintf("
\n");
-#ifndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf("
");
if (tdbIsSuperTrackChild(tdb))
/* indent members of a supertrack */
hPrintf(" ");
/* If track is not on this chrom print an informational
message for the user. */
if (hTrackOnChrom(track->tdb, chromName))
{
if (tdbIsSuper(track->tdb))
{
/* supertrack dropdown is hide/show */
superTrackDropDown(cart, track->tdb, 1);
}
else
{
/* check for option of limiting visibility to one mode */
hTvDropDownClassVisOnly(track->track, track->visibility,
track->canPack, (track->visibility == tvHide) ?
"hiddenText" : "normalText",
trackDbSetting(track->tdb, "onlyVisibility"));
}
}
else
hPrintf("[No data-%s]", chromName);
hPrintf("
");
hPrintf("
");
hPrintf("%s", track->longLabel);
hPrintf("
");
-#ifndef IMAGEv2_DRAG_REORDER_NOPRIORITY
+#ifdef PRIORITY_CHANGES_IN_CONFIG_UI
if (withPriorityOverride)
{
hPrintf("
\n");
}
hTableEnd();
hPrintf(" ");
}
}
void configPageSetTrackVis(int vis)
/* Do config page after setting track visibility. If vis is -2, then visibility
* is unchanged. If -1 then set visibility to default, otherwise it should
* be tvHide, tvDense, etc. */
{
struct dyString *title = dyStringNew(0);
char *groupTarget = NULL;
struct track *trackList = NULL;
struct track *ideoTrack = NULL;
struct group *groupList = NULL;
-#if !defined(IMAGEv2_DRAG_REORDER_NOPRIORS) || !defined(IMAGEv2_DRAG_REORDER_NOPRIORITY)
withPriorityOverride = cartUsualBoolean(cart, configPriorityOverride, FALSE);
-#endif/// !defined(IMAGEv2_DRAG_REORDER_NOPRIORS) || !defined(IMAGEv2_DRAG_REORDER_NOPRIORITY)
/* Get track list and group them. */
ctList = customTracksParseCart(database, cart, &browserLines, &ctFileName);
trackList = getTrackList(&groupList, vis);
/* The ideogram for some reason is considered a track.
* We don't really want to process it as one though, so
* we see if it's there, and if necessary remove it. */
ideoTrack = chromIdeoTrack(trackList);
if (ideoTrack != NULL)
removeTrackFromGroup(ideoTrack);
/* Fetch group to change on if any from CGI,
* and remove var so it doesn't get used again. */
groupTarget = cloneString(cartUsualString(cart, configGroupTarget, ""));
cartRemove(cart, configGroupTarget);
if (sameString(groupTarget, "none"))
freez(&groupTarget);
dyStringPrintf(title, "Configure Image");
hPrintf("