-void GuiDialog::preShow()
-{
- bc().setReadOnly(kernel().isBufferReadonly());
-}
-
-
-void GuiDialog::postShow()
-{
- // The widgets may not be valid, so refresh the button controller
- bc().refresh();
-}
-
-
-void GuiDialog::preUpdate()
-{
- bc().setReadOnly(kernel().isBufferReadonly());
-}
-
-
-void GuiDialog::postUpdate()
-{
- // The widgets may not be valid, so refresh the button controller
- bc().refresh();
-}
-
-
-void GuiDialog::checkStatus()
-{
- // buffer independant dialogs are always active.
- // This check allows us leave canApply unimplemented for some dialogs.
- if (!controller().isBufferDependent())
- return;
-
- // deactivate the dialog if we have no buffer
- if (!kernel().isBufferAvailable()) {
- bc().setReadOnly(true);
- return;
- }
-
- // check whether this dialog may be active
- if (controller().canApply()) {
- bool const readonly = kernel().isBufferReadonly();
- bc().setReadOnly(readonly);
- // refreshReadOnly() is too generous in _enabling_ widgets
- // update dialog to disable disabled widgets again
-/*
- * FIXME:
- if (!readonly || controller().canApplyToReadOnly())
- update();
-*/
- } else {
- bc().setReadOnly(true);
- }
-}
-
-
-bool GuiDialog::isVisibleView() const
-{
- return QDialog::isVisible();
-}
-
-
-bool GuiDialog::readOnly() const
-{
- return kernel().isBufferReadonly();
-}
-
-
-void GuiDialog::showView()
-{
- QSize const hint = sizeHint();
- if (hint.height() >= 0 && hint.width() >= 0)
- setMinimumSize(hint);
-
- updateView(); // make sure its up-to-date
- if (controller().exitEarly())
- return;
-
- if (QWidget::isVisible()) {
- raise();
- activateWindow();
- } else {
- QWidget::show();
- }
- setFocus();
-}
-
-
-void GuiDialog::hideView()
-{
- QDialog::hide();
-}
-
-
-bool GuiDialog::isValid()
-{
- return true;
-}
-
-