Allow hitting enter on a file in the virtual file dialog to select

This commit is contained in:
baldurk
2017-11-29 18:18:19 +00:00
parent 8931ed4086
commit 4b562ea49d
3 changed files with 17 additions and 1 deletions
@@ -719,6 +719,16 @@ void VirtualFileDialog::on_fileList_clicked(const QModelIndex &index)
ui->filename->setText(m_FileProxy->data(index, RemoteFileModel::FileNameRole).toString());
}
void VirtualFileDialog::on_fileList_keyPress(QKeyEvent *e)
{
// only process when enter is pressed
if(e->key() != Qt::Key_Return && e->key() != Qt::Key_Enter)
return;
// pass on to the filename field as if we hit enter there
on_filename_keyPress(e);
}
void VirtualFileDialog::on_showHidden_toggled(bool checked)
{
m_DirProxy->showHidden = ui->showHidden->isChecked();