diff --git a/Linphone/tool/Utils.cpp b/Linphone/tool/Utils.cpp index bf22122e..95779d01 100644 --- a/Linphone/tool/Utils.cpp +++ b/Linphone/tool/Utils.cpp @@ -395,12 +395,10 @@ void Utils::shareByEmail(const QString &subject, const QString &body, const QString &attachment, const QString &receiver) { - QString url = QString("mailto:?to=%1&subject=%2&body=%3&attachment=%4") - .arg(receiver) - .arg(subject) - .arg(body) - .arg("/home/gaelle/ligneconsolevscode"); - QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode)); + // QString attach = attachment; + // attach.prepend("file:///"); + QUrl url(QString("mailto:?to=%1&subject=%2&body=%3").arg(receiver).arg(subject).arg(body)); + QDesktopServices::openUrl(url); } QString Utils::getClipboardText() { diff --git a/Linphone/view/App/AppWindow.qml b/Linphone/view/App/AppWindow.qml index 199c65f5..aff098ae 100644 --- a/Linphone/view/App/AppWindow.qml +++ b/Linphone/view/App/AppWindow.qml @@ -178,6 +178,7 @@ ApplicationWindow { popupLayout.popupList.splice(index, 1) } function showInformationPopup(title, description, isSuccess) { + if (isSuccess == undefined) isSuccess = true var infoPopup = popupComp.createObject(popupLayout, {"title": title, "description": description, "isSuccess": isSuccess}) infoPopup.index = popupLayout.popupList.length popupLayout.popupList.push(infoPopup) diff --git a/Linphone/view/Item/Contact/ContactsList.qml b/Linphone/view/Item/Contact/ContactsList.qml index 87a0e311..71f8c802 100644 --- a/Linphone/view/Item/Contact/ContactsList.qml +++ b/Linphone/view/Item/Contact/ContactsList.qml @@ -234,7 +234,8 @@ ListView { var vcard = modelData.core.getVCard() var username = modelData.core.givenName + modelData.core.familyName var filepath = UtilsCpp.createVCardFile(username, vcard) - if (filepath == "") UtilsCpp.showInformationPopup(qsTr("Erreur"), qsTr("La création du fichier vcard a échoué")) + 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) } } diff --git a/Linphone/view/Page/Main/ContactPage.qml b/Linphone/view/Page/Main/ContactPage.qml index efdcd3d5..9df13fe4 100644 --- a/Linphone/view/Page/Main/ContactPage.qml +++ b/Linphone/view/Page/Main/ContactPage.qml @@ -708,13 +708,14 @@ AbstractMainPage { Layout.preferredHeight: 50 * DefaultStyle.dp iconSize: 24 * DefaultStyle.dp iconSource: AppIcons.shareNetwork - text: qsTr("Share") + text: qsTr("Partager") 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é")) + 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) } }