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 "QDialogView.h"
15 #include "qt_helpers.h"
17 #include "controllers/ButtonController.h"
24 QDialogView::QDialogView(Dialog & parent, docstring const & t)
25 : Dialog::View(parent,t), updating_(false)
29 Qt2BC & QDialogView::bcview()
31 return static_cast<Qt2BC &>(dialog().bc().view());
35 bool QDialogView::isVisible() const
37 return form() && form()->isVisible();
41 bool QDialogView::readOnly() const
43 return kernel().isBufferReadonly();
47 void QDialogView::show()
53 QSize const sizeHint = form()->sizeHint();
54 if (sizeHint.height() >= 0 && sizeHint.width() >= 0)
55 form()->setMinimumSize(sizeHint);
57 update(); // make sure its up-to-date
58 if (dialog().controller().exitEarly())
61 form()->setWindowTitle(toqstr("LyX: " + getTitle()));
63 if (form()->isVisible()) {
65 form()->activateWindow();
74 void QDialogView::hide()
76 if (form() && form()->isVisible())
81 bool QDialogView::isValid()
87 void QDialogView::changed()
91 bc().valid(isValid());
95 void QDialogView::slotWMHide()
97 dialog().CancelButton();
101 void QDialogView::slotApply()
103 dialog().ApplyButton();
107 void QDialogView::slotOK()
113 void QDialogView::slotClose()
115 dialog().CancelButton();
119 void QDialogView::slotRestore()
121 dialog().RestoreButton();
124 } // namespace frontend
127 #include "QDialogView_moc.cpp"