prevent Primary-click or Shift-click from deselecting when clicking on a track "backg...
[ardour.git] / gtk2_ardour / export_dialog.cc
index 451f0c2b9a2fa6a78c537ea4494519a0cbb54950..9d707678cf3048ed49b99ebfca10ebb2a970c452 100644 (file)
 
 #include <sigc++/signal.h>
 
-#include "pbd/filesystem.h"
-
 #include "ardour/audioregion.h"
 #include "ardour/export_status.h"
 #include "ardour/export_handler.h"
 
 #include "export_dialog.h"
 #include "gui_thread.h"
+#include "nag.h"
 
 #include "i18n.h"
 
@@ -127,17 +126,13 @@ ExportDialog::init ()
        /* Buttons */
 
        cancel_button = add_button (Gtk::Stock::CANCEL, RESPONSE_CANCEL);
-       // Realtime export is disabled for now, as it will most probably not work
-       //rt_export_button = add_button (_("Realtime Export"), RESPONSE_RT);
-       //fast_export_button = add_button (_("Fast Export"), RESPONSE_FAST);
-       fast_export_button = add_button (_("Export"), RESPONSE_FAST);
+       export_button = add_button (_("Export"), RESPONSE_FAST);
        set_default_response (RESPONSE_FAST);
 
        list_files_button.set_name ("PaddedButton");
 
        cancel_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::close_dialog));
-       //rt_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_rt));
-       fast_export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::export_fw));
+       export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::do_export));
 
        /* Done! */
 
@@ -145,6 +140,12 @@ ExportDialog::init ()
        progress_widget.hide_all();
 }
 
+void
+ExportDialog::expanded_changed ()
+{
+       set_resizable(advanced->get_expanded());
+}
+
 void
 ExportDialog::init_gui ()
 {
@@ -183,9 +184,17 @@ ExportDialog::init_gui ()
        get_vbox()->pack_start (warning_widget, false, false, 0);
        get_vbox()->pack_start (progress_widget, false, false, 0);
 
-       Gtk::Expander* advanced = Gtk::manage (new Gtk::Expander (_("Advanced options")));
+       advanced = Gtk::manage (new Gtk::Expander (_("Time span and channel options")));
+       advanced->property_expanded().signal_changed().connect(
+               sigc::mem_fun(*this, &ExportDialog::expanded_changed));
        advanced->add (*advanced_paned);
 
+       if (channel_selector_is_expandable()) {
+               advanced_sizegroup = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_VERTICAL);
+               advanced_sizegroup->add_widget(*timespan_selector);
+               advanced_sizegroup->add_widget(*channel_selector);
+       }
+
        get_vbox()->pack_start (*advanced, true, true);
 
        Pango::AttrList bold;
@@ -248,8 +257,7 @@ ExportDialog::update_warnings_and_example_filename ()
        list_files_hbox.hide ();
        list_files_string = "";
 
-       fast_export_button->set_sensitive (true);
-       //rt_export_button->set_sensitive (true);
+       export_button->set_sensitive (true);
 
        /* Add new warnings */
 
@@ -293,18 +301,10 @@ ExportDialog::show_conflicting_files ()
 }
 
 void
-ExportDialog::export_rt ()
+ExportDialog::do_export ()
 {
        profile_manager->prepare_for_export ();
-       handler->do_export (true);
-       show_progress ();
-}
-
-void
-ExportDialog::export_fw ()
-{
-       profile_manager->prepare_for_export ();
-       handler->do_export (false);
+       handler->do_export ();
        show_progress ();
 }
 
@@ -314,8 +314,7 @@ ExportDialog::show_progress ()
        status->running = true;
 
        cancel_button->set_label (_("Stop Export"));
-       //rt_export_button->set_sensitive (false);
-       fast_export_button->set_sensitive (false);
+       export_button->set_sensitive (false);
 
        progress_bar.set_fraction (0.0);
        warning_widget.hide_all();
@@ -333,6 +332,14 @@ ExportDialog::show_progress ()
        }
 
        if (!status->aborted()) {
+
+               NagScreen* ns = NagScreen::maybe_nag (_("export"));
+               
+               if (ns) {
+                       ns->nag ();
+                       delete ns;
+               }
+               
                status->finish ();
        }
 }
@@ -367,8 +374,7 @@ ExportDialog::progress_timeout ()
 void
 ExportDialog::add_error (string const & text)
 {
-       fast_export_button->set_sensitive (false);
-       //rt_export_button->set_sensitive (false);
+       export_button->set_sensitive (false);
 
        if (warn_string.empty()) {
                warn_string = _("<span color=\"#ffa755\">Error: ") + text + "</span>";