2 * \file GuiDialogView.cpp
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 "GuiDialogView.h"
14 #include "qt_helpers.h"
20 GuiDialogView::GuiDialogView(GuiDialog & parent, docstring const & t)
21 : Dialog::View(parent, t), updating_(false), parent_(parent)
25 ButtonController & GuiDialogView::bc()
31 bool GuiDialogView::isVisibleView() const
33 return form() && form()->isVisible();
37 bool GuiDialogView::readOnly() const
39 return kernel().isBufferReadonly();
43 void GuiDialogView::showView()
48 QSize const sizeHint = form()->sizeHint();
49 if (sizeHint.height() >= 0 && sizeHint.width() >= 0)
50 form()->setMinimumSize(sizeHint);
52 updateView(); // make sure its up-to-date
53 if (dialog().controller().exitEarly())
56 form()->setWindowTitle(toqstr("LyX: " + getViewTitle()));
58 if (form()->isVisible()) {
60 form()->activateWindow();
69 void GuiDialogView::hideView()
71 if (form() && form()->isVisible())
76 void GuiDialogView::build()
78 // protect the BC from unwarranted state transitions
85 bool GuiDialogView::isValid()
91 void GuiDialogView::changed()
95 parent_.bc().setValid(isValid());
99 void GuiDialogView::slotWMHide()
101 parent_.CancelButton();
105 void GuiDialogView::slotApply()
107 parent_.ApplyButton();
111 void GuiDialogView::slotOK()
117 void GuiDialogView::slotClose()
119 parent_.CancelButton();
123 void GuiDialogView::slotRestore()
125 parent_.RestoreButton();
128 } // namespace frontend
131 #include "GuiDialogView_moc.cpp"