summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-05-27 01:45:28 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-05-27 01:45:28 (GMT)
commitcd831d6922e52d85c73846e17354ddc434debb80 (patch)
tree7a6621a77221cad1a8f0bd2e319c5ea7aea620cb /src/mainwin.cc
parent08952ee2164efd8257adbd8684317ec1c945b7ac (diff)
add 'create library' call to mainwin.cc GUI.
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index f370f3d..39af31c 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -105,6 +105,8 @@
#define OPENCSG_VERSION_STRING "unknown, <1.3.2"
#endif
+#include "boosty.h"
+
extern QString examplesdir;
// Global application state
@@ -955,8 +957,15 @@ void MainWindow::actionSaveAs()
void MainWindow::actionShowLibraryFolder()
{
- QString url = QString::fromStdString(PlatformUtils::libraryPath());
- PRINTB("Opening file browser for %s", url.toStdString() );
+ 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 ));
}
contact: Jan Huwald // Impressum