Fix #7003, Store/Restore state of checkboxes in Export dialog

This commit is contained in:
Tim Mayberry 2016-09-11 08:39:08 +10:00
parent 3f95b5ac19
commit dab6e8a2d3
2 changed files with 48 additions and 0 deletions

View File

@ -112,12 +112,55 @@ ExportFileNotebook::update_soundcloud_upload ()
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 ());
}
void
ExportFileNotebook::FilePage::store_state ()
{
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()));
}
}
void
ExportFileNotebook::update_example_filenames ()
{

View File

@ -96,6 +96,11 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
void critical_selection_changed ();
void analysis_changed ();
void on_show ();
void on_hide ();
void store_state ();
void restore_state ();
ARDOUR::ExportProfileManager::FormatStatePtr format_state;
ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
ManagerPtr profile_manager;