diff options
author | Petr Mrázek <peterix@gmail.com> | 2020-11-24 22:31:19 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2020-11-24 22:31:49 +0100 |
commit | 88d6b6ea3fb8b6f3711d4d829f78c367e497945a (patch) | |
tree | 2b59ee91b3b18cda41f48db21cf9fd4f507fdd7f /application/pages/instance/WorldListPage.cpp | |
parent | 66c09999014fd4337baa6ae03f019cb77917d6df (diff) | |
download | PrismLauncher-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.cpp | 18 |
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(); |