comparison widgets/PluginPathConfigurator.h @ 1293:6dd15b5c14f9 plugin-path-config

Various logic fixes, and use new setter-class structures
author Chris Cannam
date Fri, 25 May 2018 16:05:51 +0100
parents 41824255ddf2
children 34b941921ac8
comparison
equal deleted inserted replaced
1292:41824255ddf2 1293:6dd15b5c14f9
24 class QPushButton; 24 class QPushButton;
25 class QGridLayout; 25 class QGridLayout;
26 class QComboBox; 26 class QComboBox;
27 class QCheckBox; 27 class QCheckBox;
28 28
29 #include "plugin/PluginPathSetter.h"
30
29 class PluginPathConfigurator : public QFrame 31 class PluginPathConfigurator : public QFrame
30 { 32 {
31 Q_OBJECT 33 Q_OBJECT
32 34
33 public: 35 public:
34 PluginPathConfigurator(QWidget *parent = 0); 36 PluginPathConfigurator(QWidget *parent = 0);
35 ~PluginPathConfigurator(); 37 ~PluginPathConfigurator();
36 38
37 // Text used to identify a plugin type to the user. 39 void setPaths(PluginPathSetter::Paths paths);
38 // e.g. "LADSPA", "Vamp", or potentially transliterations thereof 40 PluginPathSetter::Paths getPaths() const { return m_paths; }
39 typedef QString PluginTypeLabel;
40
41 struct PathConfig {
42 QStringList directories;
43 QString envVariable; // e.g. "LADSPA_PATH" etc
44 bool useEnvVariable; // true if env variable overrides directories list
45 };
46
47 typedef std::map<PluginTypeLabel, PathConfig> Paths;
48
49 void setPaths(Paths paths);
50 Paths getPaths() const;
51 41
52 signals: 42 signals:
53 void pathsChanged(const Paths &paths); 43 void pathsChanged();
54 44
55 private slots: 45 private slots:
56 void upClicked(); 46 void upClicked();
57 void downClicked(); 47 void downClicked();
58 void addClicked(); 48 void addClicked();
74 QPushButton *m_add; 64 QPushButton *m_add;
75 QPushButton *m_delete; 65 QPushButton *m_delete;
76 QPushButton *m_reset; 66 QPushButton *m_reset;
77 QCheckBox *m_envOverride; 67 QCheckBox *m_envOverride;
78 68
79 Paths m_paths; 69 PluginPathSetter::Paths m_paths;
80 Paths m_originalPaths; 70 PluginPathSetter::Paths m_defaultPaths;
81 71
82 void populate(); 72 void populate();
83 void populateFor(QString type, int makeCurrent); 73 void populateFor(QString type, int makeCurrent);
84 }; 74 };
85 75