diff options
author | Robin Gareus <robin@gareus.org> | 2013-06-23 18:05:05 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2013-06-23 18:05:05 +0200 |
commit | 072e49d3240da0fa3f4de21ed83e0c9719f0ce32 (patch) | |
tree | 611622481fe84503b5f51f5fe1b4bb8de4b80d26 /gtk2_ardour | |
parent | 60e4598aec090810f105d0e8cbcd578bc67043a9 (diff) | |
parent | db7bd7ca58739152a26ed1be2a88fa568cda0d81 (diff) |
Merge branch 'radiosrb' of https://github.com/adiknoth/ardour
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/export_format_selector.cc | 21 | ||||
-rw-r--r-- | gtk2_ardour/export_format_selector.h | 2 | ||||
-rw-r--r-- | gtk2_ardour/export_preset_selector.cc | 12 |
3 files changed, 31 insertions, 4 deletions
diff --git a/gtk2_ardour/export_format_selector.cc b/gtk2_ardour/export_format_selector.cc index f66d13d62e..a2ba3f352f 100644 --- a/gtk2_ardour/export_format_selector.cc +++ b/gtk2_ardour/export_format_selector.cc @@ -43,7 +43,7 @@ ExportFormatSelector::ExportFormatSelector () : new_button.set_name ("PaddedButton"); edit_button.signal_clicked().connect (sigc::hide_return (sigc::bind (sigc::mem_fun (*this, &ExportFormatSelector::open_edit_dialog), false))); - remove_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::remove_format)); + remove_button.signal_clicked().connect (sigc::bind (sigc::mem_fun (*this, &ExportFormatSelector::remove_format), true)); new_button.signal_clicked().connect (sigc::mem_fun (*this, &ExportFormatSelector::add_new_format)); /* Format combo */ @@ -122,7 +122,7 @@ ExportFormatSelector::add_new_format () FormatPtr new_format = state->format = NewFormat (state->format); if (open_edit_dialog (true) != Gtk::RESPONSE_APPLY) { - remove_format(); + remove_format(false); if (state->list->empty()) { state->format.reset (); } @@ -130,11 +130,26 @@ ExportFormatSelector::add_new_format () } void -ExportFormatSelector::remove_format () +ExportFormatSelector::remove_format (bool called_from_button) { + if (called_from_button) { + Gtk::MessageDialog dialog (_("Do you really want to remove the format?"), + false, + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO); + + if (Gtk::RESPONSE_YES != dialog.run ()) { + /* User has selected "no" or closed the dialog, better + * abort + */ + return; + } + } + FormatPtr remove; Gtk::TreeModel::iterator it = format_combo.get_active(); remove = it->get_value (format_cols.format); + FormatRemoved (remove); } diff --git a/gtk2_ardour/export_format_selector.h b/gtk2_ardour/export_format_selector.h index 9533b15d9b..4af647ac9c 100644 --- a/gtk2_ardour/export_format_selector.h +++ b/gtk2_ardour/export_format_selector.h @@ -63,7 +63,7 @@ class ExportFormatSelector : public Gtk::HBox, public ARDOUR::SessionHandlePtr void select_format (FormatPtr f); void add_new_format (); - void remove_format (); + void remove_format (bool called_from_button = false); int open_edit_dialog (bool new_dialog = false); void update_format_combo (); void update_format_description (); diff --git a/gtk2_ardour/export_preset_selector.cc b/gtk2_ardour/export_preset_selector.cc index 3898916bc0..9f699bbb80 100644 --- a/gtk2_ardour/export_preset_selector.cc +++ b/gtk2_ardour/export_preset_selector.cc @@ -153,6 +153,18 @@ ExportPresetSelector::remove_current () { if (!profile_manager) { return; } + Gtk::MessageDialog dialog (_("Do you really want to remove this preset?"), + false, + Gtk::MESSAGE_QUESTION, + Gtk::BUTTONS_YES_NO); + + if (Gtk::RESPONSE_YES != dialog.run ()) { + /* User has selected "no" or closed the dialog, better + * abort + */ + return; + } + profile_manager->remove_preset(); entry.get_entry()->set_text (""); sync_with_manager (); |