2017-03-29 10:18:37 +00:00
|
|
|
#include "symbolswidget.h"
|
|
|
|
#include "ui_symbolswidget.h"
|
|
|
|
|
|
|
|
#include "mainwindow.h"
|
|
|
|
|
|
|
|
SymbolsWidget::SymbolsWidget(MainWindow *main, QWidget *parent) :
|
|
|
|
QDockWidget(parent),
|
|
|
|
ui(new Ui::SymbolsWidget)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
|
|
|
this->main = main;
|
|
|
|
this->symbolsTreeWidget = ui->symbolsTreeWidget;
|
|
|
|
}
|
|
|
|
|
|
|
|
SymbolsWidget::~SymbolsWidget()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2017-04-09 19:55:06 +00:00
|
|
|
void SymbolsWidget::fillSymbols()
|
|
|
|
{
|
2017-03-29 10:18:37 +00:00
|
|
|
this->symbolsTreeWidget->clear();
|
2017-04-09 19:55:06 +00:00
|
|
|
for (auto i : this->main->core->getList("bin", "symbols"))
|
|
|
|
{
|
|
|
|
QStringList pieces = i.split(",");
|
|
|
|
if (pieces.length() == 3)
|
2017-03-29 10:18:37 +00:00
|
|
|
this->main->appendRow(this->symbolsTreeWidget, pieces[0], pieces[1], pieces[2]);
|
|
|
|
}
|
|
|
|
this->main->adjustColumns(this->symbolsTreeWidget);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SymbolsWidget::on_symbolsTreeWidget_itemDoubleClicked(QTreeWidgetItem *item, int column)
|
|
|
|
{
|
2017-04-09 17:09:35 +00:00
|
|
|
QNOTUSED(column);
|
|
|
|
|
2017-03-29 10:18:37 +00:00
|
|
|
// Get offset and name of item double clicked
|
|
|
|
// TODO: use this info to change disasm contents
|
|
|
|
QString offset = item->text(1);
|
|
|
|
QString name = item->text(3);
|
|
|
|
//qDebug() << "Item Text: " << name;
|
|
|
|
this->main->seek(offset, name);
|
|
|
|
//ui->memDock->setWindowTitle(name);
|
|
|
|
}
|