diff --git a/src/devtools/CMakeLists.txt b/src/devtools/CMakeLists.txt index f1d924bee..a2c8afbeb 100644 --- a/src/devtools/CMakeLists.txt +++ b/src/devtools/CMakeLists.txt @@ -8,6 +8,7 @@ qt_add_qml_module(devtools QML_FILES DevtoolsPage.qml AccountData.qml + DebugOptions.qml FeatureFlagPage.qml RoomData.qml ServerData.qml diff --git a/src/devtools/DebugOptions.qml b/src/devtools/DebugOptions.qml new file mode 100644 index 000000000..fe2feb572 --- /dev/null +++ b/src/devtools/DebugOptions.qml @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2024 James Graham +// SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL + +import QtQuick +import QtQuick.Layouts + +import org.kde.kirigami as Kirigami +import org.kde.kirigamiaddons.formcard as FormCard + +import org.kde.neochat + +FormCard.FormCardPage { + id: root + + FormCard.FormCard { + Layout.topMargin: Kirigami.Units.largeSpacing + + FormCard.FormCheckDelegate { + id: roomAccountDataVisibleCheck + text: i18nc("@option:check Enable the matrix 'threads' feature", "Always allow device verification") + description: i18n("Allow the user to start a verification session with devices that were already verified") + checked: Config.alwaysVerifyDevice + + onToggled: Config.alwaysVerifyDevice = checked + } + } +} diff --git a/src/devtools/DevtoolsPage.qml b/src/devtools/DevtoolsPage.qml index 04dc6cc0f..a84ecae88 100644 --- a/src/devtools/DevtoolsPage.qml +++ b/src/devtools/DevtoolsPage.qml @@ -25,6 +25,11 @@ FormCard.FormCardPage { readonly property real tabWidth: tabBar.width / tabBar.count + QQC2.TabButton { + text: i18nc("@title:tab", "Debug Options") + + implicitWidth: tabBar.tabWidth + } QQC2.TabButton { text: qsTr("Room Data") @@ -52,6 +57,7 @@ FormCard.FormCardPage { currentIndex: tabBar.currentIndex + DebugOptions {} RoomData { room: root.room connection: root.connection diff --git a/src/neochatconfig.kcfg b/src/neochatconfig.kcfg index 080e0ca16..10d20ab41 100644 --- a/src/neochatconfig.kcfg +++ b/src/neochatconfig.kcfg @@ -156,6 +156,12 @@ + + + + false + + diff --git a/src/settings/DeviceDelegate.qml b/src/settings/DeviceDelegate.qml index 46d607488..22520510c 100644 --- a/src/settings/DeviceDelegate.qml +++ b/src/settings/DeviceDelegate.qml @@ -99,7 +99,7 @@ FormCard.AbstractFormDelegate { } QQC2.ToolButton { display: QQC2.AbstractButton.IconOnly - visible: root.showVerifyButton && root.type !== DevicesModel.Verified + visible: root.showVerifyButton && (root.type !== DevicesModel.Verified || Config.alwaysVerifyDevice) action: Kirigami.Action { id: verifyDeviceAction text: i18n("Verify device")