From 346f4eae9ec06d6d85b7eae6e668c23df290c700 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 19 Apr 2024 20:50:14 -0400 Subject: [PATCH] Add action to quickly open the user folder in account settings --- launcher/include/account.h | 1 + launcher/src/account.cpp | 5 +++++ launcher/ui/Settings/AccountSettings.qml | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/launcher/include/account.h b/launcher/include/account.h index 192b22a..4d3009f 100644 --- a/launcher/include/account.h +++ b/launcher/include/account.h @@ -79,6 +79,7 @@ public: /// Returns the path to the FFXIV config folder [[nodiscard]] QDir getConfigDir() const; + [[nodiscard]] Q_INVOKABLE QString getConfigPath() const; /// Updates FFXIV.cfg with some recommended options like turning the opening cutscene movie off void updateConfig(); diff --git a/launcher/src/account.cpp b/launcher/src/account.cpp index 4144cd2..e552e7d 100644 --- a/launcher/src/account.cpp +++ b/launcher/src/account.cpp @@ -223,6 +223,11 @@ QDir Account::getConfigDir() const return userDir.absoluteFilePath(m_key); } +QString Account::getConfigPath() const +{ + return getConfigDir().absolutePath(); +} + void Account::fetchAvatar() { if (lodestoneId().isEmpty()) { diff --git a/launcher/ui/Settings/AccountSettings.qml b/launcher/ui/Settings/AccountSettings.qml index b12ff0e..631de7b 100644 --- a/launcher/ui/Settings/AccountSettings.qml +++ b/launcher/ui/Settings/AccountSettings.qml @@ -19,6 +19,13 @@ FormCard.FormCardPage { title: i18nc("@title:window", "Edit Account") actions: [ + Kirigami.Action { + text: i18n("Open User Folder…") + tooltip: i18n("The user folder contains saved appearance data and character settings for this account.") + icon.name: "folder-open-symbolic" + + onTriggered: Qt.openUrlExternally("file://" + page.account.getConfigPath()) + }, Kirigami.Action { text: i18n("Delete Account…") tooltip: !enabled ? i18n("Cannot delete the only account.") : ""