diff --git a/AppleSAWS.pro b/AppleSAWS.pro index 320ddd5..186ded8 100644 --- a/AppleSAWS.pro +++ b/AppleSAWS.pro @@ -57,7 +57,10 @@ SOURCES += \ src/ui/widgets/hexconverter.cpp \ src/ui/viewers/viewerbase.cpp \ src/ui/widgets/CharacterSetExplorer.cpp \ - src/ui/widgets/HiresScreenWidget.cpp + src/ui/widgets/HiresScreenWidget.cpp \ + src/ui/widgets/DisassemblerMetadataDialog.cpp \ + src/binaryfile/EntryPointModel.cpp \ + src/ui/widgets/LocationInfoDialog.cpp HEADERS += \ @@ -97,7 +100,10 @@ HEADERS += \ src/ui/viewers/viewerbase.h \ src/ui/viewers/fileviewerinterface.h \ src/ui/widgets/CharacterSetExplorer.h \ - src/ui/widgets/HiresScreenWidget.h + src/ui/widgets/HiresScreenWidget.h \ + src/ui/widgets/DisassemblerMetadataDialog.h \ + src/binaryfile/EntryPointModel.h \ + src/ui/widgets/LocationInfoDialog.h FORMS += \ src/ui/catalogwidget.ui \ @@ -110,4 +116,6 @@ FORMS += \ src/ui/widgets/hexconverter.ui \ src/ui/widgets/hrcgcontrolsinfo.ui \ src/ui/viewers/viewerbase.ui \ - src/ui/widgets/CharacterSetExplorer.ui + src/ui/widgets/CharacterSetExplorer.ui \ + src/ui/widgets/DisassemblerMetadataDialog.ui \ + src/ui/widgets/LocationInfoDialog.ui diff --git a/src/binaryfile/EntryPointModel.cpp b/src/binaryfile/EntryPointModel.cpp new file mode 100644 index 0000000..428b1b8 --- /dev/null +++ b/src/binaryfile/EntryPointModel.cpp @@ -0,0 +1,155 @@ +#include "EntryPointModel.h" +#include "util.h" + +#include + +EntryPointModel::EntryPointModel(QObject *parent) + : QAbstractTableModel(parent) +{ +} + +QVariant EntryPointModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + if (orientation == Qt::Horizontal) + { + if (role == Qt::DisplayRole) + { + if (section == 0) + return ""; + + } + } + else // Orientation == Qt::Vertical + { + if (role == Qt::DisplayRole) + { + return "0x"+uint16ToHex(m_entryPoints[section].address); + } + } + return QVariant(); +} + + +int EntryPointModel::rowCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + // if (parent.isValid()) + return m_entryPoints.count(); + // else + // return 0; +} + +int EntryPointModel::columnCount(const QModelIndex &parent) const +{ + Q_UNUSED(parent); + //if (parent.isValid()) + return 1; + // else + // return 0; +} + +QVariant EntryPointModel::data(const QModelIndex &index, int role) const +{ + if (role == Qt::DisplayRole) + { + EntryPoint ep = m_entryPoints[index.row()]; + if (index.column() == 0) + { + return ep.note; + } + + } + return QVariant(); +} + +bool EntryPointModel::setData(const QModelIndex &index, const QVariant &value, int role) +{ + + if (data(index, role) != value) { + if (index.column() == 0) + { + m_entryPoints[index.row()].note = value.toString(); + } + + emit dataChanged(index, index, QVector() << role); + return true; + } + return false; +} + +Qt::ItemFlags EntryPointModel::flags(const QModelIndex &index) const +{ + Q_UNUSED(index); + if (index.column() == 0) + return Qt::ItemIsEditable | QAbstractTableModel::flags(index); + else + return QAbstractTableModel::flags(index); +} + +bool EntryPointModel::insertRows(int row, int count, const QModelIndex &parent) +{ + beginInsertRows(parent, row, row + count - 1); + // FIXME: Implement me! + endInsertRows(); + return false; +} + +bool EntryPointModel::removeRows(int row, int count, const QModelIndex &parent) +{ + beginRemoveRows(parent, row, row + count - 1); + for (int idx = 0; idx < count; idx++) + { + m_entryPoints.removeAt(row); + } + endRemoveRows(); + return false; +} + +void EntryPointModel::doTestData() +{ + EntryPoint ep; + ep.address = 0x0010; + ep.note = "Test Entry Point 1"; + addEntryPoint(ep); + ep.address = 0x0020; + ep.note = "Test Entry Point 2"; + addEntryPoint(ep); + ep.address = 0x0030; + ep.note = "Test Entry Point 3"; + addEntryPoint(ep); + +} + +void EntryPointModel::addEntryPoint(EntryPoint ep) +{ + if (!m_entryPoints.count()) + { + m_entryPoints.append(ep); + insertRows(m_entryPoints.count(),1); + } + else + { + int idx = 0; + for (; idx < m_entryPoints.count(); idx++) + { + if (ep.address < m_entryPoints[idx].address) + break; + } + m_entryPoints.insert(idx,ep); + insertRows(idx,1); + } +} + +void EntryPointModel::removeSelection(QModelIndexList selection) +{ + if (selection.count() > 1) + { + qWarning() << "Unexpected number of items to remove. Only removing the first."; + } + if (selection.count()) + { + removeRow(selection[1].row()); + } +} + + diff --git a/src/binaryfile/EntryPointModel.h b/src/binaryfile/EntryPointModel.h new file mode 100644 index 0000000..b2f8619 --- /dev/null +++ b/src/binaryfile/EntryPointModel.h @@ -0,0 +1,50 @@ +#ifndef ENTRYPOINTMODEL_H +#define ENTRYPOINTMODEL_H + +#include + +struct EntryPoint { + quint16 address; + QString note; +}; + +class EntryPointModel : public QAbstractTableModel +{ + Q_OBJECT + +public: + explicit EntryPointModel(QObject *parent = 0); + + // Header: + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;//DONE + + // Basic functionality: + int rowCount(const QModelIndex &parent = QModelIndex()) const override; //DONE + int columnCount(const QModelIndex &parent = QModelIndex()) const override;//DONE + + QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;//DONE + + // Editable: + bool setData(const QModelIndex &index, const QVariant &value, + int role = Qt::EditRole) override; + + Qt::ItemFlags flags(const QModelIndex& index) const override; + + // Add data: + bool insertRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + + // Remove data: + bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) override; + + void doTestData(); + + void addEntryPoint(EntryPoint ep); + + void removeSelection(QModelIndexList selection); + +private: + QList m_entryPoints; + +}; + +#endif // ENTRYPOINTMODEL_H diff --git a/src/binaryfile/binaryfilemetadata.cpp b/src/binaryfile/binaryfilemetadata.cpp index 2e941b1..a5ff651 100644 --- a/src/binaryfile/binaryfilemetadata.cpp +++ b/src/binaryfile/binaryfilemetadata.cpp @@ -1,27 +1,44 @@ #include "binaryfilemetadata.h" -BinaryFileMetadata::BinaryFileMetadata() +BinaryFileMetadata::BinaryFileMetadata(QString filename) { - + m_filename = filename; } -void BinaryFileMetadata::addEntryPoint(quint16 address) -{ - if (!containsEntryPoint(address)) - { - m_entryPoints.append(address); - qSort(m_entryPoints); - } -} +//void BinaryFileMetadata::setEntryPoint(quint16 address, QString note) +//{ +// EntryPoint ep; +// ep.address = address; +// ep.note = note; +// setEntryPoint(ep); +//} -void BinaryFileMetadata::addDataRange(AddressRange range) -{ - m_dataRanges.append(range); -} +//void BinaryFileMetadata::setEntryPoint(EntryPoint ep) +//{ +// m_entryPoints.insert(ep.address,ep); +//} + + +//bool BinaryFileMetadata::hasEntryPointAtAddress(quint16 address) +//{ +// return m_entryPoints.contains(address); +//} + +//void BinaryFileMetadata::removeEntryPoint(quint16 address) +//{ +// if (hasEntryPointAtAddress(address)) +// { +// m_entryPoints.remove(address); +// } +//} bool BinaryFileMetadata::load() { - return false; + setSymbol(0x0000,"Test Symbol 1"); + setSymbol(0x0006,"Test Symbol 2"); + // setEntryPoint(0x0010,"Test Entry Point 1"); + // setEntryPoint(0x0020,"Test Entry Point 2"); + return true; } bool BinaryFileMetadata::save() @@ -29,15 +46,39 @@ bool BinaryFileMetadata::save() return false; } -bool BinaryFileMetadata::containsEntryPoint(quint16 address) +void BinaryFileMetadata::setSymbol(quint16 address, QString name) { - return m_entryPoints.contains(address); + AssemSymbol symbol; + symbol.address = address; + symbol.name = name; + setSymbol(symbol); } -void BinaryFileMetadata::removeEntryPoint(quint16 address) +void BinaryFileMetadata::setSymbol(AssemSymbol symbol) { - if (containsEntryPoint(address)) + m_symbols.insert(symbol.address, symbol); +} + +AssemSymbol BinaryFileMetadata::getSymbolAtAddress(quint16 address) +{ + if (hasSymbolAtAddress(address)) { - m_entryPoints.removeAll(address); + return m_symbols[address]; + } + return AssemSymbol(); +} + +void BinaryFileMetadata::removeSymbol(AssemSymbol symbol) +{ + removeSymbol(symbol.address); +} + +void BinaryFileMetadata::removeSymbol(quint16 address) +{ + if (hasSymbolAtAddress(address)) + { + m_symbols.remove(address); } } + + diff --git a/src/binaryfile/binaryfilemetadata.h b/src/binaryfile/binaryfilemetadata.h index d651724..e50537e 100644 --- a/src/binaryfile/binaryfilemetadata.h +++ b/src/binaryfile/binaryfilemetadata.h @@ -3,50 +3,53 @@ #include #include +#include -struct AddressRange -{ -public: - quint16 start; - quint16 end; - - quint16 length() { return end-start; } - - bool contains(quint16 address) { return (address >= start && address <= end); } +struct AssemSymbol { + quint16 address; + QString name; }; class BinaryFileMetadata { public: - enum UseType { - UNKNOWN = 0x00, - ROM = 0x01, - IO = 0x02, - BASIC = 0x04, - OPCODE = 0x08, - DATA = 0x10 - }; - BinaryFileMetadata(); + BinaryFileMetadata(QString filename); - void addEntryPoint(quint16 address); - void addDataRange(AddressRange range); + void setFilename(QString filename) { m_filename = filename; } + QString filename() const { return m_filename; } bool load(); bool save(); - bool containsEntryPoint(quint16 address); - void removeEntryPoint(quint16 address); +// void setEntryPoint(quint16 address, QString note = ""); +// void setEntryPoint(EntryPoint ep); - QList getEntryPoints() { return m_entryPoints; } - QList getDataRanges() { return m_dataRanges; } +// bool hasEntryPointAtAddress(EntryPoint ep); +// bool hasEntryPointAtAddress(quint16 address); + +// void removeEntryPoint(quint16 address); + +// QList getEntryPointList() const { return m_entryPoints.values(); } +// QMap getEntryPointMap() const { return m_entryPoints; } + + void setSymbol(quint16 address, QString name); + void setSymbol(AssemSymbol symbol); + bool hasSymbol(AssemSymbol symbol) const { return hasSymbolAtAddress(symbol.address); } + bool hasSymbolAtAddress(quint16 address) const { return m_symbols.contains(address); } + AssemSymbol getSymbolAtAddress(quint16 address); + void removeSymbol(AssemSymbol symbol); + void removeSymbol(quint16 address); + + QList getSymbolList() const { return m_symbols.values(); } + QMap getSymbolMap() const { return m_symbols; } private: - QList m_entryPoints; - QList m_dataRanges; + QMap m_symbols; + QString m_filename; }; #endif // BINARYFILEMETADATA_H diff --git a/src/ui/viewers/disassemblerviewer.cpp b/src/ui/viewers/disassemblerviewer.cpp index 044042c..a24bca3 100644 --- a/src/ui/viewers/disassemblerviewer.cpp +++ b/src/ui/viewers/disassemblerviewer.cpp @@ -15,6 +15,10 @@ DisassemblerViewer::DisassemblerViewer(QWidget *parent) : ui(new Ui::DisassemblerViewer) { ui->setupUi(this); + m_isRelo = false; + m_dmd = Q_NULLPTR; + m_wordWrapAction = Q_NULLPTR; + m_showMetadataAction = Q_NULLPTR; QString title = QString("Disassembly Viewer"); setWindowTitle(title); @@ -56,6 +60,7 @@ void DisassemblerViewer::toggleWordWrap(bool enabled) void DisassemblerViewer::setFile(BinaryFile *file) { m_file = file; + m_isRelo = false; QString title = QString("Disassembler Viewer: %1").arg(m_file->filename()); setWindowTitle(title); @@ -91,7 +96,7 @@ void DisassemblerViewer::setFile(BinaryFile *file) { void DisassemblerViewer::setFile(RelocatableFile *file) { m_file = file; - + m_isRelo = true; QString title = QString("Disassembler Viewer: %1 (Relocatable)").arg(m_file->filename()); setWindowTitle(title); @@ -130,7 +135,7 @@ void DisassemblerViewer::setFile(RelocatableFile *file) { QString DisassemblerViewer::getPotentialLabel(quint16 address) { QString retval = QString(); - /* if (address == 0x0A) { retval = "ASBASIC_USRVEC0"; } + /* if (address == 0x0A) { retval = "ASBASIC_USRVEC0"; } else if (address == 0x0B) { retval = "ASBASIC_USRVEC1"; } else if (address == 0x0C) { retval = "ASBASIC_USRVEC2"; } else if (address == 0x0D) { retval = "ASBASIC_GENPURPOSE0"; } @@ -160,7 +165,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { else if (address == 0x43) { retval = "DOS_BUFFER_ADDR_H"; } else if (address == 0x44) { retval = "DOS_NUMERIC_OPERAND_L"; } else if (address == 0x45) { retval = "DOS_NUMERIC_OPERAND_H"; } -/* + /* else if (address == 0x50) { retval = "ASBASIC_PTR_0L"; } else if (address == 0x51) { retval = "ASBASIC_PTR_0H"; } else if (address == 0x52) { retval = "ASBASIC_PTR_1L"; } @@ -231,7 +236,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { else if (address == 0x83) { retval = "ASBASIC_LAST_VARVAL_L"; } else if (address == 0x84) { retval = "ASBASIC_LAST_VARVAL_H"; } -/* + /* else if (address == 0x85) { retval = "ASBASIC_GENPURPOSE10"; } else if (address == 0x86) { retval = "ASBASIC_GENPURPOSE11"; } else if (address == 0x87) { retval = "ASBASIC_GENPURPOSE12"; } @@ -281,7 +286,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { */ else if (address == 0xAF) { retval = "ASBASIC_PROGEND_L"; } else if (address == 0xB0) { retval = "ASBASIC_PROGEND_H"; } -/* + /* else if (address == 0xB1) { retval = "ASBASIC_CHRGET0"; } else if (address == 0xB2) { retval = "ASBASIC_CHRGET1"; } else if (address == 0xB3) { retval = "ASBASIC_CHRGET2"; } @@ -322,7 +327,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { */ else if (address == 0xD6) { retval = "DOS_ASBASIC_PROG_PROT_FLAG"; } -/* + /* else if (address == 0xD8) { retval = "ASBASIC_ONERR_0L"; } else if (address == 0xD9) { retval = "ASBASIC_ONERR_0H"; } else if (address == 0xDA) { retval = "ASBASIC_ONERR_1L"; } @@ -337,7 +342,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { else if (address == 0xE2) { retval = "ASBASIC_HGR_YCOORD"; } else if (address == 0xE4) { retval = "ASBASIC_HGR_COLORBYTE"; } -/* + /* else if (address == 0xE5) { retval = "ASBASIC_HGR_GENUSE0"; } else if (address == 0xE6) { retval = "ASBASIC_HGR_GENUSE1"; } else if (address == 0xE7) { retval = "ASBASIC_HGR_GENUSE2"; } @@ -346,7 +351,7 @@ QString DisassemblerViewer::getPotentialLabel(quint16 address) { else if (address == 0xE9) { retval = "ASBASIC_SHAPETBL_H"; } else if (address == 0xEA) { retval = "ASBASIC_HGR_COLLISION_CTR"; } -/* + /* else if (address == 0xF0) { retval = "ASBASIC_GENUSE_FLAGS3"; } else if (address == 0xF1) { retval = "ASBASIC_GENUSE_FLAGS4"; } else if (address == 0xF2) { retval = "ASBASIC_GENUSE_FLAGS5"; } @@ -1416,15 +1421,35 @@ bool DisassemblerViewer::optionsMenuItems(QMenu *menu) { QSettings settings; - QAction *action = new QAction("&Word Wrap"); - action->setCheckable(true); - action->setChecked(settings.value("DisassemblerViewer.WordWrap",true).toBool()); - connect(action, SIGNAL(toggled(bool)), SLOT(toggleWordWrap(bool))); - menu->addAction(action); + if (!m_wordWrapAction) { + m_wordWrapAction = new QAction("&Word Wrap"); + m_wordWrapAction->setCheckable(true); + m_wordWrapAction->setChecked(settings.value("DisassemblerViewer.WordWrap",true).toBool()); + connect(m_wordWrapAction, SIGNAL(toggled(bool)), SLOT(toggleWordWrap(bool))); + } + menu->addAction(m_wordWrapAction); + + menu->addSeparator(); + + if (!m_showMetadataAction) { + m_showMetadataAction = new QAction("&Dissassembler Metadata"); + connect(m_showMetadataAction, SIGNAL(triggered(bool)), SLOT(showMetadataDialog())); + } + menu->addAction(m_showMetadataAction); return true; } +void DisassemblerViewer::showMetadataDialog() +{ + if (!m_dmd) { + m_dmd = new DisassemblerMetadataDialog(this); + m_dmd->setRelocatable(m_isRelo); + } + m_dmd->show(); + m_dmd->raise(); +} + void DisassemblerViewer::setData(QByteArray data) { ui->textArea->setText(data); @@ -1462,7 +1487,7 @@ void DisassemblerViewer::doExport() QDir savename = QDir(defaultPath).filePath(m_file->filename()+".txt"); QString saveName = QFileDialog::getSaveFileName(this, - tr("Export Disassembly"), savename.path(), tr("Text Files (*.txt)")); + tr("Export Disassembly"), savename.path(), tr("Text Files (*.txt)")); if (saveName == "") return; // User cancelled diff --git a/src/ui/viewers/disassemblerviewer.h b/src/ui/viewers/disassemblerviewer.h index e41f796..1feda2c 100644 --- a/src/ui/viewers/disassemblerviewer.h +++ b/src/ui/viewers/disassemblerviewer.h @@ -7,6 +7,7 @@ #include "binaryfile.h" #include "relocatablefile.h" #include "fileviewerinterface.h" +#include "DisassemblerMetadataDialog.h" namespace Ui { class DisassemblerViewer; @@ -36,10 +37,18 @@ public slots: void doPrint(); void doExport(); +protected slots: + void showMetadataDialog(); private: Ui::DisassemblerViewer *ui; + DisassemblerMetadataDialog *m_dmd; GenericFile *m_file; + + QAction *m_wordWrapAction; + QAction *m_showMetadataAction; + + bool m_isRelo; }; #endif // DISASSEMBLERVIEWER_H diff --git a/src/ui/widgets/DisassemblerMetadataDialog.cpp b/src/ui/widgets/DisassemblerMetadataDialog.cpp new file mode 100644 index 0000000..f41524b --- /dev/null +++ b/src/ui/widgets/DisassemblerMetadataDialog.cpp @@ -0,0 +1,110 @@ +#include "DisassemblerMetadataDialog.h" +#include "ui_DisassemblerMetadataDialog.h" +#include "util.h" +#include + + +DisassemblerMetadataDialog::DisassemblerMetadataDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::DisassemblerMetadataDialog) +{ + ui->setupUi(this); + setRelocatable(false); + + m_bfm = new BinaryFileMetadata("Test"); + m_bfm->load(); + + m_epmodel = new EntryPointModel(this); + + + processEntryPoints(); + processSymbols(); + + ui->entryTable->setModel(m_epmodel); + + connect(ui->cancelButton, SIGNAL(clicked(bool)), SLOT(handleCancelButton())); + connect(ui->exitButton,SIGNAL(clicked(bool)), SLOT(handleExitButton())); + connect(ui->processButton, SIGNAL(clicked(bool)), SLOT(handleProcessButton())); + + connect(ui->addEntryPointButton, SIGNAL(clicked(bool)), SLOT(handleAddEntryPointButton())); + connect(ui->addSymbolButton, SIGNAL(clicked(bool)), SLOT(handleAddSymbolButton())); +} + +DisassemblerMetadataDialog::~DisassemblerMetadataDialog() +{ + delete m_bfm; + delete ui; +} + +void DisassemblerMetadataDialog::setRelocatable(bool relocatable) +{ + ui->reloAddrLabel->setVisible(relocatable); + ui->reloAddrText->setVisible(relocatable); +} + +void DisassemblerMetadataDialog::handleCancelButton() +{ + this->close(); +} + +void DisassemblerMetadataDialog::handleExitButton() +{ + this->close(); +} + +void DisassemblerMetadataDialog::handleProcessButton() +{ + +} + + +void DisassemblerMetadataDialog::handleAddEntryPointButton() +{ + LocationInfoDialog lid(this); + lid.setWindowTitle("Add Entry Point"); + if (lid.exec() == Accepted) + { + EntryPoint ep; + ep.address = lid.getAddress(); + ep.note = lid.getInfo(); + m_epmodel->addEntryPoint(ep); + } +} + +void DisassemblerMetadataDialog::handleRemoveEntryPointButton() +{ +// QModelIndexList selection = ui->entryTable->selectedIndexes(); +// if (selection.count()) +// { +// m_epmodel->removeSelection(selection); +// } +} + + +void DisassemblerMetadataDialog::handleAddSymbolButton() +{ + LocationInfoDialog lid(this); + lid.setInfoLabelString("Symbol"); + lid.setWindowTitle("Add Symbol"); + if (lid.exec() == Accepted) + { + qDebug() << "Accepted"; + } + else qDebug()<<"Rejected"; +} + +void DisassemblerMetadataDialog::handleRemoveSymbolButton() +{ + +} + + +void DisassemblerMetadataDialog::processSymbols() +{ + +} + +void DisassemblerMetadataDialog::processEntryPoints() +{ + m_epmodel->doTestData(); +} diff --git a/src/ui/widgets/DisassemblerMetadataDialog.h b/src/ui/widgets/DisassemblerMetadataDialog.h new file mode 100644 index 0000000..02ceb6e --- /dev/null +++ b/src/ui/widgets/DisassemblerMetadataDialog.h @@ -0,0 +1,50 @@ +#ifndef DISASSEMBLERMETADATADIALOG_H +#define DISASSEMBLERMETADATADIALOG_H + +#include "binaryfilemetadata.h" +#include "EntryPointModel.h" +#include "LocationInfoDialog.h" + +#include + +namespace Ui { +class DisassemblerMetadataDialog; +} + +class DisassemblerMetadataDialog : public QDialog +{ + Q_OBJECT + +public: + explicit DisassemblerMetadataDialog(QWidget *parent = 0); + ~DisassemblerMetadataDialog(); + + void setRelocatable(bool relocatable); + + void processSymbols(); + void processEntryPoints(); + +protected slots: + void handleCancelButton(); + void handleExitButton(); + void handleProcessButton(); + + void handleAddEntryPointButton(); + void handleRemoveEntryPointButton(); + + void handleAddSymbolButton(); + void handleRemoveSymbolButton(); + + +private: + Ui::DisassemblerMetadataDialog *ui; + + BinaryFileMetadata *m_bfm; + + EntryPointModel *m_epmodel; + + bool m_isRelocatable; +}; + + +#endif // DISASSEMBLERMETADATADIALOG_H diff --git a/src/ui/widgets/DisassemblerMetadataDialog.ui b/src/ui/widgets/DisassemblerMetadataDialog.ui new file mode 100644 index 0000000..9af57fd --- /dev/null +++ b/src/ui/widgets/DisassemblerMetadataDialog.ui @@ -0,0 +1,229 @@ + + + DisassemblerMetadataDialog + + + + 0 + 0 + 796 + 593 + + + + Dialog + + + + + + + + Entry Points + + + false + + + false + + + + + + Qt::Horizontal + + + + 312 + 20 + + + + + + + + + + + + + + + + - + + + + + + + true + + + QAbstractItemView::NoSelection + + + QAbstractItemView::SelectRows + + + false + + + true + + + true + + + + + + + + + + Symbols + + + + + + Qt::Horizontal + + + + 311 + 20 + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + Usage + + + + + + + + + + &Process + + + + + + + + 0 + 0 + + + + xxxxx + + + + + + + + + + + + 0 + 0 + + + + Reloc. Addr + + + + + + + + 0 + 0 + + + + + + + + + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + &Cancel + + + + + + + &Exit + + + true + + + + + + + + + + diff --git a/src/ui/widgets/LocationInfoDialog.cpp b/src/ui/widgets/LocationInfoDialog.cpp new file mode 100644 index 0000000..1459b7c --- /dev/null +++ b/src/ui/widgets/LocationInfoDialog.cpp @@ -0,0 +1,29 @@ +#include "LocationInfoDialog.h" +#include "ui_LocationInfoDialog.h" + +LocationInfoDialog::LocationInfoDialog(QWidget *parent) : + QDialog(parent, Qt::CustomizeWindowHint | Qt::WindowTitleHint ), + ui(new Ui::LocationInfoDialog) +{ + ui->setupUi(this); +} + +LocationInfoDialog::~LocationInfoDialog() +{ + delete ui; +} + +void LocationInfoDialog::setInfoLabelString(QString label) +{ + ui->infoLabel->setText(label); +} + +quint16 LocationInfoDialog::getAddress() +{ + return ui->addressEdit->text().toInt(Q_NULLPTR,16); +} + +QString LocationInfoDialog::getInfo() +{ + return ui->infoEdit->text(); +} diff --git a/src/ui/widgets/LocationInfoDialog.h b/src/ui/widgets/LocationInfoDialog.h new file mode 100644 index 0000000..f2b958a --- /dev/null +++ b/src/ui/widgets/LocationInfoDialog.h @@ -0,0 +1,29 @@ +#ifndef LOCATIONINFODIALOG_H +#define LOCATIONINFODIALOG_H + +#include +#include + +namespace Ui { +class LocationInfoDialog; +} + +class LocationInfoDialog : public QDialog +{ + Q_OBJECT + +public: + explicit LocationInfoDialog(QWidget *parent = 0); + ~LocationInfoDialog(); + + void setInfoLabelString(QString label); + quint16 getAddress(); + QString getInfo(); + +protected: + +private: + Ui::LocationInfoDialog *ui; +}; + +#endif // LOCATIONINFODIALOG_H diff --git a/src/ui/widgets/LocationInfoDialog.ui b/src/ui/widgets/LocationInfoDialog.ui new file mode 100644 index 0000000..5a7c462 --- /dev/null +++ b/src/ui/widgets/LocationInfoDialog.ui @@ -0,0 +1,98 @@ + + + LocationInfoDialog + + + + 0 + 0 + 284 + 99 + + + + Dialog + + + + + + + + Address + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + HHHH + + + + + + + Note + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + LocationInfoDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + LocationInfoDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + +