X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FDialog.cpp;h=65d4a5598141dbb3471e02af0c1471a2e638051c;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=6839d7378ff0b075d8ca796c749eec21bff62048;hpb=c1dce34f5350ff117582bab440e7158ee2475ba2;p=lyx.git diff --git a/src/frontends/qt4/Dialog.cpp b/src/frontends/qt4/Dialog.cpp index 6839d7378f..65d4a55981 100644 --- a/src/frontends/qt4/Dialog.cpp +++ b/src/frontends/qt4/Dialog.cpp @@ -58,7 +58,6 @@ bool Dialog::canApply() const void Dialog::dispatch(FuncRequest const & fr) const { - theLyXFunc().setLyXView(lyxview_); lyx::dispatch(fr); } @@ -77,15 +76,15 @@ void Dialog::disconnect() const bool Dialog::isBufferAvailable() const { - return lyxview_->buffer() != 0; + return lyxview_->currentBufferView() != 0; } bool Dialog::isBufferReadonly() const { - if (!lyxview_->buffer()) + if (!lyxview_->documentBufferView()) return true; - return lyxview_->buffer()->isReadonly(); + return lyxview_->documentBufferView()->buffer().isReadonly(); } @@ -108,14 +107,14 @@ KernelDocType Dialog::docType() const BufferView const * Dialog::bufferview() const { - return lyxview_->view(); + return lyxview_->currentBufferView(); } Buffer const & Dialog::buffer() const { - LASSERT(lyxview_->buffer(), /**/); - return *lyxview_->buffer(); + LASSERT(lyxview_->currentBufferView(), /**/); + return lyxview_->currentBufferView()->buffer(); } @@ -153,7 +152,7 @@ void Dialog::apply() } -void Dialog::showView() +void Dialog::prepareView() { // Make sure the dialog controls are correctly enabled/disabled with // readonly status. @@ -165,7 +164,14 @@ void Dialog::showView() 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(); @@ -212,7 +218,7 @@ Inset const * Dialog::inset(InsetCode code) const void Dialog::checkStatus() { - // buffer independant dialogs are always active. + // buffer independent dialogs are always active. // This check allows us leave canApply unimplemented for some dialogs. if (!isBufferDependent()) { updateView(); @@ -232,9 +238,7 @@ void Dialog::checkStatus() // refreshReadOnly() is too generous in _enabling_ widgets // update dialog to disable disabled widgets again - if (!readonly || canApplyToReadOnly()) - updateView(); - + updateView(); } else enableView(false); }