**Refresh** and **Purge Game List Cache** now correctly enabled/disabled as notified by GameListRefreshRequested and GameListRefreshCompleted.

This commit is contained in:
Christian Aguilera
2020-09-27 02:40:56 +02:00
parent bada677c5a
commit 4ca92464c0
3 changed files with 13 additions and 6 deletions

View File

@ -46,6 +46,8 @@ ToolBar::ToolBar(QWidget* parent) : QToolBar(parent)
connect(&Settings::Instance(), &Settings::WidgetLockChanged, this,
[this](bool locked) { setMovable(!locked); });
connect(&Settings::Instance(), &Settings::GameListRefreshRequested, this,
[this] { m_refresh_action->setEnabled(false); });
connect(&Settings::Instance(), &Settings::GameListRefreshCompleted, this,
[this] { m_refresh_action->setEnabled(true); });
@ -112,10 +114,8 @@ void ToolBar::MakeActions()
m_set_pc_action = addAction(tr("Set PC"), this, &ToolBar::SetPCPressed);
m_open_action = addAction(tr("Open"), this, &ToolBar::OpenPressed);
m_refresh_action = addAction(tr("Refresh"), [this] {
m_refresh_action->setEnabled(false);
emit RefreshPressed();
});
m_refresh_action = addAction(tr("Refresh"), [this] { emit RefreshPressed(); });
m_refresh_action->setEnabled(false);
addSeparator();