mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-24 12:30:17 +00:00
Ensures 'Display' menu is removed if machine is closed.
This commit is contained in:
parent
a0e534b309
commit
6925a04088
@ -62,7 +62,11 @@ void MainWindow::deleteMachine() {
|
||||
audioThread.stop();
|
||||
}
|
||||
|
||||
// Release the machine.
|
||||
machine.reset();
|
||||
|
||||
// Remove any machine-specific options.
|
||||
if(displayMenu) menuBar()->removeAction(displayMenu->menuAction());
|
||||
}
|
||||
|
||||
MainWindow::~MainWindow() {
|
||||
@ -393,7 +397,7 @@ void MainWindow::launchMachine() {
|
||||
|
||||
void MainWindow::addDisplayMenu(const std::string &compositeColour, const std::string &compositeMono, const std::string &svideo, const std::string &rgb) {
|
||||
// Create a display menu.
|
||||
QMenu *const displayMenu = menuBar()->addMenu(tr("&Display"));
|
||||
displayMenu = menuBar()->addMenu(tr("&Display"));
|
||||
|
||||
QAction *compositeColourAction = nullptr;
|
||||
QAction *compositeMonochromeAction = nullptr;
|
||||
|
@ -100,6 +100,7 @@ class MainWindow : public QMainWindow, public Outputs::Speaker::Speaker::Delegat
|
||||
|
||||
void deleteMachine();
|
||||
|
||||
QMenu *displayMenu = nullptr;
|
||||
void addDisplayMenu(const std::string &compositeColour, const std::string &compositeMono, const std::string &svideo, const std::string &rgb);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user