eea5c3f688ba673e4a7af3d3a9441690aaaeeb2e tdreszer Tue Aug 10 16:43:07 2010 -0700 Removed the CB_SELECTION ifndefs diff --git src/hg/hgTracks/searchTracks.c src/hg/hgTracks/searchTracks.c index 25071b9..b5a7f79 100644 --- src/hg/hgTracks/searchTracks.c +++ src/hg/hgTracks/searchTracks.c @@ -245,7 +245,7 @@ hPrintf("\n"); hPrintf("\n"); -hPrintf("
\n" +hPrintf("\n" "
\n" "\n"); @@ -383,16 +380,10 @@ hPrintf("
\n"); -#ifdef CB_SELECTION -hPrintf("\n", searchTracks); -hPrintf("\n"); -#endif///def CB_SELECTION +hPrintf("\n", searchTracks); +hPrintf("\n"); hPrintf("
\n
\n"); -#ifndef CB_SELECTION -hPrintf("\n", searchTracks); -hPrintf("\n"); -#endif///ndef CB_SELECTION hPrintf("\n"); if(descSearch != NULL && !strlen(descSearch)) @@ -526,47 +517,48 @@ } } -if(tracksFound) +if(tracksFound < 1) + { + if(doSearch) + hPrintf("

No tracks found

\n"); + } +else { struct hash *tdbHash = makeTrackHash(database, chromName); -#ifndef CB_SELECTION - hPrintf("   %d tracks found\n", tracksFound); -#endif///ndef CB_SELECTION hPrintf("
\n\n", hgTracksName()); -#ifdef CB_SELECTION - hPrintf("
"); - if(tracksFound > 9) + #define MAX_FOUND_TRACKS 100 + if(tracksFound > MAX_FOUND_TRACKS) + { + hPrintf("
Found %d tracks, but only the first %d are displayed.",tracksFound,MAX_FOUND_TRACKS); + hPrintf("
Please narrow search criteria to find fewer tracks.
\n"); + } + + #define ENOUGH_FOUND_TRACKS 10 + if(tracksFound >= ENOUGH_FOUND_TRACKS) { hPrintf(""); hPrintf("    "); - //hPrintf("   %d tracks found\n", tracksFound); } -#endif///def CB_SELECTION hPrintf("\n"); -#else///ifndef CB_SELECTION - hButton("submit", "View in Browser"); - hPrintf(""); - hPrintf("\n"); -#endif///ndef CB_SELECTION // FIXME: I believe that only data tracks should appear in found tracks. If composite is found, show its children instead - // FIXME: I believe if the fount track list is too large, a warning should be shown instead: "Found 237 tracks... Please narrow search criteria to find fewer tracks." + + int trackCount=0; struct slRef *ptr; while((ptr = slPopHead(&tracks))) { + if(++trackCount > MAX_FOUND_TRACKS) + break; + struct track *track = (struct track *) ptr->val; // trackDbOutput(track->tdb, stderr, ',', '\n'); hPrintf("\n",COLOR_BG_ALTDEFAULT); -#ifdef CB_SELECTION + // FIXME: I think we have now changed the paradigm for subtrack vis: // There must be a {trackName}_sel to have subtrack level vis override. // This means rightClick must make a {trackName}_sel, which is needed for hgTrackUi conformity anyway @@ -590,7 +582,7 @@ cgiMakeCheckBoxIdAndJS(name,checked,name,"class='selCb' onchange=\"findTracksClickedOne(this,true);\""); hPrintf("\n"); -#endif///def CB_SELECTION + hPrintf("\n"); -#ifdef CB_SELECTION hPrintf("\n", trackUrl(track->track, NULL), track->shortLabel); hPrintf("\n"); - hPrintf("\n"); } hPrintf("
\n"); -#ifdef CB_SELECTION hPrintf("\n"); #define PM_BUTTON "" hPrintf("
",HG_COL_HEADER); printf(PM_BUTTON,"true", "plus_all", "add_sm.gif", "Select"); printf(PM_BUTTON,"false","minus_all","remove_sm.gif","Unselect"); hPrintf("VisibilityNameDescription
\n"); - hButtonWithOnClick("hgt.ignoreme", "Select All", "show all found tracks", "changeSearchVisibilityPopups('full'); return false;"); - hButtonWithOnClick("hgt.ignoreme", "Unselect All", "show all found tracks", "changeSearchVisibilityPopups('hide'); return false;"); - hPrintf("

NameDescription
\n"); if (tdbIsSuper(track->tdb)) { @@ -601,64 +593,46 @@ { hTvDropDownClassVisOnly(track->track, track->visibility, track->canPack, -#ifdef CB_SELECTION - "normalText", -#else///ifndef CB_SELECTION - (track->visibility == tvHide) ? "hiddenText" : "normalText", -#endif///ndef CB_SELECTION + "normalText", // Show hide as normal text too! (track->visibility == tvHide) ? "hiddenText" : "normalText", trackDbSetting(track->tdb, "onlyVisibility")); } hPrintf("%s%s", track->longLabel); compositeMetadataToggle(database, track->tdb, "...", TRUE, FALSE, tdbHash); -#else///ifndef CB_SELECTION - hPrintf("%s", track->shortLabel); - compositeMetadataToggle(database, track->tdb, "...", TRUE, FALSE, tdbHash); - hPrintf("%s", trackUrl(track->track, NULL), track->longLabel); -#endif///ndef CB_SELECTION hPrintf("
\n"); -#ifdef CB_SELECTION hPrintf(""); hPrintf("    "); - //hPrintf("   %d tracks found\n", tracksFound); hPrintf("\n"); -#else///ifndef CB_SELECTION - hButton("submit", "View in Browser"); -#endif///ndef CB_SELECTION hPrintf("\n
\n"); } -else - { - if(doSearch) - hPrintf("

No tracks found

\n"); - } -hPrintf("

Recently Done

\n"); webEndSectionTables(); }