Make Import the default action in the Import Dialog
Double clicking on a file or pressing the Return key will now import it. This means with autoplay enabled you can navigate a directory of audio files using the up and down arrow keys and import the wanted files (with Return) without having to touch the mouse. Being able to use double click to import a file means you don't have to move the mouse back and forth between the file browser and the import button. You can still manually audition the file with space as before.
This commit is contained in:
parent
79ccabdc93
commit
19384be74b
@ -819,6 +819,12 @@ SoundFileBrowser::set_action_sensitive (bool yn)
|
|||||||
import_button.set_sensitive (yn);
|
import_button.set_sensitive (yn);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool
|
||||||
|
SoundFileBrowser::get_action_sensitive () const
|
||||||
|
{
|
||||||
|
return import_button.get_sensitive ();
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
SoundFileBrowser::do_something (int action)
|
SoundFileBrowser::do_something (int action)
|
||||||
{
|
{
|
||||||
@ -840,6 +846,12 @@ SoundFileBrowser::on_key_press_event (GdkEventKey* ev)
|
|||||||
do_something (RESPONSE_CLOSE);
|
do_something (RESPONSE_CLOSE);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
if (ev->keyval == GDK_space && ev->type == GDK_KEY_PRESS) {
|
||||||
|
if (get_action_sensitive()) {
|
||||||
|
preview.audition();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
return ArdourWindow::on_key_press_event (ev);
|
return ArdourWindow::on_key_press_event (ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -853,7 +865,7 @@ SoundFileBrowser::clear_selection ()
|
|||||||
void
|
void
|
||||||
SoundFileBrowser::chooser_file_activated ()
|
SoundFileBrowser::chooser_file_activated ()
|
||||||
{
|
{
|
||||||
preview.audition ();
|
do_something (RESPONSE_OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -249,6 +249,7 @@ class SoundFileBrowser : public ArdourWindow
|
|||||||
bool on_audio_and_midi_filter (const Gtk::FileFilter::Info& filter_info);
|
bool on_audio_and_midi_filter (const Gtk::FileFilter::Info& filter_info);
|
||||||
|
|
||||||
void set_action_sensitive (bool);
|
void set_action_sensitive (bool);
|
||||||
|
bool get_action_sensitive () const;
|
||||||
|
|
||||||
virtual bool reset_options () { return true; }
|
virtual bool reset_options () { return true; }
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user