}
-BufferView * Dialog::bufferview()
-{
- return lyxview_->view();
-}
-
-
BufferView const * Dialog::bufferview() const
{
return lyxview_->view();
}
-Buffer & Dialog::buffer()
-{
- LASSERT(lyxview_->buffer(), /**/);
- return *lyxview_->buffer();
-}
-
-
Buffer const & Dialog::buffer() const
{
LASSERT(lyxview_->buffer(), /**/);
}
-void Dialog::showView()
+void Dialog::prepareView()
{
// Make sure the dialog controls are correctly enabled/disabled with
// readonly status.
checkStatus();
- if (exitEarly())
- return;
QWidget * w = asQWidget();
w->setWindowTitle(title_);
QSize const hint = w->sizeHint();
if (hint.height() >= 0 && hint.width() >= 0)
w->setMinimumSize(hint);
+}
+
+void Dialog::showView()
+{
+ prepareView();
+
+ QWidget * w = asQWidget();
if (w->isVisible()) {
w->raise();
w->activateWindow();
if (wantInitialFocus())
w->setFocus();
- else
+ else {
+ lyxview_->raise();
+ lyxview_->activateWindow();
lyxview_->setFocus();
+ }
}
// check whether this dialog may be active
if (canApply()) {
bool const readonly = isBufferReadonly();
- enableView(!readonly);
+ enableView(!readonly || canApplyToReadOnly());
// refreshReadOnly() is too generous in _enabling_ widgets
// update dialog to disable disabled widgets again
QString Dialog::sessionKey() const
{
- return "view-" + QString::number(lyxview_->id())
+ return "views/" + QString::number(lyxview_->id())
+ "/" + name();
}