X-Git-Url: http://winboard.nl/cgi-bin?a=blobdiff_plain;f=option.c;h=701a251ca25137dcbdf4dd0330d6d6a4baba7364;hb=ac968003c13bde5c86ffa19f8819e436b5bc03e6;hp=975940bd8770f9b79275c05d32b9409df175ba38;hpb=a8209ad25e331b9938321744c3cf0e03867eac1c;p=polyglot.git diff --git a/option.c b/option.c index 975940b..701a251 100644 --- a/option.c +++ b/option.c @@ -25,9 +25,9 @@ option_t DefaultOptions[] = { // options - { "SaveSettingsOnExit","check","0","0", "true" , NULL,0,NNB, PG|XBOARD}, + { "Persist", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD}, - { "SaveFile", "string","0","0", "" , NULL,0,NNB, PG}, + { "PersistFile", "string","0","0", "" , NULL,0,NNB, PG}, { "EngineName", "string","0","0", "" , NULL,0,NNB, PG}, { "EngineDir", "string","0","0", "." , NULL,0,NNB, PG}, @@ -78,6 +78,11 @@ option_t DefaultOptions[] = { { "WbWorkArounds", "check","0","0", "true" , NULL,0,NNB, PG|XBOARD}, { "WbWorkArounds2", "check","0","0", "false" , NULL,0,NNB, PG|XBOARD}, + + // Buttons + +// { "Defaults", "reset","0","0", "false" , NULL,0,NNB, PG|XBOARD}, + { NULL, NULL,"0","0", NULL , NULL,0,NNB, 0}, }; @@ -167,6 +172,11 @@ bool option_set(option_list_t *option, opt = option_find(option,name); if (opt == NULL) return FALSE; + if(my_string_case_equal(opt->type,"check")){ + value=(my_string_equal(value,"1")|| + my_string_case_equal(value,"true"))?"true":"false"; + } + my_string_set(&opt->value,value); if (UseDebug) my_log("POLYGLOT OPTION SET \"%s\" -> \"%s\"\n",opt->name,opt->value); @@ -187,6 +197,11 @@ bool option_set_default(option_list_t *option, opt = option_find(option,name); if (opt == NULL) return FALSE; + if(my_string_case_equal(opt->type,"check")){ + value=(my_string_equal(value,"1")|| + my_string_case_equal(value,"true"))?"true":"false"; + } + my_string_set(&opt->default_,value); if (UseDebug) my_log("POLYGLOT OPTION DEFAULT SET \"%s\" -> \"%s\"\n",opt->name,opt->default_);