diff options
Diffstat (limited to 'src/progs/ingenuity/PatchTreeWindow.cpp')
-rw-r--r-- | src/progs/ingenuity/PatchTreeWindow.cpp | 112 |
1 files changed, 56 insertions, 56 deletions
diff --git a/src/progs/ingenuity/PatchTreeWindow.cpp b/src/progs/ingenuity/PatchTreeWindow.cpp index 5fd17abd..c39349d0 100644 --- a/src/progs/ingenuity/PatchTreeWindow.cpp +++ b/src/progs/ingenuity/PatchTreeWindow.cpp @@ -31,36 +31,36 @@ namespace Ingenuity { PatchTreeWindow::PatchTreeWindow(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& xml) : Gtk::Window(cobject), - m_enable_signal(true) + _enable_signal(true) { - xml->get_widget_derived("patches_treeview", m_patches_treeview); + xml->get_widget_derived("patches_treeview", _patches_treeview); - m_patch_treestore = Gtk::TreeStore::create(m_patch_tree_columns); - m_patches_treeview->set_window(this); - m_patches_treeview->set_model(m_patch_treestore); + _patch_treestore = Gtk::TreeStore::create(_patch_tree_columns); + _patches_treeview->set_window(this); + _patches_treeview->set_model(_patch_treestore); Gtk::TreeViewColumn* name_col = Gtk::manage(new Gtk::TreeViewColumn( - "Patch", m_patch_tree_columns.name_col)); + "Patch", _patch_tree_columns.name_col)); Gtk::TreeViewColumn* enabled_col = Gtk::manage(new Gtk::TreeViewColumn( - "Run", m_patch_tree_columns.enabled_col)); + "Run", _patch_tree_columns.enabled_col)); name_col->set_resizable(true); name_col->set_expand(true); - m_patches_treeview->append_column(*name_col); - m_patches_treeview->append_column(*enabled_col); + _patches_treeview->append_column(*name_col); + _patches_treeview->append_column(*enabled_col); Gtk::CellRendererToggle* enabled_renderer = dynamic_cast<Gtk::CellRendererToggle*>( - m_patches_treeview->get_column_cell_renderer(1)); + _patches_treeview->get_column_cell_renderer(1)); enabled_renderer->property_activatable() = true; - m_patch_tree_selection = m_patches_treeview->get_selection(); + _patch_tree_selection = _patches_treeview->get_selection(); //m_patch_tree_selection->signal_changed().connect( // sigc::mem_fun(this, &PatchTreeWindow::event_patch_selected)); - m_patches_treeview->signal_row_activated().connect( + _patches_treeview->signal_row_activated().connect( sigc::mem_fun(this, &PatchTreeWindow::event_patch_activated)); enabled_renderer->signal_toggled().connect( sigc::mem_fun(this, &PatchTreeWindow::event_patch_enabled_toggled)); - m_patches_treeview->columns_autosize(); + _patches_treeview->columns_autosize(); } @@ -84,7 +84,7 @@ void PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm) { if (!pm->parent()) { - Gtk::TreeModel::iterator iter = m_patch_treestore->append(); + Gtk::TreeModel::iterator iter = _patch_treestore->append(); Gtk::TreeModel::Row row = *iter; if (pm->path() == "/") { SharedPtr<OSCEngineSender> osc_sender = PtrCast<OSCEngineSender>(App::instance().engine()); @@ -93,24 +93,24 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm) //if (root_name.substr(root_name.length()-1,1) == "/") // root_name = root_name.substr(0, root_name.length()-1); //root_name.append(":/"); - row[m_patch_tree_columns.name_col] = root_name; + row[_patch_tree_columns.name_col] = root_name; } else { - row[m_patch_tree_columns.name_col] = pm->path().name(); + row[_patch_tree_columns.name_col] = pm->path().name(); } - row[m_patch_tree_columns.enabled_col] = false; - row[m_patch_tree_columns.patch_model_col] = pm; - m_patches_treeview->expand_row(m_patch_treestore->get_path(iter), true); + row[_patch_tree_columns.enabled_col] = false; + row[_patch_tree_columns.patch_model_col] = pm; + _patches_treeview->expand_row(_patch_treestore->get_path(iter), true); } else { - Gtk::TreeModel::Children children = m_patch_treestore->children(); + Gtk::TreeModel::Children children = _patch_treestore->children(); Gtk::TreeModel::iterator c = find_patch(children, pm->parent()->path()); if (c != children.end()) { - Gtk::TreeModel::iterator iter = m_patch_treestore->append(c->children()); + Gtk::TreeModel::iterator iter = _patch_treestore->append(c->children()); Gtk::TreeModel::Row row = *iter; - row[m_patch_tree_columns.name_col] = pm->path().name(); - row[m_patch_tree_columns.enabled_col] = false; - row[m_patch_tree_columns.patch_model_col] = pm; - m_patches_treeview->expand_row(m_patch_treestore->get_path(iter), true); + row[_patch_tree_columns.name_col] = pm->path().name(); + row[_patch_tree_columns.enabled_col] = false; + row[_patch_tree_columns.patch_model_col] = pm; + _patches_treeview->expand_row(_patch_treestore->get_path(iter), true); } } @@ -122,9 +122,9 @@ PatchTreeWindow::add_patch(SharedPtr<PatchModel> pm) void PatchTreeWindow::remove_patch(const Path& path) { - Gtk::TreeModel::iterator i = find_patch(m_patch_treestore->children(), path); - if (i != m_patch_treestore->children().end()) - m_patch_treestore->erase(i); + Gtk::TreeModel::iterator i = find_patch(_patch_treestore->children(), path); + if (i != _patch_treestore->children().end()) + _patch_treestore->erase(i); } @@ -132,7 +132,7 @@ Gtk::TreeModel::iterator PatchTreeWindow::find_patch(Gtk::TreeModel::Children root, const Path& path) { for (Gtk::TreeModel::iterator c = root.begin(); c != root.end(); ++c) { - SharedPtr<PatchModel> pm = (*c)[m_patch_tree_columns.patch_model_col]; + SharedPtr<PatchModel> pm = (*c)[_patch_tree_columns.patch_model_col]; if (pm->path() == path) { return c; } else if ((*c)->children().size() > 0) { @@ -148,10 +148,10 @@ PatchTreeWindow::find_patch(Gtk::TreeModel::Children root, const Path& path) void PatchTreeWindow::event_patch_selected() { - Gtk::TreeModel::iterator active = m_patch_tree_selection->get_selected(); + Gtk::TreeModel::iterator active = _patch_tree_selection->get_selected(); if (active) { Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[m_patch_tree_columns.patch_model_col]; + SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; } } */ @@ -162,10 +162,10 @@ PatchTreeWindow::event_patch_selected() void PatchTreeWindow::show_patch_menu(GdkEventButton* ev) { - Gtk::TreeModel::iterator active = m_patch_tree_selection->get_selected(); + Gtk::TreeModel::iterator active = _patch_tree_selection->get_selected(); if (active) { Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[m_patch_tree_columns.patch_model_col]; + SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; if (pm) cerr << "FIXME: patch menu\n"; //pm->show_menu(ev); @@ -176,9 +176,9 @@ PatchTreeWindow::show_patch_menu(GdkEventButton* ev) void PatchTreeWindow::event_patch_activated(const Gtk::TreeModel::Path& path, Gtk::TreeView::Column* col) { - Gtk::TreeModel::iterator active = m_patch_treestore->get_iter(path); + Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[m_patch_tree_columns.patch_model_col]; + SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; App::instance().window_factory()->present_patch(pm); } @@ -188,22 +188,22 @@ void PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str) { Gtk::TreeModel::Path path(path_str); - Gtk::TreeModel::iterator active = m_patch_treestore->get_iter(path); + Gtk::TreeModel::iterator active = _patch_treestore->get_iter(path); Gtk::TreeModel::Row row = *active; - SharedPtr<PatchModel> pm = row[m_patch_tree_columns.patch_model_col]; + SharedPtr<PatchModel> pm = row[_patch_tree_columns.patch_model_col]; Glib::ustring patch_path = pm->path(); assert(pm); if ( ! pm->enabled()) { - if (m_enable_signal) + if (_enable_signal) App::instance().engine()->enable_patch(patch_path); - //row[m_patch_tree_columns.enabled_col] = true; + //row[_patch_tree_columns.enabled_col] = true; } else { - if (m_enable_signal) + if (_enable_signal) App::instance().engine()->disable_patch(patch_path); - //row[m_patch_tree_columns.enabled_col] = false; + //row[_patch_tree_columns.enabled_col] = false; } } @@ -211,57 +211,57 @@ PatchTreeWindow::event_patch_enabled_toggled(const Glib::ustring& path_str) void PatchTreeWindow::patch_enabled(const Path& path) { - m_enable_signal = false; + _enable_signal = false; Gtk::TreeModel::iterator i - = find_patch(m_patch_treestore->children(), path); + = find_patch(_patch_treestore->children(), path); - if (i != m_patch_treestore->children().end()) { + if (i != _patch_treestore->children().end()) { Gtk::TreeModel::Row row = *i; - row[m_patch_tree_columns.enabled_col] = true; + row[_patch_tree_columns.enabled_col] = true; } else { cerr << "[PatchTreeWindow] Unable to find patch " << path << endl; } - m_enable_signal = true; + _enable_signal = true; } void PatchTreeWindow::patch_disabled(const Path& path) { - m_enable_signal = false; + _enable_signal = false; Gtk::TreeModel::iterator i - = find_patch(m_patch_treestore->children(), path); + = find_patch(_patch_treestore->children(), path); - if (i != m_patch_treestore->children().end()) { + if (i != _patch_treestore->children().end()) { Gtk::TreeModel::Row row = *i; - row[m_patch_tree_columns.enabled_col] = false; + row[_patch_tree_columns.enabled_col] = false; } else { cerr << "[PatchTreeWindow] Unable to find patch " << path << endl; } - m_enable_signal = true; + _enable_signal = true; } void PatchTreeWindow::patch_renamed(const Path& old_path, const Path& new_path) { - m_enable_signal = false; + _enable_signal = false; Gtk::TreeModel::iterator i - = find_patch(m_patch_treestore->children(), old_path); + = find_patch(_patch_treestore->children(), old_path); - if (i != m_patch_treestore->children().end()) { + if (i != _patch_treestore->children().end()) { Gtk::TreeModel::Row row = *i; - row[m_patch_tree_columns.name_col] = new_path.name(); + row[_patch_tree_columns.name_col] = new_path.name(); } else { cerr << "[PatchTreeWindow] Unable to find patch " << old_path << endl; } - m_enable_signal = true; + _enable_signal = true; } |