summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Pilon <alex.pilon@gmail.com>2018-12-27 20:58:24 -0500
committerRobin Gareus <robin@gareus.org>2018-12-28 17:25:30 +0100
commite7091cb2cdf23e08d10b505bcb17d43ec0b4913b (patch)
tree4066f40d5903cc275d0cd61d2bc350f79c62ec2c
parent04ccd328dc9eaa2e5d1e6d5c2c35bf0864c82ada (diff)
Observe preference to prompt for names when adding range markers
-rw-r--r--gtk2_ardour/editor.h2
-rw-r--r--gtk2_ardour/editor_ops.cc11
2 files changed, 10 insertions, 3 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h
index 78996b25d8..687631312f 100644
--- a/gtk2_ardour/editor.h
+++ b/gtk2_ardour/editor.h
@@ -714,7 +714,7 @@ private:
void mouse_add_new_range (samplepos_t);
void mouse_add_new_loop (samplepos_t);
void mouse_add_new_punch (samplepos_t);
- bool choose_new_marker_name(std::string &name);
+ bool choose_new_marker_name(std::string &name, bool is_range=false);
void update_cd_marker_display ();
void ensure_cd_marker_updated (LocationMarkers * lam, ARDOUR::Location * location);
diff --git a/gtk2_ardour/editor_ops.cc b/gtk2_ardour/editor_ops.cc
index 7a528929a8..d0d8f2f8b3 100644
--- a/gtk2_ardour/editor_ops.cc
+++ b/gtk2_ardour/editor_ops.cc
@@ -2153,7 +2153,7 @@ Editor::temporal_zoom_to_sample (bool coarser, samplepos_t sample)
bool
-Editor::choose_new_marker_name(string &name) {
+Editor::choose_new_marker_name(string &name, bool is_range) {
if (!UIConfiguration::instance().get_name_new_markers()) {
/* don't prompt user for a new name */
@@ -2164,7 +2164,11 @@ Editor::choose_new_marker_name(string &name) {
dialog.set_prompt (_("New Name:"));
- dialog.set_title (_("New Location Marker"));
+ if (is_range) {
+ dialog.set_title(_("New Range"));
+ } else {
+ dialog.set_title (_("New Location Marker"));
+ }
dialog.set_name ("MarkNameWindow");
dialog.set_size_request (250, -1);
@@ -2205,6 +2209,9 @@ Editor::add_location_from_selection ()
samplepos_t end = selection->time[clicked_selection].end;
_session->locations()->next_available_name(rangename,"selection");
+ if (!choose_new_marker_name(rangename, true)) {
+ return;
+ }
Location *location = new Location (*_session, start, end, rangename, Location::IsRangeMarker, get_grid_music_divisions(0));
begin_reversible_command (_("add marker"));