diff --git a/src/Buffer.cpp b/src/Buffer.cpp index b7b27c4073..ed16070424 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -2560,10 +2560,10 @@ void Buffer::structureChanged() const } -void Buffer::errors(string const & err) const +void Buffer::errors(string const & err, bool from_master) const { if (gui_) - gui_->errors(err); + gui_->errors(err, from_master); } @@ -2853,8 +2853,14 @@ bool Buffer::doExport(string const & format, bool put_in_tempdir, tmp_result_file, FileName(absFileName()), backend_format, format, error_list); // Emit the signal to show the error list. - if (format != backend_format) + if (format != backend_format) { errors(error_type); + // also to the children, in case of master-buffer-view + std::vector clist = getChildren(); + for (vector::const_iterator cit = clist.begin(); + cit != clist.end(); ++cit) + (*cit)->errors(error_type, true); + } if (!success) return false; diff --git a/src/Buffer.h b/src/Buffer.h index 72c0d8ca09..bdaaefab7d 100644 --- a/src/Buffer.h +++ b/src/Buffer.h @@ -455,7 +455,7 @@ public: /// This function is called when the buffer structure is changed. void structureChanged() const; /// This function is called when some parsing error shows up. - void errors(std::string const & err) const; + void errors(std::string const & err, bool from_master = false) const; /// This function is called when the buffer busy status change. void setBusy(bool on) const; /// This function is called when the buffer readonly status change. diff --git a/src/frontends/Delegates.h b/src/frontends/Delegates.h index 519a285fbf..d13af7eec5 100644 --- a/src/frontends/Delegates.h +++ b/src/frontends/Delegates.h @@ -65,7 +65,7 @@ public: /// This function is called when the buffer structure has been updated. virtual void updateTocItem(std::string const &, DocIterator const &) = 0; /// This function is called when some parsing error shows up. - virtual void errors(std::string const &) = 0; + virtual void errors(std::string const &, bool from_master = false) = 0; /// This function is called when some message shows up. virtual void message(docstring const &) = 0; /// This function is called when the buffer busy status change. diff --git a/src/frontends/qt4/GuiErrorList.cpp b/src/frontends/qt4/GuiErrorList.cpp index 1824ace4b1..746d3ed35d 100644 --- a/src/frontends/qt4/GuiErrorList.cpp +++ b/src/frontends/qt4/GuiErrorList.cpp @@ -84,16 +84,24 @@ void GuiErrorList::updateContents() ErrorList const & GuiErrorList::errorList() const { - return bufferview()->buffer().errorList(error_type_); + return from_master_ ? + bufferview()->buffer().masterBuffer()->errorList(error_type_) + : bufferview()->buffer().errorList(error_type_); } -bool GuiErrorList::initialiseParams(string const & error_type) +bool GuiErrorList::initialiseParams(string const & data) { + from_master_ = prefixIs(data, "from_master|"); + string error_type = data; + if (from_master_) + error_type = split(data, '|'); error_type_ = error_type; - Buffer const & buf = bufferview()->buffer(); + Buffer const * buf = from_master_ ? + bufferview()->buffer().masterBuffer() + : &bufferview()->buffer(); name_ = bformat(_("%1$s Errors (%2$s)"), _(error_type), - from_utf8(buf.absFileName())); + from_utf8(buf->absFileName())); return true; } @@ -105,6 +113,10 @@ bool GuiErrorList::goTo(int item) if (err.par_id == -1) return false; + if (from_master_) + // FIXME: implement + return false; + Buffer const & buf = buffer(); DocIterator dit = buf.getParFromID(err.par_id); diff --git a/src/frontends/qt4/GuiErrorList.h b/src/frontends/qt4/GuiErrorList.h index 9bb6810201..af4f0b9abc 100644 --- a/src/frontends/qt4/GuiErrorList.h +++ b/src/frontends/qt4/GuiErrorList.h @@ -57,6 +57,8 @@ private: std::string error_type_; /// the parent document name docstring name_; + /// + bool from_master_; }; } // namespace frontend diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 38cb93ae9b..c91b4a723b 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -1143,11 +1143,16 @@ void GuiView::disconnectBufferView() } -void GuiView::errors(string const & error_type) +void GuiView::errors(string const & error_type, bool from_master) { - ErrorList & el = buffer()->errorList(error_type); + ErrorList & el = from_master ? + buffer()->masterBuffer()->errorList(error_type) + : buffer()->errorList(error_type); + string data = error_type; + if (from_master) + data = "from_master|" + error_type; if (!el.empty()) - showDialog("errorlist", error_type); + showDialog("errorlist", data); } diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 777c783b39..0ce40726f1 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -104,7 +104,7 @@ public: /// GuiBufferDelegate. ///@{ void resetAutosaveTimers(); - void errors(std::string const &); + void errors(std::string const &, bool from_master = false); void structureChanged(); void updateTocItem(std::string const &, DocIterator const &); ///@}