mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 03:18:07 +00:00
fix ldap property for friend (fix #LINQT-1974)
This commit is contained in:
parent
5da7a9fd6b
commit
2560691c84
4 changed files with 66 additions and 60 deletions
|
|
@ -91,7 +91,8 @@ FriendCore::FriendCore(const std::shared_ptr<linphone::Friend> &contact, bool is
|
||||||
mStarred = contact->getStarred();
|
mStarred = contact->getStarred();
|
||||||
mIsSaved = true;
|
mIsSaved = true;
|
||||||
mIsStored = isStored;
|
mIsStored = isStored;
|
||||||
mIsLdap = ToolModel::friendIsInFriendList(ToolModel::getLdapFriendList(), contact);
|
mIsLdap = ToolModel::friendIsInFriendList(ToolModel::getLdapFriendList(), contact) ||
|
||||||
|
(sourceFlags & (int)linphone::MagicSearch::Source::LdapServers) != 0;
|
||||||
mIsCardDAV = (sourceFlags & (int)linphone::MagicSearch::Source::RemoteCardDAV) != 0;
|
mIsCardDAV = (sourceFlags & (int)linphone::MagicSearch::Source::RemoteCardDAV) != 0;
|
||||||
mIsAppFriend = ToolModel::friendIsInFriendList(ToolModel::getAppFriendList(), contact);
|
mIsAppFriend = ToolModel::friendIsInFriendList(ToolModel::getAppFriendList(), contact);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ FocusScope {
|
||||||
popup.contentItem: ColumnLayout {
|
popup.contentItem: ColumnLayout {
|
||||||
IconLabelButton {
|
IconLabelButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
visible: searchResultItem.core.isStored
|
visible: searchResultItem && searchResultItem.core.isStored
|
||||||
&& !searchResultItem.core.readOnly
|
&& !searchResultItem.core.readOnly
|
||||||
//: "Enlever des favoris"
|
//: "Enlever des favoris"
|
||||||
text: searchResultItem.core.starred ? qsTr("contact_details_remove_from_favourites")
|
text: searchResultItem.core.starred ? qsTr("contact_details_remove_from_favourites")
|
||||||
|
|
@ -243,11 +243,10 @@ FocusScope {
|
||||||
text: qsTr("contact_details_delete")
|
text: qsTr("contact_details_delete")
|
||||||
icon.source: AppIcons.trashCan
|
icon.source: AppIcons.trashCan
|
||||||
spacing: Math.round(10 * DefaultStyle.dp)
|
spacing: Math.round(10 * DefaultStyle.dp)
|
||||||
visible: !searchResultItem.core.readOnly
|
visible: searchResultItem && searchResultItem.core.isStored && !searchResultItem.core.readOnly
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
onClicked: {
|
onClicked: {
|
||||||
mainItem.contactDeletionRequested(
|
mainItem.contactDeletionRequested(searchResultItem)
|
||||||
searchResultItem)
|
|
||||||
friendPopup.close()
|
friendPopup.close()
|
||||||
}
|
}
|
||||||
style: ButtonStyle.noBackgroundRed
|
style: ButtonStyle.noBackgroundRed
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,6 @@ AbstractMainPage {
|
||||||
property var remoteChat: remoteChatObj ? remoteChatObj.value : null
|
property var remoteChat: remoteChatObj ? remoteChatObj.value : null
|
||||||
onRemoteChatChanged: {
|
onRemoteChatChanged: {
|
||||||
if (remoteChat) selectedChatGui = remoteChat
|
if (remoteChat) selectedChatGui = remoteChat
|
||||||
else console.log("chat is null")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedChatGuiChanged: {
|
onSelectedChatGuiChanged: {
|
||||||
|
|
|
||||||
|
|
@ -368,14 +368,14 @@ FriendGui{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
contact: mainItem.selectedContact
|
contact: mainItem.selectedContact
|
||||||
button.color: DefaultStyle.main1_100
|
button.color: DefaultStyle.main1_100
|
||||||
|
//: Edit
|
||||||
button.text: qsTr("contact_details_edit")
|
button.text: qsTr("contact_details_edit")
|
||||||
button.style: ButtonStyle.tertiary
|
button.style: ButtonStyle.tertiary
|
||||||
button.icon.source: AppIcons.pencil
|
button.icon.source: AppIcons.pencil
|
||||||
button.onClicked: mainItem.editContact(mainItem.selectedContact)
|
button.onClicked: mainItem.editContact(mainItem.selectedContact)
|
||||||
button.visible: !mainItem.selectedContact?.core.readOnly
|
button.visible: mainItem.selectedContact && mainItem.selectedContact.core.isStored && !mainItem.selectedContact.core.readOnly
|
||||||
property string contactAddress: contact ? contact.core.defaultAddress : ""
|
property string contactAddress: contact ? contact.core.defaultAddress : ""
|
||||||
property var computedContactNameObj: UtilsCpp.getDisplayName(
|
property var computedContactNameObj: UtilsCpp.getDisplayName(contactAddress)
|
||||||
contactAddress)
|
|
||||||
property string computedContactName: computedContactNameObj ? computedContactNameObj.value : ""
|
property string computedContactName: computedContactNameObj ? computedContactNameObj.value : ""
|
||||||
property string contactName: contact ? contact.core.fullName : computedContactName
|
property string contactName: contact ? contact.core.fullName : computedContactName
|
||||||
component LabelButton: ColumnLayout {
|
component LabelButton: ColumnLayout {
|
||||||
|
|
@ -734,42 +734,47 @@ FriendGui{
|
||||||
//: "Autres actions"
|
//: "Autres actions"
|
||||||
label: qsTr("contact_details_actions_title")
|
label: qsTr("contact_details_actions_title")
|
||||||
content: ColumnLayout {
|
content: ColumnLayout {
|
||||||
IconLabelButton {
|
spacing: Math.round(10 * DefaultStyle.dp)
|
||||||
Layout.fillWidth: true
|
ColumnLayout {
|
||||||
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
visible: mainItem.selectedContact && mainItem.selectedContact.core.isStored && !mainItem.selectedContact.core.readOnly
|
||||||
icon.source: AppIcons.pencil
|
IconLabelButton {
|
||||||
//: "Éditer"
|
Layout.fillWidth: true
|
||||||
text: qsTr("contact_details_edit")
|
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
||||||
onClicked: mainItem.editContact(
|
icon.source: AppIcons.pencil
|
||||||
mainItem.selectedContact)
|
//: "Éditer"
|
||||||
visible: !mainItem.selectedContact?.core.readOnly
|
text: qsTr("contact_details_edit")
|
||||||
style: ButtonStyle.noBackground
|
onClicked: mainItem.editContact(mainItem.selectedContact)
|
||||||
|
style: ButtonStyle.noBackground
|
||||||
|
}
|
||||||
|
Rectangle {
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
||||||
|
color: DefaultStyle.main2_200
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
visible: mainItem.selectedContact && mainItem.selectedContact.core.isStored && !mainItem.selectedContact.core.readOnly
|
||||||
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
IconLabelButton {
|
||||||
color: DefaultStyle.main2_200
|
Layout.fillWidth: true
|
||||||
}
|
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
||||||
IconLabelButton {
|
icon.source: mainItem.selectedContact
|
||||||
Layout.fillWidth: true
|
&& mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart
|
||||||
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
text: mainItem.selectedContact
|
||||||
icon.source: mainItem.selectedContact
|
&& mainItem.selectedContact.core.starred
|
||||||
&& mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart
|
//: "Retirer des favoris"
|
||||||
text: mainItem.selectedContact
|
? qsTr("contact_details_remove_from_favourites")
|
||||||
&& mainItem.selectedContact.core.starred
|
//: "Ajouter aux favoris"
|
||||||
//: "Retirer des favoris"
|
: qsTr("contact_details_add_to_favourites")
|
||||||
? qsTr("contact_details_remove_from_favourites")
|
style: ButtonStyle.noBackground
|
||||||
//: "Ajouter aux favoris"
|
onClicked: if (mainItem.selectedContact)
|
||||||
: qsTr("contact_details_add_to_favourites")
|
mainItem.selectedContact.core.lSetStarred(
|
||||||
style: ButtonStyle.noBackground
|
!mainItem.selectedContact.core.starred)
|
||||||
onClicked: if (mainItem.selectedContact)
|
}
|
||||||
mainItem.selectedContact.core.lSetStarred(
|
Rectangle {
|
||||||
!mainItem.selectedContact.core.starred)
|
Layout.fillWidth: true
|
||||||
}
|
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
||||||
Rectangle {
|
color: DefaultStyle.main2_200
|
||||||
Layout.fillWidth: true
|
}
|
||||||
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
|
||||||
color: DefaultStyle.main2_200
|
|
||||||
}
|
}
|
||||||
IconLabelButton {
|
IconLabelButton {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -804,11 +809,6 @@ FriendGui{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
|
||||||
color: DefaultStyle.main2_200
|
|
||||||
}
|
|
||||||
// IconLabelButton {
|
// IconLabelButton {
|
||||||
// Layout.fillWidth: true
|
// Layout.fillWidth: true
|
||||||
// Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
// Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
||||||
|
|
@ -833,18 +833,25 @@ FriendGui{
|
||||||
// Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
// Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
||||||
// color: DefaultStyle.main2_200
|
// color: DefaultStyle.main2_200
|
||||||
// }
|
// }
|
||||||
IconLabelButton {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
visible: mainItem.selectedContact && mainItem.selectedContact.core.isStored && !mainItem.selectedContact.core.readOnly
|
||||||
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
Rectangle {
|
||||||
icon.source: AppIcons.trashCan
|
Layout.fillWidth: true
|
||||||
//: "Supprimer ce contact"
|
Layout.preferredHeight: Math.max(Math.round(1 * DefaultStyle.dp), 1)
|
||||||
text: qsTr("contact_details_delete")
|
color: DefaultStyle.main2_200
|
||||||
visible: !mainItem.selectedContact?.core.readOnly
|
}
|
||||||
onClicked: {
|
IconLabelButton {
|
||||||
mainItem.deleteContact(
|
Layout.fillWidth: true
|
||||||
mainItem.selectedContact)
|
Layout.preferredHeight: Math.round(50 * DefaultStyle.dp)
|
||||||
|
icon.source: AppIcons.trashCan
|
||||||
|
//: "Supprimer ce contact"
|
||||||
|
text: qsTr("contact_details_delete")
|
||||||
|
onClicked: {
|
||||||
|
mainItem.deleteContact(
|
||||||
|
mainItem.selectedContact)
|
||||||
|
}
|
||||||
|
style: ButtonStyle.noBackgroundRed
|
||||||
}
|
}
|
||||||
style: ButtonStyle.noBackgroundRed
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue