Implement saving of (modified) engine settings
[xboard.git] / xaw / xoptions.c
index 1c0a897..ef82272 100644 (file)
@@ -839,8 +839,12 @@ GenericCallback (Widget w, XtPointer client_data, XtPointer call_data)
        XtSetArg(args[0], XtNlabel, &name);
        XtGetValues(w, args, 1);
        if(currentOption[data].type == SaveButton) GenericReadout(currentOption, -1);
-       snprintf(buf, MSG_SIZ,  "option %s\n", name);
-       SendToProgram(buf, currentCps);
+       if(data == 0) { // XBoard save button
+           SaveEngineSettings(currentCps == &second); PopDown(dlg);
+       } else {
+           snprintf(buf, MSG_SIZ,  "option %s\n", name);
+           SendToProgram(buf, currentCps);
+       }
     } else ((ButtonCallback*) currentOption[data].target)(data);
 
     shells[dlg] = oldSh; // in case of multiple instances, restore previous (as this one could be popped down now)