From 6528cdb58abcbe432dd387d565c9a1157f90795a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karel=20Ko=C4=8D=C3=AD?= Date: Fri, 5 Jan 2018 16:24:29 +0100 Subject: Implement initial dialog for program memory dock I am missing memory view for now. --- qtmips_gui/mainwindow.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'qtmips_gui/mainwindow.cpp') diff --git a/qtmips_gui/mainwindow.cpp b/qtmips_gui/mainwindow.cpp index d1a9770..92d1a74 100644 --- a/qtmips_gui/mainwindow.cpp +++ b/qtmips_gui/mainwindow.cpp @@ -14,12 +14,14 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { this->setCentralWidget(coreview); // Create/prepare other widgets ndialog = new NewDialog(this, settings); + registers = new RegistersDock(this); + registers->hide(); + program = new ProgramDock(this); + program->hide(); cache_content = new CacheContentDock(this); cache_content->hide(); cache_statictics = new CacheStatisticsDock(this); cache_statictics->hide(); - registers = new RegistersDock(this); - registers->hide(); // Execution speed actions speed_group = new QActionGroup(this); @@ -32,9 +34,10 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { // Connect signals from menu connect(ui->actionExit, SIGNAL(triggered(bool)), this, SLOT(close())); connect(ui->actionNew, SIGNAL(triggered(bool)), this, SLOT(new_machine())); + connect(ui->actionRegisters, SIGNAL(triggered(bool)), this, SLOT(show_registers())); + connect(ui->actionProgram_memory, SIGNAL(triggered(bool)), this, SLOT(show_program())); connect(ui->actionCache, SIGNAL(triggered(bool)), this, SLOT(show_cache_content())); connect(ui->actionCache_statistics, SIGNAL(triggered(bool)), this, SLOT(show_cache_statictics())); - connect(ui->actionRegisters, SIGNAL(triggered(bool)), this, SLOT(show_registers())); connect(ui->ips1, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips5, SIGNAL(toggled(bool)), this, SLOT(set_speed())); connect(ui->ips10, SIGNAL(toggled(bool)), this, SLOT(set_speed())); @@ -88,6 +91,7 @@ void MainWindow::create_core(machine::MachineConfig *config) { // Setup docks registers->setup(machine); + program->setup(machine); // Set status to ready machine_status(machine::QtMipsMachine::ST_READY); } @@ -112,6 +116,10 @@ void MainWindow::show_registers() { show_dockwidget(registers); } +void MainWindow::show_program() { + show_dockwidget(program); +} + void MainWindow::set_speed() { if (machine == nullptr) return; // just ignore -- cgit v1.2.3