diff options
author | donbright <hugh.m.bright@gmail.com> | 2013-05-27 05:28:56 (GMT) |
---|---|---|
committer | donbright <hugh.m.bright@gmail.com> | 2013-05-27 05:28:56 (GMT) |
commit | ef7b80656fc39dc0fd4012231633cf858e6aa10b (patch) | |
tree | 17e5a57dfa154821918094cab47476189771ce00 /src/mainwin.cc | |
parent | 0967a26bff45951d7b86fe628e8b1156e6e40ede (diff) | |
parent | 37dc9342a14206f5862447eb9d3d5049ec67f638 (diff) |
Merge pull request #368 from openscad/issue125
Issue125
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r-- | src/mainwin.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc index 8151e29..08f0435 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -53,6 +53,7 @@ #ifdef Q_OS_MAC #include "CocoaUtils.h" #endif +#include "PlatformUtils.h" #include <QMenu> #include <QTime> @@ -104,6 +105,8 @@ #define OPENCSG_VERSION_STRING "unknown, <1.3.2" #endif +#include "boosty.h" + extern QString examplesdir; // Global application state @@ -227,6 +230,7 @@ MainWindow::MainWindow(const QString &filename) connect(this->fileActionSaveAs, SIGNAL(triggered()), this, SLOT(actionSaveAs())); connect(this->fileActionReload, SIGNAL(triggered()), this, SLOT(actionReload())); connect(this->fileActionQuit, SIGNAL(triggered()), this, SLOT(quit())); + connect(this->fileShowLibraryFolder, SIGNAL(triggered()), this, SLOT(actionShowLibraryFolder())); #ifndef __APPLE__ QList<QKeySequence> shortcuts = this->fileActionSave->shortcuts(); shortcuts.push_back(QKeySequence(Qt::Key_F2)); @@ -951,6 +955,20 @@ void MainWindow::actionSaveAs() } } +void MainWindow::actionShowLibraryFolder() +{ + std::string path = PlatformUtils::libraryPath(); + if (!fs::exists(path)) { + PRINTB("WARNING: Library path %s doesnt exist. Creating", path); + if (!PlatformUtils::createLibraryPath()) { + PRINTB("ERROR: Cannot create library path: %s",path); + } + } + QString url = QString::fromStdString( path ); + //PRINTB("Opening file browser for %s", url.toStdString() ); + QDesktopServices::openUrl(QUrl::fromLocalFile( url )); +} + void MainWindow::actionReload() { if (checkEditorModified()) refreshDocument(); |