center, don't expand plugin widgets
[ardour.git] / gtk2_ardour / editor_actions.cc
index d81e0302946c43e4af5f6b873fc602eeed92de3b..1a40ba99b7bdbc185b2e322551584c2c72ee1717 100644 (file)
@@ -154,7 +154,7 @@ Editor::register_actions ()
        /* We don't bother registering "unlock" because it would be insensitive
           when required. Editor::unlock() must be invoked directly.
        */
-       ActionManager::register_action (editor_actions, "lock", _("Lock"), sigc::mem_fun (*this, &Editor::lock));
+       ActionManager::register_action (editor_actions, "lock", S_("Session|Lock"), sigc::mem_fun (*this, &Editor::lock));
 
        toggle_reg_sens (editor_actions, "show-editor-mixer", _("Show Editor Mixer"), sigc::mem_fun (*this, &Editor::editor_mixer_button_toggled));
        toggle_reg_sens (editor_actions, "show-editor-list", _("Show Editor List"), sigc::mem_fun (*this, &Editor::editor_list_button_toggled));
@@ -196,6 +196,10 @@ Editor::register_actions ()
        reg_sens (editor_actions, "deselect-all", _("Deselect All"), sigc::mem_fun(*this, &Editor::deselect_all));
        reg_sens (editor_actions, "invert-selection", _("Invert Selection"), sigc::mem_fun(*this, &Editor::invert_selection));
 
+       reg_sens (editor_actions, "select-loop-range", _("Set Range to Loop Range"), sigc::mem_fun(*this, &Editor::set_selection_from_loop));
+       reg_sens (editor_actions, "select-punch-range", _("Set Range to Punch Range"), sigc::mem_fun(*this, &Editor::set_selection_from_punch));
+       reg_sens (editor_actions, "select-from-regions", _("Set Range to Selected Regions"), sigc::mem_fun(*this, &Editor::set_selection_from_region));
+
        reg_sens (editor_actions, "select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
        reg_sens (editor_actions, "alternate-select-all-after-edit-cursor", _("Select All After Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), true));
        reg_sens (editor_actions, "select-all-before-edit-cursor", _("Select All Before Edit Point"), sigc::bind (sigc::mem_fun(*this, &Editor::select_all_selectables_using_edit), false));
@@ -229,7 +233,7 @@ Editor::register_actions ()
 
        for (int i = 1; i <= 12; ++i) {
                string const a = string_compose (X_("goto-visual-state-%1"), i);
-               string const n = string_compose (_("Goto View %1"), i);
+               string const n = string_compose (_("Go to View %1"), i);
                reg_sens (editor_actions, a.c_str(), n.c_str(), sigc::bind (sigc::mem_fun (*this, &Editor::cancel_visual_state_op), i - 1));
        }
 
@@ -244,6 +248,9 @@ Editor::register_actions ()
        reg_sens (editor_actions, "jump-backward-to-mark", _("Jump to Previous Mark"), sigc::mem_fun(*this, &Editor::jump_backward_to_mark));
        reg_sens (editor_actions, "alternate-jump-backward-to-mark", _("Jump to Previous Mark"), sigc::mem_fun(*this, &Editor::jump_backward_to_mark));
 
+       reg_sens (editor_actions, "set-session-start-from-playhead", _("Set Session Start from Playhead"), sigc::mem_fun(*this, &Editor::set_session_start_from_playhead));
+       reg_sens (editor_actions, "set-session-end-from-playhead", _("Set Session End from Playhead"), sigc::mem_fun(*this, &Editor::set_session_end_from_playhead));
+
        reg_sens (editor_actions, "add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
        reg_sens (editor_actions, "alternate-add-location-from-playhead", _("Add Mark from Playhead"), sigc::mem_fun(*this, &Editor::add_location_from_playhead_cursor));
 
@@ -358,6 +365,12 @@ Editor::register_actions ()
        reg_sens (editor_actions, "start-range", _("Start Range"), sigc::mem_fun(*this, &Editor::keyboard_selection_begin));
        reg_sens (editor_actions, "finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false));
 
+       reg_sens (editor_actions, "start-punch-range", _("Start Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_start_from_edit_point));
+       reg_sens (editor_actions, "finish-punch-range", _("Finish Punch Range"), sigc::mem_fun(*this, &Editor::set_punch_end_from_edit_point));
+
+       reg_sens (editor_actions, "start-loop-range", _("Start Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_start_from_edit_point));
+       reg_sens (editor_actions, "finish-loop-range", _("Finish Loop Range"), sigc::mem_fun(*this, &Editor::set_loop_end_from_edit_point));
+
        reg_sens (editor_actions, "alt-start-range", _("Start Range"), sigc::mem_fun(*this, &Editor::keyboard_selection_begin));
        reg_sens (editor_actions, "alt-finish-range", _("Finish Range"), sigc::bind (sigc::mem_fun(*this, &Editor::keyboard_selection_finish), false));
 
@@ -398,14 +411,16 @@ Editor::register_actions ()
 
        act = reg_sens (editor_actions, "insert-time", _("Insert Time"), (sigc::mem_fun(*this, &Editor::do_insert_time)));
        ActionManager::track_selection_sensitive_actions.push_back (act);
+       act = ActionManager::register_action (editor_actions, "remove-time", _("Remove Time"), (mem_fun(*this, &Editor::do_remove_time)));
+       ActionManager::session_sensitive_actions.push_back (act);
+       ActionManager::track_selection_sensitive_actions.push_back (act);
+
 
        act = reg_sens (editor_actions, "toggle-track-active", _("Toggle Active"), (sigc::mem_fun(*this, &Editor::toggle_tracks_active)));
        ActionManager::track_selection_sensitive_actions.push_back (act);
-       if (Profile->get_sae()) {
-               act = reg_sens (editor_actions, "remove-track", _("Delete"), (sigc::mem_fun(*this, &Editor::remove_tracks)));
-       } else {
-               act = reg_sens (editor_actions, "remove-track", _("Remove"), (sigc::mem_fun(*this, &Editor::remove_tracks)));
-       }
+       act = reg_sens (editor_actions, "remove-track", _("Remove"), (sigc::mem_fun(*this, &Editor::remove_tracks)));
+       /* not selection sensitive? */
+
        ActionManager::track_selection_sensitive_actions.push_back (act);
 
        act = reg_sens (editor_actions, "fit-selection", _("Fit Selection (Vertical)"), sigc::mem_fun(*this, &Editor::fit_selection));
@@ -452,38 +467,38 @@ Editor::register_actions ()
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-object", _("Object Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseObject));
        mouse_move_button.set_related_action (act);
-       mouse_move_button.set_image (::get_icon("tool_object"));
+       mouse_move_button.set_icon (Gtkmm2ext::ArdourIcon::ToolGrab);
        mouse_move_button.set_name ("mouse mode button");
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-range", _("Range Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseRange));        
        mouse_select_button.set_related_action (act);
-       mouse_select_button.set_image (::get_icon("tool_range"));
+       mouse_select_button.set_icon (Gtkmm2ext::ArdourIcon::ToolRange);
        mouse_select_button.set_name ("mouse mode button");
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-draw", _("Note Drawing Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseDraw));   
        mouse_draw_button.set_related_action (act);
-       mouse_draw_button.set_image (::get_icon("midi_tool_pencil"));
+       mouse_draw_button.set_icon (Gtkmm2ext::ArdourIcon::ToolDraw);
        mouse_draw_button.set_name ("mouse mode button");
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-audition", _("Audition Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseAudition));       
        mouse_audition_button.set_related_action (act);
-       mouse_audition_button.set_image (::get_icon("tool_audition"));
+       mouse_audition_button.set_icon (Gtkmm2ext::ArdourIcon::ToolAudition);
        mouse_audition_button.set_name ("mouse mode button");
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-timefx", _("Time FX Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseTimeFX));    
        mouse_timefx_button.set_related_action (act);
-       mouse_timefx_button.set_image (::get_icon("tool_stretch"));
+       mouse_timefx_button.set_icon (Gtkmm2ext::ArdourIcon::ToolStretch);
        mouse_timefx_button.set_name ("mouse mode button");
 
        act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-content", _("Content Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseContent));  
        mouse_content_button.set_related_action (act);
-       mouse_content_button.set_image (::get_icon("tool_content"));
+       mouse_content_button.set_icon (Gtkmm2ext::ArdourIcon::ToolContent);
        mouse_content_button.set_name ("mouse mode button");
 
        if(!Profile->get_mixbus()) {
                act = ActionManager::register_radio_action (mouse_mode_actions, mouse_mode_group, "set-mouse-mode-cut", _("Cut Tool"), sigc::bind (sigc::mem_fun(*this, &Editor::mouse_mode_toggled), Editing::MouseCut));
                mouse_cut_button.set_related_action (act);
-               mouse_cut_button.set_image (::get_icon("tool_cut"));
+               mouse_cut_button.set_icon (Gtkmm2ext::ArdourIcon::ToolCut);
                mouse_cut_button.set_name ("mouse mode button");
        }
        
@@ -500,7 +515,7 @@ Editor::register_actions ()
 //     ActionManager::register_action (editor_actions, "set-edit-splice", _("Splice"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Splice));
        ActionManager::register_action (editor_actions, "set-edit-ripple", _("Ripple"), bind (mem_fun (*this, &Editor::set_edit_mode), Ripple));
        ActionManager::register_action (editor_actions, "set-edit-slide", _("Slide"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Slide));
-       ActionManager::register_action (editor_actions, "set-edit-lock", _("Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
+       ActionManager::register_action (editor_actions, "set-edit-lock", S_("EditMode|Lock"), sigc::bind (sigc::mem_fun (*this, &Editor::set_edit_mode), Lock));
        ActionManager::register_action (editor_actions, "cycle-edit-mode", _("Cycle Edit Mode"), sigc::mem_fun (*this, &Editor::cycle_edit_mode));
 
        ActionManager::register_action (editor_actions, X_("SnapTo"), _("Snap to"));
@@ -679,6 +694,9 @@ Editor::register_actions ()
 
        ActionManager::register_action (rl_actions, X_("removeUnusedRegions"), _("Remove Unused"), sigc::mem_fun (*_regions, &EditorRegions::remove_unused_regions));
 
+       act = reg_sens (editor_actions, X_("addExistingPTFiles"), _("Import PT session"), sigc::mem_fun (*this, &Editor::external_pt_dialog));
+       ActionManager::write_sensitive_actions.push_back (act);
+
        /* the next two are duplicate items with different names for use in two different contexts */
 
        act = reg_sens (editor_actions, X_("addExistingAudioFiles"), _("Import"), sigc::mem_fun (*this, &Editor::external_audio_dialog));