* 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
*
#include "ControlDialog.h"
-#include "ButtonControllerBase.h"
+#include "ButtonController.h"
#include "ViewBase.h"
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();
}