Merge pull request #773 from vancez/fix-launch-button
This commit is contained in:
parent
820951bce1
commit
973c4327e3
@ -2101,6 +2101,9 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &
|
|||||||
selectionBad();
|
selectionBad();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (m_selectedInstance) {
|
||||||
|
disconnect(m_selectedInstance.get(), &BaseInstance::runningStatusChanged, this, &MainWindow::refreshCurrentInstance);
|
||||||
|
}
|
||||||
QString id = current.data(InstanceList::InstanceIDRole).toString();
|
QString id = current.data(InstanceList::InstanceIDRole).toString();
|
||||||
m_selectedInstance = APPLICATION->instances()->getInstanceById(id);
|
m_selectedInstance = APPLICATION->instances()->getInstanceById(id);
|
||||||
if (m_selectedInstance)
|
if (m_selectedInstance)
|
||||||
@ -2127,6 +2130,8 @@ void MainWindow::instanceChanged(const QModelIndex ¤t, const QModelIndex &
|
|||||||
updateToolsMenu();
|
updateToolsMenu();
|
||||||
|
|
||||||
APPLICATION->settings()->set("SelectedInstance", m_selectedInstance->id());
|
APPLICATION->settings()->set("SelectedInstance", m_selectedInstance->id());
|
||||||
|
|
||||||
|
connect(m_selectedInstance.get(), &BaseInstance::runningStatusChanged, this, &MainWindow::refreshCurrentInstance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -2216,3 +2221,9 @@ void MainWindow::updateStatusCenter()
|
|||||||
m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed)));
|
m_statusCenter->setText(tr("Total playtime: %1").arg(Time::prettifyDuration(timePlayed)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::refreshCurrentInstance(bool running)
|
||||||
|
{
|
||||||
|
auto current = view->selectionModel()->currentIndex();
|
||||||
|
instanceChanged(current, current);
|
||||||
|
}
|
||||||
|
@ -192,6 +192,8 @@ private slots:
|
|||||||
void keyReleaseEvent(QKeyEvent *event) override;
|
void keyReleaseEvent(QKeyEvent *event) override;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void refreshCurrentInstance(bool running);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user