changeset 1837:9fbaf30a09ab plugin-path-config

Wire up plugin path settings logic (needs more testing)
author Chris Cannam
date Fri, 25 May 2018 16:09:40 +0100
parents 42f89437f70b
children 36e5cbe6a16f
files main/PreferencesDialog.cpp main/PreferencesDialog.h main/main.cpp repoint-lock.json repoint-project.json
diffstat 5 files changed, 29 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/main/PreferencesDialog.cpp	Fri May 25 13:39:28 2018 +0100
+++ b/main/PreferencesDialog.cpp	Fri May 25 16:09:40 2018 +0100
@@ -581,22 +581,13 @@
 
     // Plugins tab
 
-    PluginPathConfigurator *pathConfig = new PluginPathConfigurator(this);
-    QStringList path;
-    path << "/usr/lib/vamp";
-    path << "/usr/local/lib/vamp";
-    path << "/home/user/.vamp";
-    PluginPathConfigurator::Paths paths;
-    paths["Vamp"] = { path, "VAMP_PATH", true };
-    path.clear();
-    path << "/usr/lib/ladspa";
-    path << "/usr/local/lib/ladspa";
-    path << "/home/user/.ladspa";
-    paths["LADSPA"] = { path, "LADSPA_PATH", true };
-    pathConfig->setPaths(paths);
+    m_pluginPathConfigurator = new PluginPathConfigurator(this);
+    m_pluginPathConfigurator->setPaths(PluginPathSetter::getPaths());
+    connect(m_pluginPathConfigurator, SIGNAL(pathsChanged()),
+            this, SLOT(pluginPathsChanged()));
     
     m_tabOrdering[PluginTab] = m_tabs->count();
-    m_tabs->addTab(pathConfig, tr("&Plugins"));
+    m_tabs->addTab(m_pluginPathConfigurator, tr("&Plugins"));
     
     // General tab
 
@@ -925,6 +916,13 @@
 }
 
 void
+PreferencesDialog::pluginPathsChanged()
+{
+    m_applyButton->setEnabled(true);
+    m_changesOnRestart = true;
+}
+
+void
 PreferencesDialog::okClicked()
 {
     applyClicked();
@@ -1026,6 +1024,8 @@
         emit coloursChanged();
         m_coloursChanged = false;
     }
+
+    PluginPathSetter::savePathSettings(m_pluginPathConfigurator->getPaths());
 }    
 
 void
--- a/main/PreferencesDialog.h	Fri May 25 13:39:28 2018 +0100
+++ b/main/PreferencesDialog.h	Fri May 25 16:09:40 2018 +0100
@@ -13,8 +13,8 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _PREFERENCES_DIALOG_H_
-#define _PREFERENCES_DIALOG_H_
+#ifndef SV_PREFERENCES_DIALOG_H
+#define SV_PREFERENCES_DIALOG_H
 
 #include <QDialog>
 #include <QMap>
@@ -27,6 +27,7 @@
 class QLineEdit;
 class QTabWidget;
 class QComboBox;
+class PluginPathConfigurator;
 
 class PreferencesDialog : public QDialog
 {
@@ -80,6 +81,7 @@
     void localeChanged(int);
     void networkPermissionChanged(int state);
     void retinaChanged(int state);
+    void pluginPathsChanged();
 
     void tempDirButtonClicked();
 
@@ -99,6 +101,8 @@
     QComboBox *m_audioPlaybackDeviceCombo;
     QComboBox *m_audioRecordDeviceCombo;
     void rebuildDeviceCombos();
+
+    PluginPathConfigurator *m_pluginPathConfigurator;
     
     QString m_currentTemplate;
     QStringList m_templates;
--- a/main/main.cpp	Fri May 25 13:39:28 2018 +0100
+++ b/main/main.cpp	Fri May 25 16:09:40 2018 +0100
@@ -24,9 +24,10 @@
 #include "data/fileio/FileSource.h"
 #include "widgets/TipDialog.h"
 #include "widgets/InteractiveFileFinder.h"
-#include "svapp/framework/TransformUserConfigurator.h"
+#include "framework/TransformUserConfigurator.h"
 #include "transform/TransformFactory.h"
-#include "svcore/plugin/PluginScan.h"
+#include "plugin/PluginScan.h"
+#include "plugin/PluginPathSetter.h"
 
 #include <QMetaType>
 #include <QApplication>
@@ -300,6 +301,8 @@
     }
     settings.endGroup();
 
+    PluginPathSetter::setEnvironmentVariables();
+    
     QIcon icon;
     int sizes[] = { 16, 22, 24, 32, 48, 64, 128 };
     for (int i = 0; i < int(sizeof(sizes)/sizeof(sizes[0])); ++i) {
--- a/repoint-lock.json	Fri May 25 13:39:28 2018 +0100
+++ b/repoint-lock.json	Fri May 25 16:09:40 2018 +0100
@@ -4,10 +4,10 @@
       "pin": "328cb056da44"
     },
     "svcore": {
-      "pin": "85e9b7b31a8d"
+      "pin": "5d7057af0c68"
     },
     "svgui": {
-      "pin": "41824255ddf2"
+      "pin": "6dd15b5c14f9"
     },
     "svapp": {
       "pin": "7da68349a0c5"
--- a/repoint-project.json	Fri May 25 13:39:28 2018 +0100
+++ b/repoint-project.json	Fri May 25 16:09:40 2018 +0100
@@ -16,7 +16,8 @@
         },
         "svcore": {
             "vcs": "hg",
-            "service": "soundsoftware"
+            "service": "soundsoftware",
+            "branch": "plugin-path-config"
         },
         "svgui": {
             "vcs": "hg",