summaryrefslogtreecommitdiff
path: root/gtk2_ardour/export_file_notebook.cc
diff options
context:
space:
mode:
authorTim Mayberry <mojofunk@gmail.com>2016-09-17 20:28:34 +1000
committerTim Mayberry <mojofunk@gmail.com>2016-09-17 22:03:16 +1000
commit078889efa89ba2cb4be01108b80861acdc5113cb (patch)
tree2e0368f18a582f2099e1847922a4c923a5d07ae4 /gtk2_ardour/export_file_notebook.cc
parentce16b5424fd05a72d1fe086caa3c1dd0a697916b (diff)
Save changes when toggling checkboxes in ExportDialog
I used the Widget::on_hide method in the ExportFileDialog to defer the saving of changes in state of the analysis and soundcloud-upload checkboxes as it was not possible to save the format xml state directly from the ToggleButton::toggled() signal as it created a recursive loop and also to prevent saving the state more than once. Even though the ExportProfileManager::FormatListChanged signal is no longer emitted when saving format state and the crash no longer occurs without this change. I think it is worth saving explicitily from in the toggle callbacks to reduce the complexity of understanding what is taking place and when even if it is less efficient. There is definitely more opportunity for refactoring and redesign.
Diffstat (limited to 'gtk2_ardour/export_file_notebook.cc')
-rw-r--r--gtk2_ardour/export_file_notebook.cc17
1 files changed, 3 insertions, 14 deletions
diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc
index 94f6f7f08a..a3af969740 100644
--- a/gtk2_ardour/export_file_notebook.cc
+++ b/gtk2_ardour/export_file_notebook.cc
@@ -113,20 +113,10 @@ ExportFileNotebook::update_soundcloud_upload ()
}
void
-ExportFileNotebook::FilePage::on_hide ()
-{
- VBox::on_hide ();
- if (save_format_on_hide) {
- profile_manager->save_format_to_disk (format_state->format);
- save_format_on_hide = false;
- }
-}
-
-void
ExportFileNotebook::FilePage::analysis_changed ()
{
format_state->format->set_analyse (analysis_button.get_active ());
- save_format_on_hide = true;
+ profile_manager->save_format_to_disk (format_state->format);
}
void
@@ -216,8 +206,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager,
filename_label (_("Location"), Gtk::ALIGN_LEFT),
soundcloud_upload_button (_("Upload to Soundcloud")),
analysis_button (_("Analyze Exported Audio")),
- tab_number (number),
- save_format_on_hide(false)
+ tab_number (number)
{
set_border_width (12);
@@ -315,7 +304,7 @@ ExportFileNotebook::FilePage::get_soundcloud_upload () const
void
ExportFileNotebook::FilePage::soundcloud_upload_changed ()
{
- save_format_on_hide = true;
+ profile_manager->save_format_to_disk (format_state->format);
}
void