diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-30 11:21:04 -0400 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2016-09-30 11:23:01 -0400 |
commit | 4a159b817f88218ab3b77d216d4deca252e917d3 (patch) | |
tree | b52d0632a734154328b3fcca7d2df9b48ff4242b /libs/surfaces | |
parent | 9480dc1c6ace4a1ed138c9e738e28c21064e9541 (diff) |
remove useless code from push2 gui dialog
Diffstat (limited to 'libs/surfaces')
-rw-r--r-- | libs/surfaces/push2/gui.cc | 135 | ||||
-rw-r--r-- | libs/surfaces/push2/gui.h | 3 |
2 files changed, 0 insertions, 138 deletions
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<string> paths; - vector<string> labels; - vector<string> tooltips; - vector<string> keys; - vector<Glib::RefPtr<Gtk::Action> > actions; - - Gtkmm2ext::ActionMap::get_all_actions (paths, labels, tooltips, keys, actions); - - typedef std::map<string,TreeIter> NodeMap; - NodeMap nodes; - NodeMap::iterator r; - - - vector<string>::iterator k; - vector<string>::iterator p; - vector<string>::iterator t; - vector<string>::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<string> 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 "<Actions>/" prefix part of a path. - */ - path = path.substr (strlen ("<Actions>/")); - - 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<Gtk::ListStore> P2GUI::build_midi_port_list (vector<string> 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<Gtk::TreeStore> available_action_model; std::map<std::string,std::string> 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); |