X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiWorkArea.cpp;h=dde2d710cae292ed2cb0cdf1aa14b75d2f8dc220;hb=425d092204118ea6c24c28e85fdf03fcf2bb51a4;hp=410f5e97dd6642e18e331ca08999ac6f2119f5c8;hpb=dd38c54f667db751680bbce04022ceb0ec4230f0;p=lyx.git diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index 410f5e97dd..dde2d710ca 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -246,7 +246,7 @@ GuiWorkArea::GuiWorkArea(QWidget *) GuiWorkArea::GuiWorkArea(Buffer & buffer, GuiView & gv) - : buffer_view_(0), lyx_view_(0), + : buffer_view_(0), read_only_(buffer.isReadonly()), lyx_view_(0), cursor_visible_(false), need_resize_(false), schedule_redraw_(false), preedit_lines_(1), completer_(new GuiCompleter(this, this)), @@ -440,6 +440,8 @@ void GuiWorkArea::redraw(bool update_metrics) if (lyxerr.debugging(Debug::WORKAREA)) buffer_view_->coordCache().dump(); + + setReadOnly(buffer_view_->buffer().isReadonly()); } @@ -464,7 +466,8 @@ void GuiWorkArea::dispatch(FuncRequest const & cmd0, KeyModifier mod) { // Handle drag&drop if (cmd0.action == LFUN_FILE_OPEN) { - lyx_view_->dispatch(cmd0); + DispatchResult dr; + lyx_view_->dispatch(cmd0, dr); return; } @@ -1213,8 +1216,11 @@ void GuiWorkArea::updateWindowTitle() } -void GuiWorkArea::setReadOnly(bool) +void GuiWorkArea::setReadOnly(bool read_only) { + if (read_only_ == read_only) + return; + read_only_ = read_only; updateWindowTitle(); if (this == lyx_view_->currentWorkArea()) lyx_view_->updateDialogs();