Disable "Check for Updates" and "Download Mods" while the game is running

Signed-off-by: Gingeh <39150378+Gingeh@users.noreply.github.com>
This commit is contained in:
Gingeh 2022-08-01 20:19:20 +10:00
parent a8dfe98b1a
commit 77b640b76b
3 changed files with 9 additions and 1 deletions

View File

@ -46,7 +46,7 @@ class ExternalResourcesPage : public QMainWindow, public BasePage {
protected slots: protected slots:
void itemActivated(const QModelIndex& index); void itemActivated(const QModelIndex& index);
void filterTextChanged(const QString& newContents); void filterTextChanged(const QString& newContents);
void runningStateChanged(bool running); virtual void runningStateChanged(bool running);
virtual void addItem(); virtual void addItem();
virtual void removeItem(); virtual void removeItem();

View File

@ -106,6 +106,13 @@ CoreModFolderPage::CoreModFolderPage(BaseInstance* inst, std::shared_ptr<ModFold
: ModFolderPage(inst, mods, parent) : ModFolderPage(inst, mods, parent)
{} {}
void ModFolderPage::runningStateChanged(bool running)
{
ExternalResourcesPage::runningStateChanged(running);
ui->actionDownloadItem->setEnabled(!running);
ui->actionUpdateItem->setEnabled(!running);
}
bool ModFolderPage::shouldDisplay() const bool ModFolderPage::shouldDisplay() const
{ {
return true; return true;

View File

@ -53,6 +53,7 @@ class ModFolderPage : public ExternalResourcesPage {
virtual QString helpPage() const override { return "Loader-mods"; } virtual QString helpPage() const override { return "Loader-mods"; }
virtual bool shouldDisplay() const override; virtual bool shouldDisplay() const override;
virtual void runningStateChanged(bool running);
private slots: private slots:
void installMods(); void installMods();