mirror of https://github.com/vitalif/openscad
Added meny entry for disclosing the library path. Part of #125
parent
e2772c70b8
commit
13e4bcd50e
|
@ -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
|
||||
|
|
|
@ -101,6 +101,7 @@ private slots:
|
|||
void actionSave();
|
||||
void actionSaveAs();
|
||||
void actionReload();
|
||||
void actionShowLibraryFolder();
|
||||
|
||||
private slots:
|
||||
void pasteViewportTranslation();
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
#include "PlatformUtils.h"
|
||||
#include "boosty.h"
|
||||
|
||||
std::string PlatformUtils::libraryPath()
|
||||
{
|
||||
return boosty::stringy(fs::path(PlatformUtils::documentsPath()) / "OpenSCAD" / "libraries");
|
||||
}
|
|
@ -6,6 +6,7 @@
|
|||
namespace PlatformUtils {
|
||||
|
||||
std::string documentsPath();
|
||||
std::string libraryPath();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue