]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiView.cpp
add progress view of system calls
[lyx.git] / src / frontends / qt4 / GuiView.cpp
index 3353e885c970aaf49d6ce5f1185a8fa6882798fc..42e5e1ea67854832047c6f9ee9726ced2cf324d3 100644 (file)
@@ -23,6 +23,7 @@
 #include "GuiMenubar.h"
 #include "GuiToolbar.h"
 #include "GuiToolbars.h"
+#include "GuiProgress.h"
 
 #include "qt_helpers.h"
 
@@ -1053,19 +1054,14 @@ static FileName selectTemplateFile()
 
 void GuiView::newDocument(string const & filename, bool from_template)
 {
-       FileName initpath;
+       FileName initpath(lyxrc.document_path);
        Buffer * buf = buffer();
        if (buf) {
                FileName const trypath(buf->filePath());
                // If directory is writeable, use this as default.
                if (trypath.isDirWritable())
                        initpath = trypath;
-       } else
-               initpath.set(lyxrc.document_path);
-
-       // FIXME: Up to now initpath was unconditionally set to the user document
-       // path. Is it what we want? If yes, erase the code above.
-       initpath.set(lyxrc.document_path);
+       }
 
        string templatefile = from_template ?
                selectTemplateFile().absFilename() : string();
@@ -1574,7 +1570,7 @@ char const * const dialognames[] = {
 "thesaurus",
 #endif
 
-"texinfo", "toc", "href", "view-source", "vspace", "wrap", "listings" };
+"texinfo", "toc", "href", "view-source", "latex-progress", "vspace", "wrap", "listings" };
 
 char const * const * const end_dialognames =
        dialognames + (sizeof(dialognames) / sizeof(char *));
@@ -1727,8 +1723,10 @@ void GuiView::updateBufferDependent(bool switched) const
 
        for(; it != end; ++it) {
                Dialog * dialog = it->second.get();
+               if (!dialog->isVisibleView())
+                       continue;
                if (switched && dialog->isBufferDependent()) {
-                       if (dialog->isVisibleView() && dialog->initialiseParams(""))
+                       if (dialog->initialiseParams(""))
                                dialog->updateView();
                        else
                                dialog->hide();
@@ -1796,6 +1794,7 @@ Dialog * createGuiThesaurus(GuiView & lv);
 Dialog * createGuiHyperlink(GuiView & lv);
 Dialog * createGuiVSpace(GuiView & lv);
 Dialog * createGuiViewSource(GuiView & lv);
+Dialog * createGuiProgress(GuiView & lv);
 Dialog * createGuiWrap(GuiView & lv);
 
 
@@ -1847,6 +1846,8 @@ Dialog * GuiView::build(string const & name)
                return createGuiLog(*this);
        if (name == "view-source")
                return createGuiViewSource(*this);
+       if (name == "latex-progress")
+               return createGuiProgress(*this);
        if (name == "mathdelimiter")
                return createGuiDelimiter(*this);
        if (name == "mathmatrix")