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

Method checkForUpdates

pcsx2-qt/MainWindow.cpp:2076–2118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2074}
2075
2076void MainWindow::checkForUpdates(bool display_message, bool force_check)
2077{
2078 if (!AutoUpdaterDialog::isSupported())
2079 {
2080 if (display_message)
2081 {
2082 QMessageBox mbox(this);
2083 mbox.setWindowTitle(tr("Updater Error"));
2084 mbox.setWindowIcon(QtHost::GetAppIcon());
2085 mbox.setTextFormat(Qt::RichText);
2086
2087 QString message;
2088#ifdef _WIN32
2089 message = tr("<p>Sorry, you are trying to update a PCSX2 version which is not an official GitHub release. To "
2090 "prevent incompatibilities, the auto-updater is only enabled on official builds.</p>"
2091 "<p>To obtain an official build, please download from the link below:</p>"
2092 "<p><a href=\"https://pcsx2.net/downloads/\">https://pcsx2.net/downloads/</a></p>");
2093#else
2094 message = tr("Automatic updating is not supported on the current platform.");
2095#endif
2096
2097 mbox.setText(message);
2098 mbox.setIcon(QMessageBox::Critical);
2099 mbox.exec();
2100 }
2101
2102 return;
2103 }
2104
2105 if (m_auto_updater_dialog)
2106 return;
2107
2108 if (force_check)
2109 {
2110 // Wipe out the last version, that way it displays the update if we've previously skipped it.
2111 Host::RemoveBaseSettingValue("AutoUpdater", "LastVersion");
2112 Host::CommitBaseSettingChanges();
2113 }
2114
2115 m_auto_updater_dialog = new AutoUpdaterDialog(this);
2116 connect(m_auto_updater_dialog, &AutoUpdaterDialog::updateCheckCompleted, this, &MainWindow::onUpdateCheckComplete);
2117 m_auto_updater_dialog->queueUpdateCheck(display_message);
2118}
2119
2120void MainWindow::onUpdateCheckComplete()
2121{

Callers 1

Calls 2

setWindowTitleMethod · 0.80
queueUpdateCheckMethod · 0.80

Tested by

no test coverage detected