X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=menus.c;h=863f2a016728f936cf6197ce24cd6e5939a9d1cc;hb=0278ebc80411a20fd23303156285e55ce8d2b0a5;hp=9d2b286229c5d5656a79881cec324a0c44af633c;hpb=c927f6b84a06bd7ed84adf0216b24acb042115d2;p=xboard.git diff --git a/menus.c b/menus.c index 9d2b286..863f2a0 100644 --- a/menus.c +++ b/menus.c @@ -5,7 +5,8 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016 Free + * Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -105,6 +106,7 @@ extern char *getenv(); char *gameCopyFilename, *gamePasteFilename; Boolean saveSettingsOnExit; char *settingsFileName; +char gamesDir[MSG_SIZ], positionsDir[MSG_SIZ], textureDir[MSG_SIZ], bookDir[MSG_SIZ], piecesDir[MSG_SIZ]; static int LoadGamePopUp (FILE *f, int gameNumber, char *title) @@ -173,10 +175,12 @@ ReloadPositionProc () void LoadPositionProc() { + static char buf[MSG_SIZ]; if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { Reset(FALSE, TRUE); } - FileNamePopUp(_("Load position file name?"), "", ".fen .epd .pos", LoadPosition, "rb"); + snprintf(buf, MSG_SIZ, "%s/", appData.positionDir); + FileNamePopUp(_("Load position file name?"), buf, ".fen .epd .pos", LoadPosition, "rb"); } void @@ -310,19 +314,6 @@ SaveSettingsProc () } void -InfoProc () -{ - char buf[MSG_SIZ]; -#ifdef OSXAPP - snprintf(buf, MSG_SIZ, "%s ./info.command", appData.sysOpen); -#else - snprintf(buf, sizeof(buf), "xterm -e info --directory %s --directory . -f %s &", - INFODIR, INFOFILE); -#endif - system(buf); -} - -void BugReportProc () { char buf[MSG_SIZ]; @@ -366,7 +357,7 @@ AboutProc () snprintf(buf, sizeof(buf), _("%s%s\n\n" "Copyright 1991 Digital Equipment Corporation\n" -"Enhancements Copyright 1992-2014 Free Software Foundation\n" +"Enhancements Copyright 1992-2016 Free Software Foundation\n" "Enhancements Copyright 2005 Alessandro Scotti\n\n" "%s is free software and carries NO WARRANTY;" "see the file COPYING for more information.\n" @@ -1176,6 +1167,7 @@ InstallNewEngine (char *command, char *dir, char *variants, char *protocol) snprintf(buf + strlen(buf), MSG_SIZ - strlen(buf), " -fd %s", dir); if(!strcmp(protocol, "uci")) snprintf(buf + strlen(buf), MSG_SIZ - strlen(buf), " -fUCI"); + if(strstr(firstChessProgramNames, buf)) return; // avoid duplicats // append line quote = malloc(strlen(firstChessProgramNames) + strlen(buf) + 2); sprintf(quote, "%s%s\n", firstChessProgramNames, buf);