parent
2689a08ebb
commit
ed7f767155
|
@ -35,3 +35,6 @@ QtObject:
|
|||
QtProperty[QVariant] model:
|
||||
read = getModel
|
||||
notify = modelChanged
|
||||
|
||||
proc isContactWithIdAdded*(self: View, id: string): bool {.slot.} =
|
||||
return self.model.isContactWithIdAdded(id)
|
||||
|
|
|
@ -9,11 +9,16 @@ import utils 1.0
|
|||
ScrollView {
|
||||
id: contactListPanel
|
||||
|
||||
property var chatContentModule
|
||||
property alias model: groupMembers.model
|
||||
property string searchString
|
||||
property bool selectMode: true
|
||||
property var onItemChecked
|
||||
|
||||
property var isMember: function (pubkey) {
|
||||
return false
|
||||
}
|
||||
|
||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||
ScrollBar.vertical.policy: groupMembers.contentHeight > groupMembers.height ? ScrollBar.AlwaysOn : ScrollBar.AlwaysOff
|
||||
|
||||
|
@ -31,14 +36,15 @@ ScrollView {
|
|||
image.isIdenticon: !!model.identicon
|
||||
visible: {
|
||||
if (selectMode) {
|
||||
return !searchString || model.name.toLowerCase().includes(searchString)
|
||||
return (!searchString || model.name.toLowerCase().includes(searchString))
|
||||
&& !isMember(model.pubKey)
|
||||
}
|
||||
return checkbox.checked
|
||||
}
|
||||
components: [
|
||||
StatusCheckBox {
|
||||
id: checkbox
|
||||
visible: contactListPanel.selectMode && !model.isUser
|
||||
visible: contactListPanel.selectMode && !isMember(model.pubKey)
|
||||
checked: contactDelegate.isChecked
|
||||
onClicked: {
|
||||
contactDelegate.isChecked = !contactDelegate.isChecked
|
||||
|
|
|
@ -19,6 +19,7 @@ ModalPopup {
|
|||
id: popup
|
||||
|
||||
property var chatSectionModule
|
||||
property var chatContentModule
|
||||
property var store
|
||||
property var pubKeys: []
|
||||
property bool selectChatMembers: true
|
||||
|
@ -27,6 +28,8 @@ ModalPopup {
|
|||
property string channelNameValidationError: ""
|
||||
|
||||
onOpened: {
|
||||
popup.chatContentModule = popup.store.currentChatContentModule()
|
||||
|
||||
groupName.text = "";
|
||||
searchBox.text = "";
|
||||
selectChatMembers = true;
|
||||
|
@ -129,6 +132,7 @@ ModalPopup {
|
|||
ContactListPanel {
|
||||
id: contactList
|
||||
anchors.fill: parent
|
||||
chatContentModule: popup.chatContentModule
|
||||
model: chatSectionModule.listOfMyContacts
|
||||
searchString: searchBox.text.toLowerCase()
|
||||
selectMode: selectChatMembers && memberCount < maxMembers
|
||||
|
|
|
@ -130,7 +130,7 @@ StatusModal {
|
|||
}
|
||||
|
||||
NoFriendsRectangle {
|
||||
visible: popup.store.addToGroupContacts.count === 0 && memberCount > 0
|
||||
visible: chatSectionModule.listOfMyContacts.rowCount() === 0 || chatSectionModule.listOfMyContacts.rowCount() <= memberCount - 1
|
||||
//% "All your contacts are already in the group"
|
||||
text: qsTrId("group-chat-all-contacts-invited")
|
||||
textColor: Style.current.textColor
|
||||
|
@ -142,10 +142,15 @@ StatusModal {
|
|||
|
||||
ContactListPanel {
|
||||
id: contactList
|
||||
chatContentModule: popup.chatContentModule
|
||||
visible: popup.chatContentModule.usersModule.model.rowCount() > 0
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
model: chatSectionModule.listOfMyContacts
|
||||
isMember: function (pubKey) {
|
||||
return chatContentModule.usersModule.isContactWithIdAdded(pubKey)
|
||||
}
|
||||
|
||||
selectMode: memberCount < maxMembers
|
||||
searchString: searchBox.text.toLowerCase()
|
||||
onItemChecked: function(pubKey, itemChecked){
|
||||
|
|
Loading…
Reference in New Issue