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"
18 #include "support/debug.h"
20 #include <QCloseEvent>
27 GuiDialog::GuiDialog(GuiView & lv, QString const & name, QString const & title)
28 : QDialog(&lv), Dialog(lv, name, "LyX: " + title), updating_(false),
31 // remove question marks from Windows dialogs
32 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
36 void GuiDialog::closeEvent(QCloseEvent * ev)
43 void GuiDialog::setButtonsValid(bool valid)
49 void GuiDialog::slotApply()
56 void GuiDialog::slotAutoApply()
63 void GuiDialog::slotOK()
73 void GuiDialog::slotClose()
80 void GuiDialog::slotRestore()
82 // Tell the controller that a request to refresh the dialog's contents
83 // has been received. It's up to the controller to supply the necessary
84 // info by calling GuiDialog::updateView().
90 void GuiDialog::changed()
94 bc().setValid(isValid());
98 void GuiDialog::enableView(bool enable)
101 bc().setReadOnly(true);
102 bc().setValid(false);
104 Dialog::enableView(enable);
108 void GuiDialog::updateView()
110 setUpdatesEnabled(false);
112 bc().setReadOnly(isBufferReadonly());
113 // protect the BC from unwarranted state transitions
117 // The widgets may not be valid, so refresh the button controller
120 setUpdatesEnabled(true);
123 } // namespace frontend
126 #include "moc_GuiDialog.cpp"