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

Method onSaveTriggered

pcsx2-qt/LogWindow.cpp:256–273  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

254}
255
256void LogWindow::onSaveTriggered()
257{
258 const QString path = QFileDialog::getSaveFileName(this, tr("Select Log File"), QString(), tr("Log Files (*.txt)"));
259 if (path.isEmpty())
260 return;
261
262 QFile file(path);
263 if (!file.open(QFile::WriteOnly | QFile::Text))
264 {
265 QMessageBox::critical(this, tr("Error"), tr("Failed to open file for writing."));
266 return;
267 }
268
269 file.write(m_text->toPlainText().toUtf8());
270 file.close();
271
272 appendMessage(LOGLEVEL_INFO, Color_Default, tr("Log was written to %1.\n").arg(path));
273}
274
275void LogWindow::logCallback(LOGLEVEL level, ConsoleColors color, std::string_view message)
276{

Callers

nothing calls this directly

Calls 5

argMethod · 0.80
isEmptyMethod · 0.45
openMethod · 0.45
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected