]> git.lyx.org Git - features.git/commitdiff
* Pop up error dialog if issuing master-buffer-[view|update] and errors occured.
authorJürgen Spitzmüller <spitz@lyx.org>
Sun, 21 Jun 2009 12:26:41 +0000 (12:26 +0000)
committerJürgen Spitzmüller <spitz@lyx.org>
Sun, 21 Jun 2009 12:26:41 +0000 (12:26 +0000)
  Navigating in such dialogs does not work yet, but at least the user is informed
  at all that LaTeX wasn't succesful.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30209 a592a061-630c-0410-9148-cb99ea01b6c8

src/Buffer.cpp
src/Buffer.h
src/frontends/Delegates.h
src/frontends/qt4/GuiErrorList.cpp
src/frontends/qt4/GuiErrorList.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index b7b27c4073d6e5316dbe56d0a0e8126d454524d3..ed16070424220bf4a7ebd4c82ac9a37893b42035 100644 (file)
@@ -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<Buffer *> clist = getChildren();
+               for (vector<Buffer *>::const_iterator cit = clist.begin();
+                    cit != clist.end(); ++cit)
+                       (*cit)->errors(error_type, true);
+       }
        if (!success)
                return false;
 
index 72c0d8ca097271162bb5ef0075619fe22dff9870..bdaaefab7d303882ca8a82e2e007dec0fd7c5e8d 100644 (file)
@@ -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.
index 519a285fbfbd39e4a54b1b897551db85c68ac27a..d13af7eec5b3c7fdef0f12f6d30854135e7866fa 100644 (file)
@@ -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.
index 1824ace4b18b874695d559cac50cb2c2c5ffa782..746d3ed35d1fd52dd93b601e32eb8ae016154b85 100644 (file)
@@ -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);
 
index 9bb68102013587253f120484f7ed2610b159beb8..af4f0b9abc778fbfb60442c882169332b567c41b 100644 (file)
@@ -57,6 +57,8 @@ private:
        std::string error_type_;
        /// the parent document name
        docstring name_;
+       ///
+       bool from_master_;
 };
 
 } // namespace frontend
index 38cb93ae9b86330587f4a30576ed4129181756d8..c91b4a723b2417748e595288531d66f1b4d757ab 100644 (file)
@@ -1143,11 +1143,16 @@ void GuiView::disconnectBufferView()
 }
 
 
-void GuiView::errors(string const & error_type)
-{
-       ErrorList & el = buffer()->errorList(error_type);
+void GuiView::errors(string const & error_type, bool from_master)
+{
+       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);
 }
 
 
index 777c783b39a3a635d8ce6129eb3cf63251122c61..0ce40726f13234461ff1e9fb585cab064a3f6430 100644 (file)
@@ -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 &);
        ///@}