mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Qt: Add menu item to perform system update from disc
This commit is contained in:
@ -29,6 +29,7 @@
|
|||||||
#include "DolphinQt2/GameList/ListProxyModel.h"
|
#include "DolphinQt2/GameList/ListProxyModel.h"
|
||||||
#include "DolphinQt2/QtUtils/DoubleClickEventFilter.h"
|
#include "DolphinQt2/QtUtils/DoubleClickEventFilter.h"
|
||||||
#include "DolphinQt2/Settings.h"
|
#include "DolphinQt2/Settings.h"
|
||||||
|
#include "DolphinQt2/WiiUpdate.h"
|
||||||
|
|
||||||
static bool CompressCB(const std::string&, float, void*);
|
static bool CompressCB(const std::string&, float, void*);
|
||||||
|
|
||||||
@ -164,6 +165,15 @@ void GameList::ShowContextMenu(const QPoint&)
|
|||||||
|
|
||||||
menu->addSeparator();
|
menu->addSeparator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (platform == DiscIO::Platform::WII_DISC)
|
||||||
|
{
|
||||||
|
menu->addAction(tr("Perform System Update"), [this] {
|
||||||
|
WiiUpdate::PerformDiscUpdate(GetSelectedGame().toStdString(), this);
|
||||||
|
});
|
||||||
|
menu->setEnabled(!Core::IsRunning() || !SConfig::GetInstance().bWii);
|
||||||
|
}
|
||||||
|
|
||||||
if (platform == DiscIO::Platform::WII_WAD)
|
if (platform == DiscIO::Platform::WII_WAD)
|
||||||
{
|
{
|
||||||
QAction* wad_install_action = new QAction(tr("Install to the NAND"), menu);
|
QAction* wad_install_action = new QAction(tr("Install to the NAND"), menu);
|
||||||
|
@ -139,4 +139,10 @@ void PerformOnlineUpdate(const std::string& region, QWidget* parent)
|
|||||||
const WiiUtils::UpdateResult result = ShowProgress(parent, WiiUtils::DoOnlineUpdate, region);
|
const WiiUtils::UpdateResult result = ShowProgress(parent, WiiUtils::DoOnlineUpdate, region);
|
||||||
ShowResult(parent, result);
|
ShowResult(parent, result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PerformDiscUpdate(const std::string& file_path, QWidget* parent)
|
||||||
|
{
|
||||||
|
const WiiUtils::UpdateResult result = ShowProgress(parent, WiiUtils::DoDiscUpdate, file_path);
|
||||||
|
ShowResult(parent, result);
|
||||||
|
}
|
||||||
} // namespace WiiUpdate
|
} // namespace WiiUpdate
|
||||||
|
@ -11,4 +11,5 @@ class QWidget;
|
|||||||
namespace WiiUpdate
|
namespace WiiUpdate
|
||||||
{
|
{
|
||||||
void PerformOnlineUpdate(const std::string& region, QWidget* parent = nullptr);
|
void PerformOnlineUpdate(const std::string& region, QWidget* parent = nullptr);
|
||||||
|
void PerformDiscUpdate(const std::string& file_path, QWidget* parent = nullptr);
|
||||||
} // namespace WiiUpdate
|
} // namespace WiiUpdate
|
||||||
|
Reference in New Issue
Block a user