From 4a159b817f88218ab3b77d216d4deca252e917d3 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Fri, 30 Sep 2016 11:21:04 -0400 Subject: remove useless code from push2 gui dialog --- libs/surfaces/push2/gui.cc | 135 --------------------------------------------- libs/surfaces/push2/gui.h | 3 - 2 files changed, 138 deletions(-) (limited to 'libs/surfaces') diff --git a/libs/surfaces/push2/gui.cc b/libs/surfaces/push2/gui.cc index c379387dde..1e8e587a42 100644 --- a/libs/surfaces/push2/gui.cc +++ b/libs/surfaces/push2/gui.cc @@ -220,141 +220,6 @@ P2GUI::update_port_combos () } } -void -P2GUI::build_available_action_menu () -{ - /* build a model of all available actions (needs to be tree structured - * more) - */ - - available_action_model = TreeStore::create (action_columns); - - vector paths; - vector labels; - vector tooltips; - vector keys; - vector > actions; - - Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions); - - typedef std::map NodeMap; - NodeMap nodes; - NodeMap::iterator r; - - - vector::iterator k; - vector::iterator p; - vector::iterator t; - vector::iterator l; - - available_action_model->clear (); - - TreeIter rowp; - TreeModel::Row parent; - - /* Disabled item (row 0) */ - - rowp = available_action_model->append(); - parent = *(rowp); - parent[action_columns.name] = _("Disabled"); - - /* Key aliasing */ - - rowp = available_action_model->append(); - parent = *(rowp); - parent[action_columns.name] = _("Shift"); - rowp = available_action_model->append(); - parent = *(rowp); - parent[action_columns.name] = _("Control"); - rowp = available_action_model->append(); - parent = *(rowp); - parent[action_columns.name] = _("Option"); - rowp = available_action_model->append(); - parent = *(rowp); - parent[action_columns.name] = _("CmdAlt"); - - - for (l = labels.begin(), k = keys.begin(), p = paths.begin(), t = tooltips.begin(); l != labels.end(); ++k, ++p, ++t, ++l) { - - TreeModel::Row row; - vector parts; - - parts.clear (); - - split (*p, parts, '/'); - - if (parts.empty()) { - continue; - } - - //kinda kludgy way to avoid displaying menu items as mappable - if ( parts[1] == _("Main_menu") ) - continue; - if ( parts[1] == _("JACK") ) - continue; - if ( parts[1] == _("redirectmenu") ) - continue; - if ( parts[1] == _("Editor_menus") ) - continue; - if ( parts[1] == _("RegionList") ) - continue; - if ( parts[1] == _("ProcessorMenu") ) - continue; - - if ((r = nodes.find (parts[1])) == nodes.end()) { - - /* top level is missing */ - - TreeIter rowp; - TreeModel::Row parent; - rowp = available_action_model->append(); - nodes[parts[1]] = rowp; - parent = *(rowp); - parent[action_columns.name] = parts[1]; - - row = *(available_action_model->append (parent.children())); - - } else { - - row = *(available_action_model->append ((*r->second)->children())); - - } - - /* add this action */ - - if (l->empty ()) { - row[action_columns.name] = *t; - action_map[*t] = *p; - } else { - row[action_columns.name] = *l; - action_map[*l] = *p; - } - - string path = (*p); - /* ControlProtocol::access_action() is not interested in the - legacy "/" prefix part of a path. - */ - path = path.substr (strlen ("/")); - - row[action_columns.path] = path; - } -} - - -bool -P2GUI::find_action_in_model (const TreeModel::iterator& iter, std::string const & action_path, TreeModel::iterator* found) -{ - TreeModel::Row row = *iter; - string path = row[action_columns.path]; - - if (path == action_path) { - *found = iter; - return true; - } - - return false; -} - Glib::RefPtr P2GUI::build_midi_port_list (vector const & ports, bool for_input) { diff --git a/libs/surfaces/push2/gui.h b/libs/surfaces/push2/gui.h index c217d37039..6188703d5c 100644 --- a/libs/surfaces/push2/gui.h +++ b/libs/surfaces/push2/gui.h @@ -91,9 +91,6 @@ private: Glib::RefPtr available_action_model; std::map action_map; // map from action names to paths - void build_available_action_menu (); - bool find_action_in_model (const Gtk::TreeModel::iterator& iter, std::string const & action_path, Gtk::TreeModel::iterator* found); - struct PressureModeColumns : public Gtk::TreeModel::ColumnRecord { PressureModeColumns() { add (mode); -- cgit v1.2.3