parent
c3dae65658
commit
4eb0fb6b88
|
@ -92,6 +92,7 @@ void HistoryLineEdit::keyPressEvent(QKeyEvent* event)
|
|||
// NOTE: "Unlike textChanged(), this signal [textEdited()] is not emitted when
|
||||
// the text is changed programmatically, for example, by calling setText()."
|
||||
setText(newText);
|
||||
emit textEdited(newText);
|
||||
}
|
||||
|
||||
QLineEdit::keyPressEvent(event);
|
||||
|
|
|
@ -38,7 +38,7 @@ void CalculatorDialog::validateExpression(QString expression)
|
|||
void CalculatorDialog::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
mValidateThread->start(ui->txtExpression->text());
|
||||
mValidateThread->start();
|
||||
}
|
||||
|
||||
void CalculatorDialog::hideEvent(QHideEvent* event)
|
||||
|
|
|
@ -1885,6 +1885,7 @@ void DisassemblerGraphView::gotoExpressionSlot()
|
|||
return;
|
||||
if(!mGoto)
|
||||
mGoto = new GotoDialog(this);
|
||||
mGoto->setInitialExpression(ToPtrString(this->cur_instr));
|
||||
if(mGoto->exec() == QDialog::Accepted)
|
||||
{
|
||||
duint value = DbgValFromString(mGoto->expressionText.toUtf8().constData());
|
||||
|
|
|
@ -27,7 +27,7 @@ GotoDialog::GotoDialog(QWidget* parent, bool allowInvalidExpression, bool allowI
|
|||
completer = new QCompleter(this);
|
||||
completer->setModel(new SymbolAutoCompleteModel([this]
|
||||
{
|
||||
return ui->editExpression->text();
|
||||
return mCompletionText;
|
||||
}, completer));
|
||||
if(!Config()->getBool("Gui", "DisableAutoComplete"))
|
||||
ui->editExpression->setCompleter(completer);
|
||||
|
@ -39,6 +39,7 @@ GotoDialog::GotoDialog(QWidget* parent, bool allowInvalidExpression, bool allowI
|
|||
|
||||
connect(mValidateThread, SIGNAL(expressionChanged(bool, bool, dsint)), this, SLOT(expressionChanged(bool, bool, dsint)));
|
||||
connect(ui->editExpression, SIGNAL(textChanged(QString)), mValidateThread, SLOT(textChanged(QString)));
|
||||
connect(ui->editExpression, SIGNAL(textEdited(QString)), this, SLOT(textEditedSlot(QString)));
|
||||
connect(this, SIGNAL(finished(int)), this, SLOT(finishedSlot(int)));
|
||||
connect(Config(), SIGNAL(disableAutoCompleteUpdated()), this, SLOT(disableAutoCompleteUpdated()));
|
||||
|
||||
|
@ -78,7 +79,7 @@ void GotoDialog::validateExpression(QString expression)
|
|||
void GotoDialog::setInitialExpression(const QString & expression)
|
||||
{
|
||||
ui->editExpression->setText(expression);
|
||||
validateExpression(expression);
|
||||
emit ui->editExpression->textEdited(expression);
|
||||
}
|
||||
|
||||
void GotoDialog::expressionChanged(bool validExpression, bool validPointer, dsint value)
|
||||
|
@ -186,6 +187,11 @@ void GotoDialog::finishedSlot(int result)
|
|||
ui->editExpression->setFocus();
|
||||
}
|
||||
|
||||
void GotoDialog::textEditedSlot(QString text)
|
||||
{
|
||||
mCompletionText = text;
|
||||
}
|
||||
|
||||
void GotoDialog::disableAutoCompleteUpdated()
|
||||
{
|
||||
if(Config()->getBool("Gui", "DisableAutoComplete"))
|
||||
|
|
|
@ -36,6 +36,7 @@ private slots:
|
|||
void disableAutoCompleteUpdated();
|
||||
void on_buttonOk_clicked();
|
||||
void finishedSlot(int result);
|
||||
void textEditedSlot(QString text);
|
||||
|
||||
private:
|
||||
Ui::GotoDialog* ui;
|
||||
|
@ -43,6 +44,7 @@ private:
|
|||
QCompleter* completer;
|
||||
bool IsValidMemoryRange(duint addr);
|
||||
void setOkEnabled(bool enabled);
|
||||
QString mCompletionText;
|
||||
};
|
||||
|
||||
#endif // GOTODIALOG_H
|
||||
|
|
|
@ -635,6 +635,7 @@ void MemoryMapView::gotoExpressionSlot()
|
|||
if(!mGoto)
|
||||
mGoto = new GotoDialog(this);
|
||||
mGoto->setWindowTitle(tr("Enter the address to find..."));
|
||||
mGoto->setInitialExpression(ToPtrString(duint(getCellContent(getInitialSelection(), 0).toULongLong(nullptr, 16))));
|
||||
if(mGoto->exec() == QDialog::Accepted)
|
||||
{
|
||||
selectAddress(DbgValFromString(mGoto->expressionText.toUtf8().constData()));
|
||||
|
|
|
@ -47,7 +47,7 @@ WordEditDialog::~WordEditDialog()
|
|||
void WordEditDialog::showEvent(QShowEvent* event)
|
||||
{
|
||||
Q_UNUSED(event);
|
||||
mValidateThread->start(ui->expressionLineEdit->text());
|
||||
mValidateThread->start();
|
||||
}
|
||||
|
||||
void WordEditDialog::hideEvent(QHideEvent* event)
|
||||
|
|
|
@ -949,7 +949,7 @@ void TraceBrowser::gotoSlot()
|
|||
{
|
||||
if(mTraceFile == nullptr || mTraceFile->Progress() < 100)
|
||||
return;
|
||||
GotoDialog gotoDlg(this, false, true); // Problem: Cannot use when not debugging
|
||||
GotoDialog gotoDlg(this, false, true); // TODO: Cannot use when not debugging
|
||||
if(gotoDlg.exec() == QDialog::Accepted)
|
||||
{
|
||||
auto val = DbgValFromString(gotoDlg.expressionText.toUtf8().constData());
|
||||
|
|
|
@ -2,7 +2,10 @@
|
|||
#include "MiscUtil.h"
|
||||
#include "Configuration.h"
|
||||
|
||||
SymbolAutoCompleteModel::SymbolAutoCompleteModel(std::function<QString()> getTextProc, QObject* parent) : QAbstractItemModel(parent), mGetTextProc(getTextProc), isValidReg("[\\w_@][\\w\\d_]*")
|
||||
SymbolAutoCompleteModel::SymbolAutoCompleteModel(std::function<QString()> getTextProc, QObject* parent)
|
||||
: QAbstractItemModel(parent),
|
||||
mGetTextProc(getTextProc),
|
||||
isValidReg("[\\w_@][\\w\\d_]*")
|
||||
{
|
||||
lastAutocompleteCount = 0;
|
||||
disableAutoCompleteUpdated();
|
||||
|
|
|
@ -5,11 +5,10 @@ ValidateExpressionThread::ValidateExpressionThread(QObject* parent) : QThread(pa
|
|||
this->mOnExpressionChangedCallback = nullptr;
|
||||
}
|
||||
|
||||
void ValidateExpressionThread::start(QString initialValue)
|
||||
void ValidateExpressionThread::start()
|
||||
{
|
||||
mStopThread = false;
|
||||
QThread::start();
|
||||
textChanged(initialValue);
|
||||
}
|
||||
|
||||
void ValidateExpressionThread::stop()
|
||||
|
@ -43,7 +42,6 @@ void ValidateExpressionThread::additionalStateChanged()
|
|||
mExpressionMutex.lock();
|
||||
mExpressionChanged = true;
|
||||
mExpressionMutex.unlock();
|
||||
|
||||
}
|
||||
|
||||
void ValidateExpressionThread::setOnExpressionChangedCallback(EXPRESSIONCHANGEDCB callback)
|
||||
|
|
|
@ -13,7 +13,7 @@ class ValidateExpressionThread : public QThread
|
|||
Q_OBJECT
|
||||
public:
|
||||
ValidateExpressionThread(QObject* parent = 0);
|
||||
void start(QString initialValue = QString());
|
||||
void start();
|
||||
void stop();
|
||||
void emitExpressionChanged(bool validExpression, bool validPointer, dsint value);
|
||||
void emitInstructionChanged(dsint sizeDifference, QString error);
|
||||
|
|
Loading…
Reference in New Issue