if user has edited name entry in add route dialog, type changes should not reset it.
But using a response button should
This commit is contained in:
parent
2ed15cfc7e
commit
4f4ed8e194
|
@ -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));
|
||||
|
@ -206,6 +209,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 ()
|
||||
{
|
||||
|
@ -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 ();
|
||||
|
|
|
@ -80,10 +80,6 @@ public:
|
|||
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;
|
||||
|
@ -115,6 +111,7 @@ private:
|
|||
void reset_template_option_visibility ();
|
||||
void new_group_dialog_finished (int, RouteGroupDialog*);
|
||||
void on_show ();
|
||||
void on_response (int);
|
||||
|
||||
struct ChannelSetup {
|
||||
std::string name;
|
||||
|
@ -127,6 +124,10 @@ private:
|
|||
|
||||
static std::vector<std::string> channel_combo_strings;
|
||||
static std::vector<std::string> bus_mode_strings;
|
||||
|
||||
bool name_edited_by_user;
|
||||
void name_template_entry_insertion (Glib::ustring const &,int*);
|
||||
void name_template_entry_deletion (int, int);
|
||||
};
|
||||
|
||||
#endif /* __gtk_ardour_add_route_dialog_h__ */
|
||||
|
|
Loading…
Reference in New Issue
Block a user