44 lines
1.2 KiB
QML
Raw Normal View History

2020-06-17 15:18:31 -04:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
2020-05-28 08:56:43 -04:00
import "../../../../imports"
import "../../../../shared"
import "../../../../shared/status"
2020-05-28 08:56:43 -04:00
import "./"
2020-05-29 12:27:50 -04:00
ModalPopup {
function doJoin(pk, ensName) {
chatsModel.channelView.joinPrivateChat(pk, Utils.isChatKey(pk) ? "" : ensName);
popup.close();
}
2020-05-28 08:56:43 -04:00
id: popup
//% "New chat"
title: qsTrId("new-chat")
2020-05-29 12:27:50 -04:00
2020-05-29 14:38:11 -04:00
onOpened: {
contactFieldAndList.chatKey.text = ""
contactFieldAndList.pubKey = ""
contactFieldAndList.ensUsername = ""
contactFieldAndList.chatKey.forceActiveFocus(Qt.MouseFocusReason)
contactFieldAndList.existingContacts.visible = profileModel.contacts.list.hasAddedContacts()
contactFieldAndList.noContactsRect.visible = !contactFieldAndList.existingContacts.visible
}
ContactsListAndSearch {
id: contactFieldAndList
anchors.top: parent.top
anchors.bottom: parent.bottom
onUserClicked: function (isContact, pubKey, ensName) {
chatsModel.channelView.joinPrivateChat(pubKey, Utils.isChatKey(pubKey) ? "" : ensName);
popup.close();
}
2020-11-16 22:56:10 +02:00
}
2020-05-28 08:56:43 -04:00
}
/*##^##
Designer {
D{i:0;height:300;width:300}
}
##^##*/