]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlDialog.tmpl
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlDialog.tmpl
index 525338e8da176626ad58bb960f1d90281d75c29f..ac9de2c99ea60e47632da278a05e4547774b3404 100644 (file)
@@ -4,7 +4,7 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author Angus Leeming 
+ * \author Angus Leeming
  *
  * Full author contact details are available in file CREDITS
  *
@@ -14,7 +14,7 @@
 
 #include "ControlDialog.h"
 
-#include "ButtonControllerBase.h"
+#include "ButtonController.h"
 #include "ViewBase.h"
 
 
@@ -27,48 +27,56 @@ ControlDialog<Base>::ControlDialog(LyXView & lv, Dialogs & d)
 template <class Base>
 void ControlDialog<Base>::show()
 {
-       if (isBufferDependent() && !bufferIsAvailable())
+       if (this->isBufferDependent() && !this->bufferIsAvailable())
                return;
 
-       connect();
+       this->connect();
+
+       if (!dialog_built_) {
+               this->view().build();
+               dialog_built_ = true;
+       }
 
        setParams();
-       if (emergency_exit_) {
+       if (this->emergency_exit_) {
                hide();
                return;
        }
 
-       if (!dialog_built_) {
-               view().build();
-               dialog_built_ = true;
-       }
+       this->bc().readOnly(this->bufferIsReadonly());
+       this->view().show();
 
-       bc().readOnly(bufferIsReadonly());
-       view().show();
+       // The widgets may not be valid, so refresh the button controller
+       this->bc().refresh();
 }
 
+
 template <class Base>
 void ControlDialog<Base>::update()
 {
-       if (isBufferDependent() && !bufferIsAvailable())
+       if (this->isBufferDependent() && !this->bufferIsAvailable())
                return;
 
        setParams();
-       if (emergency_exit_) {
+       if (this->emergency_exit_) {
                hide();
                return;
        }
 
-       bc().readOnly(bufferIsReadonly());
-       view().update();
+       this->bc().readOnly(this->bufferIsReadonly());
+       this->view().update();
+
+       // The widgets may not be valid, so refresh the button controller
+       this->bc().refresh();
 }
 
+
 template <class Base>
 void ControlDialog<Base>::hide()
 {
-       emergency_exit_ = false;
+       this->emergency_exit_ = false;
        clearParams();
 
-       disconnect();
-       view().hide();
+       this->disconnect();
+       this->view().hide();
 }