summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorspycrab <spycrab@users.noreply.github.com>2018-01-24 13:35:44 +0100
committerspycrab <spycrab@users.noreply.github.com>2018-01-24 13:42:00 +0100
commitd9d75c27f0892d25de03a10fa0314fa2e87b9f1d (patch)
treefe0dd3af948d042d6ce9c5daef1320846da83a1c /Source/Core
parenta0f787aa1b72f52dd436f72c339ac8be81557c4a (diff)
Qt/ARCodeWidget: Use CheatCodeEditor
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/DolphinQt2/Config/ARCodeWidget.cpp19
-rw-r--r--Source/Core/DolphinQt2/Config/CheatCodeEditor.h2
2 files changed, 13 insertions, 8 deletions
diff --git a/Source/Core/DolphinQt2/Config/ARCodeWidget.cpp b/Source/Core/DolphinQt2/Config/ARCodeWidget.cpp
index e47cee4dc5..372ef5caf5 100644
--- a/Source/Core/DolphinQt2/Config/ARCodeWidget.cpp
+++ b/Source/Core/DolphinQt2/Config/ARCodeWidget.cpp
@@ -14,7 +14,7 @@
#include "Common/IniFile.h"
#include "Core/ActionReplay.h"
#include "Core/ConfigManager.h"
-#include "DolphinQt2/Config/ARCodeEditor.h"
+#include "DolphinQt2/Config/CheatCodeEditor.h"
#include "DolphinQt2/Config/CheatWarningWidget.h"
#include "DolphinQt2/GameList/GameFile.h"
@@ -122,15 +122,19 @@ void ARCodeWidget::SaveCodes()
void ARCodeWidget::OnCodeAddPressed()
{
ActionReplay::ARCode ar;
+ ar.active = true;
- ARCodeEditor ed(ar);
+ CheatCodeEditor ed;
- ed.exec();
+ ed.SetARCode(&ar);
- m_ar_codes.push_back(std::move(ar));
+ if (ed.exec())
+ {
+ m_ar_codes.push_back(std::move(ar));
- UpdateList();
- SaveCodes();
+ UpdateList();
+ SaveCodes();
+ }
}
void ARCodeWidget::OnCodeEditPressed()
@@ -148,8 +152,9 @@ void ARCodeWidget::OnCodeEditPressed()
ActionReplay::ARCode ar = current_ar;
- ARCodeEditor ed(user_defined ? current_ar : ar);
+ CheatCodeEditor ed;
+ ed.SetARCode(user_defined ? &current_ar : &ar);
ed.exec();
if (!user_defined)
diff --git a/Source/Core/DolphinQt2/Config/CheatCodeEditor.h b/Source/Core/DolphinQt2/Config/CheatCodeEditor.h
index e3057e10cc..beb0862590 100644
--- a/Source/Core/DolphinQt2/Config/CheatCodeEditor.h
+++ b/Source/Core/DolphinQt2/Config/CheatCodeEditor.h
@@ -11,7 +11,7 @@ class QTextEdit;
namespace ActionReplay
{
-class ARCode;
+struct ARCode;
}
namespace Gecko