/*
* xgamelist.c -- Game list window, part of X front end for XBoard
*
- * Copyright 1995, 2009, 2010 Free Software Foundation, Inc.
+ * Copyright 1995, 2009, 2010, 2011 Free Software Foundation, Inc.
* ------------------------------------------------------------------------
*
* GNU XBoard is free software: you can redistribute it and/or modify
glc->up = True;
j = 0;
XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;
- XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuView.Show Game List"),
args, j);
}
glc->up = True;
j = 0;
XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++;
- XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuView.Show Game List"),
args, j);
}
glc->up = False;
j = 0;
XtSetArg(args[j], XtNleftBitmap, None); j++;
- XtSetValues(XtNameToWidget(menuBarWidget, "menuMode.Show Game List"),
+ XtSetValues(XtNameToWidget(menuBarWidget, "menuView.Show Game List"),
args, j);
}
return glc && glc->up;
}
+int SaveGameListAsText(FILE *f)\r
+{\r
+ ListGame * lg = (ListGame *) gameList.head;\r
+ int nItem;\r
+\r
+ if( !glc || ((ListGame *) gameList.tailPred)->number <= 0 ) {\r
+ DisplayError("Game list not loaded or empty", 0);\r
+ return False;\r
+ }\r
+\r
+ /* Copy the list into the global memory block */\r
+ if( f != NULL ) {\r
+
+ lg = (ListGame *) gameList.head;\r
+\r
+ for (nItem = 0; nItem < ((ListGame *) gameList.tailPred)->number; nItem++){\r
+ char * st = GameListLineFull(lg->number, &lg->gameInfo);\r
+ char *line = GameListLine(lg->number, &lg->gameInfo);
+ if(filterString[0] == NULLCHAR || SearchPattern( line, filterString ) )
+ fprintf( f, "%s\n", st );
+ free(st); free(line);\r
+ lg = (ListGame *) lg->node.succ;\r
+ }\r
+\r
+ fclose(f);
+ return True;\r
+ }
+ return False;\r
+}\r
//--------------------------------- Game-List options dialog ------------------------------------------
Widget gameListOptShell, listwidg;