Make Soundcloud upload applicable to any export format.

Add soundcloud_upload property back into ExportFormatSpecification, but
instead of making it settable in the export format specification dialog,
add a tick-box in each tab of ExportFileNotebook to allow setting it.
This commit is contained in:
Colin Fletcher 2014-05-23 18:14:37 +01:00
parent 2f6debf0d2
commit 9daab3db84
4 changed files with 37 additions and 1 deletions

View file

@ -86,9 +86,30 @@ ExportFileNotebook::sync_with_manager ()
}
set_current_page (0);
update_soundcloud_upload ();
CriticalSelectionChanged ();
}
void
ExportFileNotebook::update_soundcloud_upload()
{
int i;
ExportProfileManager::FormatStateList const & formats = profile_manager->get_formats ();
ExportProfileManager::FormatStateList::const_iterator format_it;
for (i = 0, format_it = formats.begin(); format_it != formats.end(); ++i, ++format_it) {
FilePage * page;
std::cerr << "get_nth_soundcloud_upload " << i << std::endl;
if ((page = dynamic_cast<FilePage *> (get_nth_page (i)))) {
(*format_it)->format->set_soundcloud_upload( page->get_soundcloud_upload () );
// profile_manager->soundcloud_upload_list.push_back (page->get_soundcloud_upload () );
} else {
std::cerr << "not a page!" << std::endl;
}
}
}
void
ExportFileNotebook::update_example_filenames()
{
@ -177,6 +198,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
format_label (_("Format"), Gtk::ALIGN_LEFT),
filename_label (_("Location"), Gtk::ALIGN_LEFT),
soundcloud_upload_button (_("Upload to Soundcloud")),
tab_number (number)
{
set_border_width (12);
@ -185,6 +207,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
pack_start (format_align, false, false, 0);
pack_start (filename_label, false, false, 0);
pack_start (filename_align, false, false, 0);
pack_start (soundcloud_upload_button, false, false, 0);
format_align.add (format_selector);
format_align.set_padding (6, 12, 18, 0);
@ -219,6 +242,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
filename_selector.CriticalSelectionChanged.connect (
sigc::mem_fun (*this, &ExportFileNotebook::FilePage::critical_selection_changed));
soundcloud_upload_button.signal_toggled().connect (sigc::mem_fun (*parent, &ExportFileNotebook::update_soundcloud_upload));
/* Tab widget */
tab_close_button.add (*Gtk::manage (new Gtk::Image (::get_icon("close"))));
@ -255,6 +279,12 @@ ExportFileNotebook::FilePage::get_format_name () const
return _("No format!");
}
bool
ExportFileNotebook::FilePage::get_soundcloud_upload () const
{
return soundcloud_upload_button.get_active ();
}
void
ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format)
{