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), updating_(false),
34 void GuiDialog::closeEvent(QCloseEvent * ev)
41 void GuiDialog::setButtonsValid(bool valid)
47 void GuiDialog::slotApply()
54 void GuiDialog::slotAutoApply()
61 void GuiDialog::slotOK()
71 void GuiDialog::slotClose()
78 void GuiDialog::slotRestore()
80 // Tell the controller that a request to refresh the dialog's contents
81 // has been received. It's up to the controller to supply the necessary
82 // info by calling GuiDialog::updateView().
88 void GuiDialog::changed()
92 bc().setValid(isValid());
96 void GuiDialog::enableView(bool enable)
99 bc().setReadOnly(true);
100 bc().setValid(false);
102 Dialog::enableView(enable);
106 void GuiDialog::updateView()
108 setUpdatesEnabled(false);
110 bc().setReadOnly(isBufferReadonly());
111 // protect the BC from unwarranted state transitions
115 // The widgets may not be valid, so refresh the button controller
118 setUpdatesEnabled(true);
121 } // namespace frontend
124 #include "moc_GuiDialog.cpp"