mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Add button that opens scripts directory window
This commit is contained in:
parent
8631fa6cd3
commit
9c9bca546c
3 changed files with 19 additions and 1 deletions
|
@ -24,7 +24,7 @@ Window {
|
|||
resizable: true
|
||||
destroyOnInvisible: true
|
||||
x: 40; y: 40
|
||||
implicitWidth: 400; implicitHeight: 695
|
||||
implicitWidth: 400; implicitHeight: 742
|
||||
minSize: Qt.vector2d(200, 300)
|
||||
|
||||
HifiConstants { id: hifi }
|
||||
|
@ -237,6 +237,15 @@ Window {
|
|||
}
|
||||
|
||||
HifiControls.VerticalSpacer { }
|
||||
|
||||
HifiControls.Button {
|
||||
id: directoryButton
|
||||
text: "Reveal Scripts Folder"
|
||||
width: 200
|
||||
onClicked: fileDialogHelper.openScriptsDirectory()
|
||||
}
|
||||
|
||||
HifiControls.VerticalSpacer { }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -14,6 +14,9 @@
|
|||
#include <QtCore/QFile>
|
||||
#include <QtCore/QDebug>
|
||||
#include <QtCore/QRegularExpression>
|
||||
#include <QDesktopServices>
|
||||
|
||||
#include "PathUtils.h"
|
||||
|
||||
|
||||
QUrl FileDialogHelper::home() {
|
||||
|
@ -103,3 +106,7 @@ QStringList FileDialogHelper::drives() {
|
|||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
void FileDialogHelper::openScriptsDirectory() {
|
||||
QDesktopServices::openUrl(defaultScriptsLocation());
|
||||
}
|
||||
|
|
|
@ -58,6 +58,8 @@ public:
|
|||
Q_INVOKABLE bool validFolder(const QString& path);
|
||||
Q_INVOKABLE QUrl pathToUrl(const QString& path);
|
||||
Q_INVOKABLE QUrl saveHelper(const QString& saveText, const QUrl& currentFolder, const QStringList& selectionFilters);
|
||||
|
||||
Q_INVOKABLE void openScriptsDirectory();
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue