From 398df75992ba050823ce8fda5e55735d03b8a9be Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Tue, 16 Feb 2010 22:34:23 +0100 Subject: [PATCH] Add -chatBoxes option to open Chat Boxes at startup This string option contains a semicolon-separated list of handles for which Chat Boxes should be opened at startup. The value saved in the ini file is the value that was read, not the actual chat boxes that were open at the time of saving. --- args.h | 1 + common.h | 1 + winboard/winboard.c | 11 +++++++++++ 3 files changed, 13 insertions(+), 0 deletions(-) diff --git a/args.h b/args.h index 615b3ff..cbd63dc 100644 --- a/args.h +++ b/args.h @@ -624,6 +624,7 @@ ArgDescriptor argDescriptors[] = { { "zippyReplyTimeout", ArgInt, (void *)&junk, FALSE, INVALID }, #endif /* [HGM] options for broadcasting and time odds */ + { "chatBoxes", ArgString, (void *) &appData.chatBoxes, !XBOARD, (ArgIniType) NULL }, { "serverMoves", ArgString, (void *) &appData.serverMovesName, FALSE, (ArgIniType) NULL }, { "suppressLoadMoves", ArgBoolean, (void *) &appData.suppressLoadMoves, FALSE, (ArgIniType) FALSE }, { "serverPause", ArgInt, (void *) &appData.serverPause, FALSE, (ArgIniType) 15 }, diff --git a/common.h b/common.h index 35c04c8..01c2460 100644 --- a/common.h +++ b/common.h @@ -519,6 +519,7 @@ typedef struct { int fontSizeTolerance; /* xboard only */ char *initialMode; char *variant; + char *chatBoxes; int firstProtocolVersion; int secondProtocolVersion; Boolean showButtonBar; diff --git a/winboard/winboard.c b/winboard/winboard.c index e6227ec..8053123 100644 --- a/winboard/winboard.c +++ b/winboard/winboard.c @@ -859,6 +859,17 @@ InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine) 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE); #endif ShowWindow(hwndConsole, nCmdShow); + if(appData.chatBoxes) { // [HGM] chat: open chat boxes + char buf[MSG_SIZ], *p = buf, *q; + strcpy(buf, appData.chatBoxes); + do { + q = strchr(p, ';'); + if(q) *q++ = 0; + if(*p) ChatPopUp(p); + } while(p=q); +// Sleep(1000); + } + SetActiveWindow(hwndConsole); } if(!appData.noGUI) UpdateWindow(hwnd); else ShowWindow(hwnd, SW_MINIMIZE); if(gameListDialog) SetFocus(gameListDialog); // [HGM] jaws: for if we clicked multi-game game file -- 1.7.0.4