From e47dfc0c1e2df5dfa39e9d6628442244afd1a963 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Mon, 21 May 2012 09:13:59 +0000 Subject: [PATCH] when resetting the import dialog based on selceted track counts, change the file chooser filter to match a clear selection of a a particular track type (#4880) git-svn-id: svn://localhost/ardour2/branches/3.0@12351 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/sfdb_ui.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/gtk2_ardour/sfdb_ui.cc b/gtk2_ardour/sfdb_ui.cc index 554ae97e33..5451fe180e 100644 --- a/gtk2_ardour/sfdb_ui.cc +++ b/gtk2_ardour/sfdb_ui.cc @@ -1053,6 +1053,8 @@ SoundFileOmega::reset_options () string existing_choice; vector action_strings; + resetting_ourselves = true; + if (chooser.get_filter() == &audio_filter) { /* AUDIO */ @@ -1081,10 +1083,10 @@ SoundFileOmega::reset_options () } } } - + } else { - /* MIDI */ + /* MIDI ONLY */ if (selected_midi_track_cnt > 0) { action_strings.push_back (importmode2string (ImportToTrack)); @@ -1095,8 +1097,6 @@ SoundFileOmega::reset_options () action_strings.push_back (importmode2string (ImportAsRegion)); action_strings.push_back (importmode2string (ImportAsTapeTrack)); - resetting_ourselves = true; - existing_choice = action_combo.get_active_text(); set_popdown_strings (action_combo, action_strings); @@ -1583,6 +1583,15 @@ SoundFileOmega::reset (uint32_t selected_audio_tracks, uint32_t selected_midi_tr { selected_audio_track_cnt = selected_audio_tracks; selected_midi_track_cnt = selected_midi_tracks; + + if (selected_audio_track_cnt == 0 && selected_midi_track_cnt > 0) { + chooser.set_filter (midi_filter); + } else if (selected_midi_track_cnt == 0 && selected_audio_track_cnt > 0) { + chooser.set_filter (audio_filter); + } else { + chooser.set_filter (audio_and_midi_filter); + } + reset_options (); }