summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-07 17:57:49 +0000
committerDavid Robillard <d@drobilla.net>2010-02-07 17:57:49 +0000
commitece287591afab6a1b8b944c0cab675a9f08ba97e (patch)
tree46344e7d6709dd894bb98254153fdc5288d3ff1a /src/gui
parent16edd7b1272e91a5ef28e8b9211b8d5721fafe23 (diff)
downloadingen-ece287591afab6a1b8b944c0cab675a9f08ba97e.tar.gz
ingen-ece287591afab6a1b8b944c0cab675a9f08ba97e.tar.bz2
ingen-ece287591afab6a1b8b944c0cab675a9f08ba97e.zip
Show type (LV2, LADSPA, etc) label in plugin window rather than URI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2433 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/LoadPluginWindow.cpp30
-rw-r--r--src/gui/LoadPluginWindow.hpp1
2 files changed, 16 insertions, 15 deletions
diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp
index 1b8b4859..39ed0f3d 100644
--- a/src/gui/LoadPluginWindow.cpp
+++ b/src/gui/LoadPluginWindow.cpp
@@ -227,20 +227,14 @@ LoadPluginWindow::new_plugin(SharedPtr<PluginModel> pm)
void
-LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin)
+LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, SharedPtr<PluginModel> plugin)
{
const LV2URIMap& uris = App::instance().uris();
- Gtk::TreeModel::iterator iter = _plugins_liststore->append();
- Gtk::TreeModel::Row row = *iter;
- _rows.insert(make_pair(plugin->uri(), iter));
-
const Atom& name = plugin->get_property(uris.doap_name);
- if (name.is_valid()) {
- if (name.type() == Atom::STRING)
+ if (name.is_valid() && name.type() == Atom::STRING)
row[_plugins_columns._col_name] = name.get_string();
- } else if (plugin->type() == Plugin::LADSPA) {
+ else if (plugin->type() == Plugin::LADSPA)
App::instance().engine()->request_property(plugin->uri(), uris.doap_name);
- }
switch (plugin->type()) {
case Plugin::LV2:
@@ -262,6 +256,17 @@ LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin)
row[_plugins_columns._col_uri] = plugin->uri().str();
row[_plugins_columns._col_plugin] = plugin;
+}
+
+
+void
+LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin)
+{
+ Gtk::TreeModel::iterator iter = _plugins_liststore->append();
+ Gtk::TreeModel::Row row = *iter;
+ _rows.insert(make_pair(plugin->uri(), iter));
+
+ set_row(row, plugin);
plugin->signal_property.connect(sigc::bind<0>(
sigc::mem_fun(this, &LoadPluginWindow::plugin_property_changed),
@@ -415,12 +420,7 @@ LoadPluginWindow::filter_changed()
if (field.find(search) != string::npos) {
model_iter = _plugins_liststore->append();
model_row = *model_iter;
-
- model_row[_plugins_columns._col_name] = name.is_valid() ? name.get_string() : "";
- model_row[_plugins_columns._col_type] = plugin->type_uri().str();
- model_row[_plugins_columns._col_uri] = plugin->uri().str();
- model_row[_plugins_columns._col_plugin] = plugin;
-
+ set_row(model_row, plugin);
++num_visible;
}
}
diff --git a/src/gui/LoadPluginWindow.hpp b/src/gui/LoadPluginWindow.hpp
index 3ff1b724..71ac3f89 100644
--- a/src/gui/LoadPluginWindow.hpp
+++ b/src/gui/LoadPluginWindow.hpp
@@ -101,6 +101,7 @@ private:
void name_cleared(Gtk::EntryIconPosition pos, const GdkEventButton* event);
#endif
+ void set_row(Gtk::TreeModel::Row& row, SharedPtr<PluginModel> plugin);
void new_plugin(SharedPtr<PluginModel> plugin);
void plugin_property_changed(const Raul::URI& plugin,