asynchronous actions buttons to improve performances
This commit is contained in:
parent
586dca5cd0
commit
3629732fde
5 changed files with 1298 additions and 1061 deletions
|
|
@ -2,18 +2,14 @@ import QtQuick
|
|||
import QtQuick.Controls.Basic as Control
|
||||
import QtQuick.Effects
|
||||
import Linphone
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
|
||||
|
||||
Button {
|
||||
id: mainItem
|
||||
property alias popup: popup
|
||||
property bool shadowEnabled: mainItem.activeFocus || hovered
|
||||
property alias popupBackgroundColor: popupBackground.color
|
||||
property color backgroundColor: checked
|
||||
? pressedColor
|
||||
: hovered
|
||||
? hoveredColor
|
||||
: color
|
||||
property color backgroundColor: checked ? pressedColor : hovered ? hoveredColor : color
|
||||
style: ButtonStyle.popupButton
|
||||
checked: popup.visible
|
||||
implicitWidth: 24 * DefaultStyle.dp
|
||||
|
|
@ -38,17 +34,26 @@ Button {
|
|||
return item.activeFocusOnTab
|
||||
}
|
||||
function getPreviousItem(index) {
|
||||
return _getPreviousItem(popup.contentItem instanceof FocusScope ? popup.contentItem.children[0] : popup.contentItem, index)
|
||||
return _getPreviousItem(
|
||||
popup.contentItem
|
||||
instanceof FocusScope ? popup.contentItem.children[0] : popup.contentItem,
|
||||
index)
|
||||
}
|
||||
function getNextItem(index) {
|
||||
return _getNextItem(popup.contentItem instanceof FocusScope ? popup.contentItem.children[0] : popup.contentItem, index)
|
||||
return _getNextItem(
|
||||
popup.contentItem
|
||||
instanceof FocusScope ? popup.contentItem.children[0] : popup.contentItem,
|
||||
index)
|
||||
}
|
||||
|
||||
function _getPreviousItem(content, index) {
|
||||
if(content.visibleChildren.length == 0) return null
|
||||
if (content.visibleChildren.length == 0)
|
||||
return null
|
||||
--index
|
||||
while (index >= 0) {
|
||||
if( isFocusable(content.children[index]) && content.children[index].visible) return content.children[index]
|
||||
if (isFocusable(content.children[index])
|
||||
&& content.children[index].visible)
|
||||
return content.children[index]
|
||||
--index
|
||||
}
|
||||
return _getPreviousItem(content, content.children.length)
|
||||
|
|
@ -56,22 +61,27 @@ Button {
|
|||
function _getNextItem(content, index) {
|
||||
++index
|
||||
while (index < content.children.length) {
|
||||
if( isFocusable(content.children[index]) && content.children[index].visible) return content.children[index]
|
||||
if (isFocusable(content.children[index])
|
||||
&& content.children[index].visible)
|
||||
return content.children[index]
|
||||
++index
|
||||
}
|
||||
return _getNextItem(content, -1)
|
||||
}
|
||||
|
||||
Keys.onPressed: (event) => {
|
||||
Keys.onPressed: event => {
|
||||
if (mainItem.checked) {
|
||||
if( event.key == Qt.Key_Escape || event.key == Qt.Key_Left || event.key == Qt.Key_Space){
|
||||
if (event.key == Qt.Key_Escape
|
||||
|| event.key == Qt.Key_Left
|
||||
|| event.key == Qt.Key_Space) {
|
||||
mainItem.close()
|
||||
mainItem.forceActiveFocus()
|
||||
event.accepted = true
|
||||
} else if (event.key == Qt.Key_Up) {
|
||||
getPreviousItem(0).forceActiveFocus()
|
||||
event.accepted = true
|
||||
}else if(event.key == Qt.Key_Tab || event.key == Qt.Key_Down){
|
||||
} else if (event.key == Qt.Key_Tab
|
||||
|| event.key == Qt.Key_Down) {
|
||||
getNextItem(-1).forceActiveFocus()
|
||||
event.accepted = true
|
||||
}
|
||||
|
|
@ -108,24 +118,39 @@ Button {
|
|||
colorizationColor: mainItem.contentImageColor
|
||||
}
|
||||
onPressed: {
|
||||
if (popup.visible) popup.close()
|
||||
else popup.open()
|
||||
if (popup.visible)
|
||||
popup.close()
|
||||
else
|
||||
popup.open()
|
||||
}
|
||||
Control.Popup {
|
||||
id: popup
|
||||
x: 0
|
||||
y: mainItem.height
|
||||
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside | Popup.CloseOnEscape
|
||||
visible: false
|
||||
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside
|
||||
| Popup.CloseOnEscape
|
||||
padding: 10 * DefaultStyle.dp
|
||||
parent: mainItem // Explicit define for coordinates references.
|
||||
function updatePosition() {
|
||||
if (!visible) return
|
||||
if (!visible)
|
||||
return
|
||||
var popupHeight = popup.height + popup.padding
|
||||
var popupWidth = popup.width + popup.padding
|
||||
var winPosition = mainItem.Window.contentItem ? mainItem.Window.contentItem.mapToItem(mainItem,0 , 0) : {x:0,y:0}
|
||||
var winPosition = mainItem.Window.contentItem ? mainItem.Window.contentItem.mapToItem(
|
||||
mainItem, 0,
|
||||
0) : {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
}
|
||||
// Stay inside main window
|
||||
y = Math.max( Math.min( winPosition.y + mainItem.Window.height - popupHeight, mainItem.height), winPosition.y)
|
||||
x = Math.max( Math.min( winPosition.x + mainItem.Window.width - popupWidth, 0), winPosition.x)
|
||||
y = Math.max(Math.min(
|
||||
winPosition.y + mainItem.Window.height - popupHeight,
|
||||
mainItem.height), winPosition.y)
|
||||
x = Math.max(
|
||||
Math.min(
|
||||
winPosition.x + mainItem.Window.width - popupWidth,
|
||||
0), winPosition.x)
|
||||
// Avoid overlapping with popup button by going to the right (todo: check if left is better?)
|
||||
if (y < mainItem.height && y + popupHeight > 0) {
|
||||
x += mainItem.width
|
||||
|
|
@ -138,8 +163,12 @@ Button {
|
|||
|
||||
Connections {
|
||||
target: mainItem.Window
|
||||
function onHeightChanged(){ Qt.callLater(popup.updatePosition)}
|
||||
function onWidthChanged(){ Qt.callLater(popup.updatePosition)}
|
||||
function onHeightChanged() {
|
||||
Qt.callLater(popup.updatePosition)
|
||||
}
|
||||
function onWidthChanged() {
|
||||
Qt.callLater(popup.updatePosition)
|
||||
}
|
||||
}
|
||||
|
||||
background: Item {
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ import QtQuick.Controls.Basic as Control
|
|||
import Linphone
|
||||
import UtilsCpp
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils
|
||||
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
|
||||
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
||||
|
||||
ListView {
|
||||
id: mainItem
|
||||
|
|
@ -17,7 +17,7 @@ ListView {
|
|||
property string searchText: searchBar?.text
|
||||
property double busyIndicatorSize: 60 * DefaultStyle.dp
|
||||
|
||||
signal resultsReceived()
|
||||
signal resultsReceived
|
||||
|
||||
onResultsReceived: {
|
||||
loading = false
|
||||
|
|
@ -29,7 +29,9 @@ ListView {
|
|||
id: callHistoryProxy
|
||||
filterText: mainItem.searchText
|
||||
onFilterTextChanged: maxDisplayItems = initialDisplayItems
|
||||
initialDisplayItems: Math.max(20, 2 * mainItem.height / (56 * DefaultStyle.dp))
|
||||
initialDisplayItems: Math.max(
|
||||
20,
|
||||
2 * mainItem.height / (56 * DefaultStyle.dp))
|
||||
displayItemsStep: 3 * initialDisplayItems / 2
|
||||
onModelReset: {
|
||||
mainItem.resultsReceived()
|
||||
|
|
@ -38,7 +40,7 @@ ListView {
|
|||
flickDeceleration: 10000
|
||||
spacing: 10 * DefaultStyle.dp
|
||||
|
||||
Keys.onPressed: (event) => {
|
||||
Keys.onPressed: event => {
|
||||
if (event.key == Qt.Key_Escape) {
|
||||
console.log("Back")
|
||||
searchBar.forceActiveFocus()
|
||||
|
|
@ -46,13 +48,17 @@ ListView {
|
|||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: cacheBuffer = Math.max(contentHeight,0)//contentHeight>0 ? contentHeight : 0// cache all items
|
||||
Component.onCompleted: cacheBuffer = Math.max(
|
||||
contentHeight,
|
||||
0) //contentHeight>0 ? contentHeight : 0// cache all items
|
||||
// remove binding loop
|
||||
onContentHeightChanged: Qt.callLater(function () {
|
||||
if (mainItem) mainItem.cacheBuffer = Math?.max(contentHeight,0) || 0
|
||||
if (mainItem)
|
||||
mainItem.cacheBuffer = Math?.max(contentHeight, 0) || 0
|
||||
})
|
||||
|
||||
onActiveFocusChanged: if(activeFocus && currentIndex < 0 && count > 0) currentIndex = 0
|
||||
onActiveFocusChanged: if (activeFocus && currentIndex < 0 && count > 0)
|
||||
currentIndex = 0
|
||||
onCountChanged: {
|
||||
if (currentIndex < 0 && count > 0) {
|
||||
mainItem.currentIndex = 0 // Select first item after loading model
|
||||
|
|
@ -93,11 +99,11 @@ ListView {
|
|||
alwaysRunToEnd: true
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------
|
||||
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) currentIndex = -1
|
||||
if (!visible)
|
||||
currentIndex = -1
|
||||
}
|
||||
|
||||
// Qt bug: sometimes, containsMouse may not be send and update on each MouseArea.
|
||||
|
|
@ -115,7 +121,8 @@ ListView {
|
|||
spacing: 10 * DefaultStyle.dp
|
||||
Avatar {
|
||||
id: historyAvatar
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(modelData.core.remoteAddress)
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(
|
||||
modelData.core.remoteAddress)
|
||||
contact: contactObj?.value || null
|
||||
displayNameVal: modelData.core.displayName
|
||||
secured: securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
|
|
@ -144,29 +151,29 @@ ListView {
|
|||
EffectImage {
|
||||
id: statusIcon
|
||||
imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
||||
? AppIcons.arrowElbow
|
||||
: modelData.core.isOutgoing
|
||||
? AppIcons.arrowUpRight
|
||||
: AppIcons.arrowDownLeft
|
||||
colorizationColor: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.Missed
|
||||
? DefaultStyle.danger_500main
|
||||
: modelData.core.isOutgoing
|
||||
? DefaultStyle.info_500_main
|
||||
: DefaultStyle.success_500main
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted ? AppIcons.arrowElbow : modelData.core.isOutgoing ? AppIcons.arrowUpRight : AppIcons.arrowDownLeft
|
||||
colorizationColor: modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.Declined
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.Aborted
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.EarlyAborted
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : modelData.core.isOutgoing ? DefaultStyle.info_500_main : DefaultStyle.success_500main
|
||||
Layout.preferredWidth: 12 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 12 * DefaultStyle.dp
|
||||
transform: Rotation {
|
||||
angle: modelData.core.isOutgoing && (modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
angle: modelData.core.isOutgoing
|
||||
&& (modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.DeclinedElsewhere
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.Aborted
|
||||
|| modelData.core.status === LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0
|
||||
|| modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.EarlyAborted) ? 180 : 0
|
||||
origin {
|
||||
x: statusIcon.width / 2
|
||||
y: statusIcon.height / 2
|
||||
|
|
@ -191,10 +198,10 @@ ListView {
|
|||
onClicked: {
|
||||
if (modelData.core.isConference) {
|
||||
var callsWindow = UtilsCpp.getCallsWindow()
|
||||
callsWindow.setupConference(modelData.core.conferenceInfo)
|
||||
callsWindow.setupConference(
|
||||
modelData.core.conferenceInfo)
|
||||
UtilsCpp.smartShowWindow(callsWindow)
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
UtilsCpp.createCall(modelData.core.remoteAddress)
|
||||
}
|
||||
}
|
||||
|
|
@ -214,8 +221,10 @@ ListView {
|
|||
anchors.fill: parent
|
||||
opacity: 0.7
|
||||
radius: 8 * DefaultStyle.dp
|
||||
color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.main2_100
|
||||
visible: mainItem.lastMouseContainsIndex === index || mainItem.currentIndex === index
|
||||
color: mainItem.currentIndex
|
||||
=== index ? DefaultStyle.main2_200 : DefaultStyle.main2_100
|
||||
visible: mainItem.lastMouseContainsIndex === index
|
||||
|| mainItem.currentIndex === index
|
||||
}
|
||||
onPressed: {
|
||||
mainItem.currentIndex = model.index
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Linphone
|
|||
import UtilsCpp 1.0
|
||||
import ConstantsCpp 1.0
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils
|
||||
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
||||
|
||||
Flickable {
|
||||
id: mainItem
|
||||
|
|
@ -26,7 +26,8 @@ Flickable {
|
|||
|
||||
property bool selectionEnabled: true // Contact can be selected
|
||||
property bool multiSelectionEnabled: false //Multiple items can be selected.
|
||||
property list<string> selectedContacts // List of default address on selected contacts.
|
||||
property list<string> selectedContacts
|
||||
// List of default address on selected contacts.
|
||||
//property FriendGui selectedContact//: model.getAt(currentIndex) || null
|
||||
property FriendGui highlightedContact
|
||||
|
||||
|
|
@ -38,7 +39,8 @@ Flickable {
|
|||
// set searchBarText without specifying a model to bold
|
||||
// matching names
|
||||
property string searchBarText
|
||||
property string searchText// Binding is done on searchBarTextChanged
|
||||
property string searchText
|
||||
// Binding is done on searchBarTextChanged
|
||||
property ConferenceInfoGui confInfoGui
|
||||
|
||||
property bool haveFavorites: false
|
||||
|
|
@ -54,19 +56,19 @@ Flickable {
|
|||
contentHeight: contentsLayout.height
|
||||
rightMargin: itemsRightMargin
|
||||
|
||||
signal contactStarredChanged()
|
||||
signal contactStarredChanged
|
||||
signal contactDeletionRequested(FriendGui contact)
|
||||
signal contactAddedToSelection(string address)
|
||||
signal contactRemovedFromSelection(string address)
|
||||
signal contactSelected(FriendGui contact)
|
||||
|
||||
function selectContact(address) {
|
||||
var index = contactsProxy.loadUntil(address)// Be sure to have this address in proxy if it exists
|
||||
var index = contactsProxy.loadUntil(
|
||||
address) // Be sure to have this address in proxy if it exists
|
||||
if (index != -1) {
|
||||
contactsList.selectIndex(index)
|
||||
}
|
||||
return index
|
||||
|
||||
}
|
||||
function addContactToSelection(address) {
|
||||
if (multiSelectionEnabled) {
|
||||
|
|
@ -104,16 +106,26 @@ Flickable {
|
|||
}
|
||||
|
||||
function findNextList(item, count, direction) {
|
||||
if(count == 3) return null
|
||||
if (count == 3)
|
||||
return null
|
||||
var nextItem
|
||||
switch (item) {
|
||||
case suggestionsList:nextItem=(direction > 0 ? favoritesList : contactsList);break;
|
||||
case contactsList:nextItem=(direction > 0 ? suggestionsList : favoritesList);break;
|
||||
case favoritesList:nextItem=(direction > 0 ? contactsList : suggestionsList);break;
|
||||
default: return null
|
||||
case suggestionsList:
|
||||
nextItem = (direction > 0 ? favoritesList : contactsList)
|
||||
break
|
||||
case contactsList:
|
||||
nextItem = (direction > 0 ? suggestionsList : favoritesList)
|
||||
break
|
||||
case favoritesList:
|
||||
nextItem = (direction > 0 ? contactsList : suggestionsList)
|
||||
break
|
||||
default:
|
||||
return null
|
||||
}
|
||||
if( nextItem.model.count > 0) return nextItem
|
||||
else return findNextList(nextItem, count+1, direction)
|
||||
if (nextItem.model.count > 0)
|
||||
return nextItem
|
||||
else
|
||||
return findNextList(nextItem, count + 1, direction)
|
||||
}
|
||||
|
||||
function updatePosition(list) {
|
||||
|
|
@ -142,17 +154,27 @@ Flickable {
|
|||
loading = true
|
||||
}
|
||||
|
||||
Keys.onPressed: (event)=> {
|
||||
Keys.onPressed: event => {
|
||||
if (!event.accepted) {
|
||||
if(event.key == Qt.Key_Up || event.key == Qt.Key_Down){
|
||||
if (event.key == Qt.Key_Up
|
||||
|| event.key == Qt.Key_Down) {
|
||||
var newItem
|
||||
var direction = (event.key == Qt.Key_Up ? -1 : 1)
|
||||
if(suggestionsList.activeFocus) newItem = findNextList(suggestionsList, 0, direction)
|
||||
else if(contactsList.activeFocus) newItem = findNextList(contactsList, 0, direction)
|
||||
else if(favoritesList.activeFocus) newItem = findNextList(favoritesList, 0, direction)
|
||||
else newItem = findNextList(suggestionsList, 0, direction)
|
||||
if (suggestionsList.activeFocus)
|
||||
newItem = findNextList(suggestionsList, 0,
|
||||
direction)
|
||||
else if (contactsList.activeFocus)
|
||||
newItem = findNextList(contactsList, 0,
|
||||
direction)
|
||||
else if (favoritesList.activeFocus)
|
||||
newItem = findNextList(favoritesList, 0,
|
||||
direction)
|
||||
else
|
||||
newItem = findNextList(suggestionsList, 0,
|
||||
direction)
|
||||
if (newItem) {
|
||||
newItem.selectIndex(direction > 0 ? -1 : newItem.model.count - 1)
|
||||
newItem.selectIndex(
|
||||
direction > 0 ? -1 : newItem.model.count - 1)
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
|
@ -161,7 +183,8 @@ Flickable {
|
|||
Component.onCompleted: {
|
||||
if (confInfoGui) {
|
||||
for (var i = 0; i < confInfoGui.core.participants.length; ++i) {
|
||||
selectedContacts.push(confInfoGui.core.getParticipantAddressAt(i));
|
||||
selectedContacts.push(
|
||||
confInfoGui.core.getParticipantAddressAt(i))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -181,7 +204,6 @@ Flickable {
|
|||
sourceFlags: mainItem.sourceFlags
|
||||
onModelReset: {
|
||||
mainItem.resetSelections()
|
||||
|
||||
}
|
||||
onResultsProcessed: {
|
||||
mainItem.loading = false
|
||||
|
|
@ -197,8 +219,11 @@ Flickable {
|
|||
}
|
||||
|
||||
onAtYEndChanged: if (atYEnd) {
|
||||
if( (contactsProxy.haveMore && contactList.expanded ) || mainItem.hideSuggestions) contactsProxy.displayMore()
|
||||
else suggestionsProxy.displayMore()
|
||||
if ((contactsProxy.haveMore && contactList.expanded)
|
||||
|| mainItem.hideSuggestions)
|
||||
contactsProxy.displayMore()
|
||||
else
|
||||
suggestionsProxy.displayMore()
|
||||
}
|
||||
Behavior on contentY {
|
||||
NumberAnimation {
|
||||
|
|
@ -252,19 +277,29 @@ Flickable {
|
|||
itemsRightMargin: mainItem.itemsRightMargin
|
||||
|
||||
onHighlightedContactChanged: mainItem.highlightedContact = highlightedContact
|
||||
onContactSelected: (contactGui) => {
|
||||
onContactSelected: contactGui => {
|
||||
mainItem.contactSelected(contactGui)
|
||||
}
|
||||
onUpdatePosition: mainItem.updatePosition(favoritesList)
|
||||
onContactDeletionRequested: (contact) => {mainItem.contactDeletionRequested(contact)}
|
||||
onAddContactToSelection: (address) => {mainItem.addContactToSelection(address)}
|
||||
onRemoveContactFromSelection: (index) => {mainItem.removeContactFromSelection(index)}
|
||||
onContactDeletionRequested: contact => {
|
||||
mainItem.contactDeletionRequested(
|
||||
contact)
|
||||
}
|
||||
onAddContactToSelection: address => {
|
||||
mainItem.addContactToSelection(address)
|
||||
}
|
||||
onRemoveContactFromSelection: index => {
|
||||
mainItem.removeContactFromSelection(
|
||||
index)
|
||||
}
|
||||
|
||||
property MagicSearchProxy proxy: MagicSearchProxy {
|
||||
parentProxy: mainItem.mainModel
|
||||
filterType: MagicSearchProxy.FilteringTypes.Favorites
|
||||
}
|
||||
model : mainItem.showFavorites && (mainItem.searchBarText == ''|| mainItem.searchBarText == '*')? proxy : []
|
||||
model: mainItem.showFavorites
|
||||
&& (mainItem.searchBarText == ''
|
||||
|| mainItem.searchBarText == '*') ? proxy : []
|
||||
}
|
||||
|
||||
ContactListView {
|
||||
|
|
@ -286,22 +321,34 @@ Flickable {
|
|||
title: qsTr('Contacts')
|
||||
|
||||
onHighlightedContactChanged: mainItem.highlightedContact = highlightedContact
|
||||
onContactSelected: (contactGui) => {
|
||||
onContactSelected: contactGui => {
|
||||
mainItem.contactSelected(contactGui)
|
||||
}
|
||||
onUpdatePosition: mainItem.updatePosition(contactsList)
|
||||
onContactDeletionRequested: (contact) => {mainItem.contactDeletionRequested(contact)}
|
||||
onAddContactToSelection: (address) => {mainItem.addContactToSelection(address)}
|
||||
onRemoveContactFromSelection: (index) => {mainItem.removeContactFromSelection(index)}
|
||||
onContactDeletionRequested: contact => {
|
||||
mainItem.contactDeletionRequested(
|
||||
contact)
|
||||
}
|
||||
onAddContactToSelection: address => {
|
||||
mainItem.addContactToSelection(address)
|
||||
}
|
||||
onRemoveContactFromSelection: index => {
|
||||
mainItem.removeContactFromSelection(
|
||||
index)
|
||||
}
|
||||
|
||||
model: MagicSearchProxy {
|
||||
id: contactsProxy
|
||||
parentProxy: mainItem.mainModel
|
||||
filterType: MagicSearchProxy.FilteringTypes.App
|
||||
| (mainItem.searchText != '*' && mainItem.searchText != '' || SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap | MagicSearchProxy.FilteringTypes.CardDAV: 0)
|
||||
initialDisplayItems: Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp))
|
||||
| (mainItem.searchText != '*'
|
||||
&& mainItem.searchText != ''
|
||||
|| SettingsCpp.syncLdapContacts ? MagicSearchProxy.FilteringTypes.Ldap | MagicSearchProxy.FilteringTypes.CardDAV : 0)
|
||||
initialDisplayItems: Math.max(
|
||||
20,
|
||||
2 * mainItem.height / (63 * DefaultStyle.dp))
|
||||
displayItemsStep: 3 * initialDisplayItems / 2
|
||||
onLocalFriendCreated: (index) => {
|
||||
onLocalFriendCreated: index => {
|
||||
contactsList.selectIndex(index)
|
||||
}
|
||||
}
|
||||
|
|
@ -311,7 +358,8 @@ Flickable {
|
|||
visible: contentHeight > 0
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: implicitHeight
|
||||
Layout.topMargin: contactsList.height + favoritesList.height > 0 ? 4 * DefaultStyle.dp : 0
|
||||
Layout.topMargin: contactsList.height + favoritesList.height
|
||||
> 0 ? 4 * DefaultStyle.dp : 0
|
||||
interactive: false
|
||||
showInitials: false
|
||||
highlightText: mainItem.highlightText
|
||||
|
|
@ -325,18 +373,30 @@ Flickable {
|
|||
itemsRightMargin: mainItem.itemsRightMargin
|
||||
|
||||
onHighlightedContactChanged: mainItem.highlightedContact = highlightedContact
|
||||
onContactSelected: (contactGui) => {
|
||||
onContactSelected: contactGui => {
|
||||
mainItem.contactSelected(contactGui)
|
||||
}
|
||||
onUpdatePosition: mainItem.updatePosition(suggestionsList)
|
||||
onContactDeletionRequested: (contact) => {mainItem.contactDeletionRequested(contact)}
|
||||
onAddContactToSelection: (address) => {mainItem.addContactToSelection(address)}
|
||||
onRemoveContactFromSelection: (index) => {mainItem.removeContactFromSelection(index)}
|
||||
onContactDeletionRequested: contact => {
|
||||
mainItem.contactDeletionRequested(
|
||||
contact)
|
||||
}
|
||||
onAddContactToSelection: address => {
|
||||
mainItem.addContactToSelection(address)
|
||||
}
|
||||
onRemoveContactFromSelection: index => {
|
||||
mainItem.removeContactFromSelection(
|
||||
index)
|
||||
}
|
||||
model: MagicSearchProxy {
|
||||
id: suggestionsProxy
|
||||
parentProxy: mainItem.mainModel
|
||||
filterType: mainItem.hideSuggestions ? MagicSearchProxy.FilteringTypes.None : MagicSearchProxy.FilteringTypes.Other
|
||||
initialDisplayItems: contactsProxy.haveMore && contactsList.expanded ? 0 : Math.max(20, 2 * mainItem.height / (63 * DefaultStyle.dp))
|
||||
initialDisplayItems: contactsProxy.haveMore
|
||||
&& contactsList.expanded ? 0 : Math.max(
|
||||
20,
|
||||
2 * mainItem.height
|
||||
/ (63 * DefaultStyle.dp))
|
||||
onInitialDisplayItemsChanged: maxDisplayItems = initialDisplayItems
|
||||
displayItemsStep: 3 * initialDisplayItems / 2
|
||||
onModelReset: maxDisplayItems = initialDisplayItems
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Linphone
|
|||
import UtilsCpp 1.0
|
||||
import ConstantsCpp 1.0
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
|
||||
|
||||
FocusScope {
|
||||
id: mainItem
|
||||
|
|
@ -16,21 +16,25 @@ FocusScope {
|
|||
property bool showDefaultAddress: true // Display address below display name.
|
||||
property bool showActions: false // Display actions layout (call buttons)
|
||||
property bool showContactMenu: true // Display the dot menu for contacts.
|
||||
property string highlightText // Bold characters in Display name.
|
||||
property string highlightText
|
||||
|
||||
// Bold characters in Display name.
|
||||
property bool displayNameCapitalization: true // Capitalize display name.
|
||||
|
||||
property bool selectionEnabled: true // Contact can be selected
|
||||
property bool multiSelectionEnabled: false //Multiple items can be selected.
|
||||
property list<string> selectedContacts // List of default address on selected contacts.
|
||||
property list<string> selectedContacts
|
||||
// List of default address on selected contacts.
|
||||
property bool isSelected: false // selected in list => currentIndex == index
|
||||
property bool isLastHovered: false
|
||||
|
||||
property var previousInitial // Use directly previous initial
|
||||
property var previousInitial
|
||||
// Use directly previous initial
|
||||
property int itemsRightMargin: 39 * DefaultStyle.dp
|
||||
|
||||
property var displayName: searchResultItem.core.fullName
|
||||
property string initial: displayName ? displayName[0].toLocaleLowerCase(ConstantsCpp.DefaultLocale) : ''
|
||||
property string initial: displayName ? displayName[0].toLocaleLowerCase(
|
||||
ConstantsCpp.DefaultLocale) : ''
|
||||
|
||||
signal clicked(var mouse)
|
||||
signal contactDeletionRequested(FriendGui contact)
|
||||
|
|
@ -72,11 +76,14 @@ FocusScope {
|
|||
ColumnLayout {
|
||||
spacing: 0
|
||||
Text {
|
||||
text: UtilsCpp.boldTextPart(mainItem.displayName, mainItem.highlightText)
|
||||
text: UtilsCpp.boldTextPart(mainItem.displayName,
|
||||
mainItem.highlightText)
|
||||
font {
|
||||
pixelSize: mainItem.showDefaultAddress ? 16 * DefaultStyle.dp : 14 * DefaultStyle.dp
|
||||
pixelSize: mainItem.showDefaultAddress ? 16 * DefaultStyle.dp : 14
|
||||
* DefaultStyle.dp
|
||||
capitalization: mainItem.displayNameCapitalization ? Font.Capitalize : Font.MixedCase
|
||||
weight: mainItem.showDefaultAddress ? 800 * DefaultStyle.dp : 400 * DefaultStyle.dp
|
||||
weight: mainItem.showDefaultAddress ? 800 * DefaultStyle.dp : 400
|
||||
* DefaultStyle.dp
|
||||
}
|
||||
maximumLineCount: 1
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -95,16 +102,27 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
RowLayout {
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Loader {
|
||||
id: buttonsLayoutLoader
|
||||
asynchronous: true
|
||||
active: mainItem.showActions || mainItem.showContactMenu
|
||||
|| mainItem.multiSelectionEnabled
|
||||
Layout.rightMargin: active ? 10 * DefaultStyle.dp : 0
|
||||
sourceComponent: RowLayout {
|
||||
id: actionsRow
|
||||
z: 1
|
||||
visible: actionButtons || friendPopup.visible || mainItem.multiSelectionEnabled
|
||||
visible: actionButtons.visible || friendPopup.visible
|
||||
|| mainItem.multiSelectionEnabled
|
||||
spacing: visible ? 16 * DefaultStyle.dp : 0
|
||||
Layout.rightMargin: visible ? 10 * DefaultStyle.dp : 0
|
||||
enabled: visible
|
||||
EffectImage {
|
||||
id: isSelectedCheck
|
||||
visible: mainItem.multiSelectionEnabled && (mainItem.selectedContacts.indexOf(searchResultItem.core.defaultAddress) != -1)
|
||||
visible: mainItem.multiSelectionEnabled
|
||||
&& (mainItem.selectedContacts.indexOf(
|
||||
searchResultItem.core.defaultAddress) != -1)
|
||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||
imageSource: AppIcons.check
|
||||
|
|
@ -124,7 +142,8 @@ FocusScope {
|
|||
focus: visible
|
||||
radius: 40 * DefaultStyle.dp
|
||||
style: ButtonStyle.grey
|
||||
onClicked: UtilsCpp.createCall(searchResultItem.core.defaultFullAddress)
|
||||
onClicked: UtilsCpp.createCall(
|
||||
searchResultItem.core.defaultFullAddress)
|
||||
KeyNavigation.left: chatButton
|
||||
KeyNavigation.right: videoCallButton
|
||||
}
|
||||
|
|
@ -138,19 +157,25 @@ FocusScope {
|
|||
focus: visible && !callButton.visible
|
||||
radius: 40 * DefaultStyle.dp
|
||||
style: ButtonStyle.grey
|
||||
onClicked: UtilsCpp.createCall(searchResultItem.core.defaultFullAddress, {'localVideoEnabled': true})
|
||||
onClicked: UtilsCpp.createCall(
|
||||
searchResultItem.core.defaultFullAddress,
|
||||
{
|
||||
"localVideoEnabled": true
|
||||
})
|
||||
KeyNavigation.left: callButton
|
||||
KeyNavigation.right: chatButton
|
||||
}
|
||||
IconButton {
|
||||
id: chatButton
|
||||
visible: actionButtons.visible && !SettingsCpp.disableChatFeature
|
||||
visible: actionButtons.visible
|
||||
&& !SettingsCpp.disableChatFeature
|
||||
Layout.preferredWidth: 45 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 45 * DefaultStyle.dp
|
||||
icon.width: 24 * DefaultStyle.dp
|
||||
icon.height: 24 * DefaultStyle.dp
|
||||
icon.source: AppIcons.chatTeardropText
|
||||
focus: visible && !callButton.visible && !videoCallButton.visible
|
||||
focus: visible && !callButton.visible
|
||||
&& !videoCallButton.visible
|
||||
radius: 40 * DefaultStyle.dp
|
||||
style: ButtonStyle.grey
|
||||
KeyNavigation.left: videoCallButton
|
||||
|
|
@ -162,19 +187,26 @@ FocusScope {
|
|||
z: 1
|
||||
popup.x: 0
|
||||
popup.padding: 10 * DefaultStyle.dp
|
||||
visible: mainItem.showContactMenu && (contactArea.containsMouse || hovered || popup.opened)
|
||||
visible: mainItem.showContactMenu
|
||||
&& (contactArea.containsMouse || hovered
|
||||
|| popup.opened)
|
||||
enabled: visible
|
||||
|
||||
popup.contentItem: ColumnLayout {
|
||||
IconLabelButton {
|
||||
visible: searchResultItem.core.isStored && !searchResultItem.core.readOnly
|
||||
text: searchResultItem.core.starred ? qsTr("Enlever des favoris") : qsTr("Mettre en favori")
|
||||
visible: searchResultItem.core.isStored
|
||||
&& !searchResultItem.core.readOnly
|
||||
text: searchResultItem.core.starred ? qsTr(
|
||||
"Enlever des favoris") : qsTr(
|
||||
"Mettre en favori")
|
||||
icon.source: searchResultItem.core.starred ? AppIcons.heartFill : AppIcons.heart
|
||||
spacing: 10 * DefaultStyle.dp
|
||||
textColor: DefaultStyle.main2_500main
|
||||
hoveredImageColor: searchResultItem.core.starred ? DefaultStyle.main1_700 : DefaultStyle.danger_700
|
||||
contentImageColor: searchResultItem.core.starred ? DefaultStyle.danger_500main : DefaultStyle.main2_600
|
||||
onClicked: {
|
||||
searchResultItem.core.lSetStarred(!searchResultItem.core.starred)
|
||||
searchResultItem.core.lSetStarred(
|
||||
!searchResultItem.core.starred)
|
||||
friendPopup.close()
|
||||
}
|
||||
style: ButtonStyle.noBackground
|
||||
|
|
@ -186,14 +218,25 @@ FocusScope {
|
|||
textColor: DefaultStyle.main2_500main
|
||||
onClicked: {
|
||||
var vcard = searchResultItem.core.getVCard()
|
||||
var username = searchResultItem.core.givenName + searchResultItem.core.familyName
|
||||
var filepath = UtilsCpp.createVCardFile(username, vcard)
|
||||
if (filepath == "") UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("La création du fichier vcard a échoué"), false)
|
||||
else mainWindow.showInformationPopup(qsTr("VCard créée"), qsTr("VCard du contact enregistrée dans %1").arg(filepath))
|
||||
UtilsCpp.shareByEmail(qsTr("Partage de contact"), vcard, filepath)
|
||||
var username = searchResultItem.core.givenName
|
||||
+ searchResultItem.core.familyName
|
||||
var filepath = UtilsCpp.createVCardFile(
|
||||
username, vcard)
|
||||
if (filepath == "")
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Erreur"), qsTr(
|
||||
"La création du fichier vcard a échoué"),
|
||||
false)
|
||||
else
|
||||
mainWindow.showInformationPopup(
|
||||
qsTr("VCard créée"), qsTr(
|
||||
"VCard du contact enregistrée dans %1").arg(
|
||||
filepath))
|
||||
UtilsCpp.shareByEmail(
|
||||
qsTr("Partage de contact"),
|
||||
vcard, filepath)
|
||||
}
|
||||
style: ButtonStyle.noBackground
|
||||
|
||||
}
|
||||
IconLabelButton {
|
||||
text: qsTr("Supprimer")
|
||||
|
|
@ -201,7 +244,8 @@ FocusScope {
|
|||
spacing: 10 * DefaultStyle.dp
|
||||
visible: !searchResultItem.core.readOnly
|
||||
onClicked: {
|
||||
mainItem.contactDeletionRequested(searchResultItem)
|
||||
mainItem.contactDeletionRequested(
|
||||
searchResultItem)
|
||||
friendPopup.close()
|
||||
}
|
||||
style: ButtonStyle.noBackgroundRed
|
||||
|
|
@ -210,6 +254,7 @@ FocusScope {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: contactArea
|
||||
|
|
@ -219,7 +264,7 @@ FocusScope {
|
|||
hoverEnabled: true
|
||||
acceptedButtons: Qt.AllButtons
|
||||
z: -1
|
||||
focus: !actionButtons.visible
|
||||
focus: !buttonsLayoutLoader.active
|
||||
onContainsMouseChanged: {
|
||||
mainItem.containsMouseChanged(containsMouse)
|
||||
}
|
||||
|
|
@ -228,17 +273,20 @@ FocusScope {
|
|||
radius: 8 * DefaultStyle.dp
|
||||
opacity: 0.7
|
||||
color: mainItem.isSelected ? DefaultStyle.main2_200 : DefaultStyle.main2_100
|
||||
visible: mainItem.isLastHovered || friendPopup.hovered || mainItem.isSelected || friendPopup.visible
|
||||
visible: mainItem.isLastHovered || mainItem.isSelected
|
||||
}
|
||||
Keys.onPressed: (event)=> {
|
||||
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
|
||||
Keys.onPressed: event => {
|
||||
if (event.key == Qt.Key_Space
|
||||
|| event.key == Qt.Key_Enter
|
||||
|| event.key == Qt.Key_Return) {
|
||||
contactArea.clicked(undefined)
|
||||
event.accepted = true;
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
onClicked: (mouse) => {
|
||||
onClicked: mouse => {
|
||||
forceActiveFocus()
|
||||
if (mouse && mouse.button == Qt.RightButton && mainItem.showContactMenu) {
|
||||
if (mouse && mouse.button == Qt.RightButton
|
||||
&& mainItem.showContactMenu) {
|
||||
friendPopup.open()
|
||||
} else {
|
||||
mainItem.clicked(mouse)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
|
||||
/**
|
||||
* Qml template used for welcome and login/register pages
|
||||
**/
|
||||
|
||||
import QtCore
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
|
@ -11,23 +12,22 @@ import QtQuick.Effects
|
|||
import Linphone
|
||||
import UtilsCpp
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js' as Utils
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
import "qrc:/qt/qml/Linphone/view/Control/Tool/Helper/utils.js" as Utils
|
||||
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
|
||||
|
||||
Item {
|
||||
id: mainItem
|
||||
property var callObj
|
||||
property var contextualMenuOpenedComponent: undefined
|
||||
|
||||
signal addAccountRequest()
|
||||
signal openNewCallRequest()
|
||||
signal callCreated()
|
||||
signal openCallHistory()
|
||||
signal openNumPadRequest()
|
||||
signal addAccountRequest
|
||||
signal openNewCallRequest
|
||||
signal callCreated
|
||||
signal openCallHistory
|
||||
signal openNumPadRequest
|
||||
signal displayContactRequested(string contactAddress)
|
||||
signal createContactRequested(string name, string address)
|
||||
signal accountRemoved()
|
||||
|
||||
signal accountRemoved
|
||||
|
||||
function goToNewCall() {
|
||||
tabbar.currentIndex = 0
|
||||
|
|
@ -48,7 +48,8 @@ Item {
|
|||
}
|
||||
|
||||
function openContextualMenuComponent(component) {
|
||||
if (mainItem.contextualMenuOpenedComponent && mainItem.contextualMenuOpenedComponent != component) {
|
||||
if (mainItem.contextualMenuOpenedComponent
|
||||
&& mainItem.contextualMenuOpenedComponent != component) {
|
||||
mainStackView.pop()
|
||||
mainItem.contextualMenuOpenedComponent = undefined
|
||||
}
|
||||
|
|
@ -64,15 +65,19 @@ Item {
|
|||
mainItem.contextualMenuOpenedComponent = undefined
|
||||
}
|
||||
|
||||
function openAccountSettings(account: AccountGui) {
|
||||
var page = accountSettingsPageComponent.createObject(parent, {"account": account});
|
||||
function openAccountSettings(account) {
|
||||
var page = accountSettingsPageComponent.createObject(parent, {
|
||||
"account": account
|
||||
})
|
||||
openContextualMenuComponent(page)
|
||||
}
|
||||
|
||||
AccountProxy {
|
||||
id: accountProxy
|
||||
sourceModel: AppCpp.accounts
|
||||
onDefaultAccountChanged: if (tabbar.currentIndex === 0 && defaultAccount) defaultAccount.core?.lResetMissedCalls()
|
||||
onDefaultAccountChanged: if (tabbar.currentIndex === 0
|
||||
&& defaultAccount)
|
||||
defaultAccount.core?.lResetMissedCalls()
|
||||
}
|
||||
|
||||
CallProxy {
|
||||
|
|
@ -97,12 +102,10 @@ Item {
|
|||
property string remoteName: currentCall ? currentCall.core.remoteName : ""
|
||||
contentItem: MediumButton {
|
||||
style: ButtonStyle.toast
|
||||
text: currentCallNotif.currentCall
|
||||
? currentCallNotif.currentCall.core.conference
|
||||
? ("Réunion en cours : ") + currentCallNotif.currentCall.core.conference.core.subject
|
||||
: (("Appel en cours : ") + currentCallNotif.remoteName) : "appel en cours"
|
||||
text: currentCallNotif.currentCall ? currentCallNotif.currentCall.core.conference ? ("Réunion en cours : ") + currentCallNotif.currentCall.core.conference.core.subject : (("Appel en cours : ") + currentCallNotif.remoteName) : "appel en cours"
|
||||
onClicked: {
|
||||
var callsWindow = UtilsCpp.getCallsWindow(currentCallNotif.currentCall)
|
||||
var callsWindow = UtilsCpp.getCallsWindow(
|
||||
currentCallNotif.currentCall)
|
||||
UtilsCpp.smartShowWindow(callsWindow)
|
||||
}
|
||||
}
|
||||
|
|
@ -123,20 +126,35 @@ Item {
|
|||
when: mainItem.contextualMenuOpenedComponent != undefined
|
||||
value: -1
|
||||
}
|
||||
model: [
|
||||
{icon: AppIcons.phone, selectedIcon: AppIcons.phoneSelected, label: qsTr("Appels")},
|
||||
{icon: AppIcons.adressBook, selectedIcon: AppIcons.adressBookSelected, label: qsTr("Contacts")},
|
||||
{icon: AppIcons.chatTeardropText, selectedIcon: AppIcons.chatTeardropTextSelected, label: qsTr("Conversations"), visible: !SettingsCpp.disableChatFeature},
|
||||
{icon: AppIcons.videoconference, selectedIcon: AppIcons.videoconferenceSelected, label: qsTr("Réunions"), visible: !SettingsCpp.disableMeetingsFeature}
|
||||
]
|
||||
model: [{
|
||||
"icon": AppIcons.phone,
|
||||
"selectedIcon": AppIcons.phoneSelected,
|
||||
"label": qsTr("Appels")
|
||||
}, {
|
||||
"icon": AppIcons.adressBook,
|
||||
"selectedIcon": AppIcons.adressBookSelected,
|
||||
"label": qsTr("Contacts")
|
||||
}, {
|
||||
"icon": AppIcons.chatTeardropText,
|
||||
"selectedIcon": AppIcons.chatTeardropTextSelected,
|
||||
"label": qsTr("Conversations"),
|
||||
"visible": !SettingsCpp.disableChatFeature
|
||||
}, {
|
||||
"icon": AppIcons.videoconference,
|
||||
"selectedIcon": AppIcons.videoconferenceSelected,
|
||||
"label": qsTr("Réunions"),
|
||||
"visible": !SettingsCpp.disableMeetingsFeature
|
||||
}]
|
||||
onCurrentIndexChanged: {
|
||||
if (currentIndex == -1) return
|
||||
if (currentIndex === 0 && accountProxy.defaultAccount) accountProxy.defaultAccount.core?.lResetMissedCalls()
|
||||
if (currentIndex == -1)
|
||||
return
|
||||
if (currentIndex === 0 && accountProxy.defaultAccount)
|
||||
accountProxy.defaultAccount.core?.lResetMissedCalls()
|
||||
if (mainItem.contextualMenuOpenedComponent) {
|
||||
closeContextualMenuComponent()
|
||||
}
|
||||
}
|
||||
Keys.onPressed: (event)=>{
|
||||
Keys.onPressed: event => {
|
||||
if (event.key == Qt.Key_Right) {
|
||||
mainStackView.currentItem.forceActiveFocus()
|
||||
}
|
||||
|
|
@ -144,9 +162,15 @@ Item {
|
|||
Component.onCompleted: {
|
||||
if (SettingsCpp.shortcutCount > 0) {
|
||||
var shortcuts = SettingsCpp.shortcuts
|
||||
shortcuts.forEach((shortcut) => {
|
||||
model.push({icon: shortcut.icon, selectedIcon: shortcut.icon, label: shortcut.name, colored: true, link:shortcut.link})
|
||||
});
|
||||
shortcuts.forEach(shortcut => {
|
||||
model.push({
|
||||
"icon": shortcut.icon,
|
||||
"selectedIcon": shortcut.icon,
|
||||
"label": shortcut.name,
|
||||
"colored": true,
|
||||
"link": shortcut.link
|
||||
})
|
||||
})
|
||||
}
|
||||
initButtons()
|
||||
currentIndex = SettingsCpp.getLastActiveTabIndex()
|
||||
|
|
@ -181,8 +205,10 @@ Item {
|
|||
}
|
||||
|
||||
onTextChanged: {
|
||||
if (text.length != 0) listPopup.open()
|
||||
else listPopup.close()
|
||||
if (text.length != 0)
|
||||
listPopup.open()
|
||||
else
|
||||
listPopup.close()
|
||||
}
|
||||
KeyNavigation.down: contactList //contactLoader.item?.count > 0 || !contactLoader.item?.footerItem? contactLoader.item : contactLoader.item?.footerItem
|
||||
KeyNavigation.up: contactList //contactLoader.item?.footerItem ? contactLoader.item?.footerItem : contactLoader.item
|
||||
|
|
@ -192,11 +218,14 @@ Item {
|
|||
width: magicSearchBar.width
|
||||
property int maxHeight: 400 * DefaultStyle.dp
|
||||
property bool displayScrollbar: contactList.height > maxHeight
|
||||
height: Math.min(contactList.contentHeight, maxHeight) + topPadding + bottomPadding
|
||||
height: Math.min(
|
||||
contactList.contentHeight,
|
||||
maxHeight) + topPadding + bottomPadding
|
||||
y: magicSearchBar.height
|
||||
closePolicy: Popup.CloseOnEscape
|
||||
// closePolicy: Popup.CloseOnEscape
|
||||
topPadding: 20 * DefaultStyle.dp
|
||||
bottomPadding: contactList.haveContacts ? 20 * DefaultStyle.dp : 10 * DefaultStyle.dp
|
||||
bottomPadding: contactList.haveContacts ? 20 * DefaultStyle.dp : 10
|
||||
* DefaultStyle.dp
|
||||
rightPadding: 8 * DefaultStyle.dp
|
||||
leftPadding: 20 * DefaultStyle.dp
|
||||
visible: magicSearchBar.text.length != 0
|
||||
|
|
@ -210,7 +239,6 @@ Item {
|
|||
anchors.fill: parent
|
||||
border.color: DefaultStyle.main1_500_main
|
||||
border.width: contactList.activeFocus ? 2 : 0
|
||||
|
||||
}
|
||||
MultiEffect {
|
||||
source: popupBg
|
||||
|
|
@ -224,7 +252,8 @@ Item {
|
|||
|
||||
contentItem: AllContactListView {
|
||||
id: contactList
|
||||
width: listPopup.width - listPopup.leftPadding - listPopup.rightPadding
|
||||
width: listPopup.width - listPopup.leftPadding
|
||||
- listPopup.rightPadding
|
||||
itemsRightMargin: 5 * DefaultStyle.dp //(Actions have already 10 of margin)
|
||||
showInitials: false
|
||||
showContactMenu: false
|
||||
|
|
@ -283,8 +312,12 @@ Item {
|
|||
delegate: Item {
|
||||
Connections {
|
||||
target: modelData.core
|
||||
function onShowMwiChanged() {voicemail.updateCumulatedMwi()}
|
||||
function onVoicemailAddressChanged(){voicemail.updateCumulatedMwi()}
|
||||
function onShowMwiChanged() {
|
||||
voicemail.updateCumulatedMwi()
|
||||
}
|
||||
function onVoicemailAddressChanged() {
|
||||
voicemail.updateCumulatedMwi()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -312,10 +345,15 @@ Item {
|
|||
if (accountProxy.count > 1) {
|
||||
avatarButton.popup.open()
|
||||
} else {
|
||||
if (accountProxy.defaultAccount.core.voicemailAddress.length > 0)
|
||||
UtilsCpp.createCall(accountProxy.defaultAccount.core.voicemailAddress)
|
||||
if (accountProxy.defaultAccount.core.voicemailAddress.length
|
||||
> 0)
|
||||
UtilsCpp.createCall(
|
||||
accountProxy.defaultAccount.core.voicemailAddress)
|
||||
else
|
||||
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("L'URI de messagerie vocale n'est pas définie."), false)
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Erreur"), qsTr(
|
||||
"L'URI de messagerie vocale n'est pas définie."),
|
||||
false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -351,10 +389,11 @@ Item {
|
|||
id: popupFocus
|
||||
implicitHeight: settingsButtons.implicitHeight
|
||||
implicitWidth: settingsButtons.implicitWidth
|
||||
Keys.onPressed: (event)=> {
|
||||
if (event.key == Qt.Key_Left || event.key == Qt.Key_Escape) {
|
||||
Keys.onPressed: event => {
|
||||
if (event.key == Qt.Key_Left
|
||||
|| event.key == Qt.Key_Escape) {
|
||||
settingsMenuButton.popup.close()
|
||||
event.accepted = true;
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -371,23 +410,33 @@ Item {
|
|||
icon.height: 32 * DefaultStyle.dp
|
||||
text: qsTr("Mon compte")
|
||||
icon.source: AppIcons.manageProfile
|
||||
onClicked: openAccountSettings(accountProxy.defaultAccount ? accountProxy.defaultAccount : accountProxy.firstAccount())
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(0) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(0) : null
|
||||
onClicked: openAccountSettings(
|
||||
accountProxy.defaultAccount ? accountProxy.defaultAccount : accountProxy.firstAccount())
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
0) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
0) : null
|
||||
}
|
||||
IconLabelButton {
|
||||
id: dndButton
|
||||
Layout.fillWidth: true
|
||||
icon.width: 32 * DefaultStyle.dp
|
||||
icon.height: 32 * DefaultStyle.dp
|
||||
text: SettingsCpp.dnd ? qsTr("Désactiver ne pas déranger") : qsTr("Activer ne pas déranger")
|
||||
text: SettingsCpp.dnd ? qsTr("Désactiver ne pas déranger") : qsTr(
|
||||
"Activer ne pas déranger")
|
||||
icon.source: AppIcons.bellDnd
|
||||
onClicked: {
|
||||
settingsMenuButton.popup.close()
|
||||
SettingsCpp.dnd = !SettingsCpp.dnd
|
||||
}
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(1) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(1) : null
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
1) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
1) : null
|
||||
}
|
||||
IconLabelButton {
|
||||
id: settingsButton
|
||||
|
|
@ -397,9 +446,14 @@ Item {
|
|||
icon.height: 32 * DefaultStyle.dp
|
||||
text: qsTr("Paramètres")
|
||||
icon.source: AppIcons.settings
|
||||
onClicked: openContextualMenuComponent(settingsPageComponent)
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(2) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(2) : null
|
||||
onClicked: openContextualMenuComponent(
|
||||
settingsPageComponent)
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
2) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
2) : null
|
||||
}
|
||||
IconLabelButton {
|
||||
id: recordsButton
|
||||
|
|
@ -409,8 +463,12 @@ Item {
|
|||
icon.height: 32 * DefaultStyle.dp
|
||||
text: qsTr("Enregistrements")
|
||||
icon.source: AppIcons.micro
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(3) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(3) : null
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
3) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
3) : null
|
||||
}
|
||||
IconLabelButton {
|
||||
id: helpButton
|
||||
|
|
@ -419,9 +477,14 @@ Item {
|
|||
icon.height: 32 * DefaultStyle.dp
|
||||
text: qsTr("Aide")
|
||||
icon.source: AppIcons.question
|
||||
onClicked: openContextualMenuComponent(helpPageComponent)
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(4) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(4) : null
|
||||
onClicked: openContextualMenuComponent(
|
||||
helpPageComponent)
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
4) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
4) : null
|
||||
}
|
||||
IconLabelButton {
|
||||
id: quitButton
|
||||
|
|
@ -432,19 +495,24 @@ Item {
|
|||
icon.source: AppIcons.power
|
||||
onClicked: {
|
||||
settingsMenuButton.popup.close()
|
||||
UtilsCpp.getMainWindow().showConfirmationLambdaPopup("",
|
||||
qsTr("Quitter Linphone ?"),
|
||||
UtilsCpp.getMainWindow(
|
||||
).showConfirmationLambdaPopup(
|
||||
"", qsTr(
|
||||
"Quitter Linphone ?"),
|
||||
"",
|
||||
function (confirmed) {
|
||||
if (confirmed) {
|
||||
console.info("Exiting App from Top Menu");
|
||||
console.info("Exiting App from Top Menu")
|
||||
Qt.quit()
|
||||
}
|
||||
})
|
||||
}
|
||||
)
|
||||
}
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(5) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(5) : null
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
5) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
5) : null
|
||||
}
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -455,14 +523,19 @@ Item {
|
|||
IconLabelButton {
|
||||
id: addAccountButton
|
||||
Layout.fillWidth: true
|
||||
visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count
|
||||
visible: SettingsCpp.maxAccount == 0
|
||||
|| SettingsCpp.maxAccount > accountProxy.count
|
||||
icon.width: 32 * DefaultStyle.dp
|
||||
icon.height: 32 * DefaultStyle.dp
|
||||
text: qsTr("Ajouter un compte")
|
||||
icon.source: AppIcons.plusCircle
|
||||
onClicked: mainItem.addAccountRequest()
|
||||
KeyNavigation.up: visibleChildren.length != 0 ? settingsMenuButton.getPreviousItem(7) : null
|
||||
KeyNavigation.down: visibleChildren.length != 0 ? settingsMenuButton.getNextItem(7) : null
|
||||
KeyNavigation.up: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getPreviousItem(
|
||||
7) : null
|
||||
KeyNavigation.down: visibleChildren.length
|
||||
!= 0 ? settingsMenuButton.getNextItem(
|
||||
7) : null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -476,14 +549,19 @@ Item {
|
|||
objectName: "mainStackLayout"
|
||||
property int _currentIndex: tabbar.currentIndex
|
||||
currentIndex: -1
|
||||
onActiveFocusChanged: if(activeFocus && currentIndex >= 0) children[currentIndex].forceActiveFocus()
|
||||
onActiveFocusChanged: if (activeFocus
|
||||
&& currentIndex >= 0)
|
||||
children[currentIndex].forceActiveFocus()
|
||||
on_CurrentIndexChanged: {
|
||||
if (count > 0) {
|
||||
if(_currentIndex >= count && tabbar.model[_currentIndex].link){
|
||||
Qt.openUrlExternally(tabbar.model[_currentIndex].link)
|
||||
if (_currentIndex >= count
|
||||
&& tabbar.model[_currentIndex].link) {
|
||||
Qt.openUrlExternally(
|
||||
tabbar.model[_currentIndex].link)
|
||||
} else if (_currentIndex >= 0) {
|
||||
currentIndex = _currentIndex
|
||||
SettingsCpp.setLastActiveTabIndex(currentIndex)
|
||||
SettingsCpp.setLastActiveTabIndex(
|
||||
currentIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -491,13 +569,22 @@ Item {
|
|||
id: callPage
|
||||
Connections {
|
||||
target: mainItem
|
||||
function onOpenNewCallRequest(){ callPage.goToNewCall()}
|
||||
function onCallCreated(){ callPage.goToCallHistory()}
|
||||
function onOpenCallHistory(){ callPage.goToCallHistory()}
|
||||
function onOpenNumPadRequest(){ callPage.openNumPadRequest()}
|
||||
function onOpenNewCallRequest() {
|
||||
callPage.goToNewCall()
|
||||
}
|
||||
function onCallCreated() {
|
||||
callPage.goToCallHistory()
|
||||
}
|
||||
function onOpenCallHistory() {
|
||||
callPage.goToCallHistory()
|
||||
}
|
||||
function onOpenNumPadRequest() {
|
||||
callPage.openNumPadRequest()
|
||||
}
|
||||
}
|
||||
onCreateContactRequested: (name, address) => {
|
||||
mainItem.createContact(name, address)
|
||||
mainItem.createContact(
|
||||
name, address)
|
||||
}
|
||||
Component.onCompleted: {
|
||||
magicSearchBar.numericPadPopup = callPage.numericPadPopup
|
||||
|
|
@ -545,7 +632,12 @@ Item {
|
|||
Control.StackView {
|
||||
id: mainStackView
|
||||
property Transition noTransition: Transition {
|
||||
PropertyAnimation { property: "opacity"; from: 1; to: 1; duration: 0 }
|
||||
PropertyAnimation {
|
||||
property: "opacity"
|
||||
from: 1
|
||||
to: 1
|
||||
duration: 0
|
||||
}
|
||||
}
|
||||
pushEnter: noTransition
|
||||
pushExit: noTransition
|
||||
|
|
@ -560,4 +652,3 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue