Add select all / deselect all to timespan section of export dialogue (#4273).
authorCarl Hetherington <carl@carlh.net>
Tue, 13 Dec 2011 00:15:17 +0000 (00:15 +0000)
committerCarl Hetherington <carl@carlh.net>
Tue, 13 Dec 2011 00:15:17 +0000 (00:15 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@10994 d708f5d6-7413-0410-9779-e7cbd77b26cf

gtk2_ardour/export_timespan_selector.cc
gtk2_ardour/export_timespan_selector.h

index 8080c028627106485db771f751a4333ad6f6dd29..41257e12484fe82d1dd6a060b138a7a0b75bc9fa 100644 (file)
@@ -51,6 +51,22 @@ ExportTimespanSelector::ExportTimespanSelector (ARDOUR::Session * session, Profi
        option_hbox.pack_start (time_format_label, false, false, 0);
        option_hbox.pack_start (time_format_combo, false, false, 6);
 
+       Gtk::Button* b = manage (new Gtk::Button (_("Select All")));
+       b->signal_clicked().connect (
+               sigc::bind (
+                       sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), true
+                       )
+               );
+       option_hbox.pack_start (*b, false, false, 6);
+       
+       b = manage (new Gtk::Button (_("Deselect All")));
+       b->signal_clicked().connect (
+               sigc::bind (
+                       sigc::mem_fun (*this, &ExportTimespanSelector::set_selection_state_of_all_timespans), false
+                       )
+               );
+       option_hbox.pack_start (*b, false, false, 6);
+
        range_scroller.add (range_view);
 
        pack_start (option_hbox, false, false, 0);
@@ -317,6 +333,14 @@ ExportTimespanSelector::update_range_name (std::string const & path, std::string
        CriticalSelectionChanged();
 }
 
+void
+ExportTimespanSelector::set_selection_state_of_all_timespans (bool s)
+{
+       for (Gtk::ListStore::Children::iterator it = range_list->children().begin(); it != range_list->children().end(); ++it) {
+               it->set_value (range_cols.selected, s);
+       }
+}
+
 /*** ExportTimespanSelectorSingle ***/
 
 ExportTimespanSelectorSingle::ExportTimespanSelectorSingle (ARDOUR::Session * session, ProfileManagerPtr manager, std::string range_id) :
index 8b06b2ee8d04cedc835a9d6c1b691672f9d8d781..420baa5806cb99c8124244b5f34bfd2721b416f5 100644 (file)
@@ -83,6 +83,8 @@ class ExportTimespanSelector : public Gtk::VBox, public ARDOUR::SessionHandlePtr
 
        void update_range_name (std::string const & path, std::string const & new_text);
 
+       void set_selection_state_of_all_timespans (bool);
+
        /*** GUI components ***/
 
        Gtk::HBox      option_hbox;