+2002-11-29 Angus Leeming <leeming@lyx.org>
+
+ * ControlButtons.h (isClosing): make it public, so that the view can
+ see it too.
+ (OKButton): no longer virtual. ControlPrefs should use isClosing() from
+ within apply.
+
+ * ControlPrefs.[Ch] (OKButton): removed.
+
+ * ControlPrefs.C (apply): dispatch a LFUN_SAVEPREFERENCES if the
+ dialog isClosing(). (Ie, if the "save" button has been pressed.)
+
2002-11-28 John Levon <levon@movementarian.org>
* ControlSpellchecker.C: fix Lars' broken cleanup
*/
///
void ApplyButton();
- /// virtual for ControlPrefs
- virtual void OKButton();
+ ///
+ void OKButton();
///
void CancelButton();
///
void setView(ViewBase &);
///
void setButtonController(ButtonControllerBase &);
-protected:
- ///
- ViewBase & view();
-
/** When Applying it's useful to know whether the dialog is about
to close or not (no point refreshing the display for example). */
bool isClosing() const { return is_closing_; }
+protected:
+ ///
+ ViewBase & view();
+
/// Get changed parameters and Dispatch them to the kernel.
virtual void apply() = 0;
/// Disconnect signals and hide View.
{
view().apply();
lyxrc = rc_;
-}
-
-void ControlPrefs::OKButton()
-{
- ControlDialogBI::OKButton();
- lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
+ // The Save button has been pressed
+ if (isClosing()) {
+ lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
+ }
}
LyXRC const & rc() const { return rc_; }
- /// make OK do the save
- virtual void OKButton();
-
/// various file pickers
string const browsebind(string const & file);
string const browseUI(string const & file);
+2002-11-29 Angus Leeming <leeming@lyx.org>
+
+ * FormPreferences.C (apply): if controller().isClosing() (ie, if the
+ "save" button has been pressed), then save any modified gui colors.
+
2002-11-29 Angus Leeming <leeming@lyx.org>
* forms_gettext.[Ch] (scex, idex): re-written to receive and return
}
-#if 0
-void FormPreferences::ok()
-{
- FormBaseDeprecated::ok();
-
-// FIXME !!
- if (colors_.modifiedXformsPrefs) {
- string const filename =
- AddName(user_lyxdir, "preferences.xform");
- colors_.modifiedXformsPrefs = !XformsColor::write(filename);
- }
-
- lv_.dispatch(FuncRequest(LFUN_SAVEPREFERENCES));
-}
-#endif
-
-
-
void FormPreferences::hide()
{
// We need to hide the active tabfolder otherwise we get a
printer_.apply(rc);
screen_fonts_.apply(rc);
spelloptions_.apply(rc);
+
+ // The "Save" button has been pressed.
+ if (controller().isClosing() && colors_.modifiedXformsPrefs) {
+ string const filename =
+ AddName(user_lyxdir, "preferences.xform");
+ colors_.modifiedXformsPrefs = !XformsColor::write(filename);
+ }
}