add route dialog now has "Add" and "Add and Close" buttons. "Add" keeps dialog open...
authorDaniel Sheeler <dsheeler@pobox.com>
Fri, 2 Jun 2017 22:23:00 +0000 (17:23 -0500)
committerDaniel Sheeler <dsheeler@pobox.com>
Sun, 4 Jun 2017 02:44:48 +0000 (21:44 -0500)
gtk2_ardour/add_route_dialog.cc
gtk2_ardour/add_route_dialog.h
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h

index bb74bef2c088ee877a67c76b8304da6a06ce3ef7..c8ad0a7d09de5b1261e95ae6d16d1be8ba231f5a 100644 (file)
@@ -194,10 +194,10 @@ AddRouteDialog::AddRouteDialog ()
           this dialog is shown, via ::on_show()
        */
 
-       add_button (Stock::CANCEL, RESPONSE_CANCEL);
-       add_button (Stock::ADD, RESPONSE_ACCEPT);
-       set_response_sensitive (RESPONSE_ACCEPT, true);
-       set_default_response (RESPONSE_ACCEPT);
+       add_button (_("Add"), Add);
+       add_button (_("Add and Close"), AddAndClose);
+       set_response_sensitive (AddAndClose, true);
+       set_default_response (AddAndClose);
 
        track_type_chosen ();
 }
index 1a571039260211a14e3ba2ba132f4bbd1dcb3273..c79fe477c85a0c11b52bdc7c3a9fd265f220e20c 100644 (file)
@@ -51,6 +51,11 @@ class AddRouteDialog : public ArdourDialog
        AddRouteDialog ();
        ~AddRouteDialog ();
 
+       enum ResponseId {
+               Add,
+               AddAndClose,
+       };
+
        enum TypeWanted {
                AudioTrack,
                MidiTrack,
@@ -75,6 +80,10 @@ class AddRouteDialog : public ArdourDialog
        RouteDialogs::InsertAt insert_at();
        bool use_strict_io();
 
+       void on_response (int response_id) {
+               Gtk::Dialog::on_response (response_id);
+       }
+
   private:
        Gtk::Entry name_template_entry;
        Gtk::ComboBoxText track_bus_combo;
index fd3ba20a3a491c796aac46e6d5e20a8e2714f4e2..73fa305955938cbff7c76b0ee4b6221a566a129d 100644 (file)
@@ -4267,7 +4267,7 @@ void
 ARDOUR_UI::add_route ()
 {
        if (!add_route_dialog.get (false)) {
-               add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_finished));
+               add_route_dialog->signal_response().connect (sigc::mem_fun (*this, &ARDOUR_UI::add_route_dialog_response));
        }
 
        if (!_session) {
@@ -4284,18 +4284,19 @@ ARDOUR_UI::add_route ()
 }
 
 void
-ARDOUR_UI::add_route_dialog_finished (int r)
+ARDOUR_UI::add_route_dialog_response (int r)
 {
        int count;
 
-       add_route_dialog->hide();
-
        switch (r) {
-               case RESPONSE_ACCEPT:
-                       break;
-               default:
-                       return;
-                       break;
+       case AddRouteDialog::Add:
+               break;
+       case AddRouteDialog::AddAndClose:
+               add_route_dialog->ArdourDialog::on_response (r);
+               break;
+       default:
+               add_route_dialog->ArdourDialog::on_response (r);
+               return;
        }
 
        if ((count = add_route_dialog->count()) <= 0) {
index 93a9a0ef73b2da7dfa61335dd75a908521bcc3d9..b2240ad4ffdba37cdf23bf512414cf8f9496c8a3 100644 (file)
@@ -268,7 +268,7 @@ public:
        void synchronize_sync_source_and_video_pullup ();
 
        void add_route ();
-       void add_route_dialog_finished (int);
+       void add_route_dialog_response (int);
 
        void add_routes_part_two ();
        void add_routes_thread ();