fix share friend (not every platform supports attachment file)
This commit is contained in:
parent
b71664fd5b
commit
80a9c6d969
4 changed files with 10 additions and 9 deletions
|
|
@ -395,12 +395,10 @@ void Utils::shareByEmail(const QString &subject,
|
||||||
const QString &body,
|
const QString &body,
|
||||||
const QString &attachment,
|
const QString &attachment,
|
||||||
const QString &receiver) {
|
const QString &receiver) {
|
||||||
QString url = QString("mailto:?to=%1&subject=%2&body=%3&attachment=%4")
|
// QString attach = attachment;
|
||||||
.arg(receiver)
|
// attach.prepend("file:///");
|
||||||
.arg(subject)
|
QUrl url(QString("mailto:?to=%1&subject=%2&body=%3").arg(receiver).arg(subject).arg(body));
|
||||||
.arg(body)
|
QDesktopServices::openUrl(url);
|
||||||
.arg("/home/gaelle/ligneconsolevscode");
|
|
||||||
QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString Utils::getClipboardText() {
|
QString Utils::getClipboardText() {
|
||||||
|
|
|
||||||
|
|
@ -178,6 +178,7 @@ ApplicationWindow {
|
||||||
popupLayout.popupList.splice(index, 1)
|
popupLayout.popupList.splice(index, 1)
|
||||||
}
|
}
|
||||||
function showInformationPopup(title, description, isSuccess) {
|
function showInformationPopup(title, description, isSuccess) {
|
||||||
|
if (isSuccess == undefined) isSuccess = true
|
||||||
var infoPopup = popupComp.createObject(popupLayout, {"title": title, "description": description, "isSuccess": isSuccess})
|
var infoPopup = popupComp.createObject(popupLayout, {"title": title, "description": description, "isSuccess": isSuccess})
|
||||||
infoPopup.index = popupLayout.popupList.length
|
infoPopup.index = popupLayout.popupList.length
|
||||||
popupLayout.popupList.push(infoPopup)
|
popupLayout.popupList.push(infoPopup)
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,8 @@ ListView {
|
||||||
var vcard = modelData.core.getVCard()
|
var vcard = modelData.core.getVCard()
|
||||||
var username = modelData.core.givenName + modelData.core.familyName
|
var username = modelData.core.givenName + modelData.core.familyName
|
||||||
var filepath = UtilsCpp.createVCardFile(username, vcard)
|
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)
|
UtilsCpp.shareByEmail(qsTr("Partage de contact"), vcard, filepath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -708,13 +708,14 @@ AbstractMainPage {
|
||||||
Layout.preferredHeight: 50 * DefaultStyle.dp
|
Layout.preferredHeight: 50 * DefaultStyle.dp
|
||||||
iconSize: 24 * DefaultStyle.dp
|
iconSize: 24 * DefaultStyle.dp
|
||||||
iconSource: AppIcons.shareNetwork
|
iconSource: AppIcons.shareNetwork
|
||||||
text: qsTr("Share")
|
text: qsTr("Partager")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (mainItem.selectedContact) {
|
if (mainItem.selectedContact) {
|
||||||
var vcard = mainItem.selectedContact.core.getVCard()
|
var vcard = mainItem.selectedContact.core.getVCard()
|
||||||
var username = mainItem.selectedContact.core.givenName + mainItem.selectedContact.core.familyName
|
var username = mainItem.selectedContact.core.givenName + mainItem.selectedContact.core.familyName
|
||||||
var filepath = UtilsCpp.createVCardFile(username, vcard)
|
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)
|
UtilsCpp.shareByEmail(qsTr("Partage de contact"), vcard, filepath)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue