Migrate to new peer authorization levels, add new peer approval
workflow, add blocked peers to contact list in seperate section
This commit is contained in:
parent
b0aad3a1cc
commit
5694dfe23e
|
@ -102,11 +102,13 @@ ColumnLayout {
|
|||
target: gcd
|
||||
|
||||
onAddContact: function(handle, displayName, image, badge, status, authorization, loading, lastMsgTs) {
|
||||
|
||||
var model = contactsModel
|
||||
if (authorization == Const.auth_blocked) {
|
||||
model = blockedContactsModel
|
||||
}
|
||||
|
||||
|
||||
for (var i = 0; i < model.count; i++) {
|
||||
if (model.get(i)["_handle"] == handle) {
|
||||
return
|
||||
|
@ -184,7 +186,10 @@ ColumnLayout {
|
|||
authorization: _authorization
|
||||
loading: _loading
|
||||
rowColor: (_authorization == Const.auth_unknown) ? Theme.backgroundHilightElementColor : Theme.backgroundMainColor
|
||||
<<<<<<< HEAD
|
||||
Layout.fillWidth: true
|
||||
=======
|
||||
>>>>>>> Migrate to new peer authorization levels, add new peer approval
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -203,6 +208,7 @@ ColumnLayout {
|
|||
|
||||
onClicked: {
|
||||
blockedToggle.showing = !blockedToggle.showing
|
||||
<<<<<<< HEAD
|
||||
blockedContacts.visible = blockedToggle.showing
|
||||
if (blockedToggle.showing) {
|
||||
gcd.storeSetting(Const.show_blocked, "true")
|
||||
|
@ -269,6 +275,65 @@ ColumnLayout {
|
|||
blockedToggle.showing = (_showBlocked == "true")
|
||||
blockedContacts.visible = (_showBlocked == "true")
|
||||
}
|
||||
=======
|
||||
if (blockedToggle.showing) {
|
||||
hideBlocked.stop()
|
||||
openBlocked.start()
|
||||
} else {
|
||||
openBlocked.stop()
|
||||
hideBlocked.start()
|
||||
}
|
||||
}
|
||||
|
||||
SequentialAnimation { id: openBlocked
|
||||
PropertyAnimation {target: blockedContacts; property: "implicitHeight"; to: blockedContacts.childrenRect.height; duration: 100 }
|
||||
PropertyAnimation {target: sv; property: "contentY"; to: sv.contentY + (40 * logscale); duration: 200}
|
||||
}
|
||||
|
||||
PropertyAnimation { id: hideBlocked; target: blockedContacts; property: "implicitHeight"; to: 0; duration: 200 }
|
||||
|
||||
onEntered: {
|
||||
blockedBG.color = Theme.backgroundPaneColor
|
||||
}
|
||||
|
||||
onExited: {
|
||||
blockedBG.color = Theme.backgroundMainColor
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: blockedBG
|
||||
property bool isHover: false
|
||||
|
||||
anchors.fill: blockItem
|
||||
color: Theme.backgroundMainColor
|
||||
}
|
||||
|
||||
Row {
|
||||
id: blockedToggle
|
||||
property bool showing: true
|
||||
|
||||
leftPadding: 32 * logscale
|
||||
topPadding: 16 * logscale
|
||||
bottomPadding: 8 * logscale
|
||||
spacing: 5 * logscale
|
||||
|
||||
Opaque.ScalingLabel {
|
||||
id: blockLbl
|
||||
|
||||
text: qsTr("blocked")
|
||||
size: Theme.chatMetaTextSize
|
||||
color: Theme.portraitBlockedTextColor
|
||||
}
|
||||
|
||||
Opaque.ScalingLabel {
|
||||
id: blockBtn
|
||||
|
||||
text: blockedToggle.showing ? "▲" : "▼"
|
||||
size: Theme.chatMetaTextSize
|
||||
color: Theme.portraitBlockedTextColor
|
||||
}
|
||||
>>>>>>> Migrate to new peer authorization levels, add new peer approval
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -277,10 +342,22 @@ ColumnLayout {
|
|||
id: blockedContactsModel
|
||||
}
|
||||
|
||||
<<<<<<< HEAD
|
||||
ColumnLayout {
|
||||
id: blockedContacts
|
||||
Layout.fillWidth: true
|
||||
spacing: 0
|
||||
=======
|
||||
Item {
|
||||
id: blockedContacts
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
height: childrenRect.height
|
||||
implicitHeight: childrenRect.height
|
||||
|
||||
property real logscale: 4 * Math.log10(gcd.themeScale + 1)
|
||||
>>>>>>> Migrate to new peer authorization levels, add new peer approval
|
||||
|
||||
Repeater {
|
||||
id: blockedContactsRepeater
|
||||
|
@ -293,7 +370,11 @@ ColumnLayout {
|
|||
status: _status
|
||||
authorization: _authorization
|
||||
loading: _loading
|
||||
<<<<<<< HEAD
|
||||
Layout.fillWidth: true
|
||||
=======
|
||||
rowColor: Theme.backgroundHilightElementColor
|
||||
>>>>>>> Migrate to new peer authorization levels, add new peer approval
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in New Issue