Separate set_toggleaction_state () API
[ardour.git] / libs / gtkmm2ext / bindings.cc
index 16b0b004bde4b355b5c5061c6e8fe707ba5b3453..291cd6068693a128ea5cb600fb6a62685111109c 100644 (file)
@@ -730,16 +730,16 @@ Bindings::save (XMLNode& root)
                }
 
                child = new XMLNode (X_("Binding"));
-               child->add_property (X_("key"), k->first.name());
-               child->add_property (X_("action"), k->second.action_name);
+               child->set_property (X_("key"), k->first.name());
+               child->set_property (X_("action"), k->second.action_name);
                presses->add_child_nocopy (*child);
        }
 
        for (MouseButtonBindingMap::iterator k = button_press_bindings.begin(); k != button_press_bindings.end(); ++k) {
                XMLNode* child;
                child = new XMLNode (X_("Binding"));
-               child->add_property (X_("button"), k->first.name());
-               child->add_property (X_("action"), k->second.action_name);
+               child->set_property (X_("button"), k->first.name());
+               child->set_property (X_("action"), k->second.action_name);
                presses->add_child_nocopy (*child);
        }
 
@@ -753,16 +753,16 @@ Bindings::save (XMLNode& root)
                }
 
                child = new XMLNode (X_("Binding"));
-               child->add_property (X_("key"), k->first.name());
-               child->add_property (X_("action"), k->second.action_name);
+               child->set_property (X_("key"), k->first.name());
+               child->set_property (X_("action"), k->second.action_name);
                releases->add_child_nocopy (*child);
        }
 
        for (MouseButtonBindingMap::iterator k = button_release_bindings.begin(); k != button_release_bindings.end(); ++k) {
                XMLNode* child;
                child = new XMLNode (X_("Binding"));
-               child->add_property (X_("button"), k->first.name());
-               child->add_property (X_("action"), k->second.action_name);
+               child->set_property (X_("button"), k->first.name());
+               child->set_property (X_("action"), k->second.action_name);
                releases->add_child_nocopy (*child);
        }
 
@@ -805,6 +805,37 @@ Bindings::save_all_bindings_as_html (ostream& ostr)
        ostr << "</tr>\n\n";
        ostr << "</tbody></table>\n\n";
 
+       ostr << "</br></br>\n\n";
+       ostr << "<table border=\"2\" cellpadding=\"6\"><tbody>\n\n";
+       ostr << "<tr>\n\n";
+       ostr << "<td>\n\n";
+       ostr << "<h2><u> Partial List of Available Actions { => with current shortcut, where applicable } </u></h2>\n\n";
+       {
+               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);
+
+               vector<string>::iterator k;
+               vector<string>::iterator p;
+               vector<string>::iterator l;
+
+               for (p = paths.begin(), k = keys.begin(), l = labels.begin(); p != paths.end(); ++k, ++p, ++l) {
+
+                       if ((*k).empty()) {
+                               ostr << *p  << " ( " << *l << " ) "  << "</br>" << endl;
+                       } else {
+                               ostr << *p << " ( " << *l << " ) " << " => " << *k << "</br>" << endl;
+                       }
+               }
+       }
+       ostr << "</td>\n\n";
+       ostr << "</tr>\n\n";
+       ostr << "</tbody></table>\n\n";
+       
        ostr << "</body>\n";
        ostr << "</html>\n";
 }