Qt: Implement sysmenu booting

This commit is contained in:
spycrab 2017-07-06 11:01:32 +02:00
parent 3a27d60937
commit 2cf0228ada
5 changed files with 19 additions and 6 deletions

View File

@ -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()

View File

@ -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())

View File

@ -56,6 +56,7 @@ private slots:
void StateSaveUndo();
void StateSaveOldest();
void SetStateSlot(int slot);
void BootWiiSystemMenu();
void PerformOnlineUpdate(const std::string& region);

View File

@ -272,12 +272,10 @@ void MenuBar::AddTableColumnsMenu(QMenu* view_menu)
void MenuBar::UpdateToolsMenu(bool emulation_started)
{
const bool enable_wii_tools = !emulation_started || !SConfig::GetInstance().bWii;
m_boot_sysmenu->setEnabled(!emulation_started);
m_perform_online_update_menu->setEnabled(enable_wii_tools);
m_perform_online_update_menu->setEnabled(!emulation_started);
if (enable_wii_tools)
if (!emulation_started)
{
IOS::HLE::Kernel ios;
const auto tmd = ios.GetES()->FindInstalledTMD(Titles::SYSTEM_MENU);
@ -288,7 +286,7 @@ void MenuBar::UpdateToolsMenu(bool emulation_started)
QStringLiteral("");
m_boot_sysmenu->setText(tr("Load Wii System Menu %1").arg(sysmenu_version));
m_boot_sysmenu->setEnabled(!emulation_started && tmd.IsValid());
m_boot_sysmenu->setEnabled(tmd.IsValid());
for (QAction* action : m_perform_online_update_menu->actions())
action->setEnabled(!tmd.IsValid());

View File

@ -60,6 +60,7 @@ signals:
void PathRemoved(const QString&);
void HideCursorChanged();
void VolumeChanged(int volume);
void NANDRefresh();
private:
Settings();