Show the file open dialog and open the selected files */
| 879 | /* Show the file open dialog and open the selected files |
| 880 | */ |
| 881 | void MainWindow::showFileOpenDialog() |
| 882 | { |
| 883 | // load last used directory from QPreferences |
| 884 | QSettings settings; |
| 885 | |
| 886 | // Get all supported extensions/filters |
| 887 | QStringList filters = playlistItems::getSupportedFormatsFilters(); |
| 888 | |
| 889 | QFileDialog openDialog(this); |
| 890 | openDialog.setDirectory(settings.value("lastFilePath").toString()); |
| 891 | openDialog.setFileMode(QFileDialog::ExistingFiles); |
| 892 | openDialog.setNameFilters(filters); |
| 893 | |
| 894 | QStringList fileNames; |
| 895 | if (openDialog.exec()) |
| 896 | fileNames = openDialog.selectedFiles(); |
| 897 | |
| 898 | if (fileNames.count() > 0) |
| 899 | { |
| 900 | // save last used directory with QPreferences |
| 901 | QString filePath = fileNames.at(0); |
| 902 | filePath = filePath.section('/', 0, -2); |
| 903 | settings.setValue("lastFilePath", filePath); |
| 904 | } |
| 905 | |
| 906 | ui.playlistTreeWidget->loadFiles(fileNames); |
| 907 | |
| 908 | updateRecentFileActions(); |
| 909 | } |
| 910 | |
| 911 | /// End Full screen. Goto one window mode and reset all the geometry and state settings that were |
| 912 | /// saved. |
nothing calls this directly
no test coverage detected