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 connect(&lv, SIGNAL(bufferViewChanged()),
32 this, SLOT(onBufferViewChanged()));
34 // remove question marks from Windows dialogs
35 setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
39 void GuiDialog::closeEvent(QCloseEvent * ev)
46 void GuiDialog::setButtonsValid(bool valid)
52 void GuiDialog::slotApply()
59 void GuiDialog::slotAutoApply()
66 void GuiDialog::slotOK()
76 void GuiDialog::slotClose()
83 void GuiDialog::slotRestore()
85 // Tell the controller that a request to refresh the dialog's contents
86 // has been received. It's up to the controller to supply the necessary
87 // info by calling GuiDialog::updateView().
93 void GuiDialog::changed()
97 bc().setValid(isValid());
101 void GuiDialog::enableView(bool enable)
104 bc().setReadOnly(true);
105 bc().setValid(false);
107 Dialog::enableView(enable);
111 void GuiDialog::updateView()
113 setUpdatesEnabled(false);
115 bc().setReadOnly(isBufferReadonly());
116 // protect the BC from unwarranted state transitions
120 // The widgets may not be valid, so refresh the button controller
123 setUpdatesEnabled(true);
126 } // namespace frontend
129 #include "moc_GuiDialog.cpp"