From 0d21c15375f2c852248dbb711d78ec53b7448847 Mon Sep 17 00:00:00 2001 From: Colin Fletcher Date: Tue, 16 Jun 2015 11:28:43 +0100 Subject: Make 'Insert time' dialogue do for 'Cut time' too Add a bool cut parameter to InsertTimeDialog's constructor, so it can do double duty as 'Cut time'. The class probably ought to be renamed too. --- gtk2_ardour/insert_time_dialog.cc | 28 +++++++++++++++------------- gtk2_ardour/insert_time_dialog.h | 2 +- 2 files changed, 16 insertions(+), 14 deletions(-) (limited to 'gtk2_ardour') diff --git a/gtk2_ardour/insert_time_dialog.cc b/gtk2_ardour/insert_time_dialog.cc index 10b187578f..731ef60966 100644 --- a/gtk2_ardour/insert_time_dialog.cc +++ b/gtk2_ardour/insert_time_dialog.cc @@ -28,8 +28,8 @@ using namespace Gtk; using namespace Editing; -InsertTimeDialog::InsertTimeDialog (PublicEditor& e) - : ArdourDialog (_("Insert Time")) +InsertTimeDialog::InsertTimeDialog (PublicEditor& e, bool cut) + : ArdourDialog (cut ? _("Cut time") : _("Insert Time")) , _editor (e) , _clock ("insertTimeClock", true, "", true, false, true, false) { @@ -43,7 +43,7 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e) Table* table = manage (new Table (2, 2)); table->set_spacings (4); - Label* time_label = manage (new Label (_("Time to insert:"))); + Label* time_label = manage (new Label (cut ? _("Time to cut") : _("Time to insert:"))); time_label->set_alignment (1, 0.5); table->attach (*time_label, 0, 1, 0, 1, FILL | EXPAND); _clock.set (0); @@ -51,18 +51,20 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e) _clock.set_bbt_reference (pos); table->attach (_clock, 1, 2, 0, 1); - Label* intersected_label = manage (new Label (_("Intersected regions should:"))); - intersected_label->set_alignment (1, 0.5); - table->attach (*intersected_label, 0, 1, 1, 2, FILL | EXPAND); - _intersected_combo.append_text (_("stay in position")); - _intersected_combo.append_text (_("move")); - _intersected_combo.append_text (_("be split")); - _intersected_combo.set_active (0); - table->attach (_intersected_combo, 1, 2, 1, 2); + if (!cut) { + Label* intersected_label = manage (new Label (_("Intersected regions should:"))); + intersected_label->set_alignment (1, 0.5); + table->attach (*intersected_label, 0, 1, 1, 2, FILL | EXPAND); + _intersected_combo.append_text (_("stay in position")); + _intersected_combo.append_text (_("move")); + _intersected_combo.append_text (_("be split")); + _intersected_combo.set_active (0); + table->attach (_intersected_combo, 1, 2, 1, 2); + } get_vbox()->pack_start (*table); - _all_playlists.set_label (_("Insert time on all the track's playlists")); + _all_playlists.set_label (_("Apply to all the track's playlists")); get_vbox()->pack_start (_all_playlists); _move_glued.set_label (_("Move glued regions")); @@ -88,7 +90,7 @@ InsertTimeDialog::InsertTimeDialog (PublicEditor& e) get_vbox()->pack_start (*tempo_box); add_button (Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); - add_button (_("Insert time"), Gtk::RESPONSE_OK); + add_button (cut ? _("Cut time") : _("Insert time"), Gtk::RESPONSE_OK); show_all (); move_markers_toggled (); diff --git a/gtk2_ardour/insert_time_dialog.h b/gtk2_ardour/insert_time_dialog.h index 3c365c1f6b..9443691a92 100644 --- a/gtk2_ardour/insert_time_dialog.h +++ b/gtk2_ardour/insert_time_dialog.h @@ -25,7 +25,7 @@ class InsertTimeDialog : public ArdourDialog { public: - InsertTimeDialog (PublicEditor &); + InsertTimeDialog (PublicEditor &, bool cut = false); Editing::InsertTimeOption intersected_region_action (); bool all_playlists () const; -- cgit v1.2.3