From 155bbb179629a67a0294e0382383ba34803e462b Mon Sep 17 00:00:00 2001 From: Marco Melletti Date: Wed, 26 Nov 2014 17:20:14 +0100 Subject: [PATCH] ~ better tbl button placement --- qarm/mainbar.cc | 22 +++++++++++++++++++++- qarm/mainbar.h | 6 +++++- qarm/procdisplay.cc | 18 ------------------ qarm/procdisplay.h | 10 ---------- qarm/qarm.cc | 6 +++--- 5 files changed, 29 insertions(+), 33 deletions(-) diff --git a/qarm/mainbar.cc b/qarm/mainbar.cc index 21260c8..1b415c5 100644 --- a/qarm/mainbar.cc +++ b/qarm/mainbar.cc @@ -109,7 +109,7 @@ mainBar::mainBar(QWidget *parent) : ramB = new styledButton(); ramB->setToolButtonStyle(Qt::ToolButtonTextOnly); - ramB->setText("View Ram"); + ramB->setText("RAM"); for (unsigned int i = 0; i < N_DEV_PER_IL; ++i) { showTerminalActions[i] = new QAction(QString("Terminal %1").arg(i), this); @@ -132,9 +132,17 @@ mainBar::mainBar(QWidget *parent) : breakpB->setCheckable(true); breakpB->setEnabled(true); + tlbB = new styledButton(); + tlbB->setText("TLB"); + tlbB->setCheckable(true); + tlbB->setEnabled(true); + utilsUpperL->addWidget(breakpB); + utilsUpperL->addWidget(new QWidget()); utilsUpperL->addWidget(ramB); utilsLowerL->addWidget(windowB); + utilsLowerL->addWidget(new QWidget()); + utilsLowerL->addWidget(tlbB); utilsL->addLayout(utilsUpperL); utilsL->addLayout(utilsLowerL); @@ -152,6 +160,7 @@ mainBar::mainBar(QWidget *parent) : connect(configB, SIGNAL(clicked()), this, SIGNAL(showConfig())); connect(windowB, SIGNAL(clicked()), this, SLOT(showDropDownMenu())); connect(breakpB, SIGNAL(toggled(bool)), this, SLOT(toggleBPButton(bool))); + connect(tlbB, SIGNAL(toggled(bool)), this, SLOT(toggleTlbViewer(bool))); debugSignaler *debugger = debugSignaler::getInstance(); connect(debugger, SIGNAL(pause()), this, SLOT(stop())); @@ -260,4 +269,15 @@ void mainBar::uncheckBPB(){ breakpB->setChecked(false); } +void mainBar::toggleTlbViewer(bool status){ + if(status) + emit showTLB(); + else + emit hideTLB(); +} + +void mainBar::uncheckTLB(){ + tlbB->setChecked(false); +} + #endif //QARM_MAINBAR_CC diff --git a/qarm/mainbar.h b/qarm/mainbar.h index 535d958..f3b2016 100644 --- a/qarm/mainbar.h +++ b/qarm/mainbar.h @@ -58,6 +58,8 @@ public slots: void showTerminal(unsigned int devNo); void showBPW(); void hideBPW(); + void showTLB(); + void hideTLB(); private slots: void poweron(); @@ -73,9 +75,11 @@ private slots: void showTerminalClicked(); void uncheckBPB(); void toggleBPButton(bool checked); + void uncheckTLB(); + void toggleTlbViewer(bool status); private: - styledButton *playB, *resetB, *stepB, *ramB, *plusB, *minusB, *configB, *windowB, *breakpB; //interactions + styledButton *playB, *resetB, *stepB, *ramB, *plusB, *minusB, *configB, *windowB, *breakpB, *tlbB; //interactions QVBoxLayout *plusMinusL, *scrollerL, *utilsL; QHBoxLayout *utilsUpperL, *utilsLowerL; QWidget *plusMinusW, *scrollerW, *utilsW; diff --git a/qarm/procdisplay.cc b/qarm/procdisplay.cc index b4890ad..3955f08 100644 --- a/qarm/procdisplay.cc +++ b/qarm/procdisplay.cc @@ -114,11 +114,6 @@ procDisplay::procDisplay(QWidget *parent) : cpuReg[0][5]->setText("IRQ"); cpuReg[0][6]->setText("FIQ"); - tlbB = new QPushButton("Show TLB"); - tlbB->setCheckable(true); - tlbB->setEnabled(true); - connect(tlbB, SIGNAL(toggled(bool)), this, SLOT(toggleTlbViewer(bool))); - cp15Reg[0][0]->setText("CP15 registers:"); cp15Reg[1][1]->setText("ID (r0):"); cp15Reg[2][1]->setText("SCB (r1):"); @@ -154,8 +149,6 @@ procDisplay::procDisplay(QWidget *parent) : for(int j = 0; j < CP15COLS; j++) cp15L->addWidget(cp15Reg[i][j], i, j); - cp15L->addWidget(tlbB, CP15ROWS, 0); - for(int i = 0; i < INFOROWS; i++) for(int j = 0; j < INFOCOLS; j++) infoL->addWidget(infoReg[i][j], i, j); @@ -271,15 +264,4 @@ QString procDisplay::convertHex(Word val){ return ret; } -void procDisplay::toggleTlbViewer(bool status){ - if(status) - emit showTLB(); - else - emit hideTLB(); -} - -void procDisplay::uncheckTLB(){ - tlbB->setChecked(false); -} - #endif //QARM_PROCDISPLAY_CC diff --git a/qarm/procdisplay.h b/qarm/procdisplay.h index 95f7c21..29c0363 100644 --- a/qarm/procdisplay.h +++ b/qarm/procdisplay.h @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include "qarm/QLine.h" @@ -44,17 +43,8 @@ class procDisplay : public QWidget public slots: void updateVals(Word *cpu, Word *cp15, Word *pipeline, Word todH, Word todL, Word timer, QString ass); void reset(); - void uncheckTLB(); - -signals: - void showTLB(); - void hideTLB(); - -private slots: - void toggleTlbViewer(bool status); private: - QPushButton *tlbB; QVBoxLayout *mainLayout; QGridLayout *pipeL, *cpuL, *cp15L, *infoL; QHBoxLayout *lowLayout; diff --git a/qarm/qarm.cc b/qarm/qarm.cc index 8f2d4ed..4822ab9 100644 --- a/qarm/qarm.cc +++ b/qarm/qarm.cc @@ -96,9 +96,9 @@ qarm::qarm(QApplication *app): connect(bpWindow, SIGNAL(hiding()), toolbar, SLOT(uncheckBPB())); connect(this, SIGNAL(resetMachine()), bpWindow, SLOT(reset())); - connect(display, SIGNAL(showTLB()), tlbWindow, SLOT(show())); - connect(display, SIGNAL(hideTLB()), tlbWindow, SLOT(hide())); - connect(tlbWindow, SIGNAL(hiding()), display, SLOT(uncheckTLB())); + connect(toolbar, SIGNAL(showTLB()), tlbWindow, SLOT(show())); + connect(toolbar, SIGNAL(hideTLB()), tlbWindow, SLOT(hide())); + connect(tlbWindow, SIGNAL(hiding()), toolbar, SLOT(uncheckTLB())); connect(this, SIGNAL(resetMachine()), tlbWindow, SIGNAL(onMachineReset())); connect(clock, SIGNAL(timeout()), this, SLOT(step()));