start using ActionMap in preference to ActionManager

This commit is contained in:
Paul Davis 2018-12-05 17:32:35 -05:00
parent eb48c14ec4
commit 4423945643
11 changed files with 27 additions and 27 deletions

View 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);

View 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 */

View 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;

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

View 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;

View 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;

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

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

View 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);

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

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