diff --git a/Source/Core/DolphinQt2/GameList/GameFile.cpp b/Source/Core/DolphinQt2/GameList/GameFile.cpp index 159e134959..c072b07f44 100644 --- a/Source/Core/DolphinQt2/GameList/GameFile.cpp +++ b/Source/Core/DolphinQt2/GameList/GameFile.cpp @@ -327,7 +327,12 @@ bool GameFile::Install() { _assert_(m_platform == DiscIO::Platform::WII_WAD); - return WiiUtils::InstallWAD(m_path.toStdString()); + bool installed = WiiUtils::InstallWAD(m_path.toStdString()); + + if (installed) + Settings::Instance().NANDRefresh(); + + return installed; } bool GameFile::Uninstall() diff --git a/Source/Core/DolphinQt2/MainWindow.cpp b/Source/Core/DolphinQt2/MainWindow.cpp index 26f5fa9a82..59eff4da6d 100644 --- a/Source/Core/DolphinQt2/MainWindow.cpp +++ b/Source/Core/DolphinQt2/MainWindow.cpp @@ -17,6 +17,7 @@ #include "Core/Boot/Boot.h" #include "Core/BootManager.h" +#include "Core/CommonTitles.h" #include "Core/ConfigManager.h" #include "Core/Core.h" #include "Core/HW/GCKeyboard.h" @@ -187,6 +188,7 @@ void MainWindow::ConnectMenuBar() // Tools connect(m_menu_bar, &MenuBar::PerformOnlineUpdate, this, &MainWindow::PerformOnlineUpdate); + connect(m_menu_bar, &MenuBar::BootWiiSystemMenu, this, &MainWindow::BootWiiSystemMenu); // View connect(m_menu_bar, &MenuBar::ShowTable, m_game_list, &GameList::SetTableView); @@ -566,6 +568,12 @@ void MainWindow::PerformOnlineUpdate(const std::string& region) m_menu_bar->UpdateToolsMenu(false); } +void MainWindow::BootWiiSystemMenu() +{ + StartGame(QString::fromStdString( + Common::GetTitleContentPath(Titles::SYSTEM_MENU, Common::FROM_CONFIGURED_ROOT))); +} + bool MainWindow::eventFilter(QObject* object, QEvent* event) { if (event->type() == QEvent::Close && !Stop()) diff --git a/Source/Core/DolphinQt2/MainWindow.h b/Source/Core/DolphinQt2/MainWindow.h index 5effb0ac8b..120a3a13db 100644 --- a/Source/Core/DolphinQt2/MainWindow.h +++ b/Source/Core/DolphinQt2/MainWindow.h @@ -56,6 +56,7 @@ private slots: void StateSaveUndo(); void StateSaveOldest(); void SetStateSlot(int slot); + void BootWiiSystemMenu(); void PerformOnlineUpdate(const std::string& region); diff --git a/Source/Core/DolphinQt2/MenuBar.cpp b/Source/Core/DolphinQt2/MenuBar.cpp index 3a3a44a149..6dbbb89f4b 100644 --- a/Source/Core/DolphinQt2/MenuBar.cpp +++ b/Source/Core/DolphinQt2/MenuBar.cpp @@ -86,6 +86,12 @@ void MenuBar::AddToolsMenu() QMenu* tools_menu = addMenu(tr("Tools")); m_wad_install_action = tools_menu->addAction(tr("Install WAD..."), this, SLOT(InstallWAD())); + // Label will be set by a NANDRefresh later + m_boot_sysmenu = tools_menu->addAction(QStringLiteral(""), [this] { emit BootWiiSystemMenu(); }); + m_boot_sysmenu->setEnabled(false); + + connect(&Settings::Instance(), &Settings::NANDRefresh, [this] { UpdateToolsMenu(false); }); + m_perform_online_update_menu = tools_menu->addMenu(tr("Perform Online System Update")); m_perform_online_update_for_current_region = m_perform_online_update_menu->addAction( tr("Current Region"), [this] { emit PerformOnlineUpdate(""); }); @@ -266,12 +272,22 @@ void MenuBar::AddTableColumnsMenu(QMenu* view_menu) void MenuBar::UpdateToolsMenu(bool emulation_started) { - const bool enable_wii_tools = !emulation_started || !SConfig::GetInstance().bWii; - m_perform_online_update_menu->setEnabled(enable_wii_tools); - if (enable_wii_tools) + m_boot_sysmenu->setEnabled(!emulation_started); + m_perform_online_update_menu->setEnabled(!emulation_started); + + if (!emulation_started) { IOS::HLE::Kernel ios; const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU); + + const QString sysmenu_version = + tmd.IsValid() ? + QString::fromStdString(DiscIO::GetSysMenuVersionString(tmd.GetTitleVersion())) : + QStringLiteral(""); + m_boot_sysmenu->setText(tr("Load Wii System Menu %1").arg(sysmenu_version)); + + m_boot_sysmenu->setEnabled(tmd.IsValid()); + for (QAction* action : m_perform_online_update_menu->actions()) action->setEnabled(!tmd.IsValid()); m_perform_online_update_for_current_region->setEnabled(tmd.IsValid()); diff --git a/Source/Core/DolphinQt2/MenuBar.h b/Source/Core/DolphinQt2/MenuBar.h index 426c7748d6..848fad1e67 100644 --- a/Source/Core/DolphinQt2/MenuBar.h +++ b/Source/Core/DolphinQt2/MenuBar.h @@ -39,6 +39,7 @@ signals: void StateSaveUndo(); void StateSaveOldest(); void SetStateSlot(int slot); + void BootWiiSystemMenu(); void PerformOnlineUpdate(const std::string& region); @@ -95,6 +96,7 @@ private: QAction* m_fullscreen_action; QAction* m_frame_advance_action; QAction* m_screenshot_action; + QAction* m_boot_sysmenu; QMenu* m_state_load_menu; QMenu* m_state_save_menu; QMenu* m_state_slot_menu; diff --git a/Source/Core/DolphinQt2/Settings.h b/Source/Core/DolphinQt2/Settings.h index b9aeafcbbd..5adc95dd8f 100644 --- a/Source/Core/DolphinQt2/Settings.h +++ b/Source/Core/DolphinQt2/Settings.h @@ -60,6 +60,7 @@ signals: void PathRemoved(const QString&); void HideCursorChanged(); void VolumeChanged(int volume); + void NANDRefresh(); private: Settings();