13
0

update keyeditor when action label changes

This commit is contained in:
Robin Gareus 2016-04-24 22:20:44 +02:00
parent fde99e68f7
commit 55fb20f491
3 changed files with 14 additions and 0 deletions

View File

@ -108,6 +108,7 @@
#include "gui_object.h" #include "gui_object.h"
#include "gui_thread.h" #include "gui_thread.h"
#include "keyboard.h" #include "keyboard.h"
#include "keyeditor.h"
#include "luainstance.h" #include "luainstance.h"
#include "marker.h" #include "marker.h"
#include "midi_region_view.h" #include "midi_region_view.h"
@ -5748,6 +5749,7 @@ Editor::set_script_action_name (int i, const std::string& n)
} else { } else {
act->set_label (n); act->set_label (n);
} }
KeyEditor::UpdateBindings ();
} }
void void

View File

@ -53,6 +53,8 @@ using namespace PBD;
using Gtkmm2ext::Keyboard; using Gtkmm2ext::Keyboard;
using Gtkmm2ext::Bindings; using Gtkmm2ext::Bindings;
sigc::signal<void> KeyEditor::UpdateBindings;
void bindings_collision_dialog (Gtk::Window& parent) void bindings_collision_dialog (Gtk::Window& parent)
{ {
ArdourDialog dialog (parent, _("Colliding keybindings"), true); ArdourDialog dialog (parent, _("Colliding keybindings"), true);
@ -108,6 +110,7 @@ KeyEditor::KeyEditor ()
add (vpacker); add (vpacker);
unbind_button.set_sensitive (false); unbind_button.set_sensitive (false);
UpdateBindings.connect (sigc::mem_fun (*this, &KeyEditor::refresh));
} }
void void
@ -121,6 +124,7 @@ KeyEditor::add_tab (string const & name, Bindings& bindings)
return; return;
} }
tabs.push_back (t);
t->show_all (); t->show_all ();
notebook.append_page (*t, name); notebook.append_page (*t, name);
} }
@ -479,7 +483,12 @@ void
KeyEditor::reset () KeyEditor::reset ()
{ {
Keyboard::the_keyboard().reset_bindings (); Keyboard::the_keyboard().reset_bindings ();
refresh ();
}
void
KeyEditor::refresh ()
{
for (Tabs::iterator t = tabs.begin(); t != tabs.end(); ++t) { for (Tabs::iterator t = tabs.begin(); t != tabs.end(); ++t) {
(*t)->view.get_selection()->unselect_all (); (*t)->view.get_selection()->unselect_all ();
(*t)->populate (); (*t)->populate ();

View File

@ -43,6 +43,8 @@ class KeyEditor : public ArdourWindow
void add_tab (std::string const &name, Gtkmm2ext::Bindings&); void add_tab (std::string const &name, Gtkmm2ext::Bindings&);
void remove_tab (std::string const &name); void remove_tab (std::string const &name);
static sigc::signal<void> UpdateBindings;
private: private:
class Tab : public Gtk::VBox class Tab : public Gtk::VBox
{ {
@ -113,6 +115,7 @@ class KeyEditor : public ArdourWindow
void unbind (); void unbind ();
void reset (); void reset ();
void refresh ();
void page_change (GtkNotebookPage*, guint); void page_change (GtkNotebookPage*, guint);
unsigned int sort_column; unsigned int sort_column;