remove useless code from push2 gui dialog
authorPaul Davis <paul@linuxaudiosystems.com>
Fri, 30 Sep 2016 15:21:04 +0000 (11:21 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Fri, 30 Sep 2016 15:23:01 +0000 (11:23 -0400)
libs/surfaces/push2/gui.cc
libs/surfaces/push2/gui.h

index c379387dde7482f554ae18f94e4b3608004d6337..1e8e587a42aaf5f1bbe3a5b6eff717b255817be4 100644 (file)
@@ -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)
 {
index c217d37039594178e2377426fe62d94b8393fd37..6188703d5c33b8a4f819449a4fffef1991de19b7 100644 (file)
@@ -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);