copy contents of analysis, plugins, automation and externals folders during save-as
[ardour.git] / gtk2_ardour / editor_route_groups.cc
index d74ba50d64bca7f8cb9045c9e6fae80fc5eb2bf6..64dc1e414b876d3e497ae47580c19362735bf355 100644 (file)
@@ -64,7 +64,6 @@ struct ColumnInfo {
 
 EditorRouteGroups::EditorRouteGroups (Editor* e)
        : EditorComponent (e)
-       , _all_group_active_button (_("No Selection = All Tracks?"))
        , _in_row_change (false)
        , _in_rebuild (false)
 {
@@ -94,18 +93,18 @@ EditorRouteGroups::EditorRouteGroups (Editor* e)
        Gtk::Label* l;
 
        ColumnInfo ci[] = {
-               { 0, _("Col"), _("Group Tab Color") },
-               { 1, _("Name"), _("Name of Group") },
-               { 2, _("V"), _("Group is visible?") },
-               { 3, _("On"), _("Group is enabled?") },
-               { 4, S_("group|G"), _("Sharing Gain?") },
-               { 5, S_("relative|Rel"), _("Relative Gain Changes?") },
-               { 6, S_("mute|M"), _("Sharing Mute?") },
-               { 7, S_("solo|S"), _("Sharing Solo?") },
-               { 8, _("Rec"), _("Sharing Record-enable Status?") },
-               { 9, S_("monitoring|Mon"), _("Sharing Monitoring Choice?") },
-               { 10, S_("selection|Sel"), _("Sharing Selected/Editing Status?") },
-               { 11, S_("active|A"), _("Sharing Active Status?") },
+               { 0,   _("Col"),            _("Group Tab Color") },
+               { 1,   _("Name"),           _("Name of Group") },
+               { 2,  S_("Visible|V"),      _("Group is visible?") },
+               { 3,   _("On"),             _("Group is enabled?") },
+               { 4,  S_("Group|G"),        _("Sharing Gain?") },
+               { 5,  S_("Relative|Rel"),   _("Relative Gain Changes?") },
+               { 6,  S_("Mute|M"),         _("Sharing Mute?") },
+               { 7,  S_("Solo|S"),         _("Sharing Solo?") },
+               { 8,   _("Rec"),            _("Sharing Record-enable Status?") },
+               { 9,  S_("Monitoring|Mon"), _("Sharing Monitoring Choice?") },
+               { 10, S_("Selection|Sel"),  _("Sharing Selected/Editing Status?") },
+               { 11, S_("Active|A"),       _("Sharing Active Status?") },
                { -1, 0, 0 }
        };
 
@@ -188,15 +187,8 @@ EditorRouteGroups::EditorRouteGroups (Editor* e)
        button_box->pack_start (*add_button);
        button_box->pack_start (*remove_button);
 
-       _all_group_active_button.show ();
-
        _display_packer.pack_start (_scroller, true, true);
-       _display_packer.pack_start (_all_group_active_button, false, false);
        _display_packer.pack_start (*button_box, false, false);
-
-       _all_group_active_button.signal_toggled().connect (sigc::mem_fun (*this, &EditorRouteGroups::all_group_toggled));
-       _all_group_active_button.set_name (X_("EditorRouteGroupsAllGroupButton"));
-       ARDOUR_UI::instance()->set_tip (_all_group_active_button, _("Activate this button to operate on all tracks when none are selected."));
 }
 
 void
@@ -205,7 +197,7 @@ EditorRouteGroups::remove_selected ()
        Glib::RefPtr<TreeSelection> selection = _display.get_selection();
        TreeView::Selection::ListHandle_Path rows = selection->get_selected_rows ();
 
-       if (rows.empty()) {
+       if (rows.empty() || _session->deletion_in_progress()) {
                return;
        }
 
@@ -280,7 +272,6 @@ EditorRouteGroups::button_press_event (GdkEventButton* ev)
                case RESPONSE_ACCEPT:
                        c = color_dialog.get_colorsel()->get_current_color();
                        GroupTabs::set_group_color (group, gdk_color_to_rgba (c));
-                       ARDOUR_UI::config()->set_dirty ();
                        break;
                        
                default:
@@ -481,6 +472,7 @@ EditorRouteGroups::groups_changed ()
 void
 EditorRouteGroups::property_changed (RouteGroup* group, const PropertyChange&)
 {
+       assert(group);
        _in_row_change = true;
 
        Gtk::TreeModel::Children children = _model->children();
@@ -559,10 +551,6 @@ EditorRouteGroups::set_session (Session* s)
 
        if (_session) {
 
-               RouteGroup& arg (_session->all_route_group());
-
-               arg.PropertyChanged.connect (all_route_groups_changed_connection, MISSING_INVALIDATOR, boost::bind (&EditorRouteGroups::all_group_changed, this, _1), gui_context());
-
                _session->route_group_added.connect (_session_connections, MISSING_INVALIDATOR, boost::bind (&EditorRouteGroups::add, this, _1), gui_context());
                _session->route_group_removed.connect (
                        _session_connections, MISSING_INVALIDATOR, boost::bind (&EditorRouteGroups::groups_changed, this), gui_context()
@@ -575,7 +563,6 @@ EditorRouteGroups::set_session (Session* s)
        PBD::PropertyChange pc;
        pc.add (Properties::select);
        pc.add (Properties::active);
-       all_group_changed (pc);
 
        groups_changed ();
 }
@@ -588,25 +575,6 @@ EditorRouteGroups::run_new_group_dialog ()
        return _editor->_group_tabs->run_new_group_dialog (rl);
 }
 
-void
-EditorRouteGroups::all_group_toggled ()
-{
-       if (_session) {
-               _session->all_route_group().set_select (_all_group_active_button.get_active());
-       }
-}
-
-void
-EditorRouteGroups::all_group_changed (const PropertyChange&)
-{
-       if (_session) {
-               RouteGroup& arg (_session->all_route_group());
-               _all_group_active_button.set_active (arg.is_active() && arg.is_select());
-       } else {
-               _all_group_active_button.set_active (false);
-       }
-}
-
 /** Called when a model row is deleted, but also when the model is
  *  reordered by a user drag-and-drop; the latter is what we are
  *  interested in here.
@@ -614,7 +582,7 @@ EditorRouteGroups::all_group_changed (const PropertyChange&)
 void
 EditorRouteGroups::row_deleted (Gtk::TreeModel::Path const &)
 {
-       if (_in_rebuild) {
+       if (_in_rebuild || !_session || _session->deletion_in_progress()) {
                /* We need to ignore this in cases where we're not doing a drag-and-drop
                   re-order.
                */