aboutsummaryrefslogtreecommitdiff
path: root/application/pages/instance/WorldListPage.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2020-11-24 22:31:19 +0100
committerPetr Mrázek <peterix@gmail.com>2020-11-24 22:31:49 +0100
commit88d6b6ea3fb8b6f3711d4d829f78c367e497945a (patch)
tree2b59ee91b3b18cda41f48db21cf9fd4f507fdd7f /application/pages/instance/WorldListPage.cpp
parent66c09999014fd4337baa6ae03f019cb77917d6df (diff)
downloadPrismLauncher-88d6b6ea3fb8b6f3711d4d829f78c367e497945a.tar.gz
PrismLauncher-88d6b6ea3fb8b6f3711d4d829f78c367e497945a.tar.bz2
PrismLauncher-88d6b6ea3fb8b6f3711d4d829f78c367e497945a.zip
GH-3427 add low effort datapack button to worlds
Diffstat (limited to 'application/pages/instance/WorldListPage.cpp')
-rw-r--r--application/pages/instance/WorldListPage.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/application/pages/instance/WorldListPage.cpp b/application/pages/instance/WorldListPage.cpp
index 75741d22..4d737025 100644
--- a/application/pages/instance/WorldListPage.cpp
+++ b/application/pages/instance/WorldListPage.cpp
@@ -170,6 +170,24 @@ void WorldListPage::on_actionView_Folder_triggered()
DesktopServices::openDirectory(m_worlds->dir().absolutePath(), true);
}
+void WorldListPage::on_actionDatapacks_triggered()
+{
+ QModelIndex index = getSelectedWorld();
+
+ if (!index.isValid())
+ {
+ return;
+ }
+
+ if(!worldSafetyNagQuestion())
+ return;
+
+ auto fullPath = m_worlds->data(index, WorldList::FolderRole).toString();
+
+ DesktopServices::openDirectory(FS::PathCombine(fullPath, "datapacks"), true);
+}
+
+
void WorldListPage::on_actionReset_Icon_triggered()
{
auto proxiedIndex = getSelectedWorld();