diff options
author | David Robillard <d@drobilla.net> | 2007-02-07 03:22:42 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-02-07 03:22:42 +0000 |
commit | 39d5400b39c8089287d5d294becae1268d232d31 (patch) | |
tree | 0cf73ef86233121bc7f0408ca536aad196d3166c /src/progs/ingenuity/LoadPluginWindow.cpp | |
parent | e135edf1e65ac978f86f4849bd3667299dd69c7e (diff) | |
download | ingen-39d5400b39c8089287d5d294becae1268d232d31.tar.gz ingen-39d5400b39c8089287d5d294becae1268d232d31.tar.bz2 ingen-39d5400b39c8089287d5d294becae1268d232d31.zip |
Mad sed-fu for consistent private member naming.
git-svn-id: http://svn.drobilla.net/lad/ingen@286 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/ingenuity/LoadPluginWindow.cpp')
-rw-r--r-- | src/progs/ingenuity/LoadPluginWindow.cpp | 228 |
1 files changed, 114 insertions, 114 deletions
diff --git a/src/progs/ingenuity/LoadPluginWindow.cpp b/src/progs/ingenuity/LoadPluginWindow.cpp index c5a51d4d..9965470c 100644 --- a/src/progs/ingenuity/LoadPluginWindow.cpp +++ b/src/progs/ingenuity/LoadPluginWindow.cpp @@ -34,70 +34,70 @@ namespace Ingenuity { LoadPluginWindow::LoadPluginWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Gtk::Window(cobject), - m_has_shown(false), - m_plugin_name_offset(0) + _has_shown(false), + _plugin_name_offset(0) { - xml->get_widget("load_plugin_plugins_treeview", m_plugins_treeview); - xml->get_widget("load_plugin_polyphonic_checkbutton", m_polyphonic_checkbutton); - xml->get_widget("load_plugin_name_entry", m_node_name_entry); - xml->get_widget("load_plugin_clear_button", m_clear_button); - xml->get_widget("load_plugin_add_button", m_add_button); - //xml->get_widget("load_plugin_close_button", m_close_button); - //xml->get_widget("load_plugin_ok_button", m_add_button); + xml->get_widget("load_plugin_plugins_treeview", _plugins_treeview); + xml->get_widget("load_plugin_polyphonic_checkbutton", _polyphonic_checkbutton); + xml->get_widget("load_plugin_name_entry", _node_name_entry); + xml->get_widget("load_plugin_clear_button", _clear_button); + xml->get_widget("load_plugin_add_button", _add_button); + //xml->get_widget("load_plugin_close_button", _close_button); + //xml->get_widget("load_plugin_ok_button", _add_button); - xml->get_widget("load_plugin_filter_combo", m_filter_combo); - xml->get_widget("load_plugin_search_entry", m_search_entry); + xml->get_widget("load_plugin_filter_combo", _filter_combo); + xml->get_widget("load_plugin_search_entry", _search_entry); // Set up the plugins list - m_plugins_liststore = Gtk::ListStore::create(m_plugins_columns); - m_plugins_treeview->set_model(m_plugins_liststore); - m_plugins_treeview->append_column("Name", m_plugins_columns.m_col_name); - m_plugins_treeview->append_column("Type", m_plugins_columns.m_col_type); - m_plugins_treeview->append_column("URI", m_plugins_columns.m_col_uri); - //m_plugins_treeview->append_column("Library", m_plugins_columns.m_col_library); - //m_plugins_treeview->append_column("Label", m_plugins_columns.m_col_label); + _plugins_liststore = Gtk::ListStore::create(_plugins_columns); + _plugins_treeview->set_model(_plugins_liststore); + _plugins_treeview->append_column("Name", _plugins_columns._col_name); + _plugins_treeview->append_column("Type", _plugins_columns._col_type); + _plugins_treeview->append_column("URI", _plugins_columns._col_uri); + //m_plugins_treeview->append_column("Library", _plugins_columns._col_library); + //m_plugins_treeview->append_column("Label", _plugins_columns._col_label); // This could be nicer.. store the TreeViewColumns locally maybe? - m_plugins_treeview->get_column(0)->set_sort_column(m_plugins_columns.m_col_name); - m_plugins_treeview->get_column(1)->set_sort_column(m_plugins_columns.m_col_type); - m_plugins_treeview->get_column(2)->set_sort_column(m_plugins_columns.m_col_uri); - //m_plugins_treeview->get_column(3)->set_sort_column(m_plugins_columns.m_col_library); - //m_plugins_treeview->get_column(4)->set_sort_column(m_plugins_columns.m_col_label); + _plugins_treeview->get_column(0)->set_sort_column(_plugins_columns._col_name); + _plugins_treeview->get_column(1)->set_sort_column(_plugins_columns._col_type); + _plugins_treeview->get_column(2)->set_sort_column(_plugins_columns._col_uri); + //m_plugins_treeview->get_column(3)->set_sort_column(_plugins_columns._col_library); + //m_plugins_treeview->get_column(4)->set_sort_column(_plugins_columns._col_label); for (int i=0; i < 3; ++i) - m_plugins_treeview->get_column(i)->set_resizable(true); + _plugins_treeview->get_column(i)->set_resizable(true); // Set up the search criteria combobox - m_criteria_liststore = Gtk::ListStore::create(m_criteria_columns); - m_filter_combo->set_model(m_criteria_liststore); - Gtk::TreeModel::iterator iter = m_criteria_liststore->append(); + _criteria_liststore = Gtk::ListStore::create(_criteria_columns); + _filter_combo->set_model(_criteria_liststore); + Gtk::TreeModel::iterator iter = _criteria_liststore->append(); Gtk::TreeModel::Row row = *iter; - row[m_criteria_columns.m_col_label] = "Name contains"; - row[m_criteria_columns.m_col_criteria] = CriteriaColumns::NAME; - m_filter_combo->set_active(iter); - iter = m_criteria_liststore->append(); row = *iter; - row[m_criteria_columns.m_col_label] = "Type contains"; - row[m_criteria_columns.m_col_criteria] = CriteriaColumns::TYPE; - iter = m_criteria_liststore->append(); row = *iter; - row[m_criteria_columns.m_col_label] = "URI contains"; - row[m_criteria_columns.m_col_criteria] = CriteriaColumns::URI; - /*iter = m_criteria_liststore->append(); row = *iter; - row[m_criteria_columns.m_col_label] = "Library contains: "; - row[m_criteria_columns.m_col_criteria] = CriteriaColumns::LIBRARY; - iter = m_criteria_liststore->append(); row = *iter; - row[m_criteria_columns.m_col_label] = "Label contains: "; - row[m_criteria_columns.m_col_criteria] = CriteriaColumns::LABEL;*/ - - m_clear_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::clear_clicked)); - m_add_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); + row[_criteria_columns._col_label] = "Name contains"; + row[_criteria_columns._col_criteria] = CriteriaColumns::NAME; + _filter_combo->set_active(iter); + iter = _criteria_liststore->append(); row = *iter; + row[_criteria_columns._col_label] = "Type contains"; + row[_criteria_columns._col_criteria] = CriteriaColumns::TYPE; + iter = _criteria_liststore->append(); row = *iter; + row[_criteria_columns._col_label] = "URI contains"; + row[_criteria_columns._col_criteria] = CriteriaColumns::URI; + /*iter = _criteria_liststore->append(); row = *iter; + row[_criteria_columns._col_label] = "Library contains: "; + row[_criteria_columns._col_criteria] = CriteriaColumns::LIBRARY; + iter = _criteria_liststore->append(); row = *iter; + row[_criteria_columns._col_label] = "Label contains: "; + row[_criteria_columns._col_criteria] = CriteriaColumns::LABEL;*/ + + _clear_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::clear_clicked)); + _add_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); //m_close_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::close_clicked)); //m_add_button->signal_clicked().connect( sigc::mem_fun(this, &LoadPluginWindow::ok_clicked)); - m_plugins_treeview->signal_row_activated().connect(sigc::mem_fun(this, &LoadPluginWindow::plugin_activated)); - m_search_entry->signal_activate().connect( sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); - m_search_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::filter_changed)); - m_node_name_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::name_changed)); + _plugins_treeview->signal_row_activated().connect(sigc::mem_fun(this, &LoadPluginWindow::plugin_activated)); + _search_entry->signal_activate().connect( sigc::mem_fun(this, &LoadPluginWindow::add_clicked)); + _search_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::filter_changed)); + _node_name_entry->signal_changed().connect( sigc::mem_fun(this, &LoadPluginWindow::name_changed)); - m_selection = m_plugins_treeview->get_selection(); - m_selection->signal_changed().connect(sigc::mem_fun(this, &LoadPluginWindow::plugin_selection_changed)); + _selection = _plugins_treeview->get_selection(); + _selection->signal_changed().connect(sigc::mem_fun(this, &LoadPluginWindow::plugin_selection_changed)); //m_add_button->grab_default(); } @@ -107,7 +107,7 @@ void LoadPluginWindow::present(SharedPtr<PatchModel> patch, MetadataMap data) { set_patch(patch); - m_initial_data = data; + _initial_data = data; Gtk::Window::present(); } @@ -118,19 +118,19 @@ LoadPluginWindow::present(SharedPtr<PatchModel> patch, MetadataMap data) void LoadPluginWindow::name_changed() { - string name = m_node_name_entry->get_text(); + string name = _node_name_entry->get_text(); if (!Path::is_valid_name(name)) { //m_message_label->set_text("Name contains invalid characters."); - m_add_button->property_sensitive() = false; - } else if (m_patch->get_node(name)) { + _add_button->property_sensitive() = false; + } else if (_patch->get_node(name)) { //m_message_label->set_text("An object already exists with that name."); - m_add_button->property_sensitive() = false; + _add_button->property_sensitive() = false; } else if (name.length() == 0) { //m_message_label->set_text(""); - m_add_button->property_sensitive() = false; + _add_button->property_sensitive() = false; } else { //m_message_label->set_text(""); - m_add_button->property_sensitive() = true; + _add_button->property_sensitive() = true; } } @@ -142,12 +142,12 @@ LoadPluginWindow::name_changed() void LoadPluginWindow::set_patch(SharedPtr<PatchModel> patch) { - m_patch = patch; + _patch = patch; if (patch->poly() <= 1) - m_polyphonic_checkbutton->property_sensitive() = false; + _polyphonic_checkbutton->property_sensitive() = false; else - m_polyphonic_checkbutton->property_sensitive() = true; + _polyphonic_checkbutton->property_sensitive() = true; } @@ -162,20 +162,20 @@ LoadPluginWindow::set_patch(SharedPtr<PatchModel> patch) void LoadPluginWindow::on_show() { - if (!m_has_shown) { + if (!_has_shown) { set_plugin_list(App::instance().store()->plugins()); // Center on patch window - /*int m_w, m_h; - get_size(m_w, m_h); + /*int _w, _h; + get_size(_w, _h); int parent_x, parent_y, parent_w, parent_h; - m_patch_controller->window()->get_position(parent_x, parent_y); - m_patch_controller->window()->get_size(parent_w, parent_h); + _patch_controller->window()->get_position(parent_x, parent_y); + _patch_controller->window()->get_size(parent_w, parent_h); - move(parent_x + parent_w/2 - m_w/2, parent_y + parent_h/2 - m_h/2); + move(parent_x + parent_w/2 - _w/2, parent_y + parent_h/2 - _h/2); */ - m_has_shown = true; + _has_shown = true; } Gtk::Window::on_show(); } @@ -184,40 +184,40 @@ LoadPluginWindow::on_show() void LoadPluginWindow::set_plugin_list(const std::map<string, SharedPtr<PluginModel> >& m) { - m_plugins_liststore->clear(); + _plugins_liststore->clear(); for (std::map<string, SharedPtr<PluginModel> >::const_iterator i = m.begin(); i != m.end(); ++i) { SharedPtr<PluginModel> plugin = (*i).second; - Gtk::TreeModel::iterator iter = m_plugins_liststore->append(); + Gtk::TreeModel::iterator iter = _plugins_liststore->append(); Gtk::TreeModel::Row row = *iter; - row[m_plugins_columns.m_col_name] = plugin->name(); - //row[m_plugins_columns.m_col_label] = plugin->plug_label(); - row[m_plugins_columns.m_col_type] = plugin->type_uri(); - row[m_plugins_columns.m_col_uri] = plugin->uri(); - row[m_plugins_columns.m_col_label] = plugin->name(); - //row[m_plugins_columns.m_col_library] = plugin->lib_name(); - row[m_plugins_columns.m_col_plugin_model] = plugin; + row[_plugins_columns._col_name] = plugin->name(); + //row[_plugins_columns._col_label] = plugin->plug_label(); + row[_plugins_columns._col_type] = plugin->type_uri(); + row[_plugins_columns._col_uri] = plugin->uri(); + row[_plugins_columns._col_label] = plugin->name(); + //row[_plugins_columns._col_library] = plugin->lib_name(); + row[_plugins_columns._col_plugin_model] = plugin; } - m_plugins_treeview->columns_autosize(); + _plugins_treeview->columns_autosize(); } void LoadPluginWindow::add_plugin(SharedPtr<PluginModel> plugin) { - Gtk::TreeModel::iterator iter = m_plugins_liststore->append(); + Gtk::TreeModel::iterator iter = _plugins_liststore->append(); Gtk::TreeModel::Row row = *iter; - row[m_plugins_columns.m_col_name] = plugin->name(); - //row[m_plugins_columns.m_col_label] = plugin->plug_label(); - row[m_plugins_columns.m_col_type] = plugin->type_uri(); - row[m_plugins_columns.m_col_uri] = plugin->uri(); - row[m_plugins_columns.m_col_label] = plugin->name(); - //row[m_plugins_columns.m_col_library] = plugin->lib_name(); - row[m_plugins_columns.m_col_plugin_model] = plugin; + row[_plugins_columns._col_name] = plugin->name(); + //row[_plugins_columns._col_label] = plugin->plug_label(); + row[_plugins_columns._col_type] = plugin->type_uri(); + row[_plugins_columns._col_uri] = plugin->uri(); + row[_plugins_columns._col_label] = plugin->name(); + //row[_plugins_columns._col_library] = plugin->lib_name(); + row[_plugins_columns._col_plugin_model] = plugin; } @@ -235,13 +235,13 @@ LoadPluginWindow::plugin_activated(const Gtk::TreeModel::Path& path, Gtk::TreeVi void LoadPluginWindow::plugin_selection_changed() { - m_plugin_name_offset = 0; + _plugin_name_offset = 0; - m_node_name_entry->set_text(generate_module_name()); + _node_name_entry->set_text(generate_module_name()); - //Gtk::TreeModel::iterator iter = m_selection->get_selected(); + //Gtk::TreeModel::iterator iter = _selection->get_selected(); //Gtk::TreeModel::Row row = *iter; - //const PluginModel* plugin = row.get_value(m_plugins_columns.m_col_plugin_model); + //const PluginModel* plugin = row.get_value(_plugins_columns._col_plugin_model); } @@ -256,11 +256,11 @@ LoadPluginWindow::generate_module_name(int offset) { string name = ""; - Gtk::TreeModel::iterator iter = m_selection->get_selected(); + Gtk::TreeModel::iterator iter = _selection->get_selected(); if (iter) { Gtk::TreeModel::Row row = *iter; - SharedPtr<PluginModel> plugin = row.get_value(m_plugins_columns.m_col_plugin_model); + SharedPtr<PluginModel> plugin = row.get_value(_plugins_columns._col_plugin_model); char num_buf[3]; for (uint i=0; i < 99; ++i) { name = plugin->default_node_name(); @@ -271,7 +271,7 @@ LoadPluginWindow::generate_module_name(int offset) name += "_"; name += num_buf; } - if (!m_patch->get_node(name)) + if (!_patch->get_node(name)) break; else name = ""; @@ -285,13 +285,13 @@ LoadPluginWindow::generate_module_name(int offset) void LoadPluginWindow::add_clicked() { - Gtk::TreeModel::iterator iter = m_selection->get_selected(); - bool polyphonic = m_polyphonic_checkbutton->get_active(); + Gtk::TreeModel::iterator iter = _selection->get_selected(); + bool polyphonic = _polyphonic_checkbutton->get_active(); if (iter) { // If anything is selected Gtk::TreeModel::Row row = *iter; - SharedPtr<PluginModel> plugin = row.get_value(m_plugins_columns.m_col_plugin_model); - string name = m_node_name_entry->get_text(); + SharedPtr<PluginModel> plugin = row.get_value(_plugins_columns._col_plugin_model); + string name = _node_name_entry->get_text(); if (name == "") { name = generate_module_name(); } @@ -302,10 +302,10 @@ LoadPluginWindow::add_clicked() dialog.run(); } else { - Path path = m_patch->path().base() + Path::nameify(name); - App::instance().engine()->create_node_with_data(plugin->uri(), path, polyphonic, m_initial_data); - ++m_plugin_name_offset; - m_node_name_entry->set_text(generate_module_name(m_plugin_name_offset)); + Path path = _patch->path().base() + Path::nameify(name); + App::instance().engine()->create_node_with_data(plugin->uri(), path, polyphonic, _initial_data); + ++_plugin_name_offset; + _node_name_entry->set_text(generate_module_name(_plugin_name_offset)); // Set the next module location 20 over, for a cascade effect cerr << "FIXME: cascade\n"; @@ -335,14 +335,14 @@ LoadPluginWindow::ok_clicked() void LoadPluginWindow::filter_changed() { - m_plugins_liststore->clear(); + _plugins_liststore->clear(); - string search = m_search_entry->get_text(); + string search = _search_entry->get_text(); transform(search.begin(), search.end(), search.begin(), toupper); // Get selected criteria - const Gtk::TreeModel::Row row = *(m_filter_combo->get_active()); - CriteriaColumns::Criteria criteria = row[m_criteria_columns.m_col_criteria]; + const Gtk::TreeModel::Row row = *(_filter_combo->get_active()); + CriteriaColumns::Criteria criteria = row[_criteria_columns._col_criteria]; string field; @@ -374,22 +374,22 @@ LoadPluginWindow::filter_changed() transform(field.begin(), field.end(), field.begin(), toupper); if (field.find(search) != string::npos) { - model_iter = m_plugins_liststore->append(); + model_iter = _plugins_liststore->append(); model_row = *model_iter; - model_row[m_plugins_columns.m_col_name] = plugin->name(); - //model_row[m_plugins_columns.m_col_label] = plugin->plug_label(); - model_row[m_plugins_columns.m_col_type] = plugin->type_uri(); - model_row[m_plugins_columns.m_col_uri] = plugin->uri(); - model_row[m_plugins_columns.m_col_plugin_model] = plugin; + model_row[_plugins_columns._col_name] = plugin->name(); + //model_row[_plugins_columns._col_label] = plugin->plug_label(); + model_row[_plugins_columns._col_type] = plugin->type_uri(); + model_row[_plugins_columns._col_uri] = plugin->uri(); + model_row[_plugins_columns._col_plugin_model] = plugin; ++num_visible; } } if (num_visible == 1) { - m_selection->unselect_all(); - m_selection->select(model_iter); + _selection->unselect_all(); + _selection->select(model_iter); } } @@ -397,7 +397,7 @@ LoadPluginWindow::filter_changed() void LoadPluginWindow::clear_clicked() { - m_search_entry->set_text(""); + _search_entry->set_text(""); set_plugin_list(App::instance().store()->plugins()); } |