summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-04-24 22:20:44 +0200
committerRobin Gareus <robin@gareus.org>2016-04-24 22:20:44 +0200
commit55fb20f4912e74d71c3e6c171d916d09fbe8eeda (patch)
tree946516c0d1216feb45d67fc4f674dfac526017ee
parentfde99e68f7381847a126772ef929eff63e20f827 (diff)
update keyeditor when action label changes
-rw-r--r--gtk2_ardour/editor.cc2
-rw-r--r--gtk2_ardour/keyeditor.cc9
-rw-r--r--gtk2_ardour/keyeditor.h3
3 files changed, 14 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 9bf8af6aaa..2ee4793736 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -108,6 +108,7 @@
#include "gui_object.h"
#include "gui_thread.h"
#include "keyboard.h"
+#include "keyeditor.h"
#include "luainstance.h"
#include "marker.h"
#include "midi_region_view.h"
@@ -5748,6 +5749,7 @@ Editor::set_script_action_name (int i, const std::string& n)
} else {
act->set_label (n);
}
+ KeyEditor::UpdateBindings ();
}
void
diff --git a/gtk2_ardour/keyeditor.cc b/gtk2_ardour/keyeditor.cc
index 56044c1c9a..ce066efd70 100644
--- a/gtk2_ardour/keyeditor.cc
+++ b/gtk2_ardour/keyeditor.cc
@@ -53,6 +53,8 @@ using namespace PBD;
using Gtkmm2ext::Keyboard;
using Gtkmm2ext::Bindings;
+sigc::signal<void> KeyEditor::UpdateBindings;
+
void bindings_collision_dialog (Gtk::Window& parent)
{
ArdourDialog dialog (parent, _("Colliding keybindings"), true);
@@ -108,6 +110,7 @@ KeyEditor::KeyEditor ()
add (vpacker);
unbind_button.set_sensitive (false);
+ UpdateBindings.connect (sigc::mem_fun (*this, &KeyEditor::refresh));
}
void
@@ -121,6 +124,7 @@ KeyEditor::add_tab (string const & name, Bindings& bindings)
return;
}
+ tabs.push_back (t);
t->show_all ();
notebook.append_page (*t, name);
}
@@ -479,7 +483,12 @@ void
KeyEditor::reset ()
{
Keyboard::the_keyboard().reset_bindings ();
+ refresh ();
+}
+void
+KeyEditor::refresh ()
+{
for (Tabs::iterator t = tabs.begin(); t != tabs.end(); ++t) {
(*t)->view.get_selection()->unselect_all ();
(*t)->populate ();
diff --git a/gtk2_ardour/keyeditor.h b/gtk2_ardour/keyeditor.h
index 91834c4dea..5e15368069 100644
--- a/gtk2_ardour/keyeditor.h
+++ b/gtk2_ardour/keyeditor.h
@@ -43,6 +43,8 @@ class KeyEditor : public ArdourWindow
void add_tab (std::string const &name, Gtkmm2ext::Bindings&);
void remove_tab (std::string const &name);
+ static sigc::signal<void> UpdateBindings;
+
private:
class Tab : public Gtk::VBox
{
@@ -113,6 +115,7 @@ class KeyEditor : public ArdourWindow
void unbind ();
void reset ();
+ void refresh ();
void page_change (GtkNotebookPage*, guint);
unsigned int sort_column;