summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--openscad.pro3
-rw-r--r--src/MainWindow.h1
-rw-r--r--src/MainWindow.ui6
-rw-r--r--src/PlatformUtils-mac.mm (renamed from src/PlatformUtils.mm)0
-rw-r--r--src/PlatformUtils.cc7
-rw-r--r--src/PlatformUtils.h1
-rw-r--r--src/mainwin.cc7
7 files changed, 24 insertions, 1 deletions
diff --git a/openscad.pro b/openscad.pro
index c36c37b..8bd24af 100644
--- a/openscad.pro
+++ b/openscad.pro
@@ -302,6 +302,7 @@ SOURCES += src/version_check.cc \
src/parsersettings.cc \
src/stl-utils.cc \
src/boost-utils.cc \
+ src/PlatformUtils.cc \
\
src/nodedumper.cc \
src/traverser.cc \
@@ -385,7 +386,7 @@ macx {
src/CocoaUtils.h
SOURCES += src/AppleEvents.cc
OBJECTIVE_SOURCES += src/CocoaUtils.mm \
- src/PlatformUtils.mm
+ src/PlatformUtils-mac.mm
}
unix:!macx {
SOURCES += src/PlatformUtils-posix.cc
diff --git a/src/MainWindow.h b/src/MainWindow.h
index 378705e..bd32bdd 100644
--- a/src/MainWindow.h
+++ b/src/MainWindow.h
@@ -101,6 +101,7 @@ private slots:
void actionSave();
void actionSaveAs();
void actionReload();
+ void actionShowLibraryFolder();
private slots:
void pasteViewportTranslation();
diff --git a/src/MainWindow.ui b/src/MainWindow.ui
index 8e995cd..e9bd96e 100644
--- a/src/MainWindow.ui
+++ b/src/MainWindow.ui
@@ -137,6 +137,7 @@
<addaction name="fileActionOpen"/>
<addaction name="menuOpenRecent"/>
<addaction name="menuExamples"/>
+ <addaction name="fileShowLibraryFolder"/>
<addaction name="separator"/>
<addaction name="fileActionClose"/>
<addaction name="fileActionSave"/>
@@ -688,6 +689,11 @@
<string>Check for Update..</string>
</property>
</action>
+ <action name="fileShowLibraryFolder">
+ <property name="text">
+ <string>Show Library Folder...</string>
+ </property>
+ </action>
</widget>
<customwidgets>
<customwidget>
diff --git a/src/PlatformUtils.mm b/src/PlatformUtils-mac.mm
index 1e2ba43..1e2ba43 100644
--- a/src/PlatformUtils.mm
+++ b/src/PlatformUtils-mac.mm
diff --git a/src/PlatformUtils.cc b/src/PlatformUtils.cc
new file mode 100644
index 0000000..cea449b
--- /dev/null
+++ b/src/PlatformUtils.cc
@@ -0,0 +1,7 @@
+#include "PlatformUtils.h"
+#include "boosty.h"
+
+std::string PlatformUtils::libraryPath()
+{
+ return boosty::stringy(fs::path(PlatformUtils::documentsPath()) / "OpenSCAD" / "libraries");
+}
diff --git a/src/PlatformUtils.h b/src/PlatformUtils.h
index 6448427..202abaa 100644
--- a/src/PlatformUtils.h
+++ b/src/PlatformUtils.h
@@ -6,6 +6,7 @@
namespace PlatformUtils {
std::string documentsPath();
+ std::string libraryPath();
}
diff --git a/src/mainwin.cc b/src/mainwin.cc
index da3501d..9b490c7 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>
@@ -227,6 +228,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 +953,11 @@ void MainWindow::actionSaveAs()
}
}
+void MainWindow::actionShowLibraryFolder()
+{
+ QDesktopServices::openUrl(QUrl::fromLocalFile(QString::fromStdString(PlatformUtils::libraryPath())));
+}
+
void MainWindow::actionReload()
{
if (checkEditorModified()) refreshDocument();
contact: Jan Huwald // Impressum