summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLéo Lam <leo@innovatetechnologi.es>2017-07-04 18:45:37 +0200
committerLéo Lam <leo@innovatetechnologi.es>2017-08-10 23:47:18 +0800
commitea3b351d9237d8188928df1db1bb7ef5a42f72cd (patch)
tree4ad83b66b787ffdd88dc4b29e5ea139d0aaf0aaf
parent0e71c0760e1a95c495bb9ecc004eb9e50596abfe (diff)
Qt: Add menu item to perform system update from disc
-rw-r--r--Source/Core/DolphinQt2/GameList/GameList.cpp10
-rw-r--r--Source/Core/DolphinQt2/WiiUpdate.cpp6
-rw-r--r--Source/Core/DolphinQt2/WiiUpdate.h1
3 files changed, 17 insertions, 0 deletions
diff --git a/Source/Core/DolphinQt2/GameList/GameList.cpp b/Source/Core/DolphinQt2/GameList/GameList.cpp
index 8d09f63091..5232bdea1f 100644
--- a/Source/Core/DolphinQt2/GameList/GameList.cpp
+++ b/Source/Core/DolphinQt2/GameList/GameList.cpp
@@ -29,6 +29,7 @@
#include "DolphinQt2/GameList/ListProxyModel.h"
#include "DolphinQt2/QtUtils/DoubleClickEventFilter.h"
#include "DolphinQt2/Settings.h"
+#include "DolphinQt2/WiiUpdate.h"
static bool CompressCB(const std::string&, float, void*);
@@ -164,6 +165,15 @@ void GameList::ShowContextMenu(const QPoint&)
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)
{
QAction* wad_install_action = new QAction(tr("Install to the NAND"), menu);
diff --git a/Source/Core/DolphinQt2/WiiUpdate.cpp b/Source/Core/DolphinQt2/WiiUpdate.cpp
index b7e840f21e..cd9b0275e0 100644
--- a/Source/Core/DolphinQt2/WiiUpdate.cpp
+++ b/Source/Core/DolphinQt2/WiiUpdate.cpp
@@ -139,4 +139,10 @@ void PerformOnlineUpdate(const std::string& region, QWidget* parent)
const WiiUtils::UpdateResult result = ShowProgress(parent, WiiUtils::DoOnlineUpdate, region);
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
diff --git a/Source/Core/DolphinQt2/WiiUpdate.h b/Source/Core/DolphinQt2/WiiUpdate.h
index 19b7b8f463..cfeb6a7402 100644
--- a/Source/Core/DolphinQt2/WiiUpdate.h
+++ b/Source/Core/DolphinQt2/WiiUpdate.h
@@ -11,4 +11,5 @@ class QWidget;
namespace WiiUpdate
{
void PerformOnlineUpdate(const std::string& region, QWidget* parent = nullptr);
+void PerformDiscUpdate(const std::string& file_path, QWidget* parent = nullptr);
} // namespace WiiUpdate