X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=winboard%2Fwsettings.c;h=b1fe4d70d4f81f7430c0cf2aa8330a561ff2e53f;hb=0019f0f86309b939047d7260114168320c50e875;hp=d1e7eec64ed0c1554d71dd9fca1e586f1e861861;hpb=5bcaf4baecc46eda033c3b86f753a4d85d1bcfec;p=xboard.git diff --git a/winboard/wsettings.c b/winboard/wsettings.c index d1e7eec..b1fe4d7 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -34,7 +34,7 @@ int breaks[MAX_OPTIONS]; int checks, combos, buttons, layout, groups; char title[MSG_SIZ]; char *engineName, *engineDir, *engineChoice, *engineLine, *nickName, *params; -Boolean isUCI, hasBook, storeVariant, v1, addToList; +Boolean isUCI, hasBook, storeVariant, v1, addToList, useNick; extern Option installOptions[], matchOptions[]; char *engineNr[] = { N_("First"), N_("Second"), NULL }; char *engineList[1000] = {" "}, *engineMnemonic[1000] = {""}; @@ -352,8 +352,9 @@ GetOptionValues(HWND hDlg, ChessProgramState *cps, Option *optionList) if(!success) break; if(!cps) { char *p; - if(*(char**)optionList[j].target) free(*(char**)optionList[j].target); - *(char**)optionList[j].target = p = text; + p = (optionList[j].type != FileName ? strdup(text) : InterpretFileName(text, homeDir)); // all files relative to homeDir! + FREE(*(char**)optionList[j].target); *(char**)optionList[j].target = p; + free(text); text = p; while(*p++ = *text++) if(p[-1] == '\r') p--; // crush CR break; } @@ -618,6 +619,7 @@ Option installOptions[] = { { 0, 0, 0, NULL, (void*) &engineLine, (char*) engineMnemonic, engineList, ComboBox, N_("Select engine from list:") }, { 0, 0, 0, NULL, NULL, NULL, NULL, Label, N_("or specify one below:") }, { 0, 0, 0, NULL, (void*) &nickName, NULL, NULL, TextBox, N_("Nickname (optional):") }, + { 0, 0, 0, NULL, (void*) &useNick, NULL, NULL, CheckBox, N_("Use nickname in PGN tag") }, { 0, 0, 3, NULL, (void*) &engineName, NULL, NULL, FileName, N_("Engine Executable:") }, { 0, 0, 0, NULL, (void*) ¶ms, NULL, NULL, TextBox, N_("Engine command-line Parameters:") }, { 0, 0, 0, NULL, (void*) &engineDir, NULL, NULL, PathName, N_("Engine Directory:") }, @@ -653,7 +655,7 @@ void LoadEnginePopUp(HWND hwnd) { int n=0; - isUCI = addToList = storeVariant = v1 = FALSE; hasBook = TRUE; // defaults + isUCI = storeVariant = v1 = useNick = FALSE; addToList = hasBook = TRUE; // defaults if(engineDir) free(engineDir); engineDir = strdup(""); if(params) free(params); params = strdup(""); if(nickName) free(nickName); nickName = strdup(""); @@ -687,6 +689,7 @@ Option tourneyOptions[] = { { 0, 1, 1000000000, NULL, (void*) &appData.tourneyCycles, "", NULL, Spin, N_("Number of tourney cycles:") }, { 0, 0, 0, NULL, (void*) &appData.roundSync, "", NULL, CheckBox, N_("Sync after round") }, { 0, 1, 1000000000, NULL, (void*) &appData.defaultMatchGames, "", NULL, Spin, N_("Games per Match / Pairing:") }, + { 0, 0, 1, NULL, (void*) &appData.saveGameFile, "", NULL, FileName, N_("File for saving tourney games:") }, { 0, 0, 1, NULL, (void*) &appData.loadGameFile, "", NULL, FileName, N_("Game File with Opening Lines:") }, { 0, -2, 1000000000, NULL, (void*) &appData.loadGameIndex, "", NULL, Spin, N_("Game Number:") }, { 0, 0, 2, NULL, (void*) &appData.loadPositionFile, "", NULL, FileName, N_("File with Start Positions:") }, @@ -705,7 +708,7 @@ void AddToTourney(HWND hDlg) // strncat(buf, "\r\n", MSG_SIZ); int i = ComboBox_GetCurSel(GetDlgItem(hDlg, 2001+2*3)); snprintf(buf, MSG_SIZ, "%s\r\n", engineMnemonic[i+1]); - SendMessage( GetDlgItem(hDlg, 2001+2*5), EM_SETSEL, 0, 0 ); + SendMessage( GetDlgItem(hDlg, 2001+2*5), EM_SETSEL, 99999, 99999 ); SendMessage( GetDlgItem(hDlg, 2001+2*5), EM_REPLACESEL, (WPARAM) FALSE, (LPARAM) buf ); }