summaryrefslogtreecommitdiff
path: root/gtk2_ardour/add_route_dialog.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2017-07-17 11:49:00 -0400
committerPaul Davis <paul@linuxaudiosystems.com>2017-07-17 11:57:33 -0400
commit4f4ed8e1942fa0c4540facbd4271b301b90b29a3 (patch)
treef745c9bdf76d77da1d34d7e5d6617b0dbc5d7ce5 /gtk2_ardour/add_route_dialog.cc
parent2ed15cfc7e22bf78e47a9aee2b0cbd8459beec6c (diff)
if user has edited name entry in add route dialog, type changes should not reset it.
But using a response button should
Diffstat (limited to 'gtk2_ardour/add_route_dialog.cc')
-rw-r--r--gtk2_ardour/add_route_dialog.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/gtk2_ardour/add_route_dialog.cc b/gtk2_ardour/add_route_dialog.cc
index 8f29044447..718edf3ff6 100644
--- a/gtk2_ardour/add_route_dialog.cc
+++ b/gtk2_ardour/add_route_dialog.cc
@@ -61,6 +61,7 @@ AddRouteDialog::AddRouteDialog ()
, configuration_label (_("Configuration:"))
, mode_label (_("Record Mode:"))
, instrument_label (_("Instrument:"))
+ , name_edited_by_user (false)
{
set_name ("AddRouteDialog");
set_skip_taskbar_hint (true);
@@ -182,6 +183,8 @@ AddRouteDialog::AddRouteDialog ()
get_vbox()->pack_start (*vbox, false, false);
+ name_template_entry.signal_insert_text ().connect (sigc::mem_fun (*this, &AddRouteDialog::name_template_entry_insertion));
+ name_template_entry.signal_delete_text ().connect (sigc::mem_fun (*this, &AddRouteDialog::name_template_entry_deletion));
track_bus_combo.signal_changed().connect (sigc::mem_fun (*this, &AddRouteDialog::track_type_chosen));
channel_combo.signal_changed().connect (sigc::mem_fun (*this, &AddRouteDialog::channel_combo_changed));
channel_combo.set_row_separator_func (sigc::mem_fun (*this, &AddRouteDialog::channel_separator));
@@ -207,6 +210,25 @@ AddRouteDialog::~AddRouteDialog ()
}
void
+AddRouteDialog::on_response (int r)
+{
+ name_edited_by_user = false;
+ ArdourDialog::on_response (r);
+}
+
+void
+AddRouteDialog::name_template_entry_insertion (Glib::ustring const &,int*)
+{
+ name_edited_by_user = true;
+}
+
+void
+AddRouteDialog::name_template_entry_deletion (int, int)
+{
+ name_edited_by_user = true;
+}
+
+void
AddRouteDialog::channel_combo_changed ()
{
refill_track_modes ();
@@ -234,6 +256,10 @@ AddRouteDialog::type_wanted() const
void
AddRouteDialog::maybe_update_name_template_entry ()
{
+ if (name_edited_by_user) {
+ return;
+ }
+
switch (type_wanted()) {
case AudioTrack:
name_template_entry.set_text (_("Audio"));
@@ -459,6 +485,7 @@ void
AddRouteDialog::on_show ()
{
routes_spinner.grab_focus ();
+ name_edited_by_user = false;
refill_channel_setups ();
refill_route_groups ();