Merge pull request #636 from fmahnke/cheat-fix
Fixes for updating the cheats list.
This commit is contained in:
commit
0942d160ca
src/drivers/Qt
|
@ -704,14 +704,10 @@ int GuiCheatsDialog_t::activeCheatListCB(const char *name, uint32 a, uint8 v, in
|
|||
|
||||
if (item == NULL)
|
||||
{
|
||||
item = new QTreeWidgetItem();
|
||||
|
||||
actvCheatList->addTopLevelItem(item);
|
||||
item = new QTreeWidgetItem(actvCheatList);
|
||||
}
|
||||
|
||||
//item->setFlags( Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsUserCheckable );
|
||||
item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsUserCheckable | Qt::ItemNeverHasChildren);
|
||||
|
||||
item->setCheckState(0, s ? Qt::Checked : Qt::Unchecked);
|
||||
|
||||
item->setText(0, tr(codeStr));
|
||||
|
@ -737,8 +733,6 @@ void GuiCheatsDialog_t::showActiveCheatList(bool redraw)
|
|||
|
||||
enaCheats->setChecked(!globalCheatDisabled);
|
||||
|
||||
actvCheatRedraw = redraw;
|
||||
|
||||
if (redraw)
|
||||
{
|
||||
actvCheatList->clear();
|
||||
|
@ -746,6 +740,8 @@ void GuiCheatsDialog_t::showActiveCheatList(bool redraw)
|
|||
actvCheatIdx = 0;
|
||||
|
||||
FCEUI_ListCheats(::activeCheatListCB, (void *)this);
|
||||
|
||||
actvCheatList->viewport()->update();
|
||||
}
|
||||
//----------------------------------------------------------------------------
|
||||
void GuiCheatsDialog_t::openCheatFile(void)
|
||||
|
|
|
@ -72,7 +72,6 @@ protected:
|
|||
|
||||
int fontCharWidth;
|
||||
int actvCheatIdx;
|
||||
bool actvCheatRedraw;
|
||||
bool pauseWhileActive;
|
||||
bool wasPausedByCheats;
|
||||
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "Qt/config.h"
|
||||
#include "Qt/keyscan.h"
|
||||
#include "Qt/fceuWrapper.h"
|
||||
#include "Qt/CheatsConf.h"
|
||||
#include "Qt/HexEditor.h"
|
||||
#include "Qt/GameGenie.h"
|
||||
|
||||
|
@ -278,6 +279,7 @@ void GameGenieDialog_t::addCheatClicked(void)
|
|||
|
||||
FCEU_WRAPPER_LOCK();
|
||||
FCEUI_AddCheat( name.c_str(), a, v, c, 1 );
|
||||
updateCheatDialog();
|
||||
FCEU_WRAPPER_UNLOCK();
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue