X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiViewSource.cpp;h=a5beae5da691e673c05fa55d77e9ae9274527128;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=37eaa96efa0162ef49eb58bb9f1df6c4fbe30bc9;hpb=97707102da8dedf7b57934e1eba459520bc881d2;p=lyx.git diff --git a/src/frontends/qt4/GuiViewSource.cpp b/src/frontends/qt4/GuiViewSource.cpp index 37eaa96efa..a5beae5da6 100644 --- a/src/frontends/qt4/GuiViewSource.cpp +++ b/src/frontends/qt4/GuiViewSource.cpp @@ -50,6 +50,8 @@ ViewSourceWidget::ViewSourceWidget() this, SLOT(updateView())); connect(autoUpdateCB, SIGNAL(toggled(bool)), updatePB, SLOT(setDisabled(bool))); + connect(autoUpdateCB, SIGNAL(toggled(bool)), + this, SLOT(updateView())); connect(updatePB, SIGNAL(clicked()), this, SLOT(updateView())); @@ -57,7 +59,6 @@ ViewSourceWidget::ViewSourceWidget() // so we disable the signals here: document_->blockSignals(true); viewSourceTV->setDocument(document_); - viewSourceTV->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); document_->blockSignals(false); viewSourceTV->setReadOnly(true); ///dialog_->viewSourceTV->setAcceptRichText(false); @@ -116,6 +117,7 @@ static bool getContent(BufferView const * view, bool fullSource, QString & qstr) void ViewSourceWidget::setBufferView(BufferView const * bv) { bv_ = bv; + setEnabled(bv ? true : false); } @@ -126,6 +128,8 @@ void ViewSourceWidget::updateView() setEnabled(false); return; } + + setEnabled(true); QString content; if (getContent(bv_, viewFullSourceCB->isChecked(), content)) @@ -177,12 +181,10 @@ void GuiViewSource::updateView() void GuiViewSource::enableView(bool enable) { - if (!enable) { + widget_->setBufferView(bufferview()); + if (!enable) // In the opposite case, updateView() will be called anyway. - widget_->setBufferView(bufferview()); widget_->updateView(); - } - widget_->setEnabled(enable); } @@ -229,6 +231,7 @@ void GuiViewSource::restoreSession() QSettings settings; widget_->autoUpdateCB->setChecked( settings.value(sessionKey() + "/autoupdate", true).toBool()); + widget_->updateView(); }