aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRedson <redson@riseup.net>2023-05-08 19:57:30 -0300
committerRedson <redson@riseup.net>2023-05-08 19:57:30 -0300
commit0b251fa7545dbe7e61a2a57f5f3e0ff2198b2314 (patch)
tree1675fec0a94507a03ceefd7af32ef4fe155ce1ee
parentce5bb29c442cee3654c5f4287a999d5d6593032f (diff)
downloadPrismLauncher-0b251fa7545dbe7e61a2a57f5f3e0ff2198b2314.tar.gz
PrismLauncher-0b251fa7545dbe7e61a2a57f5f3e0ff2198b2314.tar.bz2
PrismLauncher-0b251fa7545dbe7e61a2a57f5f3e0ff2198b2314.zip
feat: Add the launcher root folder to the Folders menu
Signed-off-by: Redson <redson@riseup.net>
-rw-r--r--launcher/ui/MainWindow.cpp8
-rw-r--r--launcher/ui/MainWindow.h2
-rw-r--r--launcher/ui/MainWindow.ui13
3 files changed, 23 insertions, 0 deletions
diff --git a/launcher/ui/MainWindow.cpp b/launcher/ui/MainWindow.cpp
index 72b7db64..8d62dcd6 100644
--- a/launcher/ui/MainWindow.cpp
+++ b/launcher/ui/MainWindow.cpp
@@ -1201,6 +1201,14 @@ void MainWindow::on_actionViewInstanceFolder_triggered()
DesktopServices::openDirectory(str);
}
+void MainWindow::on_actionViewLauncherRootFolder_triggered()
+{
+ QDir rootDir(FS::PathCombine(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation), ".."));
+ QString DataPath = rootDir.absolutePath();
+
+ DesktopServices::openDirectory(DataPath);
+}
+
void MainWindow::refreshInstances()
{
APPLICATION->instances()->loadList();
diff --git a/launcher/ui/MainWindow.h b/launcher/ui/MainWindow.h
index 3a42c34e..08efb8a1 100644
--- a/launcher/ui/MainWindow.h
+++ b/launcher/ui/MainWindow.h
@@ -112,6 +112,8 @@ private slots:
void on_actionViewInstanceFolder_triggered();
+ void on_actionViewLauncherRootFolder_triggered();
+
void on_actionViewSelectedInstFolder_triggered();
void refreshInstances();
diff --git a/launcher/ui/MainWindow.ui b/launcher/ui/MainWindow.ui
index 2b6a10b1..7c53e294 100644
--- a/launcher/ui/MainWindow.ui
+++ b/launcher/ui/MainWindow.ui
@@ -187,6 +187,7 @@
<bool>true</bool>
</property>
<addaction name="actionViewInstanceFolder"/>
+ <addaction name="actionViewLauncherRootFolder"/>
<addaction name="actionViewCentralModsFolder"/>
</widget>
<widget class="QMenu" name="accountsMenu">
@@ -528,6 +529,18 @@
<string>Open the instance folder in a file browser.</string>
</property>
</action>
+ <action name="actionViewLauncherRootFolder">
+ <property name="icon">
+ <iconset theme="viewfolder">
+ <normaloff>.</normaloff>.</iconset>
+ </property>
+ <property name="text">
+ <string>&amp;View Launcher Root Folder</string>
+ </property>
+ <property name="toolTip">
+ <string>Open the launcher's root folder in a file browser.</string>
+ </property>
+ </action>
<action name="actionViewCentralModsFolder">
<property name="icon">
<iconset theme="centralmods">