mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-06 06:44:57 +01:00
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.
This commit is contained in:
parent
ce16b5424f
commit
078889efa8
2 changed files with 3 additions and 18 deletions
|
|
@ -112,21 +112,11 @@ ExportFileNotebook::update_soundcloud_upload ()
|
|||
soundcloud_export_selector->set_visible (show_credentials_entry);
|
||||
}
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -100,8 +100,6 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
|
|||
void analysis_changed ();
|
||||
void soundcloud_upload_changed ();
|
||||
|
||||
void on_hide ();
|
||||
|
||||
ARDOUR::ExportProfileManager::FormatStatePtr format_state;
|
||||
ARDOUR::ExportProfileManager::FilenameStatePtr filename_state;
|
||||
ManagerPtr profile_manager;
|
||||
|
|
@ -124,8 +122,6 @@ class ExportFileNotebook : public Gtk::Notebook, public ARDOUR::SessionHandlePtr
|
|||
Gtk::Alignment tab_close_alignment;
|
||||
Gtk::Button tab_close_button;
|
||||
uint32_t tab_number;
|
||||
|
||||
bool save_format_on_hide;
|
||||
};
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue