cancel_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::close_dialog));
export_button->signal_clicked().connect (sigc::mem_fun (*this, &ExportDialog::do_export));
+ file_notebook->soundcloud_export_selector = soundcloud_selector;
+
/* Done! */
show_all_children ();
}
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();
void
ExportDialog::do_export ()
{
- profile_manager->prepare_for_export ();
- handler->upload_username = soundcloud_selector->username();
- handler->upload_password = soundcloud_selector->password();
- handler->upload_public = soundcloud_selector->upload_public();
- handler->upload_open = soundcloud_selector->upload_open();
-
- handler->SoundcloudProgress.connect_same_thread(
- *this,
- boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3)
- );
+ try {
+ profile_manager->prepare_for_export ();
+ handler->soundcloud_username = soundcloud_selector->username ();
+ handler->soundcloud_password = soundcloud_selector->password ();
+ handler->soundcloud_make_public = soundcloud_selector->make_public ();
+ handler->soundcloud_open_page = soundcloud_selector->open_page ();
+ handler->soundcloud_downloadable = soundcloud_selector->downloadable ();
+
+ handler->SoundcloudProgress.connect_same_thread(
+ *this,
+ boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3)
+ );
#if 0
- handler->SoundcloudProgress.connect(
- *this, invalidator (*this),
- boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3),
- gui_context()
- );
+ handler->SoundcloudProgress.connect(
+ *this, invalidator (*this),
+ boost::bind(&ExportDialog::soundcloud_upload_progress, this, _1, _2, _3),
+ gui_context()
+ );
#endif
- handler->do_export ();
- show_progress ();
+ handler->do_export ();
+ show_progress ();
+ } catch(std::exception & e) {
+ error << string_compose (_("Export initialization failed: %1"), e.what()) << endmsg;
+ notify_errors(true);
+ }
}
void
if (gtk_events_pending()) {
gtk_main_iteration ();
} else {
- usleep (10000);
+ Glib::usleep (10000);
}
}