From 555dcd11fd3c25282e0c16f99efdddc42d824ed4 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 21 Nov 2018 23:21:13 +0100 Subject: [PATCH] Properly revert FormatSpec changes on "cancel" Previously the ExportFormatDialog saved changes to disk on "save" but did nothing on "cancel". The format changed *remained* modified in memory, just not saved (until the ExportProfileManager is re-instantiated) --- gtk2_ardour/export_file_notebook.cc | 1 + gtk2_ardour/export_format_selector.cc | 3 +++ gtk2_ardour/export_format_selector.h | 1 + 3 files changed, 5 insertions(+) diff --git a/gtk2_ardour/export_file_notebook.cc b/gtk2_ardour/export_file_notebook.cc index a7ad061093..a91a253b3c 100644 --- a/gtk2_ardour/export_file_notebook.cc +++ b/gtk2_ardour/export_file_notebook.cc @@ -252,6 +252,7 @@ ExportFileNotebook::FilePage::FilePage (Session * s, ManagerPtr profile_manager, format_selector.FormatEdited.connect (sigc::mem_fun (*this, &ExportFileNotebook::FilePage::save_format_to_manager)); format_selector.FormatRemoved.connect (sigc::mem_fun (*profile_manager, &ExportProfileManager::remove_format_profile)); format_selector.NewFormat.connect (sigc::mem_fun (*profile_manager, &ExportProfileManager::get_new_format)); + format_selector.FormatReverted.connect (sigc::mem_fun (*profile_manager, &ExportProfileManager::revert_format_profile)); format_selector.CriticalSelectionChanged.connect ( sigc::mem_fun (*this, &ExportFileNotebook::FilePage::critical_selection_changed)); diff --git a/gtk2_ardour/export_format_selector.cc b/gtk2_ardour/export_format_selector.cc index dbc74908d1..cf973b86b3 100644 --- a/gtk2_ardour/export_format_selector.cc +++ b/gtk2_ardour/export_format_selector.cc @@ -159,6 +159,9 @@ ExportFormatSelector::open_edit_dialog (bool new_dialog) update_format_description (); FormatEdited (state->format); CriticalSelectionChanged(); + } else { + FormatReverted (state->format); + CriticalSelectionChanged(); } return response; } diff --git a/gtk2_ardour/export_format_selector.h b/gtk2_ardour/export_format_selector.h index 2b7d371d04..20b8250866 100644 --- a/gtk2_ardour/export_format_selector.h +++ b/gtk2_ardour/export_format_selector.h @@ -57,6 +57,7 @@ public: sigc::signal FormatEdited; sigc::signal FormatRemoved; sigc::signal NewFormat; + sigc::signal FormatReverted; /* Compatibility with other elements */