extend API of key binding editor to allow for tab removal
authorPaul Davis <paul@linuxaudiosystems.com>
Tue, 15 Mar 2016 20:42:45 +0000 (16:42 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Tue, 15 Mar 2016 20:42:45 +0000 (16:42 -0400)
gtk2_ardour/keyeditor.cc
gtk2_ardour/keyeditor.h

index f300b4751c45fe76d3d62f293493e23c51dd3449..f567bbf7512859c09c7860687e93c8fd87328109 100644 (file)
@@ -119,6 +119,24 @@ KeyEditor::add_tab (string const & name, Bindings& bindings)
        notebook.append_page (*t, name);
 }
 
+
+void
+KeyEditor::remove_tab (string const &name)
+{
+       guint npages = notebook.get_n_pages ();
+
+       for (guint n = 0; n < npages; ++n) {
+               Widget* w = notebook.get_nth_page (n);
+               Tab* tab = dynamic_cast<Tab*> (w);
+               if (tab) {
+                       if (tab->name == name) {
+                               notebook.remove_page (*w);
+                               return;
+                       }
+               }
+       }
+}
+
 void
 KeyEditor::unbind ()
 {
index 1c90269875c594f2875ea5eafac3e69c4e831c17..d9b8ed976831e7f1b48eb3df7d7d5e454eb713ef 100644 (file)
@@ -41,6 +41,7 @@ class KeyEditor : public ArdourWindow
        KeyEditor ();
 
        void add_tab (std::string const &name, Gtkmm2ext::Bindings&);
+       void remove_tab (std::string const &name);
 
        private:
        class Tab : public Gtk::VBox