soundcloud_export_selector->set_visible (show_credentials_entry);
}
-void
-ExportFileNotebook::FilePage::on_show ()
-{
- VBox::on_show ();
- restore_state ();
-}
-
-void
-ExportFileNotebook::FilePage::on_hide ()
-{
- VBox::on_hide ();
- store_state ();
-}
-
void
ExportFileNotebook::FilePage::analysis_changed ()
{
format_state->format->set_analyse (analysis_button.get_active ());
+ profile_manager->save_format_to_disk (format_state->format);
}
void
-ExportFileNotebook::FilePage::store_state ()
+ExportFileNotebook::FilePage::update_analysis_button ()
{
- XMLNode node (X_("ExportFile"));
- node.add_property ("analyze-audio", analysis_button.get_active () ? "yes" : "no");
- node.add_property ("soundcloud-upload", soundcloud_upload_button.get_active () ? "yes" : "no");
- Config->add_instant_xml (node);
-}
-
-void
-ExportFileNotebook::FilePage::restore_state ()
-{
- XMLNode* node = Config->instant_xml (X_("ExportFile"));
-
- if (!node) {
- return;
- }
-
- XMLProperty const* prop;
-
- if ((prop = node->property ("analyze-audio")) != 0) {
- analysis_button.set_active (string_is_affirmative (prop->value()));
- }
-
- if ((prop = node->property ("soundcloud-upload")) != 0) {
- soundcloud_upload_button.set_active (string_is_affirmative (prop->value()));
- }
+ analysis_button.set_active (format_state->format->analyse());
}
void
format_selector.set_state (format_state, s);
filename_selector.set_state (filename_state, s);
analysis_button.set_active (format_state->format->analyse());
+ soundcloud_upload_button.set_active (format_state->format->soundcloud_upload());
/* Signals */
sigc::mem_fun (*this, &ExportFileNotebook::FilePage::critical_selection_changed));
soundcloud_upload_button.signal_toggled().connect (sigc::mem_fun (*parent, &ExportFileNotebook::update_soundcloud_upload));
+ soundcloud_upload_button.signal_toggled().connect (sigc::mem_fun (*this, &ExportFileNotebook::FilePage::soundcloud_upload_changed));
analysis_button.signal_toggled().connect (sigc::mem_fun (*this, &ExportFileNotebook::FilePage::analysis_changed));
/* Tab widget */
return soundcloud_upload_button.get_active ();
}
+void
+ExportFileNotebook::FilePage::soundcloud_upload_changed ()
+{
+ profile_manager->save_format_to_disk (format_state->format);
+}
+
+void
+ExportFileNotebook::FilePage::update_soundcloud_upload_button ()
+{
+ soundcloud_upload_button.set_active (format_state->format->soundcloud_upload());
+}
+
void
ExportFileNotebook::FilePage::save_format_to_manager (FormatPtr format)
{
{
update_tab_label();
update_example_filename();
+ update_analysis_button();
+ update_soundcloud_upload_button();
CriticalSelectionChanged();
}