From 2e50e897934831637c3e63d92f089cf8c260c698 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Fri, 26 Apr 2024 15:54:20 -0400 Subject: [PATCH] Disable Linux-only options that aren't relevant on Windows --- launcher/include/launchercore.h | 2 ++ launcher/src/launchercore.cpp | 9 +++++++++ launcher/ui/Settings/ProfileSettings.qml | 5 +++++ launcher/ui/Settings/SettingsPage.qml | 1 + 4 files changed, 17 insertions(+) diff --git a/launcher/include/launchercore.h b/launcher/include/launchercore.h index f55d53b..cea0b8f 100755 --- a/launcher/include/launchercore.h +++ b/launcher/include/launchercore.h @@ -62,6 +62,7 @@ class LauncherCore : public QObject Q_PROPERTY(bool loadingFinished READ isLoadingFinished NOTIFY loadingFinished) Q_PROPERTY(bool isSteam READ isSteam CONSTANT) Q_PROPERTY(bool isSteamDeck READ isSteamDeck CONSTANT) + Q_PROPERTY(bool isWindows READ isWindows CONSTANT) Q_PROPERTY(LauncherSettings *settings READ settings CONSTANT) Q_PROPERTY(ProfileManager *profileManager READ profileManager CONSTANT) Q_PROPERTY(AccountManager *accountManager READ accountManager CONSTANT) @@ -110,6 +111,7 @@ public: [[nodiscard]] bool isLoadingFinished() const; [[nodiscard]] bool isSteam() const; [[nodiscard]] bool isSteamDeck() const; + [[nodiscard]] bool isWindows() const; [[nodiscard]] Q_INVOKABLE bool isPatching() const; [[nodiscard]] QNetworkAccessManager *mgr(); diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index de2a340..0213344 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -302,6 +302,15 @@ bool LauncherCore::isSteamDeck() const } } +bool LauncherCore::isWindows() const +{ +#if defined(Q_OS_WIN) + return true; +#else + return false; +#endif +} + bool LauncherCore::isPatching() const { return m_isPatching; diff --git a/launcher/ui/Settings/ProfileSettings.qml b/launcher/ui/Settings/ProfileSettings.qml index 597bf7c..1f4b983 100644 --- a/launcher/ui/Settings/ProfileSettings.qml +++ b/launcher/ui/Settings/ProfileSettings.qml @@ -90,6 +90,8 @@ FormCard.FormCardPage { } FormCard.FormCard { + visible: !LauncherCore.isWindows + Layout.fillWidth: true FormCard.FormComboBoxDelegate { @@ -139,9 +141,12 @@ FormCard.FormCardPage { FormCard.FormHeader { title: i18n("Tools") + visible: !LauncherCore.isWindows } FormCard.FormCard { + visible: !LauncherCore.isWindows + Layout.fillWidth: true FormCard.FormCheckDelegate { diff --git a/launcher/ui/Settings/SettingsPage.qml b/launcher/ui/Settings/SettingsPage.qml index 74ef56a..7ca1591 100644 --- a/launcher/ui/Settings/SettingsPage.qml +++ b/launcher/ui/Settings/SettingsPage.qml @@ -51,6 +51,7 @@ KirigamiSettings.CategorizedSettings { text: i18n("Compatibility Tool") icon.name: "system-run" page: Qt.resolvedUrl("/qt/qml/zone/xiv/astra/ui/Settings/CompatibilityToolSetup.qml") + visible: !LauncherCore.isWindows }, KirigamiSettings.SettingAction { actionName: "devtool"