summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_file_notebook.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-09-11 08:39:08 +1000
committerTim Mayberry <mojofunk@gmail.com>2016-09-11 09:29:53 +1000
commitdab6e8a2d33b7ab6127d3916d253f2c41b51b6a0 (patch)
tree33c79c5398cebdbebed5c212202162474e15918f /gtk2_ardour/export_file_notebook.cc
parent3f95b5ac194d680f01af026482bc999c61ad036c (diff)
Fix #7003, Store/Restore state of checkboxes in Export dialog
Diffstat (limited to 'gtk2_ardour/export_file_notebook.cc')
-rw-r--r--gtk2_ardour/export_file_notebook.cc43
1 files changed, 43 insertions, 0 deletions
diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc
index 8e37356d0d..ad590ad18c 100644
--- a/gtk2_ardour/export_file_notebook.cc
+++ b/gtk2_ardour/export_file_notebook.cc
@@ -113,12 +113,55 @@ ExportFileNotebook::update_soundcloud_upload ()
}
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 ()
{
int i = 0;