From cd831d6922e52d85c73846e17354ddc434debb80 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 26 May 2013 20:45:28 -0500 Subject: add 'create library' call to mainwin.cc GUI. 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 )); } -- cgit v0.10.1