]> 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 d749676ac5fb852866b88308d0e0394dd048bc87..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,15 +46,18 @@ protected:
        virtual void clearParams() {}
        /// set the params before show or update
        virtual void setParams() {}
+
+private:
+       /// is the dialog built ?
+       bool dialog_built_;
 };
 
 
 #include "LyXView.h"
-#include "BufferView.h"
 
 template <class Base>
 ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
-       : Base(lv, d)
+       : Base(lv, d), dialog_built_(false)
 {}
 
 
@@ -63,8 +67,15 @@ void ControlDialog<Base>::show()
        if (isBufferDependent() && !lv_.view()->available())
                return;
 
+       connect();
+
        setParams();
 
+       if (!dialog_built_) {
+               view().build();
+               dialog_built_ = true;
+       }
+
        bc().readOnly(isReadonly());
        view().show();
 }
@@ -76,7 +87,7 @@ void ControlDialog<Base>::update()
                return;
 
        setParams();
-       
+
        bc().readOnly(isReadonly());
        view().update();
 }