#include "gettext.h"
#include "ButtonControllerBase.h"
+#include "debug.h"
template <class Button, class Widget>
class GuiBC : public ButtonControllerBase
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);
#include <config.h>
#include "ButtonControllerBase.h"
#include "support/LAssert.h"
+#include "debug.h"
ButtonControllerBase::ButtonControllerBase(string const & cancel,
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;
}
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 {
-2001-08-26 John Levon <moz@compsoc.man.ac.uk>
+2001-08-25 John Levon <moz@compsoc.man.ac.uk>
- * character.C (getBarData): fix bar array.
+ * 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 <a.leeming@ic.ac.uk>
* ControlInset.h (apply): tentative fix for the press Apply multiple
#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.
virtual void clearParams() {}
/// set the params before show or update
virtual void setParams() {}
+
+ /// is the dialog built ?
+ bool dialog_built_;
};
template <class Base>
ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
- : Base(lv, d)
+ : Base(lv, d), dialog_built_(false)
{}
setParams();
- static bool isBuilt = false;
- if (!isBuilt) {
- isBuilt = true;
+ if (!dialog_built_) {
view().build();
+ dialog_built_ = true;
}
bc().readOnly(isReadonly());
setParams();
bc().readOnly(isReadonly());
- // Reset the Button Controller to it's initial state
- bc().invalid();
- bc().restore();
-
view().update();
}
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)
{}
{
connectInset();
- if ( !arg.empty() )
+ if (!arg.empty())
bc().valid(); // so that the user can press Ok
show(getParams(arg));
setDaughterParams();
- static bool isBuilt = false;
- if (!isBuilt) {
- isBuilt = true;
+ if (!dialog_built_) {
view().build();
+ dialog_built_ = true;
}
bc().readOnly(isReadonly());
params_ = new Params();
bc().readOnly(isReadonly());
- // Reset the Button Controller to it's initial state
- bc().invalid();
- bc().restore();
-
view().update();
}
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) {}
};