aboutsummaryrefslogtreecommitdiff
path: root/launcher/ui/pages/instance/VersionPage.cpp
diff options
context:
space:
mode:
authorTheKodeToad <TheKodeToad@proton.me>2022-11-08 11:20:13 +0000
committerTheKodeToad <TheKodeToad@proton.me>2022-11-23 09:46:55 +0000
commit96e8217b0034a7d73c7a37881955c51d3b248dca (patch)
tree1cecbbdc6fe912e952f0e18fbdfe68639d71042b /launcher/ui/pages/instance/VersionPage.cpp
parent298871e207718cc593a02b8f0f2f64f44bf02191 (diff)
downloadPrismLauncher-96e8217b0034a7d73c7a37881955c51d3b248dca.tar.gz
PrismLauncher-96e8217b0034a7d73c7a37881955c51d3b248dca.tar.bz2
PrismLauncher-96e8217b0034a7d73c7a37881955c51d3b248dca.zip
Button to add agent
Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
Diffstat (limited to 'launcher/ui/pages/instance/VersionPage.cpp')
-rw-r--r--launcher/ui/pages/instance/VersionPage.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/launcher/ui/pages/instance/VersionPage.cpp b/launcher/ui/pages/instance/VersionPage.cpp
index a021c633..7f98cba2 100644
--- a/launcher/ui/pages/instance/VersionPage.cpp
+++ b/launcher/ui/pages/instance/VersionPage.cpp
@@ -1,8 +1,9 @@
// SPDX-License-Identifier: GPL-3.0-only
/*
- * PolyMC - Minecraft Launcher
+ * Prism Launcher - Minecraft Launcher
* Copyright (c) 2022 Jamie Mansfield <jmansfield@cadixdev.org>
* Copyright (C) 2022 Sefa Eyeoglu <contact@scrumplex.net>
+ * Copyright (C) 2022 TheKodeToad <TheKodeToad@proton.me>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -270,6 +271,7 @@ void VersionPage::updateButtons(int row)
ui->actionInstall_mods->setEnabled(controlsEnabled);
ui->actionReplace_Minecraft_jar->setEnabled(controlsEnabled);
ui->actionAdd_to_Minecraft_jar->setEnabled(controlsEnabled);
+ ui->actionAdd_Agents->setEnabled(controlsEnabled);
}
bool VersionPage::reloadPackProfile()
@@ -342,6 +344,18 @@ void VersionPage::on_actionReplace_Minecraft_jar_triggered()
updateButtons();
}
+
+void VersionPage::on_actionAdd_Agents_triggered()
+{
+ QStringList list = GuiUtil::BrowseForFiles("agent", tr("Select agents"), tr("Java agents (*.jar)"),
+ APPLICATION->settings()->get("CentralModsDir").toString(), this->parentWidget());
+
+ if (!list.isEmpty())
+ m_profile->installAgents(list);
+
+ updateButtons();
+}
+
void VersionPage::on_actionMove_up_triggered()
{
try