1
0
Fork 0

Disable data copy in find pattern dialog

This commit is contained in:
torusrxxx 2018-05-02 11:54:17 +08:00 committed by Duncan Ogilvie
parent dba3178428
commit 9741c06798
7 changed files with 22 additions and 14 deletions

View File

@ -1204,6 +1204,7 @@ void CPUDisassembly::findPatternSlot()
{
HexEditDialog hexEdit(this);
hexEdit.showEntireBlock(true);
hexEdit.isDataCopiable(false);
hexEdit.mHexEdit->setOverwriteMode(false);
hexEdit.setWindowTitle(tr("Find Pattern..."));
if(hexEdit.exec() != QDialog::Accepted)

View File

@ -1620,6 +1620,7 @@ void CPUDump::findPattern()
{
HexEditDialog hexEdit(this);
hexEdit.showEntireBlock(true);
hexEdit.isDataCopiable(false);
hexEdit.mHexEdit->setOverwriteMode(false);
hexEdit.setWindowTitle(tr("Find Pattern..."));
if(hexEdit.exec() != QDialog::Accepted)

View File

@ -939,6 +939,7 @@ void CPUStack::findPattern()
{
HexEditDialog hexEdit(this);
hexEdit.showEntireBlock(true);
hexEdit.isDataCopiable(false);
hexEdit.mHexEdit->setOverwriteMode(false);
hexEdit.setWindowTitle(tr("Find Pattern..."));
if(hexEdit.exec() != QDialog::Accepted)

View File

@ -30,6 +30,7 @@ HexEditDialog::HexEditDialog(QWidget* parent) : QDialog(parent), ui(new Ui::HexE
mHexEdit->widget()->setFocus();
connect(mHexEdit, SIGNAL(dataChanged()), this, SLOT(dataChangedSlot()));
connect(mHexEdit, SIGNAL(dataEdited()), this, SLOT(dataEditedSlot()));
connect(ui->btnCodePage2, SIGNAL(clicked()), this, SLOT(on_btnCodepage_clicked()));
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(updateStyle()));
connect(Bridge::getBridge(), SIGNAL(repaintGui()), this, SLOT(updateStyle()));
@ -47,18 +48,18 @@ HexEditDialog::~HexEditDialog()
void HexEditDialog::showEntireBlock(bool show)
{
if(show)
ui->chkEntireBlock->show();
else
ui->chkEntireBlock->hide();
ui->chkEntireBlock->setVisible(show);
}
void HexEditDialog::showKeepSize(bool show)
{
if(show)
ui->chkKeepSize->show();
else
ui->chkKeepSize->hide();
ui->chkKeepSize->setVisible(show);
}
void HexEditDialog::isDataCopiable(bool copyDataEnabled)
{
if(copyDataEnabled == false)
ui->tabModeSelect->removeTab(2); //This can't be undone!
}
void HexEditDialog::updateCodepage()
@ -70,6 +71,7 @@ void HexEditDialog::updateCodepage()
ui->lineEditCodepage->setEncoding(QTextCodec::codecForName(allCodecs.at(lastCodepage)));
ui->lineEditCodepage->setData(mHexEdit->data());
ui->labelLastCodepage->setText(QString(allCodecs.at(lastCodepage).constData()));
ui->labelLastCodepage2->setText(ui->labelLastCodepage->text());
}
void HexEditDialog::updateCodepage(const QByteArray & name)
@ -77,6 +79,7 @@ void HexEditDialog::updateCodepage(const QByteArray & name)
ui->lineEditCodepage->setEncoding(QTextCodec::codecForName(name));
ui->lineEditCodepage->setData(mHexEdit->data());
ui->labelLastCodepage->setText(QString(name));
ui->labelLastCodepage2->setText(ui->labelLastCodepage->text());
}
bool HexEditDialog::entireBlock()

View File

@ -19,6 +19,7 @@ public:
void showEntireBlock(bool show);
void showKeepSize(bool show);
void isDataCopiable(bool copyDataEnabled);
void updateCodepage();
bool entireBlock();

View File

@ -67,11 +67,11 @@
</layout>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="tabWidget">
<widget class="QTabWidget" name="tabModeSelect">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="tabHexEdit">
<property name="sizePolicy">
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
<horstretch>0</horstretch>
@ -317,7 +317,7 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="tabStringEditor">
<attribute name="title">
<string>String</string>
</attribute>
@ -347,12 +347,12 @@
</widget>
</item>
<item>
<widget class="QLabel" name="labelLastCodePage2">
<widget class="QLabel" name="labelLastCodepage2">
<property name="text">
<string>Last &amp;Codepage:</string>
</property>
<property name="buddy">
<cstring>plainEditText_2</cstring>
<cstring>plainTextEdit_2</cstring>
</property>
</widget>
</item>
@ -384,7 +384,7 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab_3">
<widget class="QWidget" name="tabCopyData">
<attribute name="title">
<string>Copy data</string>
</attribute>

View File

@ -578,6 +578,7 @@ void MemoryMapView::findPatternSlot()
{
HexEditDialog hexEdit(this);
hexEdit.showEntireBlock(true);
hexEdit.isDataCopiable(false);
hexEdit.mHexEdit->setOverwriteMode(false);
hexEdit.setWindowTitle(tr("Find Pattern..."));
if(hexEdit.exec() != QDialog::Accepted)