auto indentation qt
This commit is contained in:
parent
311ad15a68
commit
586dca5cd0
3 changed files with 1551 additions and 1437 deletions
|
|
@ -10,18 +10,15 @@ import UtilsCpp
|
|||
AbstractSettingsLayout {
|
||||
id: mainItem
|
||||
width: parent?.width
|
||||
contentModel: [
|
||||
{
|
||||
title: qsTr("Paramètres"),
|
||||
subTitle: "",
|
||||
contentComponent: generalParametersComponent
|
||||
},
|
||||
{
|
||||
title: qsTr("Paramètres de compte"),
|
||||
subTitle: "",
|
||||
contentComponent: advancedParametersComponent
|
||||
}
|
||||
]
|
||||
contentModel: [{
|
||||
"title": qsTr("Paramètres"),
|
||||
"subTitle": "",
|
||||
"contentComponent": generalParametersComponent
|
||||
}, {
|
||||
"title": qsTr("Paramètres de compte"),
|
||||
"subTitle": "",
|
||||
"contentComponent": advancedParametersComponent
|
||||
}]
|
||||
|
||||
property alias account: mainItem.model
|
||||
|
||||
|
|
@ -32,13 +29,16 @@ AbstractSettingsLayout {
|
|||
Connections {
|
||||
target: account.core
|
||||
function onIsSavedChanged() {
|
||||
if (account.core.isSaved) UtilsCpp.showInformationPopup(qsTr("Succès"), qsTr("Les changements ont été sauvegardés"), true, mainWindow)
|
||||
if (account.core.isSaved)
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Succès"),
|
||||
qsTr("Les changements ont été sauvegardés"), true,
|
||||
mainWindow)
|
||||
}
|
||||
}
|
||||
|
||||
// General parameters
|
||||
/////////////////////
|
||||
|
||||
Component {
|
||||
id: generalParametersComponent
|
||||
ColumnLayout {
|
||||
|
|
@ -50,7 +50,9 @@ AbstractSettingsLayout {
|
|||
propertyOwnerGui: account
|
||||
title: qsTr("URI du serveur de messagerie vocale")
|
||||
Layout.fillWidth: true
|
||||
isValid: function(text) { return text.length == 0 || !text.endsWith(".") } // work around sdk crash when adress ends with .
|
||||
isValid: function (text) {
|
||||
return text.length == 0 || !text.endsWith(".")
|
||||
} // work around sdk crash when adress ends with .
|
||||
toValidate: true
|
||||
}
|
||||
DecoratedTextField {
|
||||
|
|
@ -65,7 +67,6 @@ AbstractSettingsLayout {
|
|||
|
||||
// Advanced parameters
|
||||
/////////////////////
|
||||
|
||||
Component {
|
||||
id: advancedParametersComponent
|
||||
ColumnLayout {
|
||||
|
|
@ -123,7 +124,9 @@ AbstractSettingsLayout {
|
|||
propertyOwnerGui: account
|
||||
title: qsTr("Expiration (en seconde)")
|
||||
canBeEmpty: false
|
||||
isValid: function(text) { return !isNaN(Number(text)) }
|
||||
isValid: function (text) {
|
||||
return !isNaN(Number(text))
|
||||
}
|
||||
toValidate: true
|
||||
}
|
||||
DecoratedTextField {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
AbstractMainPage {
|
||||
id: mainItem
|
||||
|
|
@ -15,7 +15,7 @@ AbstractMainPage {
|
|||
newItemIconSource: AppIcons.newCall
|
||||
|
||||
property var selectedRowHistoryGui
|
||||
signal listViewUpdated()
|
||||
signal listViewUpdated
|
||||
|
||||
onVisibleChanged: if (!visible) {
|
||||
goToCallHistory()
|
||||
|
|
@ -29,12 +29,13 @@ AbstractMainPage {
|
|||
}
|
||||
property AccountGui account: accountProxy.defaultAccount
|
||||
property var state: account && account.core?.registrationState || 0
|
||||
property bool isRegistered: account ? account.core?.registrationState == LinphoneEnums.RegistrationState.Ok : false
|
||||
property bool isRegistered: account ? account.core?.registrationState
|
||||
== LinphoneEnums.RegistrationState.Ok : false
|
||||
property int selectedParticipantsCount
|
||||
signal startGroupCallRequested()
|
||||
signal createCallFromSearchBarRequested()
|
||||
signal startGroupCallRequested
|
||||
signal createCallFromSearchBarRequested
|
||||
signal createContactRequested(string name, string address)
|
||||
signal openNumPadRequest()
|
||||
signal openNumPadRequest
|
||||
|
||||
property alias numericPadPopup: numericPadPopupItem
|
||||
|
||||
|
|
@ -49,21 +50,31 @@ AbstractMainPage {
|
|||
}
|
||||
|
||||
onSelectedRowHistoryGuiChanged: {
|
||||
if (selectedRowHistoryGui) rightPanelStackView.replace(contactDetailComp, Control.StackView.Immediate)
|
||||
else rightPanelStackView.replace(emptySelection, Control.StackView.Immediate)
|
||||
if (selectedRowHistoryGui)
|
||||
rightPanelStackView.replace(contactDetailComp,
|
||||
Control.StackView.Immediate)
|
||||
else
|
||||
rightPanelStackView.replace(emptySelection,
|
||||
Control.StackView.Immediate)
|
||||
}
|
||||
rightPanelStackView.initialItem: emptySelection
|
||||
rightPanelStackView.width: 360 * DefaultStyle.dp
|
||||
|
||||
onNoItemButtonPressed: goToNewCall()
|
||||
|
||||
showDefaultItem: listStackView.currentItem && listStackView.currentItem.objectName == "historyListItem" && listStackView.currentItem.listView.count === 0 || false
|
||||
showDefaultItem: listStackView.currentItem
|
||||
&& listStackView.currentItem.objectName == "historyListItem"
|
||||
&& listStackView.currentItem.listView.count === 0 || false
|
||||
|
||||
function goToNewCall() {
|
||||
if (listStackView.currentItem && listStackView.currentItem.objectName != "newCallItem") listStackView.push(newCallItem)
|
||||
if (listStackView.currentItem
|
||||
&& listStackView.currentItem.objectName != "newCallItem")
|
||||
listStackView.push(newCallItem)
|
||||
}
|
||||
function goToCallHistory() {
|
||||
if (listStackView.currentItem && listStackView.currentItem.objectName != "historyListItem") listStackView.replace(historyListItem)
|
||||
if (listStackView.currentItem
|
||||
&& listStackView.currentItem.objectName != "historyListItem")
|
||||
listStackView.replace(historyListItem)
|
||||
}
|
||||
|
||||
Dialog {
|
||||
|
|
@ -74,7 +85,8 @@ AbstractMainPage {
|
|||
Dialog {
|
||||
id: deleteForUserPopup
|
||||
width: 278 * DefaultStyle.dp
|
||||
text: qsTr("L'historique d'appel de l'utilisateur sera supprimé. Souhaitez-vous continuer ?")
|
||||
text: qsTr(
|
||||
"L'historique d'appel de l'utilisateur sera supprimé. Souhaitez-vous continuer ?")
|
||||
}
|
||||
|
||||
leftPanelContent: Item {
|
||||
|
|
@ -156,7 +168,8 @@ AbstractMainPage {
|
|||
Connections {
|
||||
target: deleteHistoryPopup
|
||||
onAccepted: {
|
||||
if (listStackView.currentItem.listView) listStackView.currentItem.listView.model.removeAllEntries()
|
||||
if (listStackView.currentItem.listView)
|
||||
listStackView.currentItem.listView.model.removeAllEntries()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -208,7 +221,8 @@ AbstractMainPage {
|
|||
visible: historyListView.count === 0
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: 137 * DefaultStyle.dp
|
||||
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
|
||||
text: qsTr("Aucun appel%1").arg(
|
||||
searchBar.text.length != 0 ? " correspondant" : "")
|
||||
font {
|
||||
pixelSize: 16 * DefaultStyle.dp
|
||||
weight: 800 * DefaultStyle.dp
|
||||
|
|
@ -224,7 +238,9 @@ AbstractMainPage {
|
|||
|
||||
BusyIndicator {
|
||||
anchors.horizontalCenter: historyListView.horizontalCenter
|
||||
visible: historyListView.loading && historyListView.count === 0 && searchBar.text.length === 0
|
||||
visible: historyListView.loading
|
||||
&& historyListView.count === 0
|
||||
&& searchBar.text.length === 0
|
||||
height: visible ? historyListView.busyIndicatorSize : 0
|
||||
width: historyListView.busyIndicatorSize
|
||||
indicatorHeight: historyListView.busyIndicatorSize
|
||||
|
|
@ -239,10 +255,12 @@ AbstractMainPage {
|
|||
}
|
||||
}
|
||||
onCurrentIndexChanged: {
|
||||
mainItem.selectedRowHistoryGui = model.getAt(currentIndex)
|
||||
mainItem.selectedRowHistoryGui = model.getAt(
|
||||
currentIndex)
|
||||
}
|
||||
onCountChanged: {
|
||||
mainItem.selectedRowHistoryGui = model.getAt(currentIndex)
|
||||
mainItem.selectedRowHistoryGui = model.getAt(
|
||||
currentIndex)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -284,7 +302,8 @@ AbstractMainPage {
|
|||
focus: true
|
||||
KeyNavigation.down: listStackView
|
||||
onClicked: {
|
||||
console.debug("[CallPage]User: return to call history")
|
||||
console.debug(
|
||||
"[CallPage]User: return to call history")
|
||||
listStackView.pop()
|
||||
listStackView.forceActiveFocus()
|
||||
}
|
||||
|
|
@ -308,8 +327,9 @@ AbstractMainPage {
|
|||
numPadPopup: numericPadPopupItem
|
||||
groupCallVisible: true
|
||||
searchBarColor: DefaultStyle.grey_100
|
||||
onContactClicked: (contact) => {
|
||||
mainWindow.startCallWithContact(contact, false, callContactsList)
|
||||
onContactClicked: contact => {
|
||||
mainWindow.startCallWithContact(
|
||||
contact, false, callContactsList)
|
||||
}
|
||||
onGroupCallCreationRequested: {
|
||||
console.log("groupe call requetsed")
|
||||
|
|
@ -317,7 +337,9 @@ AbstractMainPage {
|
|||
}
|
||||
Connections {
|
||||
target: mainItem
|
||||
function onCreateCallFromSearchBarRequested(){ UtilsCpp.createCall(callContactsList.searchBar.text)}
|
||||
function onCreateCallFromSearchBarRequested() {
|
||||
UtilsCpp.createCall(callContactsList.searchBar.text)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -364,7 +386,9 @@ AbstractMainPage {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: qsTr("%1 participant%2 sélectionné").arg(mainItem.selectedParticipantsCount).arg(mainItem.selectedParticipantsCount > 1 ? "s" : "")
|
||||
text: qsTr("%1 participant%2 sélectionné").arg(
|
||||
mainItem.selectedParticipantsCount).arg(
|
||||
mainItem.selectedParticipantsCount > 1 ? "s" : "")
|
||||
color: DefaultStyle.main2_500main
|
||||
maximumLineCount: 1
|
||||
font {
|
||||
|
|
@ -397,7 +421,9 @@ AbstractMainPage {
|
|||
font.weight: 700 * DefaultStyle.dp
|
||||
text: qsTr("Nom du groupe")
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
font.pixelSize: 12 * DefaultStyle.dp
|
||||
font.weight: 300 * DefaultStyle.dp
|
||||
|
|
@ -417,22 +443,31 @@ AbstractMainPage {
|
|||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.topMargin: 15 * DefaultStyle.dp
|
||||
onSelectedParticipantsCountChanged: mainItem.selectedParticipantsCount = selectedParticipantsCount
|
||||
onSelectedParticipantsCountChanged: mainItem.selectedParticipantsCount
|
||||
= selectedParticipantsCount
|
||||
focus: true
|
||||
Connections {
|
||||
target: mainItem
|
||||
function onStartGroupCallRequested() {
|
||||
if (groupCallName.text.length === 0) {
|
||||
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Un nom doit être donné à l'appel de groupe"), false)
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Erreur"), qsTr(
|
||||
"Un nom doit être donné à l'appel de groupe"),
|
||||
false)
|
||||
} else if (!mainItem.isRegistered) {
|
||||
UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Vous n'etes pas connecté"), false)
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Erreur"),
|
||||
qsTr("Vous n'etes pas connecté"),
|
||||
false)
|
||||
} else {
|
||||
mainItem.confInfoGui = Qt.createQmlObject('import Linphone
|
||||
mainItem.confInfoGui = Qt.createQmlObject(
|
||||
'import Linphone
|
||||
ConferenceInfoGui{
|
||||
}', mainItem)
|
||||
mainItem.confInfoGui.core.subject = groupCallName.text
|
||||
mainItem.confInfoGui.core.isScheduled = false
|
||||
mainItem.confInfoGui.core.addParticipants(addParticipantsLayout.selectedParticipants)
|
||||
mainItem.confInfoGui.core.addParticipants(
|
||||
addParticipantsLayout.selectedParticipants)
|
||||
mainItem.confInfoGui.core.save()
|
||||
}
|
||||
}
|
||||
|
|
@ -444,7 +479,9 @@ AbstractMainPage {
|
|||
|
||||
Component {
|
||||
id: emptySelection
|
||||
Item{objectName: "emptySelection"}
|
||||
Item {
|
||||
objectName: "emptySelection"
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: contactDetailComp
|
||||
|
|
@ -459,10 +496,12 @@ AbstractMainPage {
|
|||
visible: mainItem.selectedRowHistoryGui != undefined
|
||||
callHistoryGui: selectedRowHistoryGui
|
||||
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(specificAddress)
|
||||
property var contactObj: UtilsCpp.findFriendByAddress(
|
||||
specificAddress)
|
||||
|
||||
contact: contactObj && contactObj.value || null
|
||||
specificAddress: callHistoryGui && callHistoryGui.core.remoteAddress || ""
|
||||
specificAddress: callHistoryGui
|
||||
&& callHistoryGui.core.remoteAddress || ""
|
||||
|
||||
buttonContent: PopupButton {
|
||||
id: detailOptions
|
||||
|
|
@ -472,10 +511,11 @@ AbstractMainPage {
|
|||
popup.contentItem: FocusScope {
|
||||
implicitHeight: detailsButtons.implicitHeight
|
||||
implicitWidth: detailsButtons.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) {
|
||||
detailOptions.popup.close()
|
||||
event.accepted = true;
|
||||
event.accepted = true
|
||||
}
|
||||
}
|
||||
ColumnLayout {
|
||||
|
|
@ -483,17 +523,25 @@ AbstractMainPage {
|
|||
anchors.fill: parent
|
||||
IconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
property bool isLdap: contactDetail.contact?.core?.isLdap || false
|
||||
property bool isCardDAV: contactDetail.contact?.core?.isCardDAV || false
|
||||
text: contactDetail.contact ? qsTr("Voir le contact") : qsTr("Ajouter aux contacts")
|
||||
property bool isLdap: contactDetail.contact?.core?.isLdap
|
||||
|| false
|
||||
property bool isCardDAV: contactDetail.contact?.core?.isCardDAV
|
||||
|| false
|
||||
text: contactDetail.contact ? qsTr("Voir le contact") : qsTr(
|
||||
"Ajouter aux contacts")
|
||||
icon.source: AppIcons.plusCircle
|
||||
icon.width: 32 * DefaultStyle.dp
|
||||
icon.height: 32 * DefaultStyle.dp
|
||||
visible: !isLdap && !isCardDAV
|
||||
onClicked: {
|
||||
detailOptions.close()
|
||||
if (contactDetail.contact) mainWindow.displayContactPage(contactDetail.contactAddress)
|
||||
else mainItem.createContactRequested(contactDetail.contactName, contactDetail.contactAddress)
|
||||
if (contactDetail.contact)
|
||||
mainWindow.displayContactPage(
|
||||
contactDetail.contactAddress)
|
||||
else
|
||||
mainItem.createContactRequested(
|
||||
contactDetail.contactName,
|
||||
contactDetail.contactAddress)
|
||||
}
|
||||
}
|
||||
IconLabelButton {
|
||||
|
|
@ -504,9 +552,19 @@ AbstractMainPage {
|
|||
icon.height: 32 * DefaultStyle.dp
|
||||
onClicked: {
|
||||
detailOptions.close()
|
||||
var success = UtilsCpp.copyToClipboard(mainItem.selectedRowHistoryGui && mainItem.selectedRowHistoryGui.core.remoteAddress)
|
||||
if (success) UtilsCpp.showInformationPopup(qsTr("Copié"), qsTr("L'adresse a été copiée dans le presse-papier"), true)
|
||||
else UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("Erreur lors de la copie de l'adresse"), false)
|
||||
var success = UtilsCpp.copyToClipboard(
|
||||
mainItem.selectedRowHistoryGui
|
||||
&& mainItem.selectedRowHistoryGui.core.remoteAddress)
|
||||
if (success)
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Copié"), qsTr(
|
||||
"L'adresse a été copiée dans le presse-papier"),
|
||||
true)
|
||||
else
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Erreur"), qsTr(
|
||||
"Erreur lors de la copie de l'adresse"),
|
||||
false)
|
||||
}
|
||||
}
|
||||
// IconLabelButton {
|
||||
|
|
@ -534,7 +592,8 @@ AbstractMainPage {
|
|||
Connections {
|
||||
target: deleteForUserPopup
|
||||
function onAccepted() {
|
||||
detailListView.model.removeEntriesWithFilter(detailListView.searchText)
|
||||
detailListView.model.removeEntriesWithFilter(
|
||||
detailListView.searchText)
|
||||
mainItem.listViewUpdated()
|
||||
}
|
||||
}
|
||||
|
|
@ -550,8 +609,8 @@ AbstractMainPage {
|
|||
id: detailControl
|
||||
Layout.preferredWidth: 360 * DefaultStyle.dp
|
||||
Layout.fillHeight: true
|
||||
// height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight) + topPadding + bottomPadding
|
||||
|
||||
// height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight) + topPadding + bottomPadding
|
||||
background: Rectangle {
|
||||
id: detailListBackground
|
||||
anchors.fill: parent
|
||||
|
|
@ -570,7 +629,8 @@ AbstractMainPage {
|
|||
|
||||
BusyIndicator {
|
||||
anchors.horizontalCenter: detailListView.horizontalCenter
|
||||
visible: detailListView.loading && detailListView.count === 0
|
||||
visible: detailListView.loading
|
||||
&& detailListView.count === 0
|
||||
height: visible ? detailListView.busyIndicatorSize : 0
|
||||
width: detailListView.busyIndicatorSize
|
||||
indicatorHeight: detailListView.busyIndicatorSize
|
||||
|
|
@ -591,30 +651,20 @@ AbstractMainPage {
|
|||
RowLayout {
|
||||
EffectImage {
|
||||
id: statusIcon
|
||||
imageSource: modelData.core.status === LinphoneEnums.CallStatus.Declined
|
||||
imageSource: modelData.core.status
|
||||
=== LinphoneEnums.CallStatus.Declined
|
||||
|| 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.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
|
||||
Layout.preferredWidth: 16 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 16 * DefaultStyle.dp
|
||||
transform: Rotation {
|
||||
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
|
||||
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
|
||||
origin {
|
||||
x: statusIcon.width / 2
|
||||
y: statusIcon.height / 2
|
||||
|
|
@ -622,11 +672,7 @@ AbstractMainPage {
|
|||
}
|
||||
}
|
||||
Text {
|
||||
text: modelData.core.status === LinphoneEnums.CallStatus.Missed
|
||||
? qsTr("Appel manqué")
|
||||
: modelData.core.isOutgoing
|
||||
? qsTr("Appel sortant")
|
||||
: qsTr("Appel entrant")
|
||||
text: modelData.core.status === LinphoneEnums.CallStatus.Missed ? qsTr("Appel manqué") : modelData.core.isOutgoing ? qsTr("Appel sortant") : qsTr("Appel entrant")
|
||||
font {
|
||||
pixelSize: 14 * DefaultStyle.dp
|
||||
weight: 400 * DefaultStyle.dp
|
||||
|
|
@ -634,7 +680,8 @@ AbstractMainPage {
|
|||
}
|
||||
}
|
||||
Text {
|
||||
text: UtilsCpp.formatDate(modelData.core.date)
|
||||
text: UtilsCpp.formatDate(
|
||||
modelData.core.date)
|
||||
color: modelData.core.status === LinphoneEnums.CallStatus.Missed ? DefaultStyle.danger_500main : DefaultStyle.main2_500main
|
||||
font {
|
||||
pixelSize: 12 * DefaultStyle.dp
|
||||
|
|
@ -647,7 +694,8 @@ AbstractMainPage {
|
|||
Layout.fillWidth: true
|
||||
}
|
||||
Text {
|
||||
text: UtilsCpp.formatElapsedTime(modelData.core.duration, false)
|
||||
text: UtilsCpp.formatElapsedTime(
|
||||
modelData.core.duration, false)
|
||||
font {
|
||||
pixelSize: 12 * DefaultStyle.dp
|
||||
weight: 300 * DefaultStyle.dp
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import Linphone
|
|||
import UtilsCpp
|
||||
import EnumsToStringCpp
|
||||
import SettingsCpp
|
||||
import 'qrc:/qt/qml/Linphone/view/Style/buttonStyle.js' as ButtonStyle
|
||||
import "qrc:/qt/qml/Linphone/view/Style/buttonStyle.js" as ButtonStyle
|
||||
|
||||
AbstractMainPage {
|
||||
id: mainItem
|
||||
|
|
@ -15,12 +15,17 @@ AbstractMainPage {
|
|||
newItemIconSource: AppIcons.plusCircle
|
||||
|
||||
// disable left panel contact list interaction while a contact is being edited
|
||||
property bool leftPanelEnabled: !rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName != "contactEdition"
|
||||
property bool leftPanelEnabled: !rightPanelStackView.currentItem
|
||||
|| rightPanelStackView.currentItem.objectName
|
||||
!= "contactEdition"
|
||||
property FriendGui selectedContact
|
||||
property string initialFriendToDisplay
|
||||
onInitialFriendToDisplayChanged: {
|
||||
if (initialFriendToDisplay != '' && contactList.selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = ""
|
||||
else if(initialFriendToDisplay != '') console.warn("Abstract not selected yet: ", initialFriendToDisplay)
|
||||
if (initialFriendToDisplay != '' && contactList.selectContact(
|
||||
initialFriendToDisplay) != -1)
|
||||
initialFriendToDisplay = ""
|
||||
else if (initialFriendToDisplay != '')
|
||||
console.warn("Abstract not selected yet: ", initialFriendToDisplay)
|
||||
}
|
||||
|
||||
onVisibleChanged: if (!visible) {
|
||||
|
|
@ -30,13 +35,16 @@ AbstractMainPage {
|
|||
function goToContactDetails() {
|
||||
if (selectedContact) {
|
||||
var firstItem = rightPanelStackView.get(0)
|
||||
if( firstItem && firstItem.objectName == "contactDetail")// Go directly to detail
|
||||
if (firstItem && firstItem.objectName == "contactDetail")
|
||||
// Go directly to detail
|
||||
rightPanelStackView.popToIndex(0)
|
||||
else {
|
||||
if(rightPanelStackView.depth >= 1) {// Replace in background and go back to it
|
||||
if (rightPanelStackView.depth >= 1) {
|
||||
// Replace in background and go back to it
|
||||
rightPanelStackView.replace(firstItem, contactDetail)
|
||||
rightPanelStackView.popToIndex(0)
|
||||
}else{// empty
|
||||
} else {
|
||||
// empty
|
||||
rightPanelStackView.push(contactDetail)
|
||||
}
|
||||
}
|
||||
|
|
@ -57,32 +65,44 @@ AbstractMainPage {
|
|||
friendGui.core.givenName = UtilsCpp.getGivenNameFromFullName(name)
|
||||
friendGui.core.familyName = UtilsCpp.getFamilyNameFromFullName(name)
|
||||
friendGui.core.appendAddress(address)
|
||||
if (!rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName != "contactEdition")
|
||||
rightPanelStackView.push(contactEdition, {"contact": friendGui, "title": qsTr("Nouveau contact"), "saveButtonText": qsTr("Créer")})
|
||||
if (!rightPanelStackView.currentItem
|
||||
|| rightPanelStackView.currentItem.objectName != "contactEdition")
|
||||
rightPanelStackView.push(contactEdition, {
|
||||
"contact": friendGui,
|
||||
"title": qsTr("Nouveau contact"),
|
||||
"saveButtonText": qsTr("Créer")
|
||||
})
|
||||
}
|
||||
|
||||
function editContact(friendGui) {
|
||||
rightPanelStackView.push(contactEdition, {"contact": friendGui, "title": qsTr("Modifier contact"), "saveButtonText": qsTr("Enregistrer")})
|
||||
rightPanelStackView.push(contactEdition, {
|
||||
"contact": friendGui,
|
||||
"title": qsTr("Modifier contact"),
|
||||
"saveButtonText": qsTr("Enregistrer")
|
||||
})
|
||||
}
|
||||
|
||||
// rightPanelStackView.initialItem: contactDetail
|
||||
|
||||
showDefaultItem: rightPanelStackView.depth == 0 && !contactList.haveContacts && searchBar.text.length === 0
|
||||
showDefaultItem: rightPanelStackView.depth == 0 && !contactList.haveContacts
|
||||
&& searchBar.text.length === 0
|
||||
|
||||
function deleteContact(contact) {
|
||||
if (!contact) return
|
||||
if (!contact)
|
||||
return
|
||||
var mainWin = UtilsCpp.getMainWindow()
|
||||
mainWin.showConfirmationLambdaPopup("",
|
||||
qsTr("%1 sera supprimé des contacts. Voulez-vous continuer ?").arg(contact.core.fullName),
|
||||
"",
|
||||
function (confirmed) {
|
||||
mainWin.showConfirmationLambdaPopup(
|
||||
"", qsTr(
|
||||
"%1 sera supprimé des contacts. Voulez-vous continuer ?").arg(
|
||||
contact.core.fullName), "", function (confirmed) {
|
||||
if (confirmed) {
|
||||
var name = contact.core.fullName
|
||||
contact.core.remove()
|
||||
contactList.resetSelections()
|
||||
UtilsCpp.showInformationPopup(qsTr("Supprimé"), qsTr("%1 a été supprimé").arg(name)) }
|
||||
UtilsCpp.showInformationPopup(
|
||||
qsTr("Supprimé"),
|
||||
qsTr("%1 a été supprimé").arg(name))
|
||||
}
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
Dialog {
|
||||
|
|
@ -96,7 +116,8 @@ AbstractMainPage {
|
|||
modal: true
|
||||
onAboutToHide: neverDisplayAgainCheckbox.checked = false
|
||||
title: qsTr("Augmenter la confiance")
|
||||
text: qsTr("Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ?").arg(verifyDevicePopup.deviceName)
|
||||
text: qsTr("Pour augmenter le niveau de confiance vous devez appeler les différents appareils de votre contact et valider un code.<br><br>Vous êtes sur le point d’appeler “%1” voulez vous continuer ?").arg(
|
||||
verifyDevicePopup.deviceName)
|
||||
buttons: RowLayout {
|
||||
RowLayout {
|
||||
spacing: 7 * DefaultStyle.dp
|
||||
|
|
@ -112,7 +133,9 @@ AbstractMainPage {
|
|||
}
|
||||
}
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
RowLayout {
|
||||
spacing: 15 * DefaultStyle.dp
|
||||
BigButton {
|
||||
|
|
@ -124,8 +147,11 @@ AbstractMainPage {
|
|||
style: ButtonStyle.main
|
||||
text: qsTr("Appeler")
|
||||
onClicked: {
|
||||
SettingsCpp.setDisplayDeviceCheckConfirmation(!neverDisplayAgainCheckbox.checked)
|
||||
UtilsCpp.createCall(verifyDevicePopup.deviceAddress, {}, LinphoneEnums.MediaEncryption.Zrtp)
|
||||
SettingsCpp.setDisplayDeviceCheckConfirmation(
|
||||
!neverDisplayAgainCheckbox.checked)
|
||||
UtilsCpp.createCall(verifyDevicePopup.deviceAddress,
|
||||
{},
|
||||
LinphoneEnums.MediaEncryption.Zrtp)
|
||||
onClicked: verifyDevicePopup.close()
|
||||
}
|
||||
}
|
||||
|
|
@ -193,7 +219,8 @@ AbstractMainPage {
|
|||
}
|
||||
Button {
|
||||
id: createContactButton
|
||||
visible: !rightPanelStackView.currentItem || rightPanelStackView.currentItem.objectName !== "contactEdition"
|
||||
visible: !rightPanelStackView.currentItem
|
||||
|| rightPanelStackView.currentItem.objectName !== "contactEdition"
|
||||
style: ButtonStyle.noBackground
|
||||
icon.source: AppIcons.plusCircle
|
||||
Layout.preferredWidth: 28 * DefaultStyle.dp
|
||||
|
|
@ -232,7 +259,8 @@ AbstractMainPage {
|
|||
visible: !contactList.loading && !contactList.haveContacts
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.topMargin: 137 * DefaultStyle.dp
|
||||
text: qsTr("Aucun contact%1").arg(searchBar.text.length !== 0 ? " correspondant" : "")
|
||||
text: qsTr("Aucun contact%1").arg(
|
||||
searchBar.text.length !== 0 ? " correspondant" : "")
|
||||
font {
|
||||
pixelSize: 16 * DefaultStyle.dp
|
||||
weight: 800 * DefaultStyle.dp
|
||||
|
|
@ -246,15 +274,20 @@ AbstractMainPage {
|
|||
searchBarText: searchBar.text
|
||||
hideSuggestions: true
|
||||
showDefaultAddress: false
|
||||
sourceFlags: LinphoneEnums.MagicSearchSource.Friends | LinphoneEnums.MagicSearchSource.FavoriteFriends | LinphoneEnums.MagicSearchSource.LdapServers | LinphoneEnums.MagicSearchSource.RemoteCardDAV
|
||||
sourceFlags: LinphoneEnums.MagicSearchSource.Friends
|
||||
| LinphoneEnums.MagicSearchSource.FavoriteFriends
|
||||
| LinphoneEnums.MagicSearchSource.LdapServers
|
||||
| LinphoneEnums.MagicSearchSource.RemoteCardDAV
|
||||
onHighlightedContactChanged: mainItem.selectedContact = highlightedContact
|
||||
onContactDeletionRequested: (contact) => {
|
||||
mainItem.deleteContact(contact)
|
||||
onContactDeletionRequested: contact => {
|
||||
mainItem.deleteContact(
|
||||
contact)
|
||||
}
|
||||
onLoadingChanged: {
|
||||
if (!loading && initialFriendToDisplay.length !== 0) {
|
||||
Qt.callLater(function () {
|
||||
if (selectContact(initialFriendToDisplay) != -1) initialFriendToDisplay = ""
|
||||
if (selectContact(initialFriendToDisplay) != -1)
|
||||
initialFriendToDisplay = ""
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
@ -275,7 +308,7 @@ AbstractMainPage {
|
|||
property string label
|
||||
property var icon
|
||||
property alias content: contentControl.contentItem
|
||||
signal titleIconClicked()
|
||||
signal titleIconClicked
|
||||
RowLayout {
|
||||
spacing: 10 * DefaultStyle.dp
|
||||
Text {
|
||||
|
|
@ -292,7 +325,9 @@ AbstractMainPage {
|
|||
style: ButtonStyle.noBackgroundOrange
|
||||
onClicked: contactDetailLayout.titleIconClicked()
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
RoundButton {
|
||||
id: expandButton
|
||||
style: ButtonStyle.noBackground
|
||||
|
|
@ -323,11 +358,10 @@ AbstractMainPage {
|
|||
button.onClicked: mainItem.editContact(mainItem.selectedContact)
|
||||
button.visible: !mainItem.selectedContact?.core.readOnly
|
||||
property string contactAddress: contact ? contact.core.defaultAddress : ""
|
||||
property var computedContactNameObj: UtilsCpp.getDisplayName(contactAddress)
|
||||
property var computedContactNameObj: UtilsCpp.getDisplayName(
|
||||
contactAddress)
|
||||
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 {
|
||||
id: labelButton
|
||||
// property alias image: buttonImg
|
||||
|
|
@ -359,7 +393,9 @@ AbstractMainPage {
|
|||
height: 56 * DefaultStyle.dp
|
||||
button.icon.width: 24 * DefaultStyle.dp
|
||||
button.icon.height: 24 * DefaultStyle.dp
|
||||
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, false, mainItem)
|
||||
button.onClicked: mainWindow.startCallWithContact(
|
||||
contactDetail.contact,
|
||||
false, mainItem)
|
||||
}
|
||||
LabelButton {
|
||||
button.icon.source: AppIcons.chatTeardropText
|
||||
|
|
@ -369,7 +405,8 @@ AbstractMainPage {
|
|||
height: 56 * DefaultStyle.dp
|
||||
button.icon.width: 24 * DefaultStyle.dp
|
||||
button.icon.height: 24 * DefaultStyle.dp
|
||||
button.onClicked: console.debug("[ContactLayout.qml] TODO : open conversation")
|
||||
button.onClicked: console.debug(
|
||||
"[ContactLayout.qml] TODO : open conversation")
|
||||
}
|
||||
LabelButton {
|
||||
button.icon.source: AppIcons.videoCamera
|
||||
|
|
@ -378,7 +415,9 @@ AbstractMainPage {
|
|||
height: 56 * DefaultStyle.dp
|
||||
button.icon.width: 24 * DefaultStyle.dp
|
||||
button.icon.height: 24 * DefaultStyle.dp
|
||||
button.onClicked: mainWindow.startCallWithContact(contactDetail.contact, true, mainItem)
|
||||
button.onClicked: mainWindow.startCallWithContact(
|
||||
contactDetail.contact,
|
||||
true, mainItem)
|
||||
}
|
||||
}
|
||||
bannerContent: [
|
||||
|
|
@ -399,20 +438,8 @@ AbstractMainPage {
|
|||
property var mode: contactDetail.contact ? contactDetail.contact.core.consolidatedPresence : -1
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
Layout.fillWidth: true
|
||||
text: mode === LinphoneEnums.ConsolidatedPresence.Online
|
||||
? qsTr("En ligne")
|
||||
: mode === LinphoneEnums.ConsolidatedPresence.Busy
|
||||
? qsTr("Occupé")
|
||||
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
|
||||
? qsTr("Ne pas déranger")
|
||||
: qsTr("Hors ligne")
|
||||
color: mode === LinphoneEnums.ConsolidatedPresence.Online
|
||||
? DefaultStyle.success_500main
|
||||
: mode === LinphoneEnums.ConsolidatedPresence.Busy
|
||||
? DefaultStyle.warning_600
|
||||
: mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb
|
||||
? DefaultStyle.danger_500main
|
||||
: DefaultStyle.main2_500main
|
||||
text: mode === LinphoneEnums.ConsolidatedPresence.Online ? qsTr("En ligne") : mode === LinphoneEnums.ConsolidatedPresence.Busy ? qsTr("Occupé") : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb ? qsTr("Ne pas déranger") : qsTr("Hors ligne")
|
||||
color: mode === LinphoneEnums.ConsolidatedPresence.Online ? DefaultStyle.success_500main : mode === LinphoneEnums.ConsolidatedPresence.Busy ? DefaultStyle.warning_600 : mode === LinphoneEnums.ConsolidatedPresence.DoNotDisturb ? DefaultStyle.danger_500main : DefaultStyle.main2_500main
|
||||
font.pixelSize: 14 * DefaultStyle.dp
|
||||
}
|
||||
},
|
||||
|
|
@ -485,7 +512,8 @@ AbstractMainPage {
|
|||
style: ButtonStyle.noBackground
|
||||
icon.source: AppIcons.phone
|
||||
onClicked: {
|
||||
UtilsCpp.createCall(listViewModelData.address)
|
||||
UtilsCpp.createCall(
|
||||
listViewModelData.address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -504,7 +532,9 @@ AbstractMainPage {
|
|||
}
|
||||
}
|
||||
RoundedPane {
|
||||
visible: infoLayout.visible && companyText.text.length != 0 || jobText.text.length != 0
|
||||
visible: infoLayout.visible
|
||||
&& companyText.text.length != 0
|
||||
|| jobText.text.length != 0
|
||||
Layout.fillWidth: true
|
||||
topPadding: 17 * DefaultStyle.dp
|
||||
bottomPadding: 17 * DefaultStyle.dp
|
||||
|
|
@ -524,7 +554,8 @@ AbstractMainPage {
|
|||
}
|
||||
Text {
|
||||
id: companyText
|
||||
text: mainItem.selectedContact && mainItem.selectedContact.core.organization
|
||||
text: mainItem.selectedContact
|
||||
&& mainItem.selectedContact.core.organization
|
||||
font {
|
||||
pixelSize: 14 * DefaultStyle.dp
|
||||
weight: 400 * DefaultStyle.dp
|
||||
|
|
@ -543,7 +574,8 @@ AbstractMainPage {
|
|||
}
|
||||
Text {
|
||||
id: jobText
|
||||
text: mainItem.selectedContact && mainItem.selectedContact.core.job
|
||||
text: mainItem.selectedContact
|
||||
&& mainItem.selectedContact.core.job
|
||||
font {
|
||||
pixelSize: 14 * DefaultStyle.dp
|
||||
weight: 400 * DefaultStyle.dp
|
||||
|
|
@ -573,7 +605,9 @@ AbstractMainPage {
|
|||
weight: Typography.p1.weight
|
||||
}
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
EffectImage {
|
||||
Layout.preferredWidth: 24 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 24 * DefaultStyle.dp
|
||||
|
|
@ -581,7 +615,8 @@ AbstractMainPage {
|
|||
colorizationColor: DefaultStyle.main2_600
|
||||
}
|
||||
}
|
||||
onClicked: console.debug("TODO : go to shared media")
|
||||
onClicked: console.debug(
|
||||
"TODO : go to shared media")
|
||||
}
|
||||
}
|
||||
ContactDetailLayout {
|
||||
|
|
@ -611,7 +646,9 @@ AbstractMainPage {
|
|||
ListView {
|
||||
id: deviceList
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.min(200 * DefaultStyle.dp, contentHeight)
|
||||
Layout.preferredHeight: Math.min(
|
||||
200 * DefaultStyle.dp,
|
||||
contentHeight)
|
||||
clip: true
|
||||
model: mainItem.selectedContact ? mainItem.selectedContact.core.devices : []
|
||||
spacing: 16 * DefaultStyle.dp
|
||||
|
|
@ -627,7 +664,9 @@ AbstractMainPage {
|
|||
text: deviceDelegate.deviceName
|
||||
font.pixelSize: 14 * DefaultStyle.dp
|
||||
}
|
||||
Item{Layout.fillWidth: true}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
EffectImage {
|
||||
visible: listViewModelData.securityLevel === LinphoneEnums.SecurityLevel.EndToEndEncryptedAndVerified
|
||||
imageSource: AppIcons.trusted
|
||||
|
|
@ -642,14 +681,20 @@ AbstractMainPage {
|
|||
style: ButtonStyle.tertiary
|
||||
text: qsTr("Vérifier")
|
||||
onClicked: {
|
||||
if (SettingsCpp.getDisplayDeviceCheckConfirmation()) {
|
||||
verifyDevicePopup.deviceName = deviceDelegate.deviceName
|
||||
verifyDevicePopup.deviceAddress = listViewModelData.address
|
||||
if (SettingsCpp.getDisplayDeviceCheckConfirmation(
|
||||
)) {
|
||||
verifyDevicePopup.deviceName
|
||||
= deviceDelegate.deviceName
|
||||
verifyDevicePopup.deviceAddress
|
||||
= listViewModelData.address
|
||||
verifyDevicePopup.open()
|
||||
}
|
||||
else {
|
||||
UtilsCpp.createCall(listViewModelData.address, {}, LinphoneEnums.MediaEncryption.Zrtp)
|
||||
parent.callObj = UtilsCpp.getCallByAddress(listViewModelData.address)
|
||||
} else {
|
||||
UtilsCpp.createCall(
|
||||
listViewModelData.address,
|
||||
{},
|
||||
LinphoneEnums.MediaEncryption.Zrtp)
|
||||
parent.callObj = UtilsCpp.getCallByAddress(
|
||||
listViewModelData.address)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -667,7 +712,8 @@ AbstractMainPage {
|
|||
Layout.preferredHeight: 50 * DefaultStyle.dp
|
||||
icon.source: AppIcons.pencil
|
||||
text: qsTr("Éditer")
|
||||
onClicked: mainItem.editContact(mainItem.selectedContact)
|
||||
onClicked: mainItem.editContact(
|
||||
mainItem.selectedContact)
|
||||
visible: !mainItem.selectedContact?.core.readOnly
|
||||
style: ButtonStyle.noBackground
|
||||
}
|
||||
|
|
@ -679,10 +725,14 @@ AbstractMainPage {
|
|||
IconLabelButton {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 50 * DefaultStyle.dp
|
||||
icon.source: mainItem.selectedContact && mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart
|
||||
text: mainItem.selectedContact && mainItem.selectedContact.core.starred ? qsTr("Retirer des favoris") : qsTr("Ajouter aux favoris")
|
||||
icon.source: mainItem.selectedContact
|
||||
&& mainItem.selectedContact.core.starred ? AppIcons.heartFill : AppIcons.heart
|
||||
text: mainItem.selectedContact
|
||||
&& mainItem.selectedContact.core.starred ? qsTr("Retirer des favoris") : qsTr("Ajouter aux favoris")
|
||||
style: ButtonStyle.noBackground
|
||||
onClicked: if (mainItem.selectedContact) mainItem.selectedContact.core.lSetStarred(!mainItem.selectedContact.core.starred)
|
||||
onClicked: if (mainItem.selectedContact)
|
||||
mainItem.selectedContact.core.lSetStarred(
|
||||
!mainItem.selectedContact.core.starred)
|
||||
}
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
|
|
@ -698,11 +748,24 @@ AbstractMainPage {
|
|||
onClicked: {
|
||||
if (mainItem.selectedContact) {
|
||||
var vcard = mainItem.selectedContact.core.getVCard()
|
||||
var username = mainItem.selectedContact.core.givenName + mainItem.selectedContact.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 = mainItem.selectedContact.core.givenName
|
||||
+ mainItem.selectedContact.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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -742,12 +805,12 @@ AbstractMainPage {
|
|||
text: qsTr("Supprimer ce contact")
|
||||
visible: !mainItem.selectedContact?.core.readOnly
|
||||
onClicked: {
|
||||
mainItem.deleteContact(mainItem.selectedContact)
|
||||
mainItem.deleteContact(
|
||||
mainItem.selectedContact)
|
||||
}
|
||||
style: ButtonStyle.noBackgroundRed
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Item {
|
||||
Layout.fillHeight: true
|
||||
|
|
|
|||
Loading…
Reference in a new issue