mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-26 23:55:40 +00:00
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)
|
||||
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)
|
||||
|
@ -550,21 +559,14 @@ void MainWindow::onViewSystemDisplayTriggered()
|
|||
|
||||
void MainWindow::onViewGamePropertiesActionTriggered()
|
||||
{
|
||||
const GameListEntry* entry;
|
||||
if (!m_emulation_running)
|
||||
return;
|
||||
|
||||
if (m_emulation_running)
|
||||
{
|
||||
const std::string& path = System::GetRunningPath();
|
||||
if (path.empty())
|
||||
return;
|
||||
|
||||
entry = m_host_interface->getGameList()->GetEntryForPath(path.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
entry = m_game_list_widget->getSelectedEntry();
|
||||
}
|
||||
const std::string& path = System::GetRunningPath();
|
||||
if (path.empty())
|
||||
return;
|
||||
|
||||
const GameListEntry* entry = m_host_interface->getGameList()->GetEntryForPath(path.c_str());
|
||||
if (!entry)
|
||||
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->removeAction(m_ui.actionPowerOff);
|
||||
}
|
||||
|
||||
m_ui.actionViewGameProperties->setEnabled(false);
|
||||
}
|
||||
|
||||
if (m_open_debugger_on_start && running)
|
||||
|
|
|
@ -779,6 +779,9 @@
|
|||
</property>
|
||||
</action>
|
||||
<action name="actionViewGameProperties">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Game &Properties</string>
|
||||
</property>
|
||||
|
|
Loading…
Reference in a new issue