1
0
Fork 0

GUI: resolved issue #262 (patching toggle now also toggles the bytes)

This commit is contained in:
Mr. eXoDia 2015-04-02 17:50:31 +02:00
parent b6fd21f752
commit d64e9a3432
1 changed files with 19 additions and 1 deletions

View File

@ -180,7 +180,11 @@ void PatchDialog::groupToggle()
continue;
ui->listPatches->item(i)->setCheckState(checkState);
curPatchList[i].second.checked = enabled;
//change the byte to reflect the change for the user (cypherpunk reported this)
unsigned char writebyte = curPatchList[i].second.checked ? curPatchList[i].first.newbyte : curPatchList[i].first.oldbyte;
DbgMemWrite(curPatchList[i].first.addr, &writebyte, sizeof(writebyte));
}
GuiUpdateAllViews();
mIsWorking = false;
int_t groupStart = getGroupAddress(curPatchList, group);
if(!groupStart)
@ -280,6 +284,9 @@ void PatchDialog::on_listPatches_itemChanged(QListWidgetItem* item) //checkbox c
if(patch.second.checked == checked) //check state did not change
return;
patch.second.checked = checked;
//change the byte to reflect the change for the user (cypherpunk reported this)
unsigned char writebyte = patch.second.checked ? patch.first.newbyte : patch.first.oldbyte;
DbgMemWrite(patch.first.addr, &writebyte, sizeof(writebyte));
//check state changed
if((QApplication::keyboardModifiers() & Qt::ControlModifier) != Qt::ControlModifier)
{
@ -288,11 +295,16 @@ void PatchDialog::on_listPatches_itemChanged(QListWidgetItem* item) //checkbox c
for(int i = 0; i < curPatchList.size(); i++)
if(curPatchList.at(i).second.group == patch.second.group)
{
curPatchList[i].second.checked = checked;
//change the patch state
curPatchList[i].second.checked = checked;
ui->listPatches->item(i)->setCheckState(item->checkState());
//change the byte to reflect the change for the user (cypherpunk reported this)
unsigned char writebyte = curPatchList[i].second.checked ? curPatchList[i].first.newbyte : curPatchList[i].first.oldbyte;
DbgMemWrite(curPatchList[i].first.addr, &writebyte, sizeof(writebyte));
}
mIsWorking = false;
}
GuiUpdateAllViews();
int group = mGroupSelector->group();
QString color = isGroupEnabled(curPatchList, group) ? "#00DD00" : "red";
QString addrText = QString("%1").arg(getGroupAddress(curPatchList, group), sizeof(int_t) * 2, 16, QChar('0')).toUpper();
@ -316,7 +328,10 @@ void PatchDialog::on_btnSelectAll_clicked()
{
ui->listPatches->item(i)->setCheckState(Qt::Checked);
curPatchList[i].second.checked = true;
//change the byte to reflect the change for the user (cypherpunk reported this)
DbgMemWrite(curPatchList[i].first.addr, &curPatchList[i].first.newbyte, sizeof(unsigned char));
}
GuiUpdateAllViews();
mIsWorking = false;
}
@ -334,7 +349,10 @@ void PatchDialog::on_btnDeselectAll_clicked()
{
ui->listPatches->item(i)->setCheckState(Qt::Unchecked);
curPatchList[i].second.checked = false;
//change the byte to reflect the change for the user (cypherpunk reported this)
DbgMemWrite(curPatchList[i].first.addr, &curPatchList[i].first.oldbyte, sizeof(unsigned char));
}
GuiUpdateAllViews();
mIsWorking = false;
}