2023-01-26 18:52:41 +00:00
|
|
|
import QtQuick 2.14
|
|
|
|
import QtQuick.Controls 2.14
|
|
|
|
import QtQuick.Layouts 1.14
|
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
id: root
|
|
|
|
|
2023-06-29 21:52:16 +00:00
|
|
|
property string name: "Socks"
|
2023-09-27 11:05:50 +00:00
|
|
|
property string description: "We like the sock. A community of Unisocks wearers we like the sock. Unisocks wearers we like the sock."
|
2023-06-29 21:52:16 +00:00
|
|
|
|
2023-01-26 18:52:41 +00:00
|
|
|
property int membersCount: 184
|
2023-06-29 21:52:16 +00:00
|
|
|
property bool amISectionAdmin: true
|
|
|
|
property bool isCommunityEditable: true
|
2023-01-26 18:52:41 +00:00
|
|
|
property color color: "orchid"
|
|
|
|
property url image: Style.png("tokens/UNI")
|
|
|
|
property bool colorVisible: false
|
2023-09-26 18:04:51 +00:00
|
|
|
property url banner: ctrlCommunityBanner.checked ? Style.png("settings/communities@2x") : ""
|
|
|
|
readonly property bool shardingEnabled: ctrlShardingEnabled.checked
|
2023-09-27 18:11:46 +00:00
|
|
|
property alias shardIndex: ctrlShardIndex.value
|
2024-05-01 13:19:57 +00:00
|
|
|
property bool adminControlsEnabled: true
|
2023-01-26 18:52:41 +00:00
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Name"
|
|
|
|
}
|
|
|
|
TextField {
|
|
|
|
background: Rectangle { border.color: 'lightgrey' }
|
|
|
|
Layout.preferredWidth: 200
|
|
|
|
text: root.name
|
|
|
|
onTextChanged: root.name = text
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-06-29 21:52:16 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Description"
|
|
|
|
}
|
|
|
|
TextArea {
|
|
|
|
background: Rectangle { border.color: 'lightgrey' }
|
|
|
|
Layout.preferredWidth: 200
|
|
|
|
Layout.preferredHeight: implicitHeight
|
|
|
|
text: root.description
|
|
|
|
onTextChanged: root.description = text
|
|
|
|
wrapMode: TextEdit.Wrap
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-26 18:52:41 +00:00
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Community members:"
|
|
|
|
}
|
|
|
|
|
|
|
|
Slider {
|
|
|
|
value: root.membersCount
|
|
|
|
from: 0
|
2024-05-01 13:19:57 +00:00
|
|
|
to: 3000
|
2023-01-26 18:52:41 +00:00
|
|
|
onValueChanged: root.membersCount = value
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
visible: root.colorVisible
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Community color:"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
checked: true
|
|
|
|
text: "Orchid"
|
|
|
|
onCheckedChanged: if(checked) root.color = "orchid"
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: "Blue"
|
|
|
|
onCheckedChanged: if(checked) root.color = "blue"
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: "Orange"
|
|
|
|
onCheckedChanged: if(checked) root.color = "orange"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
text: "Community image:"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
checked: true
|
|
|
|
text: qsTr("UNI")
|
|
|
|
onCheckedChanged: if(checked) root.image = Style.png("tokens/UNI")
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: qsTr("SOCKS")
|
|
|
|
onCheckedChanged: if(checked) root.image = Style.png("tokens/SOCKS")
|
|
|
|
}
|
|
|
|
RadioButton {
|
|
|
|
text: qsTr("Status")
|
|
|
|
onCheckedChanged: if(checked) root.image = Style.png("tokens/SNT")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
RowLayout {
|
2024-05-01 13:19:57 +00:00
|
|
|
visible: root.adminControlsEnabled
|
2023-01-26 18:52:41 +00:00
|
|
|
Label {
|
|
|
|
text: "Is community admin:"
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
checked: root.amISectionAdmin
|
|
|
|
onCheckedChanged: root.amISectionAdmin = checked
|
|
|
|
}
|
|
|
|
}
|
2023-06-29 21:52:16 +00:00
|
|
|
RowLayout {
|
2024-05-01 13:19:57 +00:00
|
|
|
visible: root.adminControlsEnabled
|
2023-06-29 21:52:16 +00:00
|
|
|
Label {
|
|
|
|
text: "Is community editable:"
|
|
|
|
}
|
|
|
|
|
|
|
|
CheckBox {
|
|
|
|
checked: root.isCommunityEditable
|
|
|
|
onCheckedChanged: root.isCommunityEditable = checked
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ColumnLayout {
|
|
|
|
Label {
|
|
|
|
text: "Banner"
|
|
|
|
}
|
|
|
|
|
|
|
|
RadioButton {
|
|
|
|
checked: true
|
|
|
|
text: "No banner"
|
|
|
|
}
|
|
|
|
RadioButton {
|
2023-09-26 18:04:51 +00:00
|
|
|
id: ctrlCommunityBanner
|
2023-06-29 21:52:16 +00:00
|
|
|
text: "Communities"
|
2023-09-26 18:04:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
RowLayout {
|
2024-05-01 13:19:57 +00:00
|
|
|
visible: root.adminControlsEnabled
|
2023-09-26 18:04:51 +00:00
|
|
|
Layout.fillWidth: true
|
|
|
|
CheckBox {
|
|
|
|
id: ctrlShardingEnabled
|
|
|
|
text: "Sharding enabled"
|
|
|
|
checkable: true
|
|
|
|
checked: false
|
|
|
|
}
|
|
|
|
SpinBox {
|
|
|
|
id: ctrlShardIndex
|
|
|
|
visible: ctrlShardingEnabled.checked
|
|
|
|
from: -1
|
|
|
|
to: 1023
|
|
|
|
value: -1 // -1 == disabled
|
2023-06-29 21:52:16 +00:00
|
|
|
}
|
|
|
|
}
|
2023-01-26 18:52:41 +00:00
|
|
|
}
|