Qt: Combine resume and power off toolbar buttons

This commit is contained in:
Connor McLaughlin 2020-05-23 15:03:15 +10:00
parent e6d52ce6de
commit 9f22684cea
2 changed files with 18 additions and 2 deletions

View file

@ -468,6 +468,23 @@ void MainWindow::updateEmulationActions(bool starting, bool running)
m_status_frame_time_widget->hide();
}
if (starting || running)
{
if (!m_ui.toolBar->actions().contains(m_ui.actionPowerOff))
{
m_ui.toolBar->insertAction(m_ui.actionResumeLastState, m_ui.actionPowerOff);
m_ui.toolBar->removeAction(m_ui.actionResumeLastState);
}
}
else
{
if (!m_ui.toolBar->actions().contains(m_ui.actionResumeLastState))
{
m_ui.toolBar->insertAction(m_ui.actionPowerOff, m_ui.actionResumeLastState);
m_ui.toolBar->removeAction(m_ui.actionPowerOff);
}
}
m_ui.statusBar->clearMessage();
}

View file

@ -165,9 +165,8 @@
</attribute>
<addaction name="actionStartDisc"/>
<addaction name="actionStartBios"/>
<addaction name="actionResumeLastState"/>
<addaction name="separator"/>
<addaction name="actionPowerOff"/>
<addaction name="actionResumeLastState"/>
<addaction name="actionReset"/>
<addaction name="actionPause"/>
<addaction name="actionChangeDisc"/>