#include "gtkmm2ext/utils.h"
#include "gtkmm2ext/doi.h"
+#include "widgets/tooltips.h"
+
#include "ardour/plugin_manager.h"
#include "ardour/profile.h"
#include "ardour/template_utils.h"
#include "utils.h"
#include "add_route_dialog.h"
#include "route_group_dialog.h"
-#include "tooltips.h"
#include "pbd/i18n.h"
using namespace Gtk;
, configuration_label (_("Configuration:"))
, mode_label (_("Record Mode:"))
, instrument_label (_("Instrument:"))
+ , name_edited_by_user (false)
{
set_name ("AddRouteDialog");
set_skip_taskbar_hint (true);
table2->attach (*l, 1, 2, n, n + 1, Gtk::FILL, Gtk::EXPAND, 0, 0);
table2->attach (strict_io_combo, 2, 3, n, n + 1, Gtk::FILL, Gtk::EXPAND | Gtk::FILL, 0, 0);
- ARDOUR_UI_UTILS::set_tooltip (strict_io_combo,
+ ArdourWidgets::set_tooltip (strict_io_combo,
_("With strict-i/o enabled, Effect Processors will not modify the number of channels on a track. The number of output channels will always match the number of input channels."));
++n;
}
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));
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 and Close"), AddAndClose);
+ add_button (_("Add"), Add);
+ set_response_sensitive (AddAndClose, true);
+ set_default_response (AddAndClose);
track_type_chosen ();
}
{
}
+void
+AddRouteDialog::on_response (int r)
+{
+ name_edited_by_user = false;
+ /* Don't call ArdourDialog::on_response() because that will
+ automatically hide the dialog.
+ */
+ Gtk::Dialog::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 ()
{
void
AddRouteDialog::maybe_update_name_template_entry ()
{
+ if (name_edited_by_user) {
+ return;
+ }
+
switch (type_wanted()) {
case AudioTrack:
name_template_entry.set_text (_("Audio"));
name_template_entry.set_text (VCA::default_name_template());
break;
}
+ name_edited_by_user = false;
}
void
true, MESSAGE_INFO, BUTTONS_OK, true);
msg.set_position (WIN_POS_MOUSE);
msg.run ();
- }
+ }
channel_combo.set_sensitive (true);
mode_combo.set_sensitive (true);
instrument_combo.set_sensitive (true);
#ifdef XXX_OLD_DESTRUCTIVE_API_XXX
s.push_back (_("Non Layered"));
#endif
- s.push_back (_("Tape"));
if (!ARDOUR::Profile->get_mixbus ()) {
s.push_back (_("Tape"));
}
AddRouteDialog::on_show ()
{
routes_spinner.grab_focus ();
+ name_edited_by_user = false;
refill_channel_setups ();
refill_route_groups ();