From 3e8b9682bf7eaf50a7e932485d388c382e943e0e Mon Sep 17 00:00:00 2001 From: Duncan Ogilvie Date: Sun, 19 Apr 2020 13:10:20 +0200 Subject: [PATCH] GUI: save entire block preference --- src/gui/Src/Gui/HexEditDialog.cpp | 3 ++- src/gui/Src/Gui/HexEditDialog.h | 2 +- src/gui/Src/Gui/MemoryMapView.cpp | 9 +++++++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/gui/Src/Gui/HexEditDialog.cpp b/src/gui/Src/Gui/HexEditDialog.cpp index 9c28796f..310cbee0 100644 --- a/src/gui/Src/Gui/HexEditDialog.cpp +++ b/src/gui/Src/Gui/HexEditDialog.cpp @@ -97,9 +97,10 @@ HexEditDialog::~HexEditDialog() delete ui; } -void HexEditDialog::showEntireBlock(bool show) +void HexEditDialog::showEntireBlock(bool show, bool checked) { ui->chkEntireBlock->setVisible(show); + ui->chkEntireBlock->setChecked(checked); } void HexEditDialog::showKeepSize(bool show) diff --git a/src/gui/Src/Gui/HexEditDialog.h b/src/gui/Src/Gui/HexEditDialog.h index c7784319..d083ba71 100644 --- a/src/gui/Src/Gui/HexEditDialog.h +++ b/src/gui/Src/Gui/HexEditDialog.h @@ -17,7 +17,7 @@ public: explicit HexEditDialog(QWidget* parent = 0); ~HexEditDialog(); - void showEntireBlock(bool show); + void showEntireBlock(bool show, bool checked = false); void showKeepSize(bool show); void isDataCopiable(bool copyDataEnabled); void updateCodepage(); diff --git a/src/gui/Src/Gui/MemoryMapView.cpp b/src/gui/Src/Gui/MemoryMapView.cpp index 07f5b169..90bef0ce 100644 --- a/src/gui/Src/Gui/MemoryMapView.cpp +++ b/src/gui/Src/Gui/MemoryMapView.cpp @@ -543,14 +543,19 @@ void MemoryMapView::memoryAllocateSlot() void MemoryMapView::findPatternSlot() { HexEditDialog hexEdit(this); - hexEdit.showEntireBlock(true); + duint entireBlockEnabled = 0; + BridgeSettingGetUint("Gui", "MemoryMapEntireBlock", &entireBlockEnabled); + hexEdit.showEntireBlock(true, entireBlockEnabled); + hexEdit.showKeepSize(false); hexEdit.isDataCopiable(false); hexEdit.mHexEdit->setOverwriteMode(false); hexEdit.setWindowTitle(tr("Find Pattern...")); if(hexEdit.exec() != QDialog::Accepted) return; duint addr = getCellContent(getInitialSelection(), 0).toULongLong(0, 16); - if(hexEdit.entireBlock()) + entireBlockEnabled = hexEdit.entireBlock(); + BridgeSettingSetUint("Gui", "MemoryMapEntireBlock", entireBlockEnabled); + if(entireBlockEnabled) addr = 0; QString addrText = ToPtrString(addr); DbgCmdExec(QString("findmemall " + addrText + ", \"" + hexEdit.mHexEdit->pattern() + "\", &data&").toUtf8().constData());