From: H.G. Muller Date: Mon, 26 Aug 2013 17:57:43 +0000 (+0200) Subject: Allow seting of -egtPath through menu WB X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=0235f1ff0f54978979e94bb8d34ad1a882bbff68;p=xboard.git Allow seting of -egtPath through menu WB The Nalimov Path control in Common Engine Options can now also be used to set the -egtPath; if it has the format of an egtPath string, it will count for the latter. If both -defaultPathEGTB and -egtPath are defined (which is really an inconsistent setting), the Nalimov path will be displayed. --- diff --git a/winboard/woptions.c b/winboard/woptions.c index 8a8406a..41f090f 100644 --- a/winboard/woptions.c +++ b/winboard/woptions.c @@ -3009,6 +3009,13 @@ BOOL BrowseForFolder( const char * title, char * path ) return result; } +int +IsMultiFormat(char *s) +{ + char *p = strchr(s, ':'); + return p && p != s+1; +} + LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { char buf[MAX_PATH]; @@ -3024,7 +3031,10 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM /* Initialize the dialog items */ SetDlgItemText( hDlg, IDC_PolyglotDir, appData.polyglotDir ); SetDlgItemInt( hDlg, IDC_HashSize, appData.defaultHashSize, TRUE ); + if(appData.defaultPathEGTB[0]) SetDlgItemText( hDlg, IDC_PathToEGTB, appData.defaultPathEGTB ); + else + SetDlgItemText( hDlg, IDC_PathToEGTB, appData.egtFormats ); SetDlgItemInt( hDlg, IDC_SizeOfEGTB, appData.defaultCacheSizeEGTB, TRUE ); CheckDlgButton( hDlg, IDC_UseBook, (BOOL) appData.usePolyglotBook ); SetDlgItemText( hDlg, IDC_BookFile, appData.polyglotBook ); @@ -3049,7 +3059,11 @@ LRESULT CALLBACK UciOptionsDialog(HWND hDlg, UINT message, WPARAM wParam, LPARAM appData.defaultHashSize = GetDlgItemInt(hDlg, IDC_HashSize, NULL, FALSE ); appData.defaultCacheSizeEGTB = GetDlgItemInt(hDlg, IDC_SizeOfEGTB, NULL, FALSE ); GetDlgItemText( hDlg, IDC_PathToEGTB, buf, sizeof(buf) ); - appData.defaultPathEGTB = strdup(buf); + if(IsMultiFormat(buf)) { + ASSIGN(appData.egtFormats, buf); + } else { + ASSIGN(appData.defaultPathEGTB, buf); + } GetDlgItemText( hDlg, IDC_BookFile, buf, sizeof(buf) ); appData.polyglotBook = strdup(buf); appData.usePolyglotBook = (Boolean) IsDlgButtonChecked( hDlg, IDC_UseBook );