]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiLog.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / GuiLog.cpp
index 2f1ef162967acd0e016124e70f7b383054aec9e1..e5f6c536b4b868abb10d0c8ff99773bcf2d1d4ba 100644 (file)
 #include "support/FileName.h"
 #include "support/gettext.h"
 
+#include <QDesktopServices>
 #include <QTextBrowser>
 #include <QSyntaxHighlighter>
+#include <QUrl>
 #include <QClipboard>
 
 #include <fstream>
@@ -46,7 +48,7 @@ QRegExp exprInfo("^(Document Class:|LaTeX Font Info:|File:|Package:|Language:|Un
 // Warnings
 QRegExp exprWarning("^(LaTeX Warning|LaTeX Font Warning|Package [\\w\\.]+ Warning|Class \\w+ Warning|Warning--|.*> WARN - ).*$");
 // Errors
-QRegExp exprError("^(!|.*---line [0-9]+ of file|.*> FATAL - |.*> ERROR - ).*$");
+QRegExp exprError("^(!|.*---line [0-9]+ of file|.*> FATAL - |.*> ERROR - |Missing character: There is no ).*$");
 
 
 /////////////////////////////////////////////////////////////////////
@@ -189,6 +191,22 @@ void GuiLog::on_nextWarningPB_clicked()
 }
 
 
+void GuiLog::on_openDirPB_clicked()
+{
+       support::FileName dir = logfile_.onlyPath();
+       if (!dir.exists())
+               return;
+       QUrl qdir(QUrl::fromLocalFile(toqstr(from_utf8(dir.absFileName()))));
+       // Give hints in case of bugs
+       if (!qdir.isValid()) {
+               LYXERR0("QUrl is invalid!");
+               return;
+       }
+       if (!QDesktopServices::openUrl(qdir))
+               LYXERR0("Unable to open QUrl even though dir exists!");
+}
+
+
 void GuiLog::goTo(QRegExp const & exp) const
 {
        QTextCursor const newc =
@@ -311,11 +329,12 @@ void GuiLog::getContents(ostream & ss) const
        }
 }
 
-
+/*
 void GuiLog::on_copyPB_clicked()
 {
        theClipboard().put(fromqstr(logTB->toPlainText()));
 }
+*/
 
 
 Dialog * createGuiLog(GuiView & lv) { return new GuiLog(lv); }