1
0
Fork 0

Clear the trace view info box when closing the trace

This commit is contained in:
Duncan Ogilvie 2022-07-14 23:26:53 +02:00
parent ff609dbce1
commit cb51f0e2a2
3 changed files with 15 additions and 11 deletions

View File

@ -8,7 +8,7 @@ TraceInfoBox::TraceInfoBox(TraceWidget* parent) : StdTable(parent)
{
addColumnAt(0, "", true);
setShowHeader(false);
clean();
clear();
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setMinimumHeight((getRowHeight() + 1) * 4);
@ -24,13 +24,6 @@ TraceInfoBox::~TraceInfoBox()
}
void TraceInfoBox::clean()
{
setRowCount(4);
for(int i = 0; i < 4; i++)
setCellContent(i, 0, QString());
}
void TraceInfoBox::update(unsigned long long selection, TraceFileReader* traceFile, const REGDUMP & registers)
{
int infoline = 0;
@ -39,7 +32,7 @@ void TraceInfoBox::update(unsigned long long selection, TraceFileReader* traceFi
QString line;
int opsize;
traceFile->OpCode(selection, opcode, &opsize);
clean();
clear();
auto resolveRegValue = [&registers](ZydisRegister regname)
{
switch(regname)
@ -341,6 +334,14 @@ void TraceInfoBox::update(unsigned long long selection, TraceFileReader* traceFi
reloadData();
}
void TraceInfoBox::clear()
{
setRowCount(4);
for(int i = 0; i < 4; i++)
setCellContent(i, 0, QString());
reloadData();
}
void TraceInfoBox::setupContextMenu()
{
mCopyLineAction = makeAction(tr("Copy Line"), SLOT(copyLineSlot()));

View File

@ -13,6 +13,7 @@ public:
~TraceInfoBox();
void update(unsigned long long selection, TraceFileReader* traceFile, const REGDUMP & registers);
void clear();
public slots:
void contextMenuSlot(QPoint pos);
@ -20,7 +21,6 @@ public slots:
private:
void setupContextMenu();
void setupShortcuts();
void clean();
QAction* mCopyLineAction;
};

View File

@ -87,7 +87,10 @@ void TraceWidget::traceSelectionChanged(unsigned long long selection)
void TraceWidget::updateSlot()
{
mGeneralRegs->setActive(mTraceWidget->isFileOpened());
auto fileOpened = mTraceWidget->isFileOpened();
mGeneralRegs->setActive(fileOpened);
if(!fileOpened)
mInfo->clear();
}
TraceBrowser* TraceWidget::getTraceBrowser()