QT: Add Play/Pause to Emulation menu

This commit is contained in:
Simon McFarlane 2015-05-02 15:30:25 -07:00
parent 29a9c24b73
commit 5988750fe4
2 changed files with 16 additions and 0 deletions

View File

@ -66,8 +66,10 @@ DMainWindow::DMainWindow(QWidget* parent_widget)
connect(m_ui->actionIconView, SIGNAL(triggered()), this, SLOT(OnGameListStyleChanged()));
connect(m_ui->actionPlay, SIGNAL(triggered()), this, SLOT(OnPlay()));
connect(m_ui->actionPlay_mnu, SIGNAL(triggered()), this, SLOT(OnPlay()));
connect(m_game_tracker, SIGNAL(StartGame()), this, SLOT(OnPlay()));
connect(m_ui->actionStop, SIGNAL(triggered()), this, SLOT(OnStop()));
connect(m_ui->actionStop_mnu, SIGNAL(triggered()), this, SLOT(OnStop()));
connect(m_ui->actionWebsite, SIGNAL(triggered()), this, SLOT(OnOpenWebsite()));
connect(m_ui->actionOnlineDocs, SIGNAL(triggered()), this, SLOT(OnOpenDocs()));
@ -292,11 +294,13 @@ void DMainWindow::OnCoreStateChanged(Core::EState state)
{
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE));
m_ui->actionPlay->setText(tr("Pause"));
m_ui->actionPlay_mnu->setText(tr("Pause"));
}
else if (is_paused || is_not_initialized)
{
m_ui->actionPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY));
m_ui->actionPlay->setText(tr("Play"));
m_ui->actionPlay_mnu->setText(tr("Play"));
}
m_ui->actionStop->setEnabled(!is_not_initialized);

View File

@ -49,6 +49,8 @@
<property name="title">
<string>E&amp;mulation</string>
</property>
<addaction name="actionPlay_mnu"/>
<addaction name="actionStop_mnu"/>
</widget>
<widget class="QMenu" name="mnuOptions">
<property name="title">
@ -213,6 +215,16 @@
<string>Exit</string>
</property>
</action>
<action name="actionPlay_mnu">
<property name="text">
<string>Play</string>
</property>
</action>
<action name="actionStop_mnu">
<property name="text">
<string>Stop</string>
</property>
</action>
</widget>
<resources/>
<connections/>