diff --git a/UI/frontend-plugins/frontend-tools/data/locale/en-US.ini b/UI/frontend-plugins/frontend-tools/data/locale/en-US.ini index 2df4ff67e..9eefe2c05 100644 --- a/UI/frontend-plugins/frontend-tools/data/locale/en-US.ini +++ b/UI/frontend-plugins/frontend-tools/data/locale/en-US.ini @@ -33,6 +33,7 @@ RemoveScripts="Remove Scripts" ReloadScripts="Reload Scripts" LoadedScripts="Loaded Scripts" Reload="Reload" +OpenFileLocation="Open file location" PythonSettings="Python Settings" PythonSettings.PythonInstallPath32bit="Python Install Path (32bit)" PythonSettings.PythonInstallPath64bit="Python Install Path (64bit)" diff --git a/UI/frontend-plugins/frontend-tools/scripts.cpp b/UI/frontend-plugins/frontend-tools/scripts.cpp index 6bf920c82..cafca8866 100644 --- a/UI/frontend-plugins/frontend-tools/scripts.cpp +++ b/UI/frontend-plugins/frontend-tools/scripts.cpp @@ -390,6 +390,17 @@ void ScriptsTool::on_reloadScripts_clicked() on_scripts_currentRowChanged(ui->scripts->currentRow()); } +void ScriptsTool::OpenScriptParentDirectory() +{ + QList items = ui->scripts->selectedItems(); + for (QListWidgetItem *item : items) { + QDir dir(item->data(Qt::UserRole).toString()); + dir.cdUp(); + QDesktopServices::openUrl( + QUrl::fromLocalFile(dir.absolutePath())); + } +} + void ScriptsTool::on_scripts_customContextMenuRequested(const QPoint &pos) { @@ -405,6 +416,8 @@ void ScriptsTool::on_scripts_customContextMenuRequested(const QPoint &pos) popup.addSeparator(); popup.addAction(obs_module_text("Reload"), this, SLOT(on_reloadScripts_clicked())); + popup.addAction(obs_module_text("OpenFileLocation"), this, + SLOT(OpenScriptParentDirectory())); popup.addSeparator(); popup.addAction(tr("Remove"), this, SLOT(on_removeScripts_clicked())); diff --git a/UI/frontend-plugins/frontend-tools/scripts.hpp b/UI/frontend-plugins/frontend-tools/scripts.hpp index 8eedf7afc..c511b378e 100644 --- a/UI/frontend-plugins/frontend-tools/scripts.hpp +++ b/UI/frontend-plugins/frontend-tools/scripts.hpp @@ -48,6 +48,8 @@ public slots: void on_scriptLog_clicked(); void on_defaults_clicked(); + void OpenScriptParentDirectory(); + void on_scripts_currentRowChanged(int row); void on_pythonPathBrowse_clicked();