]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiLog.cpp
Amend f441590c
[lyx.git] / src / frontends / qt4 / GuiLog.cpp
index 14e7aaf73a035fd7b95fd33eb4eb8a1a76d15059..e5f6c536b4b868abb10d0c8ff99773bcf2d1d4ba 100644 (file)
 #include "support/FileName.h"
 #include "support/gettext.h"
 
+#include <QDesktopServices>
 #include <QTextBrowser>
 #include <QSyntaxHighlighter>
+#include <QUrl>
 #include <QClipboard>
 
 #include <fstream>
@@ -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); }