MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / openFile

Method openFile

pcsx2-qt/Tools/InputRecording/InputRecordingViewer.cpp:81–106  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81void InputRecordingViewer::openFile()
82{
83 QFileDialog dialog(this);
84 dialog.setFileMode(QFileDialog::ExistingFile);
85 dialog.setWindowTitle(tr("Select a File"));
86 dialog.setNameFilter(tr("Input Recording Files (*.p2m2)"));
87 QStringList fileNames;
88 if (dialog.exec())
89 {
90 fileNames = dialog.selectedFiles();
91 }
92 if (!fileNames.isEmpty())
93 {
94 const std::string fileName = QDir::toNativeSeparators(fileNames.first()).toStdString();
95 m_file_open = m_file.openExisting(fileName);
96 m_ui.actionClose->setEnabled(m_file_open);
97 if (m_file_open)
98 {
99 loadTable();
100 }
101 else
102 {
103 QMessageBox::critical(this, tr("Opening Recording Failed"), tr("Failed to open file: %1").arg(QString::fromUtf8(fileName.c_str())));
104 }
105 }
106}
107
108void InputRecordingViewer::closeFile()
109{

Callers

nothing calls this directly

Calls 6

setWindowTitleMethod · 0.80
firstMethod · 0.80
openExistingMethod · 0.80
argMethod · 0.80
isEmptyMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected