fixes
This commit is contained in:
parent
9240207ef5
commit
bbc409f4b1
8 changed files with 131 additions and 138 deletions
|
|
@ -124,14 +124,13 @@ bool ToolModel::createCall(const QString &sipAddress,
|
||||||
lCritical() << "[" + QString(gClassName) + "] The calling address is not an interpretable SIP address: "
|
lCritical() << "[" + QString(gClassName) + "] The calling address is not an interpretable SIP address: "
|
||||||
<< sipAddress;
|
<< sipAddress;
|
||||||
if (errorMessage) {
|
if (errorMessage) {
|
||||||
*errorMessage = tr("The calling address is not an interpretable SIP address : ");
|
*errorMessage = tr("The calling address is not an interpretable SIP address : %1").arg(sipAddress);
|
||||||
errorMessage->append(sipAddress);
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
for (auto &account : core->getAccountList()) {
|
for (auto &account : core->getAccountList()) {
|
||||||
if (account->getContactAddress() && account->getContactAddress()->weakEqual(address)) {
|
if (account->getContactAddress() && account->getContactAddress()->weakEqual(address)) {
|
||||||
*errorMessage = "The calling address is a connected account.";
|
if (errorMessage) *errorMessage = "The calling address is a connected account.";
|
||||||
lDebug() << "[" + QString(gClassName) + "]" + *errorMessage;
|
lDebug() << "[" + QString(gClassName) + "]" + *errorMessage;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,8 @@ char *Utils::rstrstr(const char *a, const char *b) {
|
||||||
VariantObject *Utils::getDisplayName(const QString &address) {
|
VariantObject *Utils::getDisplayName(const QString &address) {
|
||||||
QStringList splitted = address.split(":");
|
QStringList splitted = address.split(":");
|
||||||
if (splitted.size() > 0 && splitted[0] == "sip") splitted.removeFirst();
|
if (splitted.size() > 0 && splitted[0] == "sip") splitted.removeFirst();
|
||||||
VariantObject *data = new VariantObject(splitted.first().split("@").first()); // Scope : GUI
|
VariantObject *data = nullptr;
|
||||||
|
if (splitted.size() != 0) data = new VariantObject(splitted.first().split("@").first()); // Scope : GUI
|
||||||
if (!data) return nullptr;
|
if (!data) return nullptr;
|
||||||
data->makeRequest([address]() {
|
data->makeRequest([address]() {
|
||||||
QString displayName = ToolModel::getDisplayName(address);
|
QString displayName = ToolModel::getDisplayName(address);
|
||||||
|
|
|
||||||
|
|
@ -30,6 +30,123 @@ ApplicationWindow {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Popup {
|
||||||
|
id: startCallPopup
|
||||||
|
property FriendGui contact
|
||||||
|
property bool videoEnabled
|
||||||
|
onContactChanged: {
|
||||||
|
console.log("contact changed", contact)
|
||||||
|
}
|
||||||
|
underlineColor: DefaultStyle.main1_500_main
|
||||||
|
anchors.centerIn: parent
|
||||||
|
width: 370 * DefaultStyle.dp
|
||||||
|
modal: true
|
||||||
|
leftPadding: 15 * DefaultStyle.dp
|
||||||
|
rightPadding: 15 * DefaultStyle.dp
|
||||||
|
topPadding: 20 * DefaultStyle.dp
|
||||||
|
bottomPadding: 25 * DefaultStyle.dp
|
||||||
|
contentItem: ColumnLayout {
|
||||||
|
spacing: 16 * DefaultStyle.dp
|
||||||
|
RowLayout {
|
||||||
|
spacing: 0
|
||||||
|
Text {
|
||||||
|
text: qsTr("Which channel do you choose?")
|
||||||
|
font {
|
||||||
|
pixelSize: 16 * DefaultStyle.dp
|
||||||
|
weight: 800 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Item{Layout.fillWidth: true}
|
||||||
|
Button {
|
||||||
|
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||||
|
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
background: Item{}
|
||||||
|
icon.source:AppIcons.closeX
|
||||||
|
width: 24 * DefaultStyle.dp
|
||||||
|
height: 24 * DefaultStyle.dp
|
||||||
|
icon.width: 24 * DefaultStyle.dp
|
||||||
|
icon.height: 24 * DefaultStyle.dp
|
||||||
|
contentItem: Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: AppIcons.closeX
|
||||||
|
}
|
||||||
|
onClicked: startCallPopup.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ListView {
|
||||||
|
id: popuplist
|
||||||
|
model: VariantList {
|
||||||
|
model: startCallPopup.contact && startCallPopup.contact.core.allAddresses || []
|
||||||
|
}
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: contentHeight
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
delegate: Item {
|
||||||
|
width: popuplist.width
|
||||||
|
height: 56 * DefaultStyle.dp
|
||||||
|
ColumnLayout {
|
||||||
|
width: popuplist.width
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
spacing: 10 * DefaultStyle.dp
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 7 * DefaultStyle.dp
|
||||||
|
Text {
|
||||||
|
Layout.leftMargin: 5 * DefaultStyle.dp
|
||||||
|
text: modelData.label + " :"
|
||||||
|
font {
|
||||||
|
pixelSize: 13 * DefaultStyle.dp
|
||||||
|
weight: 700 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Text {
|
||||||
|
Layout.leftMargin: 5 * DefaultStyle.dp
|
||||||
|
text: modelData.address
|
||||||
|
font {
|
||||||
|
pixelSize: 14 * DefaultStyle.dp
|
||||||
|
weight: 400 * DefaultStyle.dp
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
visible: index != popuplist.model.count - 1
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: 1 * DefaultStyle.dp
|
||||||
|
color: DefaultStyle.main2_200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||||
|
onClicked: UtilsCpp.createCall(modelData.address, {'localVideoEnabled': startCallPopup.videoEnabled})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function startCallWithContact(contact, videoEnabled, parentItem) {
|
||||||
|
if (parentItem == undefined) parentItem = mainWindow
|
||||||
|
startCallPopup.parent = parentItem
|
||||||
|
if (contact) {
|
||||||
|
console.log("START CALL WITH", contact.core.displayName, "addresses count", contact.core.allAddresses.length)
|
||||||
|
if (contact.core.allAddresses.length > 1) {
|
||||||
|
startCallPopup.contact = contact
|
||||||
|
startCallPopup.videoEnabled = videoEnabled
|
||||||
|
startCallPopup.open()
|
||||||
|
|
||||||
|
} else {
|
||||||
|
var addressToCall = contact.core.defaultAddress.length === 0
|
||||||
|
? contact.core.phoneNumbers.length === 0
|
||||||
|
? ""
|
||||||
|
: contact.core.phoneNumbers[0].address
|
||||||
|
: contact.core.defaultAddress
|
||||||
|
if (addressToCall.length != 0) UtilsCpp.createCall(addressToCall, {'localVideoEnabled':videoEnabled})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function removeFromPopupLayout(index) {
|
function removeFromPopupLayout(index) {
|
||||||
popupLayout.popupList.splice(index, 1)
|
popupLayout.popupList.splice(index, 1)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ AppWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
if(call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && (!call.core.tokenVerified || call.core.isMismatch)) {
|
if(call && call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp && (!call.core.tokenVerified || call.core.isMismatch)) {
|
||||||
zrtpValidation.open()
|
zrtpValidation.open()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,101 +17,6 @@ Item {
|
||||||
property NumericPad numPad
|
property NumericPad numPad
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
Popup {
|
|
||||||
id: startCallPopup
|
|
||||||
property FriendGui contact
|
|
||||||
onContactChanged: {
|
|
||||||
console.log("contact changed", contact)
|
|
||||||
}
|
|
||||||
underlineColor: DefaultStyle.main1_500_main
|
|
||||||
anchors.centerIn: parent
|
|
||||||
width: parent.width
|
|
||||||
modal: true
|
|
||||||
leftPadding: 15 * DefaultStyle.dp
|
|
||||||
rightPadding: 15 * DefaultStyle.dp
|
|
||||||
topPadding: 20 * DefaultStyle.dp
|
|
||||||
bottomPadding: 25 * DefaultStyle.dp
|
|
||||||
contentItem: ColumnLayout {
|
|
||||||
spacing: 16 * DefaultStyle.dp
|
|
||||||
RowLayout {
|
|
||||||
spacing: 0
|
|
||||||
Text {
|
|
||||||
text: qsTr("Which channel do you choose?")
|
|
||||||
font {
|
|
||||||
pixelSize: 16 * DefaultStyle.dp
|
|
||||||
weight: 800 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Item{Layout.fillWidth: true}
|
|
||||||
Button {
|
|
||||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
|
||||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
background: Item{}
|
|
||||||
icon.source:AppIcons.closeX
|
|
||||||
width: 24 * DefaultStyle.dp
|
|
||||||
height: 24 * DefaultStyle.dp
|
|
||||||
icon.width: 24 * DefaultStyle.dp
|
|
||||||
icon.height: 24 * DefaultStyle.dp
|
|
||||||
contentItem: Image {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: AppIcons.closeX
|
|
||||||
}
|
|
||||||
onClicked: startCallPopup.close()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ListView {
|
|
||||||
id: popuplist
|
|
||||||
model: VariantList {
|
|
||||||
model: startCallPopup.contact && startCallPopup.contact.core.allAddresses || []
|
|
||||||
}
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: contentHeight
|
|
||||||
spacing: 10 * DefaultStyle.dp
|
|
||||||
delegate: Item {
|
|
||||||
width: parent.width
|
|
||||||
height: 56 * DefaultStyle.dp
|
|
||||||
ColumnLayout {
|
|
||||||
width: parent.width
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
spacing: 10 * DefaultStyle.dp
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 7 * DefaultStyle.dp
|
|
||||||
Text {
|
|
||||||
Layout.leftMargin: 5 * DefaultStyle.dp
|
|
||||||
text: modelData.label + " :"
|
|
||||||
font {
|
|
||||||
pixelSize: 13 * DefaultStyle.dp
|
|
||||||
weight: 700 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Text {
|
|
||||||
Layout.leftMargin: 5 * DefaultStyle.dp
|
|
||||||
text: modelData.address
|
|
||||||
font {
|
|
||||||
pixelSize: 14 * DefaultStyle.dp
|
|
||||||
weight: 400 * DefaultStyle.dp
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Rectangle {
|
|
||||||
visible: index != popuplist.model.count - 1
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 1 * DefaultStyle.dp
|
|
||||||
color: DefaultStyle.main2_200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
|
|
||||||
onClicked: mainItem.callButtonPressed(modelData.address)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Control.Control {
|
Control.Control {
|
||||||
id: listLayout
|
id: listLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -212,17 +117,7 @@ Item {
|
||||||
model: MagicSearchProxy {
|
model: MagicSearchProxy {
|
||||||
searchText: searchBar.text.length === 0 ? "*" : searchBar.text
|
searchText: searchBar.text.length === 0 ? "*" : searchBar.text
|
||||||
}
|
}
|
||||||
onContactClicked: (contact) => {
|
onSelectedContactChanged: mainWindow.startCallWithContact(selectedContact, false, mainItem.parent)
|
||||||
if (contact) {
|
|
||||||
if (contact.core.allAddresses.length > 1) {
|
|
||||||
startCallPopup.contact = contact
|
|
||||||
startCallPopup.open()
|
|
||||||
|
|
||||||
} else {
|
|
||||||
mainItem.callButtonPressed(contact.core.defaultAddress)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
|
|
@ -247,22 +142,7 @@ Item {
|
||||||
sourceFlags: LinphoneEnums.MagicSearchSource.All
|
sourceFlags: LinphoneEnums.MagicSearchSource.All
|
||||||
aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend
|
aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend
|
||||||
}
|
}
|
||||||
onSelectedContactChanged: {
|
onSelectedContactChanged: mainWindow.startCallWithContact(selectedContact, false, mainItem.parent)
|
||||||
if (selectedContact) {
|
|
||||||
if (selectedContact.core.allAddresses.length > 1) {
|
|
||||||
startCallPopup.contact = selectedContact
|
|
||||||
startCallPopup.open()
|
|
||||||
|
|
||||||
} else {
|
|
||||||
var addressToCall = selectedContact.core.defaultAddress.length === 0
|
|
||||||
? selectedContact.core.phoneNumbers.length === 0
|
|
||||||
? ""
|
|
||||||
: selectedContact.core.phoneNumbers[0].address
|
|
||||||
: selectedContact.core.defaultAddress
|
|
||||||
if (addressToCall.length != 0) mainItem.callButtonPressed(addressToCall)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Item {
|
Item {
|
||||||
|
|
|
||||||
|
|
@ -46,7 +46,6 @@ ListView {
|
||||||
signal contactStarredChanged()
|
signal contactStarredChanged()
|
||||||
signal contactDeletionRequested(FriendGui contact)
|
signal contactDeletionRequested(FriendGui contact)
|
||||||
signal contactAddedToSelection()
|
signal contactAddedToSelection()
|
||||||
signal contactClicked(FriendGui contact)
|
|
||||||
|
|
||||||
function addContactToSelection(address) {
|
function addContactToSelection(address) {
|
||||||
if (multiSelectionEnabled) {
|
if (multiSelectionEnabled) {
|
||||||
|
|
@ -63,6 +62,8 @@ ListView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
model: MagicSearchProxy {
|
model: MagicSearchProxy {
|
||||||
searchText: searchBarText.length === 0 ? "*" : searchBarText
|
searchText: searchBarText.length === 0 ? "*" : searchBarText
|
||||||
onFriendCreated: (index) => {
|
onFriendCreated: (index) => {
|
||||||
|
|
@ -265,8 +266,8 @@ ListView {
|
||||||
visible: contactArea.containsMouse || friendPopup.hovered || (!mainItem.multiSelectionEnabled && mainItem.currentIndex === index)
|
visible: contactArea.containsMouse || friendPopup.hovered || (!mainItem.multiSelectionEnabled && mainItem.currentIndex === index)
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
mainItem.currentIndex = -1
|
||||||
mainItem.currentIndex = index
|
mainItem.currentIndex = index
|
||||||
mainItem.contactClicked(modelData)
|
|
||||||
if (mainItem.multiSelectionEnabled) {
|
if (mainItem.multiSelectionEnabled) {
|
||||||
var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress)
|
var indexInSelection = mainItem.selectedContacts.indexOf(modelData.core.defaultAddress)
|
||||||
if (indexInSelection == -1) {
|
if (indexInSelection == -1) {
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.phone
|
button.icon.source: AppIcons.phone
|
||||||
label: qsTr("Appel")
|
label: qsTr("Appel")
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
UtilsCpp.createCall(mainItem.contactAddress)
|
mainWindow.startCallWithContact(contact, false, mainItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LabelButton {
|
LabelButton {
|
||||||
|
|
@ -160,7 +160,7 @@ ColumnLayout {
|
||||||
button.icon.height: 24 * DefaultStyle.dp
|
button.icon.height: 24 * DefaultStyle.dp
|
||||||
button.icon.source: AppIcons.chatTeardropText
|
button.icon.source: AppIcons.chatTeardropText
|
||||||
label: qsTr("Message")
|
label: qsTr("Message")
|
||||||
button.onClicked: console.debug("[CallPage.qml] TODO : open conversation")
|
button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation")
|
||||||
}
|
}
|
||||||
LabelButton {
|
LabelButton {
|
||||||
visible: !mainItem.isConference
|
visible: !mainItem.isConference
|
||||||
|
|
@ -171,7 +171,7 @@ ColumnLayout {
|
||||||
button.icon.source: AppIcons.videoCamera
|
button.icon.source: AppIcons.videoCamera
|
||||||
label: qsTr("Appel Video")
|
label: qsTr("Appel Video")
|
||||||
button.onClicked: {
|
button.onClicked: {
|
||||||
UtilsCpp.createCall(mainItem.contactAddress, {'localVideoEnabled':true})
|
mainWindow.startCallWithContact(contact, true, mainItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -79,9 +79,9 @@ AbstractMainPage {
|
||||||
anchors.top: titleLoader.bottom
|
anchors.top: titleLoader.bottom
|
||||||
anchors.topMargin: 18 * DefaultStyle.dp
|
anchors.topMargin: 18 * DefaultStyle.dp
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
|
anchors.leftMargin: 45 * DefaultStyle.dp
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.leftMargin: 45 * DefaultStyle.dp
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -413,11 +413,6 @@ AbstractMainPage {
|
||||||
numPad: numericPad
|
numPad: numericPad
|
||||||
groupCallVisible: true
|
groupCallVisible: true
|
||||||
searchBarColor: DefaultStyle.grey_100
|
searchBarColor: DefaultStyle.grey_100
|
||||||
|
|
||||||
onCallButtonPressed: (address) => {
|
|
||||||
UtilsCpp.createCall(address)
|
|
||||||
// var window = UtilsCpp.getCallsWindow()
|
|
||||||
}
|
|
||||||
onGroupCallCreationRequested: {
|
onGroupCallCreationRequested: {
|
||||||
console.log("groupe call requetsed")
|
console.log("groupe call requetsed")
|
||||||
listStackView.push(groupCallItem)
|
listStackView.push(groupCallItem)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue