From d83faa6bbb9043e952c81229d1dc3d1d1895fa2c Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 26 May 2024 08:15:20 -0400 Subject: [PATCH] Add button to change the install folder when setting up a profile This is useful if you want to set up the game on an external disk or SD card, for example. --- launcher/ui/Setup/SetupPage.qml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/launcher/ui/Setup/SetupPage.qml b/launcher/ui/Setup/SetupPage.qml index c6f4204..5534767 100644 --- a/launcher/ui/Setup/SetupPage.qml +++ b/launcher/ui/Setup/SetupPage.qml @@ -19,10 +19,17 @@ FormCard.FormCardPage { title: isInitialSetup ? i18n("Initial Setup") : i18n("Profile Setup") + data: FolderDialog { + id: installFolderDialog + + onAccepted: page.profile.gamePath = decodeURIComponent(selectedFolder.toString().replace("file://", "")) + } + Image { source: "qrc:/zone.xiv.astra.svg" fillMode: Image.PreserveAspectFit + visible: !LauncherCore.profileManager.hasAnyExistingInstallations() Layout.fillWidth: true Layout.fillHeight: true @@ -31,16 +38,34 @@ FormCard.FormCardPage { FormCard.FormCard { Layout.fillWidth: true + Layout.topMargin: LauncherCore.profileManager.hasAnyExistingInstallations() ? Kirigami.Units.largeSpacing : 0 FormCard.FormTextDelegate { + id: helpText + text: { if (page.isInitialSetup) { - return i18n("You must have a legitimate installation of the FFXIV to continue."); + return i18n("You must have a legitimate installation of FFXIV to continue."); } else { - return i18n("Select a game installation of FFXIV for '%1'.", page.profile.name); + return i18n("Select a game installation for '%1'.", page.profile.name); } } } + + FormCard.FormDelegateSeparator { + above: helpText + below: selectInstallFolder + } + + FormCard.FormButtonDelegate { + id: selectInstallFolder + + icon.name: "document-open-folder" + text: i18n("Select Install Folder") + description: profile.gamePath + + onClicked: installFolderDialog.open() + } } FormCard.FormHeader {