Make menu item for Add Track/Bus/VCA dialog consistent with window title
[ardour.git] / gtk2_ardour / duplicate_routes_dialog.cc
index d9bbc5ccaaa885b820b269ccff2f8c2afc2decd7..1b97599c5bb98557c0e3ce476d91f9cb98e59867 100644 (file)
 #include "ardour/route.h"
 #include "ardour/session.h"
 
+#include "ardour_ui.h"
 #include "editor.h"
 #include "duplicate_routes_dialog.h"
 #include "selection.h"
 
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace ARDOUR;
 using namespace Gtk;
@@ -38,17 +39,30 @@ DuplicateRouteDialog::DuplicateRouteDialog ()
        , share_playlists_button (playlist_button_group, _("Share playlists"))
        , count_adjustment (1.0, 1.0, 999, 1.0, 10.0)
        , count_spinner (count_adjustment)
-       , count_label (_("Duplicate each track/bus this number of times"))
+       , count_label (_("Duplicate each track/bus this number of times:"))
 {
        count_box.pack_start (count_label, false, false);
-       count_box.pack_start (count_spinner, false, false);
-       get_vbox()->pack_start (count_box, false, false, 20);
+       count_box.pack_start (count_spinner, false, false, 5);
+       get_vbox()->pack_start (count_box, false, false, 10);
 
        playlist_button_box.pack_start (copy_playlists_button, false, false);
        playlist_button_box.pack_start (new_playlists_button, false, false);
        playlist_button_box.pack_start (share_playlists_button, false, false);
        playlist_button_box.show_all ();
 
+       insert_at_combo.append_text (_("First"));
+       insert_at_combo.append_text (_("Before Selection"));
+       insert_at_combo.append_text (_("After Selection"));
+       insert_at_combo.append_text (_("Last"));
+       insert_at_combo.set_active (3);
+
+       Gtk::Label* l = manage (new Label (_("Insert duplicates at: ")));
+       Gtk::HBox* b = manage (new HBox);
+       b->pack_start (*l, false, false, 10);
+       b->pack_start (insert_at_combo, true, true);
+
+       get_vbox()->pack_end (*b, false, false, 10);
+
        get_vbox()->show_all ();
 
        add_button (Stock::CANCEL, RESPONSE_CANCEL);
@@ -157,7 +171,7 @@ DuplicateRouteDialog::on_response (int response)
                }
 
                XMLNode& state (rui->route()->get_state());
-               RouteList rl = _session->new_route_from_template (cnt, state, std::string(), playlist_action);
+               RouteList rl = _session->new_route_from_template (cnt, ARDOUR_UI::instance()->translate_order (insert_at()), state, std::string(), playlist_action);
 
                /* normally the state node would be added to a parent, and
                 * ownership would transfer. Because we don't do that here,
@@ -179,3 +193,20 @@ DuplicateRouteDialog::on_response (int response)
                msg.run ();
        }
 }
+
+RouteDialogs::InsertAt
+DuplicateRouteDialog::insert_at ()
+{
+       using namespace RouteDialogs;
+
+       std::string str = insert_at_combo.get_active_text();
+
+       if (str == _("First")) {
+               return First;
+       } else if (str == _("After Selection")) {
+               return AfterSelection;
+       } else if (str == _("Before Selection")){
+               return BeforeSelection;
+       }
+       return Last;
+}