start using ActionMap in preference to ActionManager
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 5 Dec 2018 22:32:35 +0000 (17:32 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 5 Dec 2018 22:33:06 +0000 (17:33 -0500)
gtk2_ardour/ardour_ui2.cc
gtk2_ardour/editor.cc
gtk2_ardour/editor.h
gtk2_ardour/mixer_ui.cc
gtk2_ardour/mixer_ui.h
gtk2_ardour/monitor_section.h
gtk2_ardour/processor_box.h
gtk2_ardour/public_editor.cc
gtk2_ardour/public_editor.h
gtk2_ardour/step_entry.cc
gtk2_ardour/step_entry.h

index f791259af75645174f664e8034b2539cc7c3ff03..431f094ca7e2e75c8145a8be31a80c1209cbc11b 100644 (file)
@@ -255,42 +255,42 @@ ARDOUR_UI::setup_transport ()
        RefPtr<Action> act;
        /* setup actions */
 
-       act = ActionManager::get_action (X_("Transport"), X_("ToggleExternalSync"));
+       act = global_actions.find_action (X_("Transport"), X_("ToggleExternalSync"));
        sync_button.set_related_action (act);
        sync_button.signal_button_press_event().connect (sigc::mem_fun (*this, &ARDOUR_UI::sync_button_clicked), false);
 
        sync_button.set_sizing_text (S_("LogestSync|M-Clk"));
 
        /* CANNOT sigc::bind these to clicked or toggled, must use pressed or released */
-       act = ActionManager::get_action (X_("Main"), X_("cancel-solo"));
+       act = global_actions.find_action (X_("Main"), X_("cancel-solo"));
        solo_alert_button.set_related_action (act);
        auditioning_alert_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::audition_alert_clicked));
        error_alert_button.signal_button_release_event().connect (sigc::mem_fun(*this,&ARDOUR_UI::error_alert_press), false);
-       act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
+       act = editor->find_action (X_("Editor"), X_("toggle-log-window"));
        error_alert_button.set_related_action(act);
        error_alert_button.set_fallthrough_to_parent(true);
 
        layered_button.signal_clicked.connect (sigc::mem_fun(*this,&ARDOUR_UI::layered_button_clicked));
 
-       editor_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-editor-visibility")));
-       mixer_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-mixer-visibility")));
-       prefs_visibility_button.set_related_action (ActionManager::get_action (X_("Common"), X_("change-preferences-visibility")));
+       editor_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-editor-visibility")));
+       mixer_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-mixer-visibility")));
+       prefs_visibility_button.set_related_action (global_actions.find_action (X_("Common"), X_("change-preferences-visibility")));
 
-       act = ActionManager::get_action ("Transport", "ToggleAutoReturn");
+       act = global_actions.find_action ("Transport", "ToggleAutoReturn");
        auto_return_button.set_related_action (act);
-       act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
+       act = global_actions.find_action (X_("Transport"), X_("ToggleFollowEdits"));
        follow_edits_button.set_related_action (act);
-       act = ActionManager::get_action ("Transport", "ToggleAutoInput");
+       act = global_actions.find_action ("Transport", "ToggleAutoInput");
        auto_input_button.set_related_action (act);
 
-       act = ActionManager::get_action ("Transport", "TogglePunchIn");
+       act = global_actions.find_action ("Transport", "TogglePunchIn");
        punch_in_button.set_related_action (act);
-       act = ActionManager::get_action ("Transport", "TogglePunchOut");
+       act = global_actions.find_action ("Transport", "TogglePunchOut");
        punch_out_button.set_related_action (act);
 
-       act = ActionManager::get_action ("Transport", "SessionMonitorIn");
+       act = global_actions.find_action ("Transport", "SessionMonitorIn");
        monitor_in_button.set_related_action (act);
-       act = ActionManager::get_action ("Transport", "SessionMonitorDisk");
+       act = global_actions.find_action ("Transport", "SessionMonitorDisk");
        monitor_disk_button.set_related_action (act);
 
        /* connect signals */
@@ -594,7 +594,7 @@ ARDOUR_UI::error_alert_press (GdkEventButton* ev)
        if (ev->button == 1) {
                if (_log_not_acknowledged == LogLevelError) {
                        // just acknowledge the error, don't hide the log if it's already visible
-                       RefPtr<Action> act = ActionManager::get_action (X_("Editor"), X_("toggle-log-window"));
+                       RefPtr<Action> act = editor->find_action (X_("Editor"), X_("toggle-log-window"));
                        Glib::RefPtr<ToggleAction> tact = Glib::RefPtr<ToggleAction>::cast_dynamic (act);
                        if (tact && tact->get_active()) {
                                do_toggle = false;
@@ -781,7 +781,7 @@ ARDOUR_UI::sync_button_clicked (GdkEventButton* ev)
 void
 ARDOUR_UI::toggle_follow_edits ()
 {
-       RefPtr<Action> act = ActionManager::get_action (X_("Transport"), X_("ToggleFollowEdits"));
+       RefPtr<Action> act = global_actions.find_action (X_("Transport"), X_("ToggleFollowEdits"));
        assert (act);
 
        RefPtr<ToggleAction> tact = RefPtr<ToggleAction>::cast_dynamic (act);
index bd006e13fbd4039bdc4fb5740523dd817996c4cf..ef301370c6aeb6acb4ce35044dfaf070be8225c1 100644 (file)
@@ -448,7 +448,6 @@ Editor::Editor ()
        , _stepping_axis_view (0)
        , quantize_dialog (0)
        , _main_menu_disabler (0)
-       , myactions (X_("editor"))
 {
        /* we are a singleton */
 
index 8606135f52ac65adad65c3bc3f6e04f317011c53..b0ba469f0701435b74c463abacf02db1b0927ea7 100644 (file)
@@ -2318,8 +2318,6 @@ private:
        void toggle_reg_sens (Glib::RefPtr<Gtk::ActionGroup> group, char const * name, char const * label, sigc::slot<void> slot);
        void radio_reg_sens (Glib::RefPtr<Gtk::ActionGroup> action_group, Gtk::RadioAction::Group& radio_group, char const * name, char const * label, sigc::slot<void> slot);
 
-       Gtkmm2ext::ActionMap myactions;
-
        friend class Drag;
        friend class RegionCutDrag;
        friend class RegionDrag;
index c9163165337e6d3d9de9c548cc21b2df6cebca5b..07193c3286912ac723f3834a47ce682662a9ae5a 100644 (file)
@@ -100,6 +100,7 @@ Mixer_UI::instance ()
 
 Mixer_UI::Mixer_UI ()
        : Tabbable (_content, _("Mixer"))
+       , ActionMapOwner (X_("mixer"))
        , no_track_list_redisplay (false)
        , in_group_row_change (false)
        , track_menu (0)
@@ -113,7 +114,6 @@ Mixer_UI::Mixer_UI ()
        , _maximised (false)
        , _show_mixer_list (true)
        , _strip_selection_change_without_scroll (false)
-       , myactions (X_("mixer"))
        , _selection (*this, *this)
 {
        register_actions ();
index 1315f74f5dee05bc4905c980a409468fd1a1c4ba..5908622c581bdf82092abaa1fa79781bef711e14 100644 (file)
@@ -80,7 +80,7 @@ protected:
        virtual bool row_drop_possible_vfunc (const Gtk::TreeModel::Path&, const Gtk::SelectionData&) const;
 };
 
-class Mixer_UI : public ArdourWidgets::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider
+class Mixer_UI : public ArdourWidgets::Tabbable, public PBD::ScopedConnectionList, public ARDOUR::SessionHandlePtr, public AxisViewProvider, public Gtkmm2ext::ActionMapOwner
 {
 public:
        static Mixer_UI* instance();
@@ -407,7 +407,6 @@ private:
 
        void escape ();
 
-       Gtkmm2ext::ActionMap myactions;
        RouteProcessorSelection _selection;
        AxisViewSelection _axis_targets;
 
index f00c438667a70b39a8d573129032a77ff78a0e0a..46d3621955efc51efea5f0edbb4b2cc89171dfbf 100644 (file)
@@ -41,7 +41,7 @@ namespace ArdourWidgets {
        class TearOff;
 }
 
-class MonitorSection : public RouteUI, public Gtk::EventBox
+class MonitorSection : public RouteUI, public Gtk::EventBox, public Gtkmm2ext::StaticActionMapOwner
 {
 public:
        MonitorSection (ARDOUR::Session*);
@@ -55,6 +55,8 @@ public:
 
        PluginSelector* plugin_selector() { return _plugin_selector; }
 
+       Gtkmm2ext::ActionMap& my_actions() const { return myactions; }
+
 private:
        Gtk::HBox hpacker;
        Gtk::VBox vpacker;
index 037e601f3369ef744d18d37613bee12d61a38be0..36db2a4d6974b822655bacf405aa212637843ec0 100644 (file)
@@ -392,7 +392,7 @@ private:
        PBD::ScopedConnectionList _iomap_connection;
 };
 
-class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARDOUR::SessionHandlePtr
+class ProcessorBox : public Gtk::HBox, public PluginInterestedObject, public ARDOUR::SessionHandlePtr, Gtkmm2ext::StaticActionMapOwner
 {
 public:
        enum ProcessorOperation {
@@ -444,6 +444,8 @@ public:
        sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorSelected;
        sigc::signal<void,boost::shared_ptr<ARDOUR::Processor> > ProcessorUnselected;
 
+       Gtkmm2ext::ActionMap& my_actions() const { return myactions; }
+
        static Glib::RefPtr<Gtk::ActionGroup> processor_box_actions;
        static Gtkmm2ext::Bindings* bindings;
        static void register_actions();
index 6ac0ba358b9bc116ff020e9d90f210ca858c7f26..7d9f89354fdd257b49543fecde8990288e6ca405 100644 (file)
@@ -32,6 +32,7 @@ sigc::signal<void> PublicEditor::DropDownKeys;
 
 PublicEditor::PublicEditor (Gtk::Widget& content)
        : Tabbable (content, _("Editor"))
+       , ActionMapOwner (X_("editor"))
        , _suspend_route_redisplay_counter (0)
 {
 }
index aed2fb94c1e288b0d37baed3f68763fa5bd036bf..5c2b376e73e4e7be748fbc10c47d088203270f5a 100644 (file)
@@ -111,7 +111,7 @@ using ARDOUR::samplecnt_t;
  * of PublicEditor need not be recompiled if private methods or member variables
  * change.
  */
-class PublicEditor : public ArdourWidgets::Tabbable,  public ARDOUR::SessionHandlePtr, public AxisViewProvider
+class PublicEditor : public ArdourWidgets::Tabbable,  public ARDOUR::SessionHandlePtr, public AxisViewProvider, public Gtkmm2ext::ActionMapOwner
 {
 public:
        PublicEditor (Gtk::Widget& content);
index 992c0fd187fa14369d39ed3e0b5fdb00f32e9ebc..cda7b7b910db2b292bd09f3c89219c2d043c0638 100644 (file)
@@ -59,6 +59,7 @@ _rest_event_handler (GtkWidget* /*widget*/, gpointer arg)
 
 StepEntry::StepEntry (StepEditor& seditor)
        : ArdourWindow (string_compose (_("Step Entry: %1"), seditor.name()))
+       , ActionMapOwner (X_("step entry"))
        , _current_note_length (1.0)
        , _current_note_velocity (64)
        , triplet_button ("3")
@@ -87,7 +88,6 @@ StepEntry::StepEntry (StepEditor& seditor)
        , _piano (0)
        , piano (0)
        , se (&seditor)
-       , myactions (X_("step entry"))
 {
        register_actions ();
        load_bindings ();
index b81ae89227dacf5aafebff7f88a645f82bc48887..f05dfa13b20105fc65a5145334fdfe90e5216636 100644 (file)
@@ -32,7 +32,7 @@
 
 class StepEditor;
 
-class StepEntry : public ArdourWindow
+class StepEntry : public ArdourWindow, public Gtkmm2ext::ActionMapOwner
 {
 public:
        StepEntry (StepEditor&);
@@ -165,7 +165,6 @@ private:
        bool radio_button_release (GdkEventButton*, Gtk::RadioButton*, int);
 
        void load_bindings ();
-       Gtkmm2ext::ActionMap myactions;
        Gtkmm2ext::Bindings*  bindings;
 
        void inc_note_velocity ();