Hande export initialization exceptions gracefully
authorSakari Bergen <sakari.bergen@beatwaves.net>
Sat, 23 Nov 2013 17:11:31 +0000 (19:11 +0200)
committerSakari Bergen <sakari.bergen@beatwaves.net>
Sat, 23 Nov 2013 17:11:31 +0000 (19:11 +0200)
gtk2_ardour/export_dialog.cc
gtk2_ardour/export_dialog.h

index a64acd16801af3c2ec619e39ce1ea44bc75fba59..145874778687826b7d46322724530ce6c3c9d913 100644 (file)
@@ -215,9 +215,9 @@ ExportDialog::init_components ()
 }
 
 void
-ExportDialog::notify_errors ()
+ExportDialog::notify_errors (bool force)
 {
-       if (status->errors()) {
+       if (force || status->errors()) {
                std::string txt = _("Export has been aborted due to an error!\nSee the Log for details.");
                Gtk::MessageDialog msg (txt, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
                msg.run();
@@ -303,9 +303,14 @@ ExportDialog::show_conflicting_files ()
 void
 ExportDialog::do_export ()
 {
-       profile_manager->prepare_for_export ();
-       handler->do_export ();
-       show_progress ();
+       try {
+               profile_manager->prepare_for_export ();
+               handler->do_export ();
+               show_progress ();
+       } catch(std::exception & e) {
+               error << string_compose (_("Export initialization failed: %1"), e.what()) << endmsg;
+               notify_errors(true);
+       }
 }
 
 void
index 52c53660d865a17e78fa7e4f7e8e27406346612a..756a3e7b53a4fda2f5b0288262157b7e894d445c 100644 (file)
@@ -95,7 +95,7 @@ class ExportDialog : public ArdourDialog {
 
        void expanded_changed();
 
-       void notify_errors ();
+       void notify_errors (bool force = false);
        void close_dialog ();
 
        void sync_with_manager ();