Port remaining room settings to FormCard
This commit is contained in:
@@ -8,33 +8,24 @@ import QtQuick.Layouts 1.15
|
|||||||
import QtQuick.Window 2.15
|
import QtQuick.Window 2.15
|
||||||
|
|
||||||
import org.kde.kirigami 2.15 as Kirigami
|
import org.kde.kirigami 2.15 as Kirigami
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||||
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property NeoChatRoom room
|
property NeoChatRoom room
|
||||||
|
|
||||||
title: i18n("General")
|
title: i18n("General")
|
||||||
topPadding: 0
|
|
||||||
leftPadding: 0
|
FormCard.FormHeader {
|
||||||
rightPadding: 0
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormHeader {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18n("Room Information")
|
title: i18n("Room Information")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.AbstractFormDelegate {
|
||||||
contentItem: ColumnLayout {
|
background: null
|
||||||
spacing: 0
|
|
||||||
MobileForm.AbstractFormDelegate {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
background: Item {}
|
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -75,15 +66,14 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormTextFieldDelegate {
|
FormCard.FormTextFieldDelegate {
|
||||||
id: roomNameField
|
id: roomNameField
|
||||||
label: i18n("Room name:")
|
label: i18n("Room name:")
|
||||||
text: room.name
|
text: room.name
|
||||||
enabled: room.canSendState("m.room.name")
|
enabled: room.canSendState("m.room.name")
|
||||||
}
|
}
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: roomTopicField
|
id: roomTopicField
|
||||||
Layout.fillWidth: true
|
|
||||||
enabled: room.canSendState("m.room.topic")
|
enabled: room.canSendState("m.room.topic")
|
||||||
background: Item {}
|
background: Item {}
|
||||||
contentItem: ColumnLayout {
|
contentItem: ColumnLayout {
|
||||||
@@ -100,8 +90,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
Layout.fillWidth: true
|
|
||||||
background: Item {}
|
background: Item {}
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
Item {
|
Item {
|
||||||
@@ -124,7 +113,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
id: roomIdDelegate
|
id: roomIdDelegate
|
||||||
text: i18n("Room ID")
|
text: i18n("Room ID")
|
||||||
description: room.id
|
description: room.id
|
||||||
@@ -144,7 +133,7 @@ Kirigami.ScrollablePage {
|
|||||||
QQC2.ToolTip.visible: hovered
|
QQC2.ToolTip.visible: hovered
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormTextDelegate {
|
FormCard.FormTextDelegate {
|
||||||
text: i18n("Room version")
|
text: i18n("Room version")
|
||||||
description: room.version
|
description: room.version
|
||||||
|
|
||||||
@@ -168,17 +157,12 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18n("Aliases")
|
title: i18n("Aliases")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormTextDelegate {
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormTextDelegate {
|
|
||||||
visible: room.aliases.length <= 0
|
visible: room.aliases.length <= 0
|
||||||
text: i18n("No canonical alias set")
|
text: i18n("No canonical alias set")
|
||||||
}
|
}
|
||||||
@@ -186,7 +170,7 @@ Kirigami.ScrollablePage {
|
|||||||
id: altAliasRepeater
|
id: altAliasRepeater
|
||||||
model: room.aliases.slice().reverse()
|
model: room.aliases.slice().reverse()
|
||||||
|
|
||||||
delegate: MobileForm.FormTextDelegate {
|
delegate: FormCard.FormTextDelegate {
|
||||||
text: modelData
|
text: modelData
|
||||||
description: room.canonicalAlias.length > 0 && modelData === room.canonicalAlias ? "Canonical alias" : ""
|
description: room.canonicalAlias.length > 0 && modelData === room.canonicalAlias ? "Canonical alias" : ""
|
||||||
contentItem.children: [
|
contentItem.children: [
|
||||||
@@ -224,8 +208,7 @@ Kirigami.ScrollablePage {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.canonical_alias")
|
visible: room.canSendState("m.room.canonical_alias")
|
||||||
|
|
||||||
contentItem : RowLayout {
|
contentItem : RowLayout {
|
||||||
@@ -268,17 +251,12 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18n("URL Previews")
|
title: i18n("URL Previews")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormCheckDelegate {
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormCheckDelegate {
|
|
||||||
text: i18n("Enable URL previews by default for room members")
|
text: i18n("Enable URL previews by default for room members")
|
||||||
checked: room.defaultUrlPreviewState
|
checked: room.defaultUrlPreviewState
|
||||||
visible: room.canSendState("org.matrix.room.preview_urls")
|
visible: room.canSendState("org.matrix.room.preview_urls")
|
||||||
@@ -286,7 +264,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.defaultUrlPreviewState = checked
|
room.defaultUrlPreviewState = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormCheckDelegate {
|
FormCard.FormCheckDelegate {
|
||||||
text: i18n("Enable URL previews")
|
text: i18n("Enable URL previews")
|
||||||
// Most users won't see the above setting so tell them the default.
|
// Most users won't see the above setting so tell them the default.
|
||||||
description: room.defaultUrlPreviewState ? i18n("URL previews are enabled by default in this room") : i18n("URL previews are disabled by default in this room")
|
description: room.defaultUrlPreviewState ? i18n("URL previews are enabled by default in this room") : i18n("URL previews are disabled by default in this room")
|
||||||
@@ -296,10 +274,8 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Kirigami.InlineMessage {
|
Kirigami.InlineMessage {
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.maximumWidth: Kirigami.Units.gridUnit * 30
|
Layout.maximumWidth: Kirigami.Units.gridUnit * 30
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: i18n("This room continues another conversation.")
|
text: i18n("This room continues another conversation.")
|
||||||
@@ -314,7 +290,6 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Kirigami.InlineMessage {
|
Kirigami.InlineMessage {
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.maximumWidth: Kirigami.Units.gridUnit * 30
|
Layout.maximumWidth: Kirigami.Units.gridUnit * 30
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
text: i18n("This room has been replaced.")
|
text: i18n("This room has been replaced.")
|
||||||
@@ -329,7 +304,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
property Component openFileDialog: Component {
|
||||||
id: openFileDialog
|
id: openFileDialog
|
||||||
|
|
||||||
OpenFileDialog {
|
OpenFileDialog {
|
||||||
@@ -337,7 +312,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.OverlaySheet {
|
property Kirigami.OverlaySheet roomUpgradeSheet: Kirigami.OverlaySheet {
|
||||||
id: roomUpgradeSheet
|
id: roomUpgradeSheet
|
||||||
|
|
||||||
property var currentRoomVersion
|
property var currentRoomVersion
|
||||||
@@ -360,6 +335,6 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,53 +6,44 @@ import QtQuick.Controls 2.15 as QQC2
|
|||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
|
|
||||||
import org.kde.kirigami 2.15 as Kirigami
|
import org.kde.kirigami 2.15 as Kirigami
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||||
import org.kde.kirigamiaddons.delegates 1.0 as Delegates
|
import org.kde.kirigamiaddons.delegates 1.0 as Delegates
|
||||||
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
import org.kde.kirigamiaddons.labs.components 1.0 as KirigamiComponents
|
||||||
import org.kde.kitemmodels 1.0
|
import org.kde.kitemmodels 1.0
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property NeoChatRoom room
|
property NeoChatRoom room
|
||||||
|
|
||||||
title: i18nc('@title:window', 'Permissions')
|
title: i18nc('@title:window', 'Permissions')
|
||||||
topPadding: 0
|
|
||||||
leftPadding: 0
|
|
||||||
rightPadding: 0
|
|
||||||
|
|
||||||
UserListModel {
|
property UserListModel userListModel: UserListModel {
|
||||||
id: userListModel
|
id: userListModel
|
||||||
room: root.room
|
room: root.room
|
||||||
}
|
}
|
||||||
|
|
||||||
ListModel {
|
property ListModel powerLevelModel: ListModel {
|
||||||
id: powerLevelModel
|
id: powerLevelModel
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
FormCard.FormHeader {
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormHeader {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18n("Privileged Users")
|
title: i18n("Privileged Users")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
Repeater {
|
Repeater {
|
||||||
model: KSortFilterProxyModel {
|
model: KSortFilterProxyModel {
|
||||||
sourceModel: userListModel
|
sourceModel: userListModel
|
||||||
sortRole: "powerLevel"
|
sortRoleName: "powerLevel"
|
||||||
sortOrder: Qt.DescendingOrder
|
sortOrder: Qt.DescendingOrder
|
||||||
filterRowCallback: function(source_row, source_parent) {
|
filterRowCallback: function(source_row, source_parent) {
|
||||||
let powerLevelRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), UserListModel.PowerLevelRole)
|
let powerLevelRole = sourceModel.data(sourceModel.index(source_row, 0, source_parent), UserListModel.PowerLevelRole)
|
||||||
return powerLevelRole > 0;
|
return powerLevelRole > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
delegate: MobileForm.FormTextDelegate {
|
delegate: FormCard.FormTextDelegate {
|
||||||
text: name
|
text: name
|
||||||
description: userId
|
description: userId
|
||||||
contentItem.children: RowLayout {
|
contentItem.children: RowLayout {
|
||||||
@@ -88,10 +79,9 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormDelegateSeparator { below: userListSearchCard }
|
FormCard.FormDelegateSeparator { below: userListSearchCard }
|
||||||
MobileForm.AbstractFormDelegate {
|
FormCard.AbstractFormDelegate {
|
||||||
id: userListSearchCard
|
id: userListSearchCard
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
|
|
||||||
contentItem: Kirigami.SearchField {
|
contentItem: Kirigami.SearchField {
|
||||||
@@ -234,19 +224,14 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
title: i18n("Default permissions")
|
title: i18n("Default permissions")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
contentItem: ColumnLayout {
|
FormCard.FormComboBoxDelegate {
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormComboBoxDelegate {
|
|
||||||
text: i18n("Default user power level")
|
text: i18n("Default user power level")
|
||||||
description: i18n("This is power level for all new users when joining the room")
|
description: i18n("This is power level for all new users when joining the room")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -255,7 +240,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.defaultUserPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.defaultUserPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultUserPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultUserPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Default power level to set the room state")
|
text: i18n("Default power level to set the room state")
|
||||||
description: i18n("This is used for all state events that do not have their own entry here")
|
description: i18n("This is used for all state events that do not have their own entry here")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -264,7 +249,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.statePowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.statePowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.statePowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.statePowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Default power level to send messages")
|
text: i18n("Default power level to send messages")
|
||||||
description: i18n("This is used for all message events that do not have their own entry here")
|
description: i18n("This is used for all message events that do not have their own entry here")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -274,19 +259,14 @@ Kirigami.ScrollablePage {
|
|||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultEventPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.defaultEventPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
title: i18n("Basic permissions")
|
title: i18n("Basic permissions")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
contentItem: ColumnLayout {
|
FormCard.FormComboBoxDelegate {
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormComboBoxDelegate {
|
|
||||||
text: i18n("Invite users")
|
text: i18n("Invite users")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
valueRole: "powerLevel"
|
valueRole: "powerLevel"
|
||||||
@@ -294,7 +274,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.invitePowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.invitePowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.invitePowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.invitePowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Kick users")
|
text: i18n("Kick users")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
valueRole: "powerLevel"
|
valueRole: "powerLevel"
|
||||||
@@ -302,7 +282,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.kickPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.kickPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.kickPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.kickPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Ban users")
|
text: i18n("Ban users")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
valueRole: "powerLevel"
|
valueRole: "powerLevel"
|
||||||
@@ -310,7 +290,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.banPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.banPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.banPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.banPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Remove message sent by other users")
|
text: i18n("Remove message sent by other users")
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
valueRole: "powerLevel"
|
valueRole: "powerLevel"
|
||||||
@@ -319,19 +299,14 @@ Kirigami.ScrollablePage {
|
|||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.redactPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.redactPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
title: i18n("Event permissions")
|
title: i18n("Event permissions")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
|
||||||
visible: room.canSendState("m.room.power_levels")
|
visible: room.canSendState("m.room.power_levels")
|
||||||
contentItem: ColumnLayout {
|
FormCard.FormComboBoxDelegate {
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormComboBoxDelegate {
|
|
||||||
text: i18n("Change user permissions")
|
text: i18n("Change user permissions")
|
||||||
description: "m.room.power_levels"
|
description: "m.room.power_levels"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -340,7 +315,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.powerLevelPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.powerLevelPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.powerLevelPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.powerLevelPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Change the room name")
|
text: i18n("Change the room name")
|
||||||
description: "m.room.name"
|
description: "m.room.name"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -349,7 +324,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.namePowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.namePowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.namePowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.namePowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Change the room avatar")
|
text: i18n("Change the room avatar")
|
||||||
description: "m.room.avatar"
|
description: "m.room.avatar"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -358,7 +333,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.avatarPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.avatarPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.avatarPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.avatarPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Change the room canonical alias")
|
text: i18n("Change the room canonical alias")
|
||||||
description: "m.room.canonical_alias"
|
description: "m.room.canonical_alias"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -367,7 +342,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.canonicalAliasPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.canonicalAliasPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.canonicalAliasPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.canonicalAliasPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Change the room topic")
|
text: i18n("Change the room topic")
|
||||||
description: "m.room.topic"
|
description: "m.room.topic"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -376,7 +351,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.topicPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.topicPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.topicPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.topicPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Enable encryption for the room")
|
text: i18n("Enable encryption for the room")
|
||||||
description: "m.room.encryption"
|
description: "m.room.encryption"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -385,7 +360,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.encryptionPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.encryptionPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.encryptionPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.encryptionPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Change the room history visibility")
|
text: i18n("Change the room history visibility")
|
||||||
description: "m.room.history_visibility"
|
description: "m.room.history_visibility"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -394,7 +369,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.historyVisibilityPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.historyVisibilityPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.historyVisibilityPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.historyVisibilityPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Set pinned events")
|
text: i18n("Set pinned events")
|
||||||
description: "m.room.pinned_events"
|
description: "m.room.pinned_events"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -403,7 +378,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.pinnedEventsPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.pinnedEventsPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.pinnedEventsPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.pinnedEventsPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Upgrade the room")
|
text: i18n("Upgrade the room")
|
||||||
description: "m.room.tombstone"
|
description: "m.room.tombstone"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -412,7 +387,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.tombstonePowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.tombstonePowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.tombstonePowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.tombstonePowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Set the room server access control list (ACL)")
|
text: i18n("Set the room server access control list (ACL)")
|
||||||
description: "m.room.server_acl"
|
description: "m.room.server_acl"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -421,7 +396,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.serverAclPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.serverAclPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.serverAclPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.serverAclPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
visible: room.isSpace
|
visible: room.isSpace
|
||||||
text: i18n("Set the children of this space")
|
text: i18n("Set the children of this space")
|
||||||
description: "m.space.child"
|
description: "m.space.child"
|
||||||
@@ -431,7 +406,7 @@ Kirigami.ScrollablePage {
|
|||||||
Component.onCompleted: currentIndex = indexOfValue(room.spaceChildPowerLevel)
|
Component.onCompleted: currentIndex = indexOfValue(room.spaceChildPowerLevel)
|
||||||
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.spaceChildPowerLevel = currentValue
|
onCurrentValueChanged: if(room.canSendState("m.room.power_levels")) room.spaceChildPowerLevel = currentValue
|
||||||
}
|
}
|
||||||
MobileForm.FormComboBoxDelegate {
|
FormCard.FormComboBoxDelegate {
|
||||||
text: i18n("Set the parent space of this room")
|
text: i18n("Set the parent space of this room")
|
||||||
description: "m.space.parent"
|
description: "m.space.parent"
|
||||||
textRole: "text"
|
textRole: "text"
|
||||||
@@ -442,5 +417,3 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,31 +6,23 @@ import QtQuick 2.15
|
|||||||
import QtQuick.Controls 2.15 as QQC2
|
import QtQuick.Controls 2.15 as QQC2
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts 1.15
|
||||||
import org.kde.kirigami 2.15 as Kirigami
|
import org.kde.kirigami 2.15 as Kirigami
|
||||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||||
|
|
||||||
import org.kde.neochat 1.0
|
import org.kde.neochat 1.0
|
||||||
|
|
||||||
Kirigami.ScrollablePage {
|
FormCard.FormCardPage {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property NeoChatRoom room
|
property NeoChatRoom room
|
||||||
property string needUpgradeRoom: i18n("You need to upgrade this room to a newer version to enable this setting.")
|
property string needUpgradeRoom: i18n("You need to upgrade this room to a newer version to enable this setting.")
|
||||||
|
|
||||||
title: i18n("Security")
|
title: i18n("Security")
|
||||||
topPadding: 0
|
|
||||||
leftPadding: 0
|
FormCard.FormHeader {
|
||||||
rightPadding: 0
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormHeader {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18nc("@option:check", "Encryption")
|
title: i18nc("@option:check", "Encryption")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormSwitchDelegate {
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormSwitchDelegate {
|
|
||||||
id: enableEncryptionSwitch
|
id: enableEncryptionSwitch
|
||||||
text: i18n("Enable encryption")
|
text: i18n("Enable encryption")
|
||||||
description: i18nc("option:check", "Once enabled, encryption cannot be disabled.")
|
description: i18nc("option:check", "Once enabled, encryption cannot be disabled.")
|
||||||
@@ -42,17 +34,12 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18nc("@option:check", "Access")
|
title: i18nc("@option:check", "Access")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormRadioDelegate {
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormRadioDelegate {
|
|
||||||
text: i18nc("@option:check", "Private (invite only)")
|
text: i18nc("@option:check", "Private (invite only)")
|
||||||
description: i18n("Only invited people can join.")
|
description: i18n("Only invited people can join.")
|
||||||
checked: room.joinRule === "invite"
|
checked: room.joinRule === "invite"
|
||||||
@@ -61,7 +48,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.joinRule = "invite";
|
room.joinRule = "invite";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Space members")
|
text: i18nc("@option:check", "Space members")
|
||||||
description: i18n("Anyone in a space can find and join.") +
|
description: i18n("Anyone in a space can find and join.") +
|
||||||
(!["8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
(!["8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||||
@@ -71,7 +58,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.joinRule = "restricted";
|
room.joinRule = "restricted";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Knock")
|
text: i18nc("@option:check", "Knock")
|
||||||
description: i18n("People not in the room need to request an invite to join the room.") +
|
description: i18n("People not in the room need to request an invite to join the room.") +
|
||||||
(!["7", "8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
(!["7", "8", "9", "10"].includes(room.version) ? `\n${needUpgradeRoom}` : "")
|
||||||
@@ -82,7 +69,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.joinRule = "knock";
|
room.joinRule = "knock";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Public")
|
text: i18nc("@option:check", "Public")
|
||||||
description: i18nc("@option:check", "Anyone can find and join.")
|
description: i18nc("@option:check", "Anyone can find and join.")
|
||||||
checked: room.joinRule === "public"
|
checked: room.joinRule === "public"
|
||||||
@@ -92,17 +79,12 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MobileForm.FormHeader {
|
FormCard.FormHeader {
|
||||||
Layout.fillWidth: true
|
|
||||||
title: i18nc("@option:check", "Message history visibility")
|
title: i18nc("@option:check", "Message history visibility")
|
||||||
}
|
}
|
||||||
MobileForm.FormCard {
|
FormCard.FormCard {
|
||||||
Layout.fillWidth: true
|
FormCard.FormRadioDelegate {
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 0
|
|
||||||
MobileForm.FormRadioDelegate {
|
|
||||||
text: i18nc("@option:check", "Anyone")
|
text: i18nc("@option:check", "Anyone")
|
||||||
description: i18nc("@option:check", "Anyone, regardless of whether they have joined, can view history.")
|
description: i18nc("@option:check", "Anyone, regardless of whether they have joined, can view history.")
|
||||||
checked: room.historyVisibility === "world_readable"
|
checked: room.historyVisibility === "world_readable"
|
||||||
@@ -111,7 +93,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.historyVisibility = "world_readable"
|
room.historyVisibility = "world_readable"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Members only")
|
text: i18nc("@option:check", "Members only")
|
||||||
description: i18nc("@option:check", "All members can view the entire message history, even before they joined.")
|
description: i18nc("@option:check", "All members can view the entire message history, even before they joined.")
|
||||||
checked: room.historyVisibility === "shared"
|
checked: room.historyVisibility === "shared"
|
||||||
@@ -120,7 +102,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.historyVisibility = "shared"
|
room.historyVisibility = "shared"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Members only (since invite)")
|
text: i18nc("@option:check", "Members only (since invite)")
|
||||||
description: i18nc("@option:check", "New members can view the message history from the point they were invited to the room.")
|
description: i18nc("@option:check", "New members can view the message history from the point they were invited to the room.")
|
||||||
checked: room.historyVisibility === "invited"
|
checked: room.historyVisibility === "invited"
|
||||||
@@ -129,7 +111,7 @@ Kirigami.ScrollablePage {
|
|||||||
room.historyVisibility = "invited"
|
room.historyVisibility = "invited"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
MobileForm.FormRadioDelegate {
|
FormCard.FormRadioDelegate {
|
||||||
text: i18nc("@option:check", "Members only (since joining)")
|
text: i18nc("@option:check", "Members only (since joining)")
|
||||||
description: i18nc("@option:check", "New members can view the message history from the point they joined the room.")
|
description: i18nc("@option:check", "New members can view the message history from the point they joined the room.")
|
||||||
checked: room.historyVisibility === "joined"
|
checked: room.historyVisibility === "joined"
|
||||||
@@ -139,8 +121,6 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
footer: QQC2.ToolBar {
|
footer: QQC2.ToolBar {
|
||||||
contentItem: RowLayout {
|
contentItem: RowLayout {
|
||||||
@@ -155,7 +135,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Component {
|
property Component confirmEncryptionDialog: Component {
|
||||||
id: confirmEncryptionDialog
|
id: confirmEncryptionDialog
|
||||||
|
|
||||||
ConfirmEncryptionDialog {
|
ConfirmEncryptionDialog {
|
||||||
@@ -168,7 +148,7 @@ Kirigami.ScrollablePage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
property Connections connections: Connections {
|
||||||
target: room
|
target: room
|
||||||
onEncryption: {
|
onEncryption: {
|
||||||
enableEncryptionSwitch.checked = room.usesEncryption
|
enableEncryptionSwitch.checked = room.usesEncryption
|
||||||
|
|||||||
Reference in New Issue
Block a user