From 7c4e8cfeec612d2825828b63f87f1f6f0e03393c Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Sun, 21 Feb 2021 18:21:00 -0500 Subject: [PATCH] Added File/Close menu options to Qt debugger, ppu viewer, and name table viewer. --- src/drivers/Qt/ConsoleDebugger.cpp | 13 ++++++++++++- src/drivers/Qt/NameTableViewer.cpp | 13 ++++++++++++- src/drivers/Qt/ppuViewer.cpp | 13 ++++++++++++- 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/src/drivers/Qt/ConsoleDebugger.cpp b/src/drivers/Qt/ConsoleDebugger.cpp index 37a59ad6..6bdd9285 100644 --- a/src/drivers/Qt/ConsoleDebugger.cpp +++ b/src/drivers/Qt/ConsoleDebugger.cpp @@ -88,7 +88,7 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent) QFrame *frame; QLabel *lbl; QMenuBar *menuBar; - QMenu *debugMenu, *optMenu, *subMenu; + QMenu *fileMenu, *debugMenu, *optMenu, *subMenu; QActionGroup *actGroup; QAction *act; float fontCharWidth; @@ -117,6 +117,17 @@ ConsoleDebugger::ConsoleDebugger(QWidget *parent) //----------------------------------------------------------------------- // Menu Start //----------------------------------------------------------------------- + // File + fileMenu = menuBar->addMenu(tr("&File")); + + // File -> Close + act = new QAction(tr("&Close"), this); + act->setShortcut(QKeySequence::Close); + act->setStatusTip(tr("Close Window")); + connect(act, SIGNAL(triggered()), this, SLOT(closeWindow(void)) ); + + fileMenu->addAction(act); + // Debug debugMenu = menuBar->addMenu(tr("&Debug")); diff --git a/src/drivers/Qt/NameTableViewer.cpp b/src/drivers/Qt/NameTableViewer.cpp index 78d3c67b..6c2c7c0b 100644 --- a/src/drivers/Qt/NameTableViewer.cpp +++ b/src/drivers/Qt/NameTableViewer.cpp @@ -123,7 +123,7 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent) QGridLayout *grid; QGroupBox *frame; QMenuBar *menuBar; - QMenu *viewMenu, *colorMenu, *subMenu; + QMenu *fileMenu, *viewMenu, *colorMenu, *subMenu; QAction *act; QActionGroup *group; QLabel *lbl; @@ -148,6 +148,17 @@ ppuNameTableViewerDialog_t::ppuNameTableViewerDialog_t(QWidget *parent) //----------------------------------------------------------------------- // Menu //----------------------------------------------------------------------- + // File + fileMenu = menuBar->addMenu(tr("&File")); + + // File -> Close + act = new QAction(tr("&Close"), this); + act->setShortcut(QKeySequence::Close); + act->setStatusTip(tr("Close Window")); + connect(act, SIGNAL(triggered()), this, SLOT(closeWindow(void)) ); + + fileMenu->addAction(act); + // View viewMenu = menuBar->addMenu(tr("&View")); diff --git a/src/drivers/Qt/ppuViewer.cpp b/src/drivers/Qt/ppuViewer.cpp index 668df173..a818a0b6 100644 --- a/src/drivers/Qt/ppuViewer.cpp +++ b/src/drivers/Qt/ppuViewer.cpp @@ -117,7 +117,7 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) QHBoxLayout *hbox; QGridLayout *grid; QActionGroup *group; - QMenu *viewMenu, *colorMenu, *optMenu, *subMenu; + QMenu *fileMenu, *viewMenu, *colorMenu, *optMenu, *subMenu; QAction *act; char stmp[64]; int useNativeMenuBar; @@ -233,6 +233,17 @@ ppuViewerDialog_t::ppuViewerDialog_t(QWidget *parent) //----------------------------------------------------------------------- // Menu //----------------------------------------------------------------------- + // File + fileMenu = menuBar->addMenu(tr("&File")); + + // File -> Close + act = new QAction(tr("&Close"), this); + act->setShortcut(QKeySequence::Close); + act->setStatusTip(tr("Close Window")); + connect(act, SIGNAL(triggered()), this, SLOT(closeWindow(void)) ); + + fileMenu->addAction(act); + // View1 viewMenu = menuBar->addMenu(tr("View&1"));