Fix actions on sip address selection (starting call/chat etc from searchbars)

This commit is contained in:
Julien Wadel 2021-12-02 22:01:37 +01:00
parent 16067fcc59
commit 71ab0837d5
11 changed files with 22 additions and 18 deletions

View file

@ -58,13 +58,15 @@ DialogPlus {
return UtilsCpp.hasCapability(entry.sipAddress, LinphoneEnums.FriendCapabilityLimeX3Dh)
},
handler: function (entry) {
console.log("Call selected: " +entry + "/"+entry.sipAddress)
mainItem.addressSelectedCallback(entry.sipAddress)
exit(1)
},
}]
onEntryClicked: {
mainItem.addressSelectedCallback(sipAddress)
console.log("Call selected: " +entry + "/"+entry.sipAddress)
mainItem.addressSelectedCallback(entry.sipAddress)
exit(1)
}
}

View file

@ -12,7 +12,7 @@ import UtilsCpp 1.0
Row {
id: mainItem
signal entryClicked(string sipAddress)
signal entryClicked(var entry)
readonly property var _sipAddressObserver: SipAddressesModel.getSipAddressObserver($historyEntry.sipAddress, '')
property QtObject iconData
@ -170,7 +170,7 @@ Row {
verticalAlignment: Text.AlignVCenter
MouseArea{
anchors.fill:parent
onClicked:entryClicked($historyEntry.sipAddress)
onClicked:entryClicked($historyEntry)
}
}
ActionButton {

View file

@ -14,7 +14,7 @@ Rectangle {
id: container
property alias proxyModel: history.model
signal entryClicked(string sipAddress)
signal entryClicked(var entry)
// ---------------------------------------------------------------------------
@ -183,7 +183,7 @@ Rectangle {
}
Connections{
target:entryLoader.item
onEntryClicked:{entryClicked(sipAddress)}
onEntryClicked:{entryClicked(entry)}
}
}
}

View file

@ -205,6 +205,8 @@ ScrollableListView {
delegate: Rectangle {
id: sipAddressEntry
property var entry: modelData
color: SipAddressesViewStyle.entry.color.normal
height: SipAddressesViewStyle.entry.height
@ -245,7 +247,7 @@ ScrollableListView {
MouseArea {
anchors.fill: parent
onClicked: sipAddressesView.entryClicked(modelData.sipAddress, index)
onClicked: sipAddressesView.entryClicked(modelData, index)
}
}
@ -284,11 +286,11 @@ ScrollableListView {
tooltipText:modelData.tooltipText?modelData.tooltipText:''
visible: sipAddressesView.actions[index].visible
onClicked: {
sipAddressesView.actions[index].handler(modelData)
sipAddressesView.actions[index].handler(sipAddressEntry.entry)
}
Icon{
visible: modelData.secure>0 &&
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler(modelData) : true)
(sipAddressesView.actions[index].secureIconVisibleHandler ? sipAddressesView.actions[index].secureIconVisibleHandler(sipAddressEntry.entry) : true)
icon: 'secure_on'
iconSize:15
anchors.right:parent.right

View file

@ -97,7 +97,7 @@ DialogPlus {
id: sipAddressesModel
}
onEntryClicked: actions[0].handlerSipAddress(entry)
onEntryClicked: actions[0].handlerSipAddress(entry.sipAddress)
}
}
}

View file

@ -107,7 +107,7 @@ DialogPlus {
id: sipAddressesModel
}
onEntryClicked: actions[0].handlerSipAddress(entry)
onEntryClicked: actions[0].handlerSipAddress(entry.sipAddress)
}
}
}

View file

@ -115,7 +115,7 @@ DialogPlus {
id: conferenceHelperModel
}
onEntryClicked: actions[0].handerSipAddress(entry)
onEntryClicked: actions[0].handerSipAddress(entry.sipAddress)
}
}
}

View file

@ -98,7 +98,7 @@ DialogPlus {
}]
onEntryClicked: {
selectedParticipants.addAddress(entry)
selectedParticipants.addAddress(entry.sipAddress)
}
}

View file

@ -328,8 +328,8 @@ DialogPlus {
}]
onEntryClicked: {
selectedParticipants.addAddress(entry)
smartSearchBar.addAddressToIgnore(entry);
selectedParticipants.addAddress(entry.sipAddress)
smartSearchBar.addAddressToIgnore(entry.sipAddress);
++lastContacts.reloadCount
}
}

View file

@ -159,8 +159,8 @@ ColumnLayout {
Layout.fillWidth: true
onEntryClicked:{
historyView.fullPeerAddress=sipAddress
historyView.peerAddress=sipAddress
historyView.fullPeerAddress=entry.sipAddress
historyView.peerAddress=entry.sipAddress
historyProxyModel.resetMessageCount()
}

View file

@ -186,9 +186,9 @@ ApplicationWindow {
onEntryClicked: {
if (SettingsModel.contactsEnabled) {
window.setView('ContactEdit', { sipAddress: entry })
window.setView('ContactEdit', { sipAddress: entry.sipAddress })
} else {
CallsListModel.createChatRoom( '', false, [entry], true )
CallsListModel.createChatRoom( '', false, [entry.sipAddress], true )
}
}