menu and action update
[ardour.git] / gtk2_ardour / editor_ops.cc
index 2e486aa23a45a06ffa4ac093b62051bf2424b784..260d2ce387ec7daa4fcba8a9b3cf86ba6455f2b9 100644 (file)
@@ -184,11 +184,11 @@ Do you really want to destroy %1 ?"),
 
        Gtkmm2ext::Choice prompter (prompt, choices);
 
-       prompter.chosen.connect (Gtk::Main::quit.slot());
+       prompter.chosen.connect (ptr_fun (Main::quit));
        prompter.show_all ();
 
-       Gtk::Main::run ();
-
+       Main::run ();
+               
        if (prompter.get_choice() != 0) {
                return;
        }
@@ -1462,7 +1462,7 @@ Editor::clear_locations ()
 void
 Editor::insert_region_list_drag (AudioRegion& region)
 {
-       double x, y;
+       int x, y;
        double wx, wy;
        double cx, cy;
        TimeAxisView *tv;
@@ -1471,7 +1471,6 @@ Editor::insert_region_list_drag (AudioRegion& region)
        Playlist *playlist;
        
        track_canvas.get_pointer (x, y);
-
        track_canvas.window_to_world (x, y, wx, wy);
 
        GdkEvent event;
@@ -1529,7 +1528,7 @@ Editor::insert_region_list_selection (float times)
        
        Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
        
-       if (selected.count_selected_rows() != 1) {
+       if (selected->count_selected_rows() != 1) {
                return;
        }
        
@@ -1766,9 +1765,7 @@ Editor::rename_region ()
        /* recurse */
 
        dialog.show_all ();
-       ARDOUR_UI::instance()->allow_focus (true);
        Main::run ();
-       ARDOUR_UI::instance()->allow_focus (false);
 
        if (region_renamed) {
                (*selection->audio_regions.begin())->region.set_name (entry.get_text());
@@ -1821,23 +1818,21 @@ Editor::audition_playlist_region_standalone (AudioRegion& region)
 void
 Editor::build_interthread_progress_window ()
 {
-       interthread_progress_window = new ArdourDialog (X_("interthread progress"));
+       interthread_progress_window = new ArdourDialog (X_("interthread progress"), true);
 
        interthread_progress_bar.set_orientation (Gtk::PROGRESS_LEFT_TO_RIGHT);
        
-       interthread_progress_vbox.set_border_width (10);
-       interthread_progress_vbox.set_spacing (5);
-       interthread_progress_vbox.pack_start (interthread_progress_label, false, false);
-       interthread_progress_vbox.pack_start (interthread_progress_bar,false, false);
-       interthread_progress_vbox.pack_start (interthread_cancel_button,false, false);
+       interthread_progress_window->get_vbox()->pack_start (interthread_progress_label, false, false);
+       interthread_progress_window->get_vbox()->pack_start (interthread_progress_bar,false, false);
+
+       // GTK2FIX: this button needs a modifiable label
+
+       Button* b = interthread_progress_window->add_button (Stock::CANCEL, RESPONSE_CANCEL);
+       b->signal_clicked().connect (mem_fun(*this, &Editor::interthread_cancel_clicked));
 
        interthread_cancel_button.add (interthread_cancel_label);
 
-       interthread_cancel_button.signal_clicked().connect (mem_fun(*this, &Editor::interthread_cancel_clicked));
-       
-       interthread_progress_window->set_modal (true);
        interthread_progress_window->set_default_size (200, 100);
-       interthread_progress_window->add (interthread_progress_vbox);
 }
 
 void
@@ -2003,7 +1998,7 @@ Editor::reject_because_rate_differs (string path, SF_INFO& finfo, string action,
                        string_compose (_("%1\nThis audiofile's sample rate doesn't match the session sample rate!"), path),
                        choices);
 
-               rate_choice.chosen.connect (Main::quit.slot());
+               rate_choice.chosen.connect (ptr_fun (Main::quit));
                rate_choice.show_all ();
 
                Main::run ();
@@ -2604,7 +2599,7 @@ Editor::region_fill_selection ()
 
        Glib::RefPtr<TreeSelection> selected = region_list_display.get_selection();
 
-       if (selected.count_selected_rows() != 1) {
+       if (selected->count_selected_rows() != 1) {
                return;
        }
 
@@ -3169,7 +3164,7 @@ Editor::paste (float times)
 void
 Editor::mouse_paste ()
 {
-       double x, y;
+       int x, y;
        double wx, wy;
        track_canvas.get_pointer (x, y);
        track_canvas.window_to_world (x, y, wx, wy);
@@ -3218,11 +3213,11 @@ Editor::paste_internal (jack_nframes_t position, float times)
 void
 Editor::paste_named_selection (float times)
 {
-       TrackSelection::iterator i;
+       TrackSelection::iterator t;
 
        Glib::RefPtr<TreeSelection> selected = named_selection_display.get_selection();
 
-       if (selected.count_selected_rows() == 0 || selection->tracks.empty()) {
+       if (selected->count_selected_rows() != 1 || selection->tracks.empty()) {
                return;
        }
 
@@ -3236,13 +3231,13 @@ Editor::paste_named_selection (float times)
                
        begin_reversible_command (_("paste chunk"));
 
-       for (i = selection->tracks.begin(); i != selection->tracks.end(); ++i) {
+       for (t = selection->tracks.begin(); t != selection->tracks.end(); ++t) {
                
                AudioTimeAxisView* atv;
                Playlist* pl;
                AudioPlaylist* apl;
 
-               if ((atv = dynamic_cast<AudioTimeAxisView*> (*i)) == 0) {
+               if ((atv = dynamic_cast<AudioTimeAxisView*> (*t)) == 0) {
                        continue;
                }
 
@@ -3434,16 +3429,17 @@ Editor::remove_last_capture ()
 
                choices.push_back (_("Yes, destroy it."));
                choices.push_back (_("No, do nothing."));
-
+               
                Gtkmm2ext::Choice prompter (prompt, choices);
-               prompter.done.connect (Gtk::Main::quit.slot());
+               prompter.chosen.connect (ptr_fun (Main::quit));
                prompter.show_all ();
 
-               Gtk::Main::run ();
-
+               Main::run ();
+               
                if (prompter.get_choice() == 0) {
                        session->remove_last_capture ();
                }
+
        } else {
                session->remove_last_capture();
        }