13
0

extend API of key binding editor to allow for tab removal

This commit is contained in:
Paul Davis 2016-03-15 16:42:45 -04:00
parent 89ba1c9edd
commit f83a7f4131
2 changed files with 19 additions and 0 deletions

View 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 ()
{

View 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