Properly revert FormatSpec changes on "cancel"
authorRobin Gareus <robin@gareus.org>
Wed, 21 Nov 2018 22:21:13 +0000 (23:21 +0100)
committerRobin Gareus <robin@gareus.org>
Wed, 21 Nov 2018 22:21:13 +0000 (23:21 +0100)
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
gtk2_ardour/export_format_selector.cc
gtk2_ardour/export_format_selector.h

index a7ad0610938adb0307fc00779437306cb3796184..a91a253b3cf2f2e430a83cb350ff2011cadf7208 100644 (file)
@@ -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));
index dbc74908d1e3469ae429a3065e28e0dbdf39486e..cf973b86b3d367f89238a7b58d204020fcb4aa8b 100644 (file)
@@ -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;
 }
index 2b7d371d0423de54324af3e566d78725af016438..20b825086658546bd19534bb8171227490b2dcbf 100644 (file)
@@ -57,6 +57,7 @@ public:
        sigc::signal<void, FormatPtr> FormatEdited;
        sigc::signal<void, FormatPtr> FormatRemoved;
        sigc::signal<FormatPtr, FormatPtr> NewFormat;
+       sigc::signal<void, FormatPtr> FormatReverted;
 
        /* Compatibility with other elements */