mirror of
https://github.com/sheumann/DiskBrowser.git
synced 2024-12-21 20:29:17 +00:00
Indicate if no results are found for a query.
This commit is contained in:
parent
716df24211
commit
d615b32431
@ -46,6 +46,9 @@ Word myUserID;
|
||||
/* String for "More Results" (used to identify that list entry) */
|
||||
char moreResultsString[] = " <More Results>";
|
||||
|
||||
/* String to indicate no results were found */
|
||||
char noResultsString[] = " No Disks Found";
|
||||
|
||||
/***/
|
||||
|
||||
static char menuTitle[] = "\pArchive.org Disk Browser\xC9";
|
||||
|
@ -46,6 +46,9 @@ extern struct diskListEntry *diskList;
|
||||
/* String for "More Results" (used to identify that list entry) */
|
||||
extern char moreResultsString[];
|
||||
|
||||
/* String to indicate no results were found */
|
||||
extern char noResultsString[];
|
||||
|
||||
/* Do we want to open a window with disk contents? Counts down until ready. */
|
||||
extern int wantToOpenWindow;
|
||||
|
||||
|
11
diskmount.c
11
diskmount.c
@ -42,15 +42,18 @@ void DoMount(void) {
|
||||
enum NetDiskError result = 0;
|
||||
json_value *filesJSON = NULL;
|
||||
|
||||
WaitCursor();
|
||||
|
||||
if (itemNumber == 0) {
|
||||
// shouldn't happen
|
||||
result = 1;
|
||||
goto errorReturn;
|
||||
return;
|
||||
}
|
||||
itemNumber--;
|
||||
|
||||
if (diskList[itemNumber].memPtr == noResultsString) {
|
||||
return;
|
||||
}
|
||||
|
||||
WaitCursor();
|
||||
|
||||
if (diskList[itemNumber].memPtr == moreResultsString) {
|
||||
DoSearch(true);
|
||||
return;
|
||||
|
@ -40,6 +40,7 @@ static boolean processDoc(json_value *docObj);
|
||||
static char *EncodeQueryString(char *queryString);
|
||||
|
||||
struct diskListEntry moreResultsEntry = {moreResultsString , 0, "", ""};
|
||||
struct diskListEntry noResultsEntry = {noResultsString , 0x60, "", ""};
|
||||
|
||||
static void InsertDiskListEntry(struct diskListEntry *entry);
|
||||
|
||||
@ -154,6 +155,10 @@ void DoSearch(boolean getMore) {
|
||||
MakeThisCtlTarget(disksListHandle);
|
||||
CallCtlDefProc(disksListHandle, ctlChangeTarget, 0);
|
||||
}
|
||||
} else {
|
||||
InsertDiskListEntry(&noResultsEntry);
|
||||
NewList2(NULL, 1, (Ref) diskList, refIsPointer,
|
||||
diskListLength, (Handle)disksListHandle);
|
||||
}
|
||||
|
||||
free(searchURL);
|
||||
|
Loading…
Reference in New Issue
Block a user