Pre-select arch and bytes on hexdump preview

This commit is contained in:
Hugo Teso 2017-03-30 11:27:43 +02:00
parent 00354483a1
commit 48897c15ba
3 changed files with 19 additions and 0 deletions

View File

@ -202,6 +202,7 @@ void OptionsDialog::anal_finished()
this->w->updateFrames(); this->w->updateFrames();
this->w->setFilename(this->filename); this->w->setFilename(this->filename);
this->w->get_refs( this->w->core->cmd("?v entry0") ); this->w->get_refs( this->w->core->cmd("?v entry0") );
this->w->memoryDock->selectHexPreview();
// Restore project notes // Restore project notes
QString notes = this->core->cmd("Pn"); QString notes = this->core->cmd("Pn");

View File

@ -1671,3 +1671,19 @@ void MemoryWidget::on_opcodeDescButton_clicked()
ui->opcodeDescButton->setArrowType(Qt::DownArrow); ui->opcodeDescButton->setArrowType(Qt::DownArrow);
} }
} }
void MemoryWidget::selectHexPreview() {
// Pre-select arch and bits in the hexdump sidebar
QString arch = this->main->core->cmd("e asm.arch").trimmed();
QString bits = this->main->core->cmd("e asm.bits").trimmed();
//int arch_index = ui->hexArchComboBox_2->findText(arch);
if (ui->hexArchComboBox_2->findText(arch) != -1) {
ui->hexArchComboBox_2->setCurrentIndex(ui->hexArchComboBox_2->findText(arch));
}
//int bits_index = ui->hexBitsComboBox_2->findText(bits);
if (ui->hexBitsComboBox_2->findText(bits) != -1) {
ui->hexBitsComboBox_2->setCurrentIndex(ui->hexBitsComboBox_2->findText(bits));
}
}

View File

@ -80,6 +80,8 @@ public slots:
void highlightDisasms(); void highlightDisasms();
void selectHexPreview();
protected: protected:
bool eventFilter(QObject *obj, QEvent *event); bool eventFilter(QObject *obj, QEvent *event);