This is a collection of the three fixes I made over the weekend ... thanks john -- "Premature generalization is the root of all evil." - Karl Fogel
Index: ButtonController.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonController.h,v retrieving revision 1.10 diff -u -r1.10 ButtonController.h --- ButtonController.h 2001/06/16 14:48:12 1.10 +++ ButtonController.h 2001/08/27 19:39:35 @@ -21,6 +21,7 @@ #include "gettext.h" #include "ButtonControllerBase.h" +#include "debug.h" template <class Button, class Widget> class GuiBC : public ButtonControllerBase @@ -75,6 +76,8 @@ template <class Button, class Widget> void GuiBC<Button, Widget>::refresh() { + lyxerr[Debug::GUI] << "Calling BC refresh()" << std::endl; + if (okay_) { bool const enabled = bp().buttonStatus(ButtonPolicy::OKAY); setButtonEnabled(okay_, enabled); Index: ButtonControllerBase.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonControllerBase.C,v retrieving revision 1.5 diff -u -r1.5 ButtonControllerBase.C --- ButtonControllerBase.C 2001/06/13 15:11:16 1.5 +++ ButtonControllerBase.C 2001/08/27 19:39:35 @@ -18,6 +18,7 @@ #include <config.h> #include "ButtonControllerBase.h" #include "support/LAssert.h" +#include "debug.h" ButtonControllerBase::ButtonControllerBase(string const & cancel, @@ -82,12 +83,15 @@ bool ButtonControllerBase::readOnly(bool ro) { + lyxerr[Debug::GUI] << "Setting controller ro: " << ro << std::endl; + if (ro) { bp().input(ButtonPolicy::SMI_READ_ONLY); } else { bp().input(ButtonPolicy::SMI_READ_WRITE); } refreshReadOnly(); + refresh(); return ro; } Index: ButtonPolicies.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ButtonPolicies.C,v retrieving revision 1.6 diff -u -r1.6 ButtonPolicies.C --- ButtonPolicies.C 2001/06/13 15:11:16 1.6 +++ ButtonPolicies.C 2001/08/27 19:39:35 @@ -34,6 +34,11 @@ if (ButtonPolicy::SMI_NOOP == in) return; ButtonPolicy::State tmp = s_m[state][in]; + + lyxerr[Debug::GUI] << "Transition from state " + << state << " to state " << tmp << " after input " + << in << std::endl; + if (ButtonPolicy::BOGUS != tmp) { state = tmp; } else { Index: ChangeLog =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ChangeLog,v retrieving revision 1.78 diff -u -r1.78 ChangeLog --- ChangeLog 2001/08/24 15:49:03 1.78 +++ ChangeLog 2001/08/27 19:39:39 @@ -1,3 +1,19 @@ +2001-08-25 John Levon <[EMAIL PROTECTED]> + + * ControlInset.h: + * ControlDialogs.h: remove bc() hack, now fixed in + Qt2 frontend. use member dialog_built_ instead of shared + static. + + * ButtonController.h: + * ButtonPolicies.C: more debug info + + * ButtonControllerBase.C: call refresh() when setting readOnly ! + + * GUI.h: External form has apply, use the right policy + + * character.C: fix two off-by-one errors when latex font was removed + 2001-08-15 Angus Leeming <[EMAIL PROTECTED]> * ControlInset.h (apply): tentative fix for the press Apply multiple Index: ControlDialogs.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlDialogs.h,v retrieving revision 1.7 diff -u -r1.7 ControlDialogs.h --- ControlDialogs.h 2001/08/24 14:57:27 1.7 +++ ControlDialogs.h 2001/08/27 19:39:42 @@ -21,6 +21,7 @@ #define CONTROLDIALOGS_H #include "ControlConnections.h" +#include "debug.h" /** Base class to control connection/disconnection of signals with the LyX kernel for dialogs NOT used with insets. @@ -45,6 +46,9 @@ virtual void clearParams() {} /// set the params before show or update virtual void setParams() {} + + /// is the dialog built ? + bool dialog_built_; }; @@ -52,7 +56,7 @@ template <class Base> ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d) - : Base(lv, d) + : Base(lv, d), dialog_built_(false) {} @@ -64,10 +68,9 @@ setParams(); - static bool isBuilt = false; - if (!isBuilt) { - isBuilt = true; + if (!dialog_built_) { view().build(); + dialog_built_ = true; } bc().readOnly(isReadonly()); @@ -83,10 +86,6 @@ setParams(); bc().readOnly(isReadonly()); - // Reset the Button Controller to it's initial state - bc().invalid(); - bc().restore(); - view().update(); } Index: ControlInset.h =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/ControlInset.h,v retrieving revision 1.14 diff -u -r1.14 ControlInset.h --- ControlInset.h 2001/08/24 15:49:03 1.14 +++ ControlInset.h 2001/08/27 19:39:42 @@ -96,13 +96,17 @@ Memory is allocated only whilst the dialog is visible. */ Params * params_; + + /// is the dialog built ? + bool dialog_built_; + }; template <class Inset, class Params> ControlInset<Inset, Params>::ControlInset(LyXView & lv, Dialogs & d) : ControlConnectBD(lv, d), - inset_(0), ih_(0), params_(0) + inset_(0), ih_(0), params_(0), dialog_built_(false) {} @@ -121,7 +125,7 @@ { connectInset(); - if ( !arg.empty() ) + if (!arg.empty()) bc().valid(); // so that the user can press Ok show(getParams(arg)); @@ -136,10 +140,9 @@ setDaughterParams(); - static bool isBuilt = false; - if (!isBuilt) { - isBuilt = true; + if (!dialog_built_) { view().build(); + dialog_built_ = true; } bc().readOnly(isReadonly()); @@ -175,10 +178,6 @@ params_ = new Params(); bc().readOnly(isReadonly()); - // Reset the Button Controller to it's initial state - bc().invalid(); - bc().restore(); - view().update(); } diff -u -r1.21 GUI.h --- GUI.h 2001/08/09 15:08:06 1.21 +++ GUI.h 2001/08/27 19:39:42 @@ -159,11 +159,11 @@ template <class GUIview, class GUIbc> class GUIExternal : - public GUI<ControlExternal, GUIview, OkCancelReadOnlyPolicy, GUIbc> { + public GUI<ControlExternal, GUIview, OkApplyCancelReadOnlyPolicy, GUIbc> { public: /// GUIExternal(LyXView & lv, Dialogs & d) - : GUI<ControlExternal, GUIview, OkCancelReadOnlyPolicy, GUIbc>(lv, d) {} + : GUI<ControlExternal, GUIview, OkApplyCancelReadOnlyPolicy, +GUIbc>(lv, d) {} }; Index: character.C =================================================================== RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/frontends/controllers/character.C,v retrieving revision 1.5 diff -u -r1.5 character.C --- character.C 2001/08/15 17:11:35 1.5 +++ character.C 2001/08/27 19:39:42 @@ -126,7 +126,7 @@ vector<BarPair> const getBarData() { - vector<BarPair> bar(6); + vector<BarPair> bar(5); BarPair pr; pr.first = _("No change"); pr.second = IGNORE; @@ -138,7 +138,7 @@ pr.first = _("Noun"); pr.second = NOUN_TOGGLE; bar[3] = pr; pr.first = _("Reset"); pr.second = INHERIT; - bar[5] = pr; + bar[4] = pr; return bar; }