mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
limit to 4 windows, and disable 'new window' menu item when that amount is reached
This commit is contained in:
@ -203,6 +203,12 @@ void EmuInstance::createWindow()
|
||||
// if creating a secondary window, we may need to initialize its OpenGL context here
|
||||
if (win->hasOpenGL() && (id != 0))
|
||||
emuThread->initContext(id);
|
||||
|
||||
bool enable = (numWindows < kMaxWindows);
|
||||
doOnAllWindows([=](MainWindow* win)
|
||||
{
|
||||
win->actNewWindow->setEnabled(enable);
|
||||
});
|
||||
}
|
||||
|
||||
void EmuInstance::deleteWindow(int id, bool close)
|
||||
@ -232,6 +238,14 @@ void EmuInstance::deleteWindow(int id, bool close)
|
||||
// if the main window is closed, Qt will take care of closing any secondary windows
|
||||
deleteEmuInstance(instanceID);
|
||||
}
|
||||
else
|
||||
{
|
||||
bool enable = (numWindows < kMaxWindows);
|
||||
doOnAllWindows([=](MainWindow* win)
|
||||
{
|
||||
win->actNewWindow->setEnabled(enable);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
void EmuInstance::deleteAllWindows()
|
||||
|
Reference in New Issue
Block a user