VOID SetSaveOptionEnables(HWND hDlg);\r
VOID SetTimeControlEnables(HWND hDlg);\r
\r
+char *\r
+InterpretFileName(char *buf, char *homeDir)\r
+{ // [HGM] file name relative to homeDir. (Taken out of SafeOptionsDialog, because it is generally useful)\r
+ char *result = NULL;\r
+ if ((isalpha(buf[0]) && buf[1] == ':') ||\r
+ (buf[0] == '\\' && buf[1] == '\\')) {\r
+ return strdup(buf);\r
+ } else {\r
+ char buf2[MSG_SIZ], buf3[MSG_SIZ];\r
+ char *dummy;\r
+ GetCurrentDirectory(MSG_SIZ, buf3);\r
+ SetCurrentDirectory(homeDir);\r
+ if (GetFullPathName(buf, MSG_SIZ, buf2, &dummy)) {\r
+ result = strdup(buf2);\r
+ } else {\r
+ result = strdup(buf);\r
+ }\r
+ SetCurrentDirectory(buf3);\r
+ }\r
+ return result;\r
+}\r
+\r
/*---------------------------------------------------------------------------*\\r
*\r
* General Options Dialog functions\r
-1, // Twilight,\r
OPT_VariantMakruk,\r
OPT_VariantSChess,\r
+ OPT_VariantGrand,\r
OPT_VariantSpartan, // Spartan\r
-2 // sentinel\r
};\r
SetSampleFontText(hDlg, OPT_SampleCommentsFont, &workFont[COMMENT_FONT]);\r
SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]);\r
SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
+ SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
firstPaint = FALSE;\r
}\r
break;\r
CopyFont(font[i][CONSOLE_FONT], &workFont[CONSOLE_FONT]);\r
CopyFont(font[i][COMMENT_FONT], &workFont[COMMENT_FONT]);\r
CopyFont(font[i][MOVEHISTORY_FONT], &workFont[MOVEHISTORY_FONT]);\r
+ CopyFont(font[i][GAMELIST_FONT], &workFont[GAMELIST_FONT]);\r
}\r
/* end sad necessity */\r
\r
SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
break;\r
\r
+ case OPT_ChooseGameListFont:\r
+ MyCreateFont(hDlg, &workFont[GAMELIST_FONT]);\r
+ SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
+ break;\r
+\r
case OPT_DefaultFonts:\r
for (i=0; i<NUM_FONTS; i++) {\r
DeleteObject(&workFont[i].hf);\r
SetSampleFontText(hDlg, OPT_SampleCommentsFont, &workFont[COMMENT_FONT]);\r
SetSampleFontText(hDlg, OPT_SampleConsoleFont, &workFont[CONSOLE_FONT]);\r
SetSampleFontText(hDlg, OPT_SampleMoveHistoryFont, &workFont[MOVEHISTORY_FONT]);\r
+ SetSampleFontText(hDlg, OPT_SampleGameListFont, &workFont[GAMELIST_FONT]);\r
break;\r
}\r
}\r
if (cd->label == NULL) goto cant_parse;\r
return;\r
cant_parse:\r
- ExitArgError(_("Can't parse com port settings"), arg);\r
+ ExitArgError(_("Can't parse com port settings"), arg, TRUE);\r
}\r
\r
\r
if (IsDlgButtonChecked(hDlg, OPT_Autosave)) {\r
appData.autoSaveGames = TRUE;\r
if (IsDlgButtonChecked(hDlg, OPT_AVPrompt)) {\r
- appData.saveGameFile = "";\r
+ ASSIGN(appData.saveGameFile, ""); // [HGM] make sure value is ALWAYS in allocated memory\r
} else /*if (IsDlgButtonChecked(hDlg, OPT_AVToFile))*/ {\r
GetDlgItemText(hDlg, OPT_AVFilename, buf, MSG_SIZ);\r
if (*buf == NULLCHAR) {\r
_("Option Error"), MB_OK|MB_ICONEXCLAMATION);\r
return FALSE;\r
}\r
- if ((isalpha(buf[0]) && buf[1] == ':') ||\r
- (buf[0] == '\\' && buf[1] == '\\')) {\r
- appData.saveGameFile = strdup(buf);\r
- } else {\r
- char buf2[MSG_SIZ], buf3[MSG_SIZ];\r
- char *dummy;\r
- GetCurrentDirectory(MSG_SIZ, buf3);\r
- SetCurrentDirectory(installDir);\r
- if (GetFullPathName(buf, MSG_SIZ, buf2, &dummy)) {\r
- appData.saveGameFile = strdup(buf2);\r
- } else {\r
- appData.saveGameFile = strdup(buf);\r
- }\r
- SetCurrentDirectory(buf3);\r
- }\r
+ FREE(appData.saveGameFile);\r
+ appData.saveGameFile = InterpretFileName(buf, homeDir);\r
}\r
} else {\r
appData.autoSaveGames = FALSE;\r
- appData.saveGameFile = "";\r
+ ASSIGN(appData.saveGameFile, "");\r
}\r
appData.oldSaveStyle = IsDlgButtonChecked(hDlg, OPT_Old);\r
appData.saveOutOfBookInfo = IsDlgButtonChecked( hDlg, OPT_OutOfBookInfo );\r
* UCI Options Dialog functions\r
*\r
\*---------------------------------------------------------------------------*/\r
-static BOOL BrowseForFolder( const char * title, char * path )\r
+BOOL BrowseForFolder( const char * title, char * path )\r
{\r
BOOL result = FALSE;\r
BROWSEINFO bi;\r