X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=xgamelist.c;h=41a43cecb4851e48123427de348d5b3432fb257d;hb=a7db862b2f44d23b358a1319cd8a374cf88c24fd;hp=d458898bbb76ff7695a701dbb8edd096bd36f53b;hpb=ed47244d151ccf276b9e233b4415e00aa5d3d29d;p=xboard.git diff --git a/xgamelist.c b/xgamelist.c index d458898..41a43ce 100644 --- a/xgamelist.c +++ b/xgamelist.c @@ -1,7 +1,7 @@ /* * 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 @@ -516,6 +516,7 @@ ShowGameListProc(w, event, prms, nprms) XtSetArg(args[j], XtNleftBitmap, xMarkPixmap); j++; XtSetValues(XtNameToWidget(menuBarWidget, "menuView.Show Game List"), args, j); + GameListHighlight(lastLoadGameNumber); } void @@ -618,6 +619,35 @@ GameListIsUp() return glc && glc->up; } +int SaveGameListAsText(FILE *f) +{ + ListGame * lg = (ListGame *) gameList.head; + int nItem; + + if( !glc || ((ListGame *) gameList.tailPred)->number <= 0 ) { + DisplayError("Game list not loaded or empty", 0); + return False; + } + + /* Copy the list into the global memory block */ + if( f != NULL ) { + + lg = (ListGame *) gameList.head; + + for (nItem = 0; nItem < ((ListGame *) gameList.tailPred)->number; nItem++){ + char * st = GameListLineFull(lg->number, &lg->gameInfo); + char *line = GameListLine(lg->number, &lg->gameInfo); + if(filterString[0] == NULLCHAR || SearchPattern( line, filterString ) ) + fprintf( f, "%s\n", st ); + free(st); free(line); + lg = (ListGame *) lg->node.succ; + } + + fclose(f); + return True; + } + return False; +} //--------------------------------- Game-List options dialog ------------------------------------------ Widget gameListOptShell, listwidg;