3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Angus Leeming
8 * Full author contact details are available in file CREDITS.
13 #include "GuiDialog.h"
20 GuiDialog::GuiDialog(LyXView & lv, std::string const & name)
25 void GuiDialog::setButtonsValid(bool valid)
31 void GuiDialog::ApplyButton()
38 void GuiDialog::OKButton()
48 void GuiDialog::CancelButton()
55 void GuiDialog::RestoreButton()
57 // Tell the kernel that a request to refresh the dialog's contents
58 // has been received. It's up to the kernel to supply the necessary
59 // info by calling GuiDialog::updateView().
60 kernel().updateDialog(name_);
65 void GuiDialog::preShow()
67 bc().setReadOnly(kernel().isBufferReadonly());
71 void GuiDialog::postShow()
73 // The widgets may not be valid, so refresh the button controller
78 void GuiDialog::preUpdate()
80 bc().setReadOnly(kernel().isBufferReadonly());
84 void GuiDialog::postUpdate()
86 // The widgets may not be valid, so refresh the button controller
91 void GuiDialog::checkStatus()
93 // buffer independant dialogs are always active.
94 // This check allows us leave canApply unimplemented for some dialogs.
95 if (!controller().isBufferDependent())
98 // deactivate the dialog if we have no buffer
99 if (!kernel().isBufferAvailable()) {
100 bc().setReadOnly(true);
104 // check whether this dialog may be active
105 if (controller().canApply()) {
106 bool const readonly = kernel().isBufferReadonly();
107 bc().setReadOnly(readonly);
108 // refreshReadOnly() is too generous in _enabling_ widgets
109 // update dialog to disable disabled widgets again
112 if (!readonly || controller().canApplyToReadOnly())
116 bc().setReadOnly(true);
120 } // namespace frontend