From efecf86cd9b54072c6a2f38d62f1d775e69c545b Mon Sep 17 00:00:00 2001 From: H.G. Muller Date: Sat, 29 Jan 2011 20:11:30 +0100 Subject: [PATCH] Implement -reset option feature in WinBoard --- backend.c | 2 ++ winboard/wsettings.c | 5 ++++- 2 files changed, 6 insertions(+), 1 deletions(-) diff --git a/backend.c b/backend.c index 17e77ae..e0f6ec9 100644 --- a/backend.c +++ b/backend.c @@ -13908,6 +13908,8 @@ ParseOption(Option *opt, ChessProgramState *cps) opt->type = Button; } else if(p = strstr(opt->name, " -save")) { opt->type = SaveButton; + } else if(p = strstr(opt->name, " -reset")) { + opt->type = ResetButton; } else return FALSE; *p = 0; // terminate option name // now look if the command-line options define a setting for this engine option. diff --git a/winboard/wsettings.c b/winboard/wsettings.c index ccfae75..df992aa 100644 --- a/winboard/wsettings.c +++ b/winboard/wsettings.c @@ -419,7 +419,10 @@ LRESULT CALLBACK SettingsProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPa if(j < 0) break; if( activeCps->option[j].type == SaveButton) GetOptionValues(hDlg, activeCps); - else if( activeCps->option[j].type != Button) break; + else if( activeCps->option[j].type == ResetButton) { + ClearOptions(activeCps); + EndDialog( hDlg, 0 ); + } else if( activeCps->option[j].type != Button) break; snprintf(buf, MSG_SIZ, "option %s\n", activeCps->option[j].name); SendToProgram(buf, activeCps); } -- 1.7.0.4