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 "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)

View File

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