Merge pull request #7827 from spycrab/issue_11588

MenuBar: Implement proper update-capabilities check
This commit is contained in:
spycrab 2019-02-26 20:49:30 +01:00 committed by GitHub
commit c1e947911d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 8 deletions

View File

@ -52,6 +52,7 @@
#include "DolphinQt/Settings.h" #include "DolphinQt/Settings.h"
#include "DolphinQt/Updater.h" #include "DolphinQt/Updater.h"
#include "UICommon/AutoUpdate.h"
#include "UICommon/GameFile.h" #include "UICommon/GameFile.h"
QPointer<MenuBar> MenuBar::s_menu_bar; QPointer<MenuBar> MenuBar::s_menu_bar;
@ -507,7 +508,6 @@ void MenuBar::AddOptionsMenu()
m_change_font = options_menu->addAction(tr("&Font..."), this, &MenuBar::ChangeDebugFont); m_change_font = options_menu->addAction(tr("&Font..."), this, &MenuBar::ChangeDebugFont);
} }
#ifdef _WIN32
void MenuBar::InstallUpdateManually() void MenuBar::InstallUpdateManually()
{ {
auto& track = SConfig::GetInstance().m_auto_update_track; auto& track = SConfig::GetInstance().m_auto_update_track;
@ -526,7 +526,6 @@ void MenuBar::InstallUpdateManually()
track = previous_value; track = previous_value;
} }
#endif
void MenuBar::AddHelpMenu() void MenuBar::AddHelpMenu()
{ {
@ -544,13 +543,17 @@ void MenuBar::AddHelpMenu()
QDesktopServices::openUrl(QUrl(QStringLiteral("https://github.com/dolphin-emu/dolphin"))); QDesktopServices::openUrl(QUrl(QStringLiteral("https://github.com/dolphin-emu/dolphin")));
}); });
#ifdef _WIN32 if (AutoUpdateChecker::SystemSupportsAutoUpdates())
{
help_menu->addSeparator(); help_menu->addSeparator();
help_menu->addAction(tr("&Check for Updates..."), this, &MenuBar::InstallUpdateManually); help_menu->addAction(tr("&Check for Updates..."), this, &MenuBar::InstallUpdateManually);
}
#ifndef __APPLE__
help_menu->addSeparator();
#endif #endif
help_menu->addSeparator();
help_menu->addAction(tr("&About"), this, &MenuBar::ShowAboutDialog); help_menu->addAction(tr("&About"), this, &MenuBar::ShowAboutDialog);
} }

View File

@ -42,9 +42,7 @@ public:
QMenu* GetListColumnsMenu() const { return m_cols_menu; } QMenu* GetListColumnsMenu() const { return m_cols_menu; }
#ifdef _WIN32
void InstallUpdateManually(); void InstallUpdateManually();
#endif
signals: signals:
// File // File