comparison widgets/PluginPathConfigurator.h @ 1289:ed04d3666d33 plugin-path-config

Toward more than one plugin type in this widget
author Chris Cannam
date Mon, 21 May 2018 16:15:36 +0100
parents 4683b6ffb76a
children 050eca637c19
comparison
equal deleted inserted replaced
1288:4683b6ffb76a 1289:ed04d3666d33
21 class QLabel; 21 class QLabel;
22 class QWidget; 22 class QWidget;
23 class QListWidget; 23 class QListWidget;
24 class QPushButton; 24 class QPushButton;
25 class QGridLayout; 25 class QGridLayout;
26 class QComboBox;
26 27
27 class PluginPathConfigurator : public QFrame 28 class PluginPathConfigurator : public QFrame
28 { 29 {
29 Q_OBJECT 30 Q_OBJECT
30 31
31 public: 32 public:
32 PluginPathConfigurator(QWidget *parent = 0); 33 PluginPathConfigurator(QWidget *parent = 0);
33 ~PluginPathConfigurator(); 34 ~PluginPathConfigurator();
34 35
35 void setPath(QStringList directories, QString envVariable); 36 // Text used to identify a plugin type to the user.
36 QStringList getPath() const; 37 // e.g. "LADSPA", "Vamp", or potentially transliterations thereof
38 typedef QString PluginTypeLabel;
39
40 struct PathConfig {
41 QStringList directories;
42 QString envVariable; // e.g. "LADSPA_PATH" etc
43 };
44
45 typedef std::map<PluginTypeLabel, PathConfig> Paths;
46
47 void setPaths(Paths paths);
48 Paths getPaths() const;
37 49
38 signals: 50 signals:
39 void pathChanged(QStringList); 51 void pathsChanged(const Paths &paths);
40 52
41 private slots: 53 private slots:
42 void upClicked(); 54 void upClicked();
43 void downClicked(); 55 void downClicked();
44 void deleteClicked(); 56 void deleteClicked();
57 void currentTypeChanged(QString);
45 void currentLocationChanged(int); 58 void currentLocationChanged(int);
46 59
47 private: 60 private:
48 QGridLayout *m_layout; 61 QGridLayout *m_layout;
62 QLabel *m_header;
63 QComboBox *m_pluginTypeSelector;
49 QListWidget *m_list; 64 QListWidget *m_list;
50 QPushButton *m_up; 65 QPushButton *m_up;
51 QPushButton *m_down; 66 QPushButton *m_down;
52 QPushButton *m_delete; 67 QPushButton *m_delete;
53 68
54 QStringList m_path; 69 Paths m_paths;
55 QString m_var;
56 70
57 void populate(int makeCurrent = 0); 71 void populate();
72 void populateFor(QString type, int makeCurrent);
58 }; 73 };
59 74
60 #endif 75 #endif
61 76
62 77