Add a debug options page to devtools with the option to always allow verification for now
Closes network/neochat#646
This commit is contained in:
@@ -8,6 +8,7 @@ qt_add_qml_module(devtools
|
|||||||
QML_FILES
|
QML_FILES
|
||||||
DevtoolsPage.qml
|
DevtoolsPage.qml
|
||||||
AccountData.qml
|
AccountData.qml
|
||||||
|
DebugOptions.qml
|
||||||
FeatureFlagPage.qml
|
FeatureFlagPage.qml
|
||||||
RoomData.qml
|
RoomData.qml
|
||||||
ServerData.qml
|
ServerData.qml
|
||||||
|
|||||||
27
src/devtools/DebugOptions.qml
Normal file
27
src/devtools/DebugOptions.qml
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
// SPDX-FileCopyrightText: 2024 James Graham <james.h.graham@protonmail.com>
|
||||||
|
// 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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -25,6 +25,11 @@ FormCard.FormCardPage {
|
|||||||
|
|
||||||
readonly property real tabWidth: tabBar.width / tabBar.count
|
readonly property real tabWidth: tabBar.width / tabBar.count
|
||||||
|
|
||||||
|
QQC2.TabButton {
|
||||||
|
text: i18nc("@title:tab", "Debug Options")
|
||||||
|
|
||||||
|
implicitWidth: tabBar.tabWidth
|
||||||
|
}
|
||||||
QQC2.TabButton {
|
QQC2.TabButton {
|
||||||
text: qsTr("Room Data")
|
text: qsTr("Room Data")
|
||||||
|
|
||||||
@@ -52,6 +57,7 @@ FormCard.FormCardPage {
|
|||||||
|
|
||||||
currentIndex: tabBar.currentIndex
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
|
DebugOptions {}
|
||||||
RoomData {
|
RoomData {
|
||||||
room: root.room
|
room: root.room
|
||||||
connection: root.connection
|
connection: root.connection
|
||||||
|
|||||||
@@ -156,6 +156,12 @@
|
|||||||
<default></default>
|
<default></default>
|
||||||
</entry>
|
</entry>
|
||||||
</group>
|
</group>
|
||||||
|
<group name="Debug">
|
||||||
|
<entry name="AlwaysVerifyDevice" type="bool">
|
||||||
|
<label>Always allow device verification</label>
|
||||||
|
<default>false</default>
|
||||||
|
</entry>
|
||||||
|
</group>
|
||||||
<group name="FeatureFlags">
|
<group name="FeatureFlags">
|
||||||
<entry name="Threads" type="bool">
|
<entry name="Threads" type="bool">
|
||||||
<label>Enable threads</label>
|
<label>Enable threads</label>
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ FormCard.AbstractFormDelegate {
|
|||||||
}
|
}
|
||||||
QQC2.ToolButton {
|
QQC2.ToolButton {
|
||||||
display: QQC2.AbstractButton.IconOnly
|
display: QQC2.AbstractButton.IconOnly
|
||||||
visible: root.showVerifyButton && root.type !== DevicesModel.Verified
|
visible: root.showVerifyButton && (root.type !== DevicesModel.Verified || Config.alwaysVerifyDevice)
|
||||||
action: Kirigami.Action {
|
action: Kirigami.Action {
|
||||||
id: verifyDeviceAction
|
id: verifyDeviceAction
|
||||||
text: i18n("Verify device")
|
text: i18n("Verify device")
|
||||||
|
|||||||
Reference in New Issue
Block a user