From: H.G. Muller Date: Sat, 31 Mar 2012 18:27:20 +0000 (+0200) Subject: Move LoadGamePopUp to menus.c X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=7ac623955d0fa99cc7e1aaaa7ecfa6aa2aa194a4;p=xboard.git Move LoadGamePopUp to menus.c --- diff --git a/menus.c b/menus.c index f5e1885..6f0aebb 100644 --- a/menus.c +++ b/menus.c @@ -110,6 +110,25 @@ char *gameCopyFilename, *gamePasteFilename; Boolean saveSettingsOnExit; char *settingsFileName; +static int +LoadGamePopUp (FILE *f, int gameNumber, char *title) +{ + cmailMsgLoaded = FALSE; + if (gameNumber == 0) { + int error = GameListBuild(f); + if (error) { + DisplayError(_("Cannot build game list"), error); + } else if (!ListEmpty(&gameList) && + ((ListGame *) gameList.tailPred)->number > 1) { + GameListPopUp(f, title); + return TRUE; + } + GameListDestroy(); + gameNumber = 1; + } + return LoadGame(f, gameNumber, title, FALSE); +} + void LoadGameProc () { diff --git a/menus.h b/menus.h index cacb22c..e053d91 100644 --- a/menus.h +++ b/menus.h @@ -170,7 +170,6 @@ MenuItem *MenuNameToItem P((char *menuName)); void SetMenuEnables P((Enables *enab)); void EnableButtonBar P((int state)); char *ModeToWidgetName P((GameMode mode)); -int LoadGamePopUp P((FILE *f, int gameNumber, char *title)); void CreateAnimVars P((void)); diff --git a/xboard.c b/xboard.c index 4c96479..293f781 100644 --- a/xboard.c +++ b/xboard.c @@ -2907,24 +2907,6 @@ ModeHighlight () /* * Button/menu procedures */ -int -LoadGamePopUp (FILE *f, int gameNumber, char *title) -{ - cmailMsgLoaded = FALSE; - if (gameNumber == 0) { - int error = GameListBuild(f); - if (error) { - DisplayError(_("Cannot build game list"), error); - } else if (!ListEmpty(&gameList) && - ((ListGame *) gameList.tailPred)->number > 1) { - GameListPopUp(f, title); - return TRUE; - } - GameListDestroy(); - gameNumber = 1; - } - return LoadGame(f, gameNumber, title, FALSE); -} /* this variable is shared between CopyPositionProc and SendPositionSelection */ char *selected_fen_position=NULL;