MCPcopy Create free account
hub / github.com/IENT/YUView / showFileOpenDialog

Method showFileOpenDialog

YUViewLib/src/ui/Mainwindow.cpp:881–909  ·  view source on GitHub ↗

Show the file open dialog and open the selected files */

Source from the content-addressed store, hash-verified

879/* Show the file open dialog and open the selected files
880 */
881void 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.

Callers

nothing calls this directly

Calls 4

toStringMethod · 0.80
atMethod · 0.45
loadFilesMethod · 0.45

Tested by

no test coverage detected