diff --git a/src/gui/Src/BasicView/AbstractTableView.cpp b/src/gui/Src/BasicView/AbstractTableView.cpp index d4ed2517..85abc419 100644 --- a/src/gui/Src/BasicView/AbstractTableView.cpp +++ b/src/gui/Src/BasicView/AbstractTableView.cpp @@ -16,6 +16,9 @@ AbstractTableView::AbstractTableView(QWidget* parent) : QAbstractScrollArea(pare fontsUpdated(); colorsUpdated(); + // Paint cell content only when debugger is running + setDrawDebugOnly(true); + mRowCount = 0; mHeaderButtonSytle.setStyleSheet(" QPushButton {\n background-color: rgb(192, 192, 192);\n border-style: outset;\n border-width: 2px;\n border-color: rgb(128, 128, 128);\n }\n QPushButton:pressed {\n background-color: rgb(192, 192, 192);\n border-style: inset;\n }"); @@ -152,11 +155,16 @@ void AbstractTableView::paintEvent(QPaintEvent* event) // Paints cell contents if(i < mNbrOfLineToPrint) { - QString wStr = paintContent(&wPainter, mTableOffset, i, j, x, y, getColumnWidth(j), getRowHeight()); - if(wStr.length()) + // Don't draw cells if the flag is set, and no process is running + if (mDrawDebugOnly && DbgIsDebugging()) { - wPainter.setPen(textColor); - wPainter.drawText(QRect(x + 4, y, getColumnWidth(j) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr); + QString wStr = paintContent(&wPainter, mTableOffset, i, j, x, y, getColumnWidth(j), getRowHeight()); + + if(wStr.length()) + { + wPainter.setPen(textColor); + wPainter.drawText(QRect(x + 4, y, getColumnWidth(j) - 4, getRowHeight()), Qt::AlignVCenter | Qt::AlignLeft, wStr); + } } } @@ -904,7 +912,21 @@ int AbstractTableView::getCharWidth() } /************************************************************************************ - Table Offset Management + Content drawing control +************************************************************************************/ + +bool AbstractTableView::getDrawDebugOnly() +{ + return mDrawDebugOnly; +} + +void AbstractTableView::setDrawDebugOnly(bool value) +{ + mDrawDebugOnly = value; +} + +/************************************************************************************ + Table offset management ************************************************************************************/ dsint AbstractTableView::getTableOffset() { diff --git a/src/gui/Src/BasicView/AbstractTableView.h b/src/gui/Src/BasicView/AbstractTableView.h index 28c6ee54..c0c856e6 100644 --- a/src/gui/Src/BasicView/AbstractTableView.h +++ b/src/gui/Src/BasicView/AbstractTableView.h @@ -42,7 +42,7 @@ public: // Constructor explicit AbstractTableView(QWidget* parent = 0); - //config updates + // Config updates virtual void colorsUpdated(); virtual void fontsUpdated(); @@ -96,7 +96,11 @@ public: void setShowHeader(bool show); int getCharWidth(); - // Table Offset Management + // Content drawing control + bool getDrawDebugOnly(); + void setDrawDebugOnly(bool value); + + // Table offset management dsint getTableOffset(); void setTableOffset(dsint val); @@ -187,6 +191,7 @@ protected: QColor headerTextColor; QColor selectionColor; bool mAllowPainting; + bool mDrawDebugOnly; }; #endif // ABSTRACTTABLEVIEW_H diff --git a/src/gui/Src/BasicView/HexDump.cpp b/src/gui/Src/BasicView/HexDump.cpp index 7aca7b67..6bb5717c 100644 --- a/src/gui/Src/BasicView/HexDump.cpp +++ b/src/gui/Src/BasicView/HexDump.cpp @@ -240,10 +240,6 @@ void HexDump::mouseReleaseEvent(QMouseEvent* event) QString HexDump::paintContent(QPainter* painter, dsint rowBase, int rowOffset, int col, int x, int y, int w, int h) { - // Don't draw if not debugging - if (!DbgIsDebugging()) - return ""; - // Reset byte offset when base address is reached if(rowBase == 0 && mByteOffset != 0) printDumpAt(mMemPage->getBase(), false, false); diff --git a/src/gui/Src/Gui/AttachDialog.cpp b/src/gui/Src/Gui/AttachDialog.cpp index 36f318f3..cdd99fa1 100644 --- a/src/gui/Src/Gui/AttachDialog.cpp +++ b/src/gui/Src/Gui/AttachDialog.cpp @@ -24,6 +24,7 @@ AttachDialog::AttachDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Attach int charwidth = ui->listProcesses->getCharWidth(); ui->listProcesses->addColumnAt(charwidth * sizeof(int) * 2 + 8, "PID", true); ui->listProcesses->addColumnAt(800, "Path", true); + ui->listProcesses->setDrawDebugOnly(false); connect(ui->listProcesses, SIGNAL(enterPressedSignal()), this, SLOT(on_btnAttach_clicked())); connect(ui->listProcesses, SIGNAL(doubleClickedSignal()), this, SLOT(on_btnAttach_clicked())); connect(ui->listProcesses, SIGNAL(contextMenuSignal(QPoint)), this, SLOT(processListContextMenu(QPoint)));