summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2017-02-18 16:14:41 +0100
committerRobin Gareus <robin@gareus.org>2017-02-18 16:14:41 +0100
commit92e203a19e55c445a7051c7148a659c3507c2770 (patch)
tree84454c69653da6980850d8a27471cf282523d252 /gtk2_ardour
parent2d50871034e8c6982ec34dc088c48fd35c76f03d (diff)
Consolidate ActionChanged callbacks, add tooltips
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui_dependents.cc17
-rw-r--r--gtk2_ardour/editor.cc21
-rw-r--r--gtk2_ardour/editor.h2
3 files changed, 16 insertions, 24 deletions
diff --git a/gtk2_ardour/ardour_ui_dependents.cc b/gtk2_ardour/ardour_ui_dependents.cc
index 0971952d26..0c052924bd 100644
--- a/gtk2_ardour/ardour_ui_dependents.cc
+++ b/gtk2_ardour/ardour_ui_dependents.cc
@@ -41,6 +41,7 @@
#include "luawindow.h"
#include "mixer_ui.h"
#include "keyboard.h"
+#include "keyeditor.h"
#include "splash.h"
#include "rc_option_editor.h"
#include "route_params_ui.h"
@@ -419,7 +420,7 @@ ARDOUR_UI::bind_lua_action_script (GdkEventButton*ev, int i)
}
void
-ARDOUR_UI::update_action_script_btn (int i, const std::string&)
+ARDOUR_UI::update_action_script_btn (int i, const std::string& n)
{
if (LuaInstance::instance()->lua_action_has_icon (i)) {
uintptr_t ii = i;
@@ -427,4 +428,18 @@ ARDOUR_UI::update_action_script_btn (int i, const std::string&)
} else {
action_script_call_btn[i].set_icon (0, 0);
}
+
+ std::string const a = string_compose (X_("script-action-%1"), i + 1);
+ Glib::RefPtr<Action> act = ActionManager::get_action(X_("Editor"), a.c_str());
+ assert (act);
+ if (n.empty ()) {
+ act->set_label (string_compose (_("Unset #%1"), i + 1));
+ act->set_tooltip (_("No action bound\nRight-click to assign"));
+ act->set_sensitive (false);
+ } else {
+ act->set_label (n);
+ act->set_tooltip (string_compose (_("%1\n\nClick to run\nRight-click to re-assign\nShift+right-click to unassign"), n));
+ act->set_sensitive (true);
+ }
+ KeyEditor::UpdateBindings ();
}
diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc
index 512e9ef58e..bb769e30ef 100644
--- a/gtk2_ardour/editor.cc
+++ b/gtk2_ardour/editor.cc
@@ -112,7 +112,6 @@
#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"
@@ -869,8 +868,6 @@ Editor::Editor ()
setup_fade_images ();
- LuaInstance::instance()->ActionChanged.connect (sigc::mem_fun (*this, &Editor::set_script_action_name));
-
instant_save ();
}
@@ -5877,24 +5874,6 @@ Editor::trigger_script (int i)
}
void
-Editor::set_script_action_name (int i, const std::string& n)
-{
- string const a = string_compose (X_("script-action-%1"), i + 1);
- Glib::RefPtr<Action> act = ActionManager::get_action(X_("Editor"), a.c_str());
- assert (act);
- if (n.empty ()) {
- act->set_label (string_compose (_("Unset #%1"), i + 1));
- act->set_tooltip (_("no action bound"));
- act->set_sensitive (false);
- } else {
- act->set_label (n);
- act->set_tooltip (n);
- act->set_sensitive (true);
- }
- KeyEditor::UpdateBindings ();
-}
-
-void
Editor::show_editor_list (bool yn)
{
if (yn) {
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index fb1e4b4bdc..458753d638 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -1640,8 +1640,6 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
void initialize_canvas ();
- void set_script_action_name (int i, const std::string&);
-
/* display control */
bool _show_measures;