]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlDialogs.h
The reference dialog now disconnects from the inset on Apply. Its behaviour
[lyx.git] / src / frontends / controllers / ControlDialogs.h
index 65d87f3101f9d783cd21ac509b38896fc684e5ac..f7dabe94708329a936b82ed2c797d12608ac96d2 100644 (file)
@@ -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,10 @@ protected:
        virtual void clearParams() {}
        /// set the params before show or update
        virtual void setParams() {}
+
+private:
+       /// is the dialog built ?
+       bool dialog_built_;
 };
 
 
@@ -52,7 +57,7 @@ protected:
 
 template <class Base>
 ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
-       : Base(lv, d)
+       : Base(lv, d), dialog_built_(false)
 {}
 
 
@@ -62,12 +67,13 @@ void ControlDialog<Base>::show()
        if (isBufferDependent() && !lv_.view()->available())
                return;
 
+       connect();
+
        setParams();
 
-       static bool isBuilt = false;
-       if (!isBuilt) {
-               isBuilt = true;
+       if (!dialog_built_) {
                view().build();
+               dialog_built_ = true;
        }
 
        bc().readOnly(isReadonly());
@@ -83,10 +89,6 @@ void ControlDialog<Base>::update()
        setParams();
 
        bc().readOnly(isReadonly());
-       // Reset the Button Controller to it's initial state
-       bc().invalid();
-       bc().restore();
-
        view().update();
 }