diff --git a/src/common/log_channels.h b/src/common/log_channels.h index c5c45771a..7e4f3eefc 100644 --- a/src/common/log_channels.h +++ b/src/common/log_channels.h @@ -4,7 +4,6 @@ #define ENUMERATE_LOG_CHANNELS(X) \ X(Achievements) \ X(AudioStream) \ - X(AutoUpdaterDialog) \ X(BIOS) \ X(Bus) \ X(CDImage) \ diff --git a/src/duckstation-qt/CMakeLists.txt b/src/duckstation-qt/CMakeLists.txt index b5654bba0..2f3594baa 100644 --- a/src/duckstation-qt/CMakeLists.txt +++ b/src/duckstation-qt/CMakeLists.txt @@ -20,9 +20,9 @@ set(SRCS audiosettingswidget.h audiosettingswidget.ui audiostretchsettingsdialog.ui - autoupdaterdialog.cpp - autoupdaterdialog.h - autoupdaterdialog.ui + autoupdaterwindow.cpp + autoupdaterwindow.h + autoupdaterwindow.ui biossettingswidget.cpp biossettingswidget.h biossettingswidget.ui diff --git a/src/duckstation-qt/autoupdaterdialog.cpp b/src/duckstation-qt/autoupdaterwindow.cpp similarity index 89% rename from src/duckstation-qt/autoupdaterdialog.cpp rename to src/duckstation-qt/autoupdaterwindow.cpp index 823a335ff..d1167e8a6 100644 --- a/src/duckstation-qt/autoupdaterdialog.cpp +++ b/src/duckstation-qt/autoupdaterwindow.cpp @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: 2019-2024 Connor McLaughlin // SPDX-License-Identifier: CC-BY-NC-ND-4.0 -#include "autoupdaterdialog.h" +#include "autoupdaterwindow.h" #include "mainwindow.h" #include "qthost.h" #include "qtprogresscallback.h" @@ -76,17 +76,17 @@ static const char* DOWNLOAD_PAGE_URL = "https://github.com/stenzek/duckstation/r #endif -LOG_CHANNEL(AutoUpdaterDialog); +LOG_CHANNEL(Host); -AutoUpdaterDialog::AutoUpdaterDialog(QWidget* parent /* = nullptr */) : QDialog(parent) +AutoUpdaterWindow::AutoUpdaterWindow(QWidget* parent /* = nullptr */) : QWidget(parent) { m_ui.setupUi(this); - + setWindowIcon(QtHost::GetAppIcon()); setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint); - connect(m_ui.downloadAndInstall, &QPushButton::clicked, this, &AutoUpdaterDialog::downloadUpdateClicked); - connect(m_ui.skipThisUpdate, &QPushButton::clicked, this, &AutoUpdaterDialog::skipThisUpdateClicked); - connect(m_ui.remindMeLater, &QPushButton::clicked, this, &AutoUpdaterDialog::remindMeLaterClicked); + connect(m_ui.downloadAndInstall, &QPushButton::clicked, this, &AutoUpdaterWindow::downloadUpdateClicked); + connect(m_ui.skipThisUpdate, &QPushButton::clicked, this, &AutoUpdaterWindow::skipThisUpdateClicked); + connect(m_ui.remindMeLater, &QPushButton::clicked, this, &AutoUpdaterWindow::remindMeLaterClicked); Error error; m_http = HTTPDownloader::Create(Host::GetHTTPUserAgent(), &error); @@ -94,9 +94,9 @@ AutoUpdaterDialog::AutoUpdaterDialog(QWidget* parent /* = nullptr */) : QDialog( ERROR_LOG("Failed to create HTTP downloader, auto updater will not be available:\n{}", error.GetDescription()); } -AutoUpdaterDialog::~AutoUpdaterDialog() = default; +AutoUpdaterWindow::~AutoUpdaterWindow() = default; -bool AutoUpdaterDialog::isSupported() +bool AutoUpdaterWindow::isSupported() { #ifdef UPDATE_CHECKER_SUPPORTED return true; @@ -105,7 +105,7 @@ bool AutoUpdaterDialog::isSupported() #endif } -bool AutoUpdaterDialog::isOfficialBuild() +bool AutoUpdaterWindow::isOfficialBuild() { #if !__has_include("scmversion/tag.h") return false; @@ -114,7 +114,7 @@ bool AutoUpdaterDialog::isOfficialBuild() #endif } -void AutoUpdaterDialog::warnAboutUnofficialBuild() +void AutoUpdaterWindow::warnAboutUnofficialBuild() { // // To those distributing their own builds or packages of DuckStation, and seeing this message: @@ -206,7 +206,7 @@ void AutoUpdaterDialog::warnAboutUnofficialBuild() #endif } -QStringList AutoUpdaterDialog::getTagList() +QStringList AutoUpdaterWindow::getTagList() { #ifdef UPDATE_CHECKER_SUPPORTED return QStringList(std::begin(UPDATE_TAGS), std::end(UPDATE_TAGS)); @@ -215,7 +215,7 @@ QStringList AutoUpdaterDialog::getTagList() #endif } -std::string AutoUpdaterDialog::getDefaultTag() +std::string AutoUpdaterWindow::getDefaultTag() { #ifdef UPDATE_CHECKER_SUPPORTED return THIS_RELEASE_TAG; @@ -224,7 +224,7 @@ std::string AutoUpdaterDialog::getDefaultTag() #endif } -std::string AutoUpdaterDialog::getCurrentUpdateTag() const +std::string AutoUpdaterWindow::getCurrentUpdateTag() const { #ifdef UPDATE_CHECKER_SUPPORTED return Host::GetBaseStringSettingValue("AutoUpdater", "UpdateTag", THIS_RELEASE_TAG); @@ -233,12 +233,12 @@ std::string AutoUpdaterDialog::getCurrentUpdateTag() const #endif } -void AutoUpdaterDialog::reportError(const std::string_view msg) +void AutoUpdaterWindow::reportError(const std::string_view msg) { QMessageBox::critical(this, tr("Updater Error"), QtUtils::StringViewToQString(msg)); } -bool AutoUpdaterDialog::ensureHttpReady() +bool AutoUpdaterWindow::ensureHttpReady() { if (!m_http) return false; @@ -246,7 +246,7 @@ bool AutoUpdaterDialog::ensureHttpReady() if (!m_http_poll_timer) { m_http_poll_timer = new QTimer(this); - m_http_poll_timer->connect(m_http_poll_timer, &QTimer::timeout, this, &AutoUpdaterDialog::httpPollTimerPoll); + m_http_poll_timer->connect(m_http_poll_timer, &QTimer::timeout, this, &AutoUpdaterWindow::httpPollTimerPoll); } if (!m_http_poll_timer->isActive()) @@ -259,7 +259,7 @@ bool AutoUpdaterDialog::ensureHttpReady() return true; } -void AutoUpdaterDialog::httpPollTimerPoll() +void AutoUpdaterWindow::httpPollTimerPoll() { Assert(m_http); m_http->PollRequests(); @@ -271,39 +271,7 @@ void AutoUpdaterDialog::httpPollTimerPoll() } } -void AutoUpdaterDialog::lockAndExec() -{ - // pause+unfullscreen system. annoyingly, need to reparent if we were fullscreen - MainWindow::SystemLock lock = g_main_window->pauseAndLockSystem(); - const Qt::WindowFlags prev_flags = windowFlags(); - QWidget* const prev_parent = qobject_cast(parent()); - const bool needs_parent_change = (prev_parent && lock.getDialogParent() != prev_parent); - if (needs_parent_change) - { - setParent(lock.getDialogParent()); - setWindowFlags(prev_flags); - qApp->processEvents(QEventLoop::ExcludeUserInputEvents); - - // ensure we're at the front - QTimer::singleShot(20, Qt::TimerType::CoarseTimer, parent(), SLOT(raise())); - } - - const int result = exec(); - - if (needs_parent_change) - { - setParent(prev_parent); - setWindowFlags(prev_flags); - } - - // cancel resume if we're exiting anyway - if (result) - lock.cancelResume(); - - emit updateCheckCompleted(); -} - -void AutoUpdaterDialog::queueUpdateCheck(bool display_errors) +void AutoUpdaterWindow::queueUpdateCheck(bool display_errors) { #ifdef UPDATE_CHECKER_SUPPORTED if (!ensureHttpReady()) @@ -322,7 +290,7 @@ void AutoUpdaterDialog::queueUpdateCheck(bool display_errors) #endif } -void AutoUpdaterDialog::queueGetLatestRelease() +void AutoUpdaterWindow::queueGetLatestRelease() { #ifdef UPDATE_CHECKER_SUPPORTED if (!ensureHttpReady()) @@ -332,12 +300,12 @@ void AutoUpdaterDialog::queueGetLatestRelease() } std::string url = fmt::format(fmt::runtime(LATEST_RELEASE_URL), getCurrentUpdateTag()); - m_http->CreateRequest(std::move(url), std::bind(&AutoUpdaterDialog::getLatestReleaseComplete, this, + m_http->CreateRequest(std::move(url), std::bind(&AutoUpdaterWindow::getLatestReleaseComplete, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_4)); #endif } -void AutoUpdaterDialog::getLatestTagComplete(s32 status_code, const Error& error, std::vector response, +void AutoUpdaterWindow::getLatestTagComplete(s32 status_code, const Error& error, std::vector response, bool display_errors) { #ifdef UPDATE_CHECKER_SUPPORTED @@ -401,7 +369,7 @@ void AutoUpdaterDialog::getLatestTagComplete(s32 status_code, const Error& error #endif } -void AutoUpdaterDialog::getLatestReleaseComplete(s32 status_code, const Error& error, std::vector response) +void AutoUpdaterWindow::getLatestReleaseComplete(s32 status_code, const Error& error, std::vector response) { #ifdef UPDATE_CHECKER_SUPPORTED if (status_code == HTTPDownloader::HTTP_STATUS_OK) @@ -447,9 +415,7 @@ void AutoUpdaterDialog::getLatestReleaseComplete(s32 status_code, const Error& e m_ui.downloadAndInstall->setEnabled(true); m_ui.updateNotes->setText(tr("Loading...")); queueGetChanges(); - - // We have to defer this, because it comes back through the timer/HTTP callback... - QMetaObject::invokeMethod(this, "lockAndExec", Qt::QueuedConnection); + QtUtils::ShowOrRaiseWindow(this); return; } else @@ -466,19 +432,19 @@ void AutoUpdaterDialog::getLatestReleaseComplete(s32 status_code, const Error& e #endif } -void AutoUpdaterDialog::queueGetChanges() +void AutoUpdaterWindow::queueGetChanges() { #ifdef UPDATE_CHECKER_SUPPORTED if (!ensureHttpReady()) return; std::string url = fmt::format(fmt::runtime(CHANGES_URL), g_scm_hash_str, getCurrentUpdateTag()); - m_http->CreateRequest(std::move(url), std::bind(&AutoUpdaterDialog::getChangesComplete, this, std::placeholders::_1, + m_http->CreateRequest(std::move(url), std::bind(&AutoUpdaterWindow::getChangesComplete, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_4)); #endif } -void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error, std::vector response) +void AutoUpdaterWindow::getChangesComplete(s32 status_code, const Error& error, std::vector response) { #ifdef UPDATE_CHECKER_SUPPORTED if (status_code == HTTPDownloader::HTTP_STATUS_OK) @@ -552,7 +518,7 @@ void AutoUpdaterDialog::getChangesComplete(s32 status_code, const Error& error, #endif } -void AutoUpdaterDialog::downloadUpdateClicked() +void AutoUpdaterWindow::downloadUpdateClicked() { #ifdef AUTO_UPDATER_SUPPORTED // Prevent multiple clicks of the button. @@ -609,7 +575,7 @@ void AutoUpdaterDialog::downloadUpdateClicked() { // updater started. since we're a modal on the main window, we have to queue this. QMetaObject::invokeMethod(g_main_window, "requestExit", Qt::QueuedConnection, Q_ARG(bool, false)); - done(1); + close(); } else { @@ -621,7 +587,7 @@ void AutoUpdaterDialog::downloadUpdateClicked() #endif } -bool AutoUpdaterDialog::updateNeeded() const +bool AutoUpdaterWindow::updateNeeded() const { QString last_checked_sha = QString::fromStdString(Host::GetBaseStringSettingValue("AutoUpdater", "LastVersion")); @@ -638,16 +604,22 @@ bool AutoUpdaterDialog::updateNeeded() const return true; } -void AutoUpdaterDialog::skipThisUpdateClicked() +void AutoUpdaterWindow::skipThisUpdateClicked() { Host::SetBaseStringSettingValue("AutoUpdater", "LastVersion", m_latest_sha.toUtf8().constData()); Host::CommitBaseSettingChanges(); - done(0); + close(); } -void AutoUpdaterDialog::remindMeLaterClicked() +void AutoUpdaterWindow::remindMeLaterClicked() { - done(0); + close(); +} + +void AutoUpdaterWindow::closeEvent(QCloseEvent* event) +{ + emit updateCheckCompleted(); + QWidget::closeEvent(event); } #ifdef _WIN32 @@ -655,7 +627,7 @@ void AutoUpdaterDialog::remindMeLaterClicked() static constexpr char UPDATER_EXECUTABLE[] = "updater.exe"; static constexpr char UPDATER_ARCHIVE_NAME[] = "update.zip"; -bool AutoUpdaterDialog::doesUpdaterNeedElevation(const std::string& application_dir) const +bool AutoUpdaterWindow::doesUpdaterNeedElevation(const std::string& application_dir) const { // Try to create a dummy text file in the updater directory. If it fails, we probably won't have write permission. const std::string dummy_path = Path::Combine(application_dir, "update.txt"); @@ -668,7 +640,7 @@ bool AutoUpdaterDialog::doesUpdaterNeedElevation(const std::string& application_ return false; } -bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) +bool AutoUpdaterWindow::processUpdate(const std::vector& update_data) { const std::string& application_dir = EmuFolders::AppRoot; const std::string update_zip_path = Path::Combine(EmuFolders::DataRoot, UPDATER_ARCHIVE_NAME); @@ -697,7 +669,7 @@ bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) return doUpdate(application_dir, update_zip_path, updater_path); } -bool AutoUpdaterDialog::extractUpdater(const std::string& zip_path, const std::string& destination_path, Error* error) +bool AutoUpdaterWindow::extractUpdater(const std::string& zip_path, const std::string& destination_path, Error* error) { unzFile zf = MinizipHelpers::OpenUnzFile(zip_path.c_str()); if (!zf) @@ -753,7 +725,7 @@ bool AutoUpdaterDialog::extractUpdater(const std::string& zip_path, const std::s return true; } -bool AutoUpdaterDialog::doUpdate(const std::string& application_dir, const std::string& zip_path, +bool AutoUpdaterWindow::doUpdate(const std::string& application_dir, const std::string& zip_path, const std::string& updater_path) { const std::string program_path = QDir::toNativeSeparators(QCoreApplication::applicationFilePath()).toStdString(); @@ -787,7 +759,7 @@ bool AutoUpdaterDialog::doUpdate(const std::string& application_dir, const std:: return true; } -void AutoUpdaterDialog::cleanupAfterUpdate() +void AutoUpdaterWindow::cleanupAfterUpdate() { // If we weren't portable, then updater executable gets left in the application directory. if (EmuFolders::AppRoot == EmuFolders::DataRoot) @@ -809,7 +781,7 @@ void AutoUpdaterDialog::cleanupAfterUpdate() #elif defined(__APPLE__) -bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) +bool AutoUpdaterWindow::processUpdate(const std::vector& update_data) { std::optional bundle_path = CocoaTools::GetNonTranslocatedBundlePath(); if (!bundle_path.has_value()) @@ -870,13 +842,13 @@ bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) return true; } -void AutoUpdaterDialog::cleanupAfterUpdate() +void AutoUpdaterWindow::cleanupAfterUpdate() { } #elif defined(__linux__) -bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) +bool AutoUpdaterWindow::processUpdate(const std::vector& update_data) { const char* appimage_path = std::getenv("APPIMAGE"); if (!appimage_path || !FileSystem::FileExists(appimage_path)) @@ -995,7 +967,7 @@ bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) return true; } -void AutoUpdaterDialog::cleanupAfterUpdate() +void AutoUpdaterWindow::cleanupAfterUpdate() { // Remove old/backup AppImage. const char* appimage_path = std::getenv("APPIMAGE"); @@ -1014,12 +986,12 @@ void AutoUpdaterDialog::cleanupAfterUpdate() #else -bool AutoUpdaterDialog::processUpdate(const std::vector& update_data) +bool AutoUpdaterWindow::processUpdate(const std::vector& update_data) { return false; } -void AutoUpdaterDialog::cleanupAfterUpdate() +void AutoUpdaterWindow::cleanupAfterUpdate() { } diff --git a/src/duckstation-qt/autoupdaterdialog.h b/src/duckstation-qt/autoupdaterwindow.h similarity index 88% rename from src/duckstation-qt/autoupdaterdialog.h rename to src/duckstation-qt/autoupdaterwindow.h index bb72891ff..bb8df14d7 100644 --- a/src/duckstation-qt/autoupdaterdialog.h +++ b/src/duckstation-qt/autoupdaterwindow.h @@ -5,7 +5,7 @@ #include "common/types.h" -#include "ui_autoupdaterdialog.h" +#include "ui_autoupdaterwindow.h" #include #include @@ -21,13 +21,13 @@ class HTTPDownloader; class EmuThread; -class AutoUpdaterDialog final : public QDialog +class AutoUpdaterWindow final : public QWidget { Q_OBJECT public: - explicit AutoUpdaterDialog(QWidget* parent = nullptr); - ~AutoUpdaterDialog(); + explicit AutoUpdaterWindow(QWidget* parent = nullptr); + ~AutoUpdaterWindow(); static bool isSupported(); static QStringList getTagList(); @@ -45,12 +45,14 @@ public Q_SLOTS: private Q_SLOTS: void httpPollTimerPoll(); - void lockAndExec(); void downloadUpdateClicked(); void skipThisUpdateClicked(); void remindMeLaterClicked(); +protected: + void closeEvent(QCloseEvent* event) override; + private: void reportError(const std::string_view msg); @@ -73,7 +75,7 @@ private: bool extractUpdater(const std::string& zip_path, const std::string& destination_path, Error* error); #endif - Ui::AutoUpdaterDialog m_ui; + Ui::AutoUpdaterWindow m_ui; std::unique_ptr m_http; QTimer* m_http_poll_timer = nullptr; diff --git a/src/duckstation-qt/autoupdaterdialog.ui b/src/duckstation-qt/autoupdaterwindow.ui similarity index 92% rename from src/duckstation-qt/autoupdaterdialog.ui rename to src/duckstation-qt/autoupdaterwindow.ui index f6d9a6d98..15c80792a 100644 --- a/src/duckstation-qt/autoupdaterdialog.ui +++ b/src/duckstation-qt/autoupdaterwindow.ui @@ -1,10 +1,7 @@ - AutoUpdaterDialog - - - Qt::ApplicationModal - + AutoUpdaterWindow + 0 @@ -16,9 +13,6 @@ Automatic Updater - - true - diff --git a/src/duckstation-qt/duckstation-qt.vcxproj b/src/duckstation-qt/duckstation-qt.vcxproj index 48d849c26..f356258f8 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj +++ b/src/duckstation-qt/duckstation-qt.vcxproj @@ -7,7 +7,7 @@ - + @@ -68,7 +68,7 @@ - + @@ -145,7 +145,7 @@ Document - + Document @@ -216,7 +216,7 @@ - + diff --git a/src/duckstation-qt/duckstation-qt.vcxproj.filters b/src/duckstation-qt/duckstation-qt.vcxproj.filters index ea984d9ee..fdbc3dc49 100644 --- a/src/duckstation-qt/duckstation-qt.vcxproj.filters +++ b/src/duckstation-qt/duckstation-qt.vcxproj.filters @@ -18,7 +18,7 @@ - + @@ -56,7 +56,7 @@ moc - + moc @@ -211,7 +211,7 @@ - + @@ -248,7 +248,7 @@ - + diff --git a/src/duckstation-qt/interfacesettingswidget.cpp b/src/duckstation-qt/interfacesettingswidget.cpp index e7c13b9cd..5d0809dbd 100644 --- a/src/duckstation-qt/interfacesettingswidget.cpp +++ b/src/duckstation-qt/interfacesettingswidget.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: CC-BY-NC-ND-4.0 #include "interfacesettingswidget.h" -#include "autoupdaterdialog.h" +#include "autoupdaterwindow.h" #include "mainwindow.h" #include "qtutils.h" #include "scmversion/scmversion.h" @@ -135,12 +135,12 @@ InterfaceSettingsWidget::InterfaceSettingsWidget(SettingsWindow* dialog, QWidget if (!m_dialog->isPerGameSettings()) { - if (AutoUpdaterDialog::isSupported()) + if (AutoUpdaterWindow::isSupported()) { SettingWidgetBinder::BindWidgetToBoolSetting(sif, m_ui.autoUpdateEnabled, "AutoUpdater", "CheckAtStartup", true); - m_ui.autoUpdateTag->addItems(AutoUpdaterDialog::getTagList()); + m_ui.autoUpdateTag->addItems(AutoUpdaterWindow::getTagList()); SettingWidgetBinder::BindWidgetToStringSetting(sif, m_ui.autoUpdateTag, "AutoUpdater", "UpdateTag", - AutoUpdaterDialog::getDefaultTag()); + AutoUpdaterWindow::getDefaultTag()); connect(m_ui.checkForUpdates, &QPushButton::clicked, this, []() { g_main_window->checkForUpdates(true); }); } else diff --git a/src/duckstation-qt/mainwindow.cpp b/src/duckstation-qt/mainwindow.cpp index 88fd8f6aa..5c7fb177d 100644 --- a/src/duckstation-qt/mainwindow.cpp +++ b/src/duckstation-qt/mainwindow.cpp @@ -4,7 +4,7 @@ #include "mainwindow.h" #include "aboutdialog.h" #include "achievementlogindialog.h" -#include "autoupdaterdialog.h" +#include "autoupdaterwindow.h" #include "coverdownloaddialog.h" #include "debuggerwindow.h" #include "displaywidget.h" @@ -815,6 +815,7 @@ void MainWindow::destroySubWindows() QtUtils::CloseAndDeleteWindow(m_memory_scanner_window); QtUtils::CloseAndDeleteWindow(m_debugger_window); QtUtils::CloseAndDeleteWindow(m_memory_card_editor_window); + QtUtils::CloseAndDeleteWindow(m_auto_updater_dialog); QtUtils::CloseAndDeleteWindow(m_controller_settings_window); QtUtils::CloseAndDeleteWindow(m_input_profile_editor_window); QtUtils::CloseAndDeleteWindow(m_settings_window); @@ -2964,7 +2965,7 @@ void MainWindow::onToolsOpenTextureDirectoryTriggered() void MainWindow::checkForUpdates(bool display_message) { - if (!AutoUpdaterDialog::isSupported()) + if (!AutoUpdaterWindow::isSupported()) { if (display_message) { @@ -2974,7 +2975,7 @@ void MainWindow::checkForUpdates(bool display_message) mbox.setTextFormat(Qt::RichText); QString message; - if (!AutoUpdaterDialog::isOfficialBuild()) + if (!AutoUpdaterWindow::isOfficialBuild()) { message = tr("

Sorry, you are trying to update a DuckStation version which is not an official GitHub release. To " @@ -2998,8 +2999,8 @@ void MainWindow::checkForUpdates(bool display_message) if (m_auto_updater_dialog) return; - m_auto_updater_dialog = new AutoUpdaterDialog(this); - connect(m_auto_updater_dialog, &AutoUpdaterDialog::updateCheckCompleted, this, &MainWindow::onUpdateCheckComplete); + m_auto_updater_dialog = new AutoUpdaterWindow(); + connect(m_auto_updater_dialog, &AutoUpdaterWindow::updateCheckCompleted, this, &MainWindow::onUpdateCheckComplete); m_auto_updater_dialog->queueUpdateCheck(display_message); } diff --git a/src/duckstation-qt/mainwindow.h b/src/duckstation-qt/mainwindow.h index e4180f25b..c300f4267 100644 --- a/src/duckstation-qt/mainwindow.h +++ b/src/duckstation-qt/mainwindow.h @@ -29,7 +29,7 @@ class QShortcut; class MainWindow; class GameListWidget; class EmuThread; -class AutoUpdaterDialog; +class AutoUpdaterWindow; class MemoryCardEditorWindow; class DebuggerWindow; class MemoryScannerWindow; @@ -100,6 +100,7 @@ public: ALWAYS_INLINE QLabel* getStatusResolutionWidget() const { return m_status_resolution_widget; } ALWAYS_INLINE QLabel* getStatusFPSWidget() const { return m_status_fps_widget; } ALWAYS_INLINE QLabel* getStatusVPSWidget() const { return m_status_vps_widget; } + ALWAYS_INLINE AutoUpdaterWindow* getAutoUpdaterDialog() const { return m_auto_updater_dialog; } /// Opens the editor for a specific input profile. void openInputProfileEditor(const std::string_view name); @@ -326,7 +327,7 @@ private: ControllerSettingsWindow* m_controller_settings_window = nullptr; ControllerSettingsWindow* m_input_profile_editor_window = nullptr; - AutoUpdaterDialog* m_auto_updater_dialog = nullptr; + AutoUpdaterWindow* m_auto_updater_dialog = nullptr; MemoryCardEditorWindow* m_memory_card_editor_window = nullptr; DebuggerWindow* m_debugger_window = nullptr; MemoryScannerWindow* m_memory_scanner_window = nullptr; diff --git a/src/duckstation-qt/qthost.cpp b/src/duckstation-qt/qthost.cpp index 20a13ea42..193043876 100644 --- a/src/duckstation-qt/qthost.cpp +++ b/src/duckstation-qt/qthost.cpp @@ -2,7 +2,7 @@ // SPDX-License-Identifier: CC-BY-NC-ND-4.0 #include "qthost.h" -#include "autoupdaterdialog.h" +#include "autoupdaterwindow.h" #include "displaywidget.h" #include "logwindow.h" #include "mainwindow.h" @@ -2808,7 +2808,7 @@ bool QtHost::ParseCommandLineParametersAndInitializeConfig(QApplication& app, } else if (CHECK_ARG("-updatecleanup")) { - s_cleanup_after_update = AutoUpdaterDialog::isSupported(); + s_cleanup_after_update = AutoUpdaterWindow::isSupported(); continue; } else if (CHECK_ARG("--")) @@ -2929,13 +2929,13 @@ int main(int argc, char* argv[]) // Remove any previous-version remanants. if (s_cleanup_after_update) - AutoUpdaterDialog::cleanupAfterUpdate(); + AutoUpdaterWindow::cleanupAfterUpdate(); // Set theme before creating any windows. QtHost::UpdateApplicationTheme(); // Build warning. - AutoUpdaterDialog::warnAboutUnofficialBuild(); + AutoUpdaterWindow::warnAboutUnofficialBuild(); // Start logging early. LogWindow::updateSettings();