add update menu conditionaly

Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
This commit is contained in:
Trial97 2023-11-07 09:48:07 +02:00
parent 6506e93e4a
commit 5d5adbd7da
No known key found for this signature in database
GPG Key ID: 55EF5DA53DB36318

View File

@ -84,6 +84,7 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel>
connect(ui->actionDownloadItem, &QAction::triggered, this, &ModFolderPage::installMods);
if (!APPLICATION->settings()->get("ModDependenciesDisabled").toBool()) { // dependencies
auto updateMenu = ui->actionUpdateItem->menu();
if (updateMenu) {
updateMenu->clear();
@ -103,6 +104,7 @@ ModFolderPage::ModFolderPage(BaseInstance* inst, std::shared_ptr<ModFolderModel>
connect(updateWithDeps, &QAction::triggered, this, [this] { updateMods(true); });
}
ui->actionUpdateItem->setMenu(updateMenu);
}
ui->actionUpdateItem->setToolTip(tr("Try to check or update all selected mods (all mods if none are selected)"));
connect(ui->actionUpdateItem, &QAction::triggered, this, &ModFolderPage::updateMods);