fix #LINQT-1705 allow adding ldap friend in app contacts
This commit is contained in:
parent
62884832c4
commit
fb009fa17a
2 changed files with 139 additions and 148 deletions
|
|
@ -103,19 +103,13 @@ FocusScope {
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
Loader {
|
RowLayout {
|
||||||
id: buttonsLayoutLoader
|
|
||||||
asynchronous: true
|
|
||||||
active: mainItem.showActions || mainItem.showContactMenu
|
|
||||||
|| mainItem.multiSelectionEnabled
|
|
||||||
Layout.rightMargin: active ? Math.round(10 * DefaultStyle.dp) : 0
|
|
||||||
sourceComponent: RowLayout {
|
|
||||||
id: actionsRow
|
id: actionsRow
|
||||||
z: 1
|
z: 1
|
||||||
visible: actionButtons.visible || friendPopup.visible
|
visible: mainItem.showActions || actionButtons.visible || mainItem.showContactMenu || mainItem.multiSelectionEnabled
|
||||||
|| mainItem.multiSelectionEnabled
|
|
||||||
spacing: visible ? Math.round(16 * DefaultStyle.dp) : 0
|
spacing: visible ? Math.round(16 * DefaultStyle.dp) : 0
|
||||||
enabled: visible
|
enabled: visible
|
||||||
|
Layout.rightMargin: Math.round(5 * DefaultStyle.dp)
|
||||||
EffectImage {
|
EffectImage {
|
||||||
id: isSelectedCheck
|
id: isSelectedCheck
|
||||||
visible: mainItem.multiSelectionEnabled
|
visible: mainItem.multiSelectionEnabled
|
||||||
|
|
@ -186,9 +180,7 @@ FocusScope {
|
||||||
z: 1
|
z: 1
|
||||||
popup.x: 0
|
popup.x: 0
|
||||||
popup.padding: Math.round(10 * DefaultStyle.dp)
|
popup.padding: Math.round(10 * DefaultStyle.dp)
|
||||||
visible: mainItem.showContactMenu
|
visible: mainItem.showContactMenu && (contactArea.containsMouse || mainItem.isLastHovered || hovered || popup.opened)
|
||||||
&& (contactArea.containsMouse || hovered
|
|
||||||
|| popup.opened)
|
|
||||||
enabled: visible
|
enabled: visible
|
||||||
|
|
||||||
popup.contentItem: ColumnLayout {
|
popup.contentItem: ColumnLayout {
|
||||||
|
|
@ -255,7 +247,6 @@ FocusScope {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: contactArea
|
id: contactArea
|
||||||
|
|
@ -265,7 +256,7 @@ FocusScope {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
z: -1
|
z: -1
|
||||||
focus: !buttonsLayoutLoader.active
|
focus: !actionButtons.visible
|
||||||
onContainsMouseChanged: {
|
onContainsMouseChanged: {
|
||||||
mainItem.containsMouseChanged(containsMouse)
|
mainItem.containsMouseChanged(containsMouse)
|
||||||
}
|
}
|
||||||
|
|
@ -274,7 +265,7 @@ FocusScope {
|
||||||
radius: Math.round(8 * DefaultStyle.dp)
|
radius: Math.round(8 * DefaultStyle.dp)
|
||||||
opacity: 0.7
|
opacity: 0.7
|
||||||
color: mainItem.isSelected ? DefaultStyle.main2_200 : DefaultStyle.main2_100
|
color: mainItem.isSelected ? DefaultStyle.main2_200 : DefaultStyle.main2_100
|
||||||
visible: mainItem.isLastHovered || mainItem.isSelected
|
visible: mainItem.isLastHovered || mainItem.isSelected || friendPopup.hovered
|
||||||
}
|
}
|
||||||
Keys.onPressed: event => {
|
Keys.onPressed: event => {
|
||||||
if (event.key == Qt.Key_Space
|
if (event.key == Qt.Key_Space
|
||||||
|
|
@ -288,7 +279,7 @@ FocusScope {
|
||||||
forceActiveFocus()
|
forceActiveFocus()
|
||||||
if (mouse && mouse.button == Qt.RightButton
|
if (mouse && mouse.button == Qt.RightButton
|
||||||
&& mainItem.showContactMenu) {
|
&& mainItem.showContactMenu) {
|
||||||
friendPopup.open()
|
if (friendPopup) friendPopup.open()
|
||||||
} else {
|
} else {
|
||||||
mainItem.clicked(mouse)
|
mainItem.clicked(mouse)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -533,17 +533,17 @@ ConferenceInfoGui{
|
||||||
|| false
|
|| false
|
||||||
property bool isCardDAV: contactDetail.contact?.core?.isCardDAV
|
property bool isCardDAV: contactDetail.contact?.core?.isCardDAV
|
||||||
|| false
|
|| false
|
||||||
|
property bool isLocalFriend: contactDetail.contact && !isLdap && !isCardDAV
|
||||||
//: "Voir le contact"
|
//: "Voir le contact"
|
||||||
text: contactDetail.contact ? qsTr("menu_see_existing_contact") :
|
text: isLocalFriend ? qsTr("menu_see_existing_contact") :
|
||||||
//: "Ajouter aux contacts"
|
//: "Ajouter aux contacts"
|
||||||
qsTr("menu_add_address_to_contacts")
|
qsTr("menu_add_address_to_contacts")
|
||||||
icon.source: AppIcons.plusCircle
|
icon.source: AppIcons.plusCircle
|
||||||
icon.width: Math.round(32 * DefaultStyle.dp)
|
icon.width: Math.round(32 * DefaultStyle.dp)
|
||||||
icon.height: Math.round(32 * DefaultStyle.dp)
|
icon.height: Math.round(32 * DefaultStyle.dp)
|
||||||
visible: !isLdap && !isCardDAV
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
detailOptions.close()
|
detailOptions.close()
|
||||||
if (contactDetail.contact)
|
if (isLocalFriend)
|
||||||
mainWindow.displayContactPage(
|
mainWindow.displayContactPage(
|
||||||
contactDetail.contactAddress)
|
contactDetail.contactAddress)
|
||||||
else
|
else
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue