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)
90 bc().setReadOnly(!enable);
91 bc().setValid(enable);
92 Dialog::enableView(enable);
96 void GuiDialog::updateView()
98 setUpdatesEnabled(false);
100 bc().setReadOnly(isBufferReadonly());
101 // protect the BC from unwarranted state transitions
105 // The widgets may not be valid, so refresh the button controller
108 setUpdatesEnabled(true);
111 } // namespace frontend
114 #include "GuiDialog_moc.cpp"