Qt/ARCodeWidget: Use CheatCodeEditor

This commit is contained in:
spycrab 2018-01-24 13:35:44 +01:00
parent a0f787aa1b
commit d9d75c27f0
2 changed files with 13 additions and 8 deletions

View file

@ -14,7 +14,7 @@
#include "Common/IniFile.h" #include "Common/IniFile.h"
#include "Core/ActionReplay.h" #include "Core/ActionReplay.h"
#include "Core/ConfigManager.h" #include "Core/ConfigManager.h"
#include "DolphinQt2/Config/ARCodeEditor.h" #include "DolphinQt2/Config/CheatCodeEditor.h"
#include "DolphinQt2/Config/CheatWarningWidget.h" #include "DolphinQt2/Config/CheatWarningWidget.h"
#include "DolphinQt2/GameList/GameFile.h" #include "DolphinQt2/GameList/GameFile.h"
@ -122,15 +122,19 @@ void ARCodeWidget::SaveCodes()
void ARCodeWidget::OnCodeAddPressed() void ARCodeWidget::OnCodeAddPressed()
{ {
ActionReplay::ARCode ar; 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(); UpdateList();
SaveCodes(); SaveCodes();
}
} }
void ARCodeWidget::OnCodeEditPressed() void ARCodeWidget::OnCodeEditPressed()
@ -148,8 +152,9 @@ void ARCodeWidget::OnCodeEditPressed()
ActionReplay::ARCode ar = current_ar; ActionReplay::ARCode ar = current_ar;
ARCodeEditor ed(user_defined ? current_ar : ar); CheatCodeEditor ed;
ed.SetARCode(user_defined ? &current_ar : &ar);
ed.exec(); ed.exec();
if (!user_defined) if (!user_defined)

View file

@ -11,7 +11,7 @@ class QTextEdit;
namespace ActionReplay namespace ActionReplay
{ {
class ARCode; struct ARCode;
} }
namespace Gecko namespace Gecko