add route dialog now has "Add" and "Add and Close" buttons. "Add" keeps dialog open so user can add multiple templates.

This commit is contained in:
Daniel Sheeler 2017-06-02 17:23:00 -05:00
parent 11ba1854b3
commit 2c41df9474
4 changed files with 24 additions and 14 deletions

View 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 ();
}

View 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;

View 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) {

View 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 ();