Qt: Only enable view->game properties for game list entry
This commit is contained in:
parent
ebfbae8dd1
commit
d150a2ccc3
|
@ -421,6 +421,15 @@ void MainWindow::onRunningGameChanged(const QString& filename, const QString& ga
|
||||||
|
|
||||||
if (m_display_widget)
|
if (m_display_widget)
|
||||||
m_display_widget->setWindowTitle(windowTitle());
|
m_display_widget->setWindowTitle(windowTitle());
|
||||||
|
|
||||||
|
bool has_game_list_entry = false;
|
||||||
|
if (!filename.isEmpty())
|
||||||
|
{
|
||||||
|
const GameListEntry* entry = m_host_interface->getGameList()->GetEntryForPath(filename.toStdString().c_str());
|
||||||
|
has_game_list_entry = (entry != nullptr);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui.actionViewGameProperties->setEnabled(has_game_list_entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::onApplicationStateChanged(Qt::ApplicationState state)
|
void MainWindow::onApplicationStateChanged(Qt::ApplicationState state)
|
||||||
|
@ -550,21 +559,14 @@ void MainWindow::onViewSystemDisplayTriggered()
|
||||||
|
|
||||||
void MainWindow::onViewGamePropertiesActionTriggered()
|
void MainWindow::onViewGamePropertiesActionTriggered()
|
||||||
{
|
{
|
||||||
const GameListEntry* entry;
|
if (!m_emulation_running)
|
||||||
|
return;
|
||||||
|
|
||||||
if (m_emulation_running)
|
|
||||||
{
|
|
||||||
const std::string& path = System::GetRunningPath();
|
const std::string& path = System::GetRunningPath();
|
||||||
if (path.empty())
|
if (path.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
entry = m_host_interface->getGameList()->GetEntryForPath(path.c_str());
|
const GameListEntry* entry = m_host_interface->getGameList()->GetEntryForPath(path.c_str());
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
entry = m_game_list_widget->getSelectedEntry();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!entry)
|
if (!entry)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -908,6 +910,8 @@ void MainWindow::updateEmulationActions(bool starting, bool running, bool cheevo
|
||||||
m_ui.toolBar->insertAction(m_ui.actionPowerOff, m_ui.actionResumeLastState);
|
m_ui.toolBar->insertAction(m_ui.actionPowerOff, m_ui.actionResumeLastState);
|
||||||
m_ui.toolBar->removeAction(m_ui.actionPowerOff);
|
m_ui.toolBar->removeAction(m_ui.actionPowerOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_ui.actionViewGameProperties->setEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_open_debugger_on_start && running)
|
if (m_open_debugger_on_start && running)
|
||||||
|
|
|
@ -779,6 +779,9 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionViewGameProperties">
|
<action name="actionViewGameProperties">
|
||||||
|
<property name="enabled">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Game &Properties</string>
|
<string>Game &Properties</string>
|
||||||
</property>
|
</property>
|
||||||
|
|
Loading…
Reference in New Issue