Use rectangle intersection for MIDI note rect select.
[ardour.git] / gtk2_ardour / sfdb_ui.cc
index 167b2534b3edb48c829b44afdd789e413f36d40c..8dacd0dff1d81ce0567acc7c9092596ee76099f7 100644 (file)
@@ -414,8 +414,8 @@ SoundFileBox::save_tags (const vector<string>& tags)
        Library->save_changes ();
 }
 
-SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::Session* s, bool persistent)
-       : ArdourWindow (parent, title)
+SoundFileBrowser::SoundFileBrowser (string title, ARDOUR::Session* s, bool persistent)
+       : ArdourWindow (title)
        , found_list (ListStore::create(found_list_columns))
        , freesound_list (ListStore::create(freesound_list_columns))
        , chooser (FILE_CHOOSER_ACTION_OPEN)
@@ -613,6 +613,8 @@ SoundFileBrowser::SoundFileBrowser (Gtk::Window& parent, string title, ARDOUR::S
        Gtkmm2ext::UI::instance()->set_tip (cancel_button, _("Press to close this window without importing any files"));
 
        vpacker.pack_end (*button_box, false, false);
+
+       set_wmclass (X_("import"), PROGRAM_NAME);
 }
 
 SoundFileBrowser::~SoundFileBrowser ()
@@ -835,7 +837,7 @@ SoundFileBrowser::freesound_list_view_selected ()
                }
 
                freesound_progress_bar.set_text(
-                               string_compose(_("found %1 matche(s)"), matches));
+                       string_compose(P_("found %1 match", "found %1 matches", matches), matches));
 
                preview.setup_labels (file);
        }
@@ -1056,15 +1058,10 @@ SoundFileBrowser::freesound_search()
        gdk_window_set_cursor (get_window()->gobj(), prev_cursor);
 
        freesound_progress_bar.set_fraction(0.0);
-       switch (matches) {
-               case 0:
-                       freesound_progress_bar.set_text(_("Search returned no results."));
-                       break;
-               case 1:
-                       freesound_progress_bar.set_text(_("Found one match."));
-                       break;
-               default:
-                       freesound_progress_bar.set_text(string_compose(_("Found %1 matche(s)"), matches));
+       if (matches == 0) {
+               freesound_progress_bar.set_text(_("Search returned no results."));
+       } else {
+               freesound_progress_bar.set_text(string_compose(P_("Found %1 match", "Found %1 matches", matches), matches));
        }
        freesound_list_view.get_column(1)->set_sizing(TREE_VIEW_COLUMN_AUTOSIZE);
 #endif
@@ -1460,8 +1457,8 @@ SoundFileOmega::check_link_status (const Session* s, const vector<string>& paths
        return ret;
 }
 
-SoundFileChooser::SoundFileChooser (Gtk::Window& parent, string title, ARDOUR::Session* s)
-       : SoundFileBrowser (parent, title, s, false)
+SoundFileChooser::SoundFileChooser (string title, ARDOUR::Session* s)
+       : SoundFileBrowser (title, s, false)
 {
        chooser.set_select_multiple (false);
        found_list_view.get_selection()->set_mode (SELECTION_SINGLE);
@@ -1497,12 +1494,12 @@ SoundFileChooser::get_filename ()
        return paths.front();
 }
 
-SoundFileOmega::SoundFileOmega (Gtk::Window& parent, string title, ARDOUR::Session* s, 
+SoundFileOmega::SoundFileOmega (string title, ARDOUR::Session* s, 
                                uint32_t selected_audio_tracks, 
                                uint32_t selected_midi_tracks, 
                                bool persistent,
                                Editing::ImportMode mode_hint)
-       : SoundFileBrowser (parent, title, s, persistent)
+       : SoundFileBrowser (title, s, persistent)
        , copy_files_btn ( _("Copy files to session"))
        , selected_audio_track_cnt (selected_audio_tracks)
        , selected_midi_track_cnt (selected_midi_tracks)