X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=menus.c;h=b8e531b4905733848de41272437f7890fc1e2bd0;hb=a56bd5ee92e43cbf5537d877fd4010e5e34a3e11;hp=1d0e23d0d6aa30feb718ab52afc1ea4823e9faa6;hpb=bdb4175a5cbca3f506502f644ab1f027f8e636f2;p=xboard.git diff --git a/menus.c b/menus.c index 1d0e23d..b8e531b 100644 --- a/menus.c +++ b/menus.c @@ -5,7 +5,7 @@ * Massachusetts. * * Enhancements Copyright 1992-2001, 2002, 2003, 2004, 2005, 2006, - * 2007, 2008, 2009, 2010, 2011, 2012 Free Software Foundation, Inc. + * 2007, 2008, 2009, 2010, 2011, 2012, 2013 Free Software Foundation, Inc. * * The following terms apply to Digital Equipment Corporation's copyright * interest in XBoard: @@ -87,7 +87,6 @@ extern char *getenv(); #include "frontend.h" #include "backend.h" -#include "xhistory.h" #include "menus.h" #include "gettext.h" @@ -172,7 +171,7 @@ ReloadPositionProc () } void -LoadPositionProc() +LoadPositionProc() { if (gameMode == AnalyzeMode || gameMode == AnalyzeFile) { Reset(FALSE, TRUE); @@ -360,13 +359,14 @@ AboutProc () #else char *zippy = ""; #endif - snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), _("%s%s\n\n" "Copyright 1991 Digital Equipment Corporation\n" -"Enhancements Copyright 1992-2012 Free Software Foundation\n" +"Enhancements Copyright 1992-2013 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\n" +"see the file COPYING for more information.\n" +"The GTK build of this version is experimental and unstable\n\n" "Visit XBoard on the web at: http://www.gnu.org/software/xboard/\n" "Check out the newest features at: http://www.gnu.org/software/xboard/whats_new.html\n\n" "Report bugs via email at: \n\n" @@ -568,6 +568,12 @@ HideThinkingProc () MARK_MENU_ITEM("Options.HideThinking", appData.hideThinkingFromHuman); } +void +CreateBookDelayed () +{ + ScheduleDelayedEvent(CreateBookEvent, 50); +} + /* * Menu definition tables */ @@ -588,6 +594,7 @@ MenuItem fileMenu[] = { // {N_("Reload Same Position"), "Reload Same Position", ReloadPositionProc}, {N_("Save Game Ctrl+S"), "SaveGame", SaveGameProc}, {N_("Save Position Ctrl+Shift+S"), "SavePosition", SavePositionProc}, + {N_("Save Games as Book"), "CreateBook", CreateBookDelayed}, {"----", NULL, NothingProc}, {N_("Mail Move"), "MailMove", MailMoveEvent}, {N_("Reload CMail Message"), "ReloadCMailMessage", ReloadCmailMsgProc}, @@ -677,7 +684,7 @@ MenuItem actionMenu[] = { {NULL, NULL, NULL} }; -MenuItem engineMenu[] = { +MenuItem engineMenu[100] = { {N_("Load New 1st Engine ..."), "LoadNew1stEngine", LoadEngine1Proc}, {N_("Load New 2nd Engine ..."), "LoadNew2ndEngine", LoadEngine2Proc}, {"----", NULL, NothingProc}, @@ -820,18 +827,22 @@ MenuNameToItem (char *menuName) return NULL; // item not found } +int firstEngineItem; + void AppendEnginesToMenu (char *list) { int i=0; char *p; if(appData.icsActive || appData.recentEngines <= 0) return; + for(firstEngineItem=0; engineMenu[firstEngineItem].string; firstEngineItem++); recentEngines = strdup(list); while (*list) { p = strchr(list, '\n'); if(p == NULL) break; - if(i == 0) AppendMenuItem("----", 0); // at least one valid item to add + if(i == 0) engineMenu[firstEngineItem++].string = "----"; // at least one valid item to add *p = 0; - AppendMenuItem(list, i); + if(firstEngineItem + i < 99) + engineMenu[firstEngineItem+i].string = strdup(list); // just set name; MenuProc stays NULL i++; *p = '\n'; list = p + 1; } } @@ -845,7 +856,7 @@ Enables icsEnables[] = { { "Mode.AnalyzeFile", False }, { "Mode.TwoMachines", False }, { "Mode.MachineMatch", False }, -#ifndef ZIPPY +#if !ZIPPY { "Engine.Hint", False }, { "Engine.Book", False }, { "Engine.MoveNow", False }, @@ -1209,5 +1220,3 @@ InitMenuMarkers() MarkMenuItem("Options.SaveSettingsonExit", True); } } - -