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"
16 #include "qt_helpers.h"
17 #include "FuncRequest.h"
19 #include "support/debug.h"
21 #include <QCloseEvent>
28 GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
29 : QDialog(&lv), Dialog(lv, name, "LyX: " + title), is_closing_(false)
33 void GuiDialog::closeEvent(QCloseEvent * ev)
40 void GuiDialog::setButtonsValid(bool valid)
46 void GuiDialog::slotApply()
53 void GuiDialog::slotOK()
63 void GuiDialog::slotClose()
70 void GuiDialog::slotRestore()
72 // Tell the controller that a request to refresh the dialog's contents
73 // has been received. It's up to the controller to supply the necessary
74 // info by calling GuiDialog::updateView().
80 void GuiDialog::changed()
84 bc().setValid(isValid());
88 void GuiDialog::enableView(bool enable)
91 bc().setReadOnly(true);
94 Dialog::enableView(enable);
98 void GuiDialog::updateView()
100 setUpdatesEnabled(false);
102 bc().setReadOnly(isBufferReadonly());
103 // protect the BC from unwarranted state transitions
107 // The widgets may not be valid, so refresh the button controller
110 setUpdatesEnabled(true);
113 } // namespace frontend
116 #include "GuiDialog_moc.cpp"