From cb738db9a54a3f087a8fde405b9c52277e7783c2 Mon Sep 17 00:00:00 2001 From: crueter Date: Sun, 7 Dec 2025 13:53:47 -0500 Subject: [PATCH] [config] warn user on reload Signed-off-by: crueter --- src/Eden/Config/GlobalConfigureDialog.qml | 25 +++++++++++-------- src/Eden/Config/pages/SettingsList.qml | 3 ++- .../Config/pages/general/UiGeneralPage.qml | 11 +------- src/Eden/Interface/SettingsInterface.h | 1 - 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/src/Eden/Config/GlobalConfigureDialog.qml b/src/Eden/Config/GlobalConfigureDialog.qml index 320ac42cc5..709cc9d651 100644 --- a/src/Eden/Config/GlobalConfigureDialog.qml +++ b/src/Eden/Config/GlobalConfigureDialog.qml @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later - import QtQuick import QtQuick.Controls import QtQuick.Layouts @@ -21,9 +20,7 @@ NativeDialog { title: qsTr("Eden Configuration") standardButtons: Dialog.Ok | Dialog.Apply | Dialog.Cancel - Component.onCompleted: { - configs = Util.searchItem(swipe, "PageScrollView") - } + Component.onCompleted: configs = Util.searchItem(swipe, "PageScrollView") function applyConfigs() { configs.forEach(config => { @@ -33,21 +30,29 @@ NativeDialog { QtConfig.save() } + MessageDialog { + id: warn + text: qsTr("To apply the new style, Eden will now close and re-open.") + icon: CarboxylEnums.Warning + title: qsTr("Reloading") + standardButtons: DialogButtonBox.Ok + + onVisibleChanged: if (!visible) + EdenApplication.reload() + } + onAccepted: { applyConfigs() + // TODO(crueter): Configurable game icon size for carousel if (EdenApplication.shouldReload) { EdenApplication.shouldReload = false - // TODO(crueter): Warn the user. - // TODO(crueter): Configurable game icon size for carousel - EdenApplication.reload() + warn.show() } } - onApplied: { - applyConfigs() - } + onApplied: applyConfigs() onRejected: { diff --git a/src/Eden/Config/pages/SettingsList.qml b/src/Eden/Config/pages/SettingsList.qml index eb58e1079e..4e45b9aaac 100644 --- a/src/Eden/Config/pages/SettingsList.qml +++ b/src/Eden/Config/pages/SettingsList.qml @@ -1,6 +1,5 @@ // SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later - import QtQuick import QtQuick.Layouts @@ -36,5 +35,7 @@ ListView { Layout.leftMargin: 0 spacing: 5 + // TODO: Many styles can get away with 0 or even negative spacing + // Maybe make a "touch-friendly" setting? model: SettingsInterface.category(category, idInclude, idExclude) } diff --git a/src/Eden/Config/pages/general/UiGeneralPage.qml b/src/Eden/Config/pages/general/UiGeneralPage.qml index 029a38bfe1..66b23f66a2 100644 --- a/src/Eden/Config/pages/general/UiGeneralPage.qml +++ b/src/Eden/Config/pages/general/UiGeneralPage.qml @@ -1,6 +1,6 @@ + // SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later - import QtQuick import QtQuick.Controls import QtQuick.Layouts @@ -24,9 +24,6 @@ PageScrollView { Clover.accent = Clover.accents[accent.contentItem.currentIndex] Clover.theme = Clover.themes[theme.contentItem.currentIndex] - - if (linux.visible) - linux.apply() } ColumnLayout { @@ -42,12 +39,6 @@ PageScrollView { visible: Qt.platform.os === "linux" } - SettingsList { - id: linux - category: SettingsCategories.Linux - visible: Qt.platform.os === "linux" - } - SectionHeader { text: qsTr("Theming") } diff --git a/src/Eden/Interface/SettingsInterface.h b/src/Eden/Interface/SettingsInterface.h index 9b1ed5ddd1..aca4184cc3 100644 --- a/src/Eden/Interface/SettingsInterface.h +++ b/src/Eden/Interface/SettingsInterface.h @@ -47,7 +47,6 @@ enum class Category { Multiplayer = u32(Settings::Category::Multiplayer), Services = u32(Settings::Category::Services), Paths = u32(Settings::Category::Paths), - Linux = u32(Settings::Category::Linux), LibraryApplet = u32(Settings::Category::LibraryApplet), MaxEnum = u32(Settings::Category::MaxEnum), };