Qt: Disable more actions while system starting

This commit is contained in:
Stenzek 2025-07-19 18:05:43 +10:00
parent ad53fc2345
commit a8506f4708
No known key found for this signature in database

View File

@ -517,9 +517,10 @@ void MainWindow::updateDisplayWidgetCursor()
void MainWindow::updateDisplayRelatedActions(bool has_surface, bool fullscreen) void MainWindow::updateDisplayRelatedActions(bool has_surface, bool fullscreen)
{ {
// rendering to main, or switched to gamelist/grid // rendering to main, or switched to gamelist/grid
m_ui.actionViewSystemDisplay->setEnabled(wantsDisplayWidget() && QtHost::CanRenderToMainWindow()); m_ui.actionViewSystemDisplay->setEnabled(wantsDisplayWidget() && QtHost::CanRenderToMainWindow() &&
m_ui.menuWindowSize->setEnabled(s_system_valid && has_surface && !fullscreen); !s_system_starting);
m_ui.actionFullscreen->setEnabled(has_surface); m_ui.menuWindowSize->setEnabled(s_system_valid && !s_system_starting && has_surface && !fullscreen);
m_ui.actionFullscreen->setEnabled(has_surface && !s_system_starting);
m_ui.actionFullscreen->setChecked(fullscreen); m_ui.actionFullscreen->setChecked(fullscreen);
} }
@ -551,6 +552,7 @@ void MainWindow::onSystemStarting()
switchToEmulationView(); switchToEmulationView();
updateEmulationActions(true, false, s_achievements_hardcore_mode); updateEmulationActions(true, false, s_achievements_hardcore_mode);
updateDisplayRelatedActions(m_display_widget != nullptr, isRenderingFullscreen());
} }
void MainWindow::onSystemStarted() void MainWindow::onSystemStarted()
@ -560,6 +562,7 @@ void MainWindow::onSystemStarted()
s_system_valid = true; s_system_valid = true;
updateEmulationActions(false, true, s_achievements_hardcore_mode); updateEmulationActions(false, true, s_achievements_hardcore_mode);
updateDisplayRelatedActions(m_display_widget != nullptr, isRenderingFullscreen());
updateWindowTitle(); updateWindowTitle();
updateStatusBarWidgetVisibility(); updateStatusBarWidgetVisibility();
updateDisplayWidgetCursor(); updateDisplayWidgetCursor();
@ -610,6 +613,7 @@ void MainWindow::onSystemStopping()
s_undo_state_timestamp.reset(); s_undo_state_timestamp.reset();
updateEmulationActions(false, false, s_achievements_hardcore_mode); updateEmulationActions(false, false, s_achievements_hardcore_mode);
updateDisplayRelatedActions(m_display_widget != nullptr, isRenderingFullscreen());
updateStatusBarWidgetVisibility(); updateStatusBarWidgetVisibility();
} }
@ -2010,9 +2014,13 @@ void MainWindow::updateEmulationActions(bool starting, bool running, bool achiev
m_ui.actionDumpVRAM->setDisabled(starting_or_not_running || achievements_hardcore_mode); m_ui.actionDumpVRAM->setDisabled(starting_or_not_running || achievements_hardcore_mode);
m_ui.actionDumpSPURAM->setDisabled(starting_or_not_running || achievements_hardcore_mode); m_ui.actionDumpSPURAM->setDisabled(starting_or_not_running || achievements_hardcore_mode);
m_ui.actionLoadState->setDisabled(starting);
m_ui.menuLoadState->setDisabled(starting);
m_ui.actionSaveState->setDisabled(starting_or_not_running); m_ui.actionSaveState->setDisabled(starting_or_not_running);
m_ui.menuSaveState->setDisabled(starting_or_not_running); m_ui.menuSaveState->setDisabled(starting_or_not_running);
m_ui.menuWindowSize->setDisabled(starting_or_not_running); m_ui.menuWindowSize->setDisabled(starting_or_not_running);
m_ui.actionViewGameList->setDisabled(starting);
m_ui.actionViewGameGrid->setDisabled(starting);
m_ui.actionViewGameProperties->setDisabled(starting_or_not_running); m_ui.actionViewGameProperties->setDisabled(starting_or_not_running);