Commit 5a282e7d authored by Carl Schwan's avatar Carl Schwan 🚴
Browse files

Add Qr code to contact module



Signed-off-by: Carl Schwan's avatarCarl Schwan <carl@carlschwan.eu>
parent 69f3aaa9
Pipeline #177738 failed with stage
in 17 minutes and 5 seconds
......@@ -33,6 +33,7 @@ ecm_target_qml_sources(kalendar_contact_plugin
qml/private/ContactsPage.qml
qml/private/Header.qml
qml/private/PhoneNumberDialog.qml
qml/private/QrCodePage.qml
)
ecm_qt_declare_logging_category(kalendar_contact_plugin
......
......@@ -148,6 +148,13 @@ Kirigami.ScrollablePage {
iconName: "mail-message"
visible: addressee.preferredEmail.length > 0
onTriggered: Qt.openUrlExternally(`mailto:${addressee.preferredEmail}`)
},
Kirigami.Action {
text: i18n("Show QR Code")
iconName: 'view-barcode-qr'
onTriggered: pageStack.layers.push(Qt.resolvedUrl('./QrCodePage.qml'), {
qrCodeData: addressee.qrCodeData(),
})
}
]
}
......
// SPDX-FileCopyrightText: 2015 Martin Gräßlin <mgraesslin@kde.org>
// SPDX-FileCopyrightText: 2022 Carl Schwan <car@carlschwan.eu>
// SPDX-License-Identifier: GPL-2.0-or-later
import QtQuick 2.15
import QtQml 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15 as QQC2
import org.kde.kirigami 2.15 as Kirigami
import org.kde.kalendar.contact 1.0
import org.kde.prison 1.0 as Prison
Kirigami.Page {
property string qrCodeData
title: i18n("QR Code")
contentItem: Prison.Barcode {
id: barcodeItem
content: qrCodeData
barcodeType: Prison.Barcode.QRCode
}
QQC2.Label {
anchors.fill: parent
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
text: i18n("Creating QR code failed")
wrapMode: Text.WordWrap
visible: barcodeItem.implicitWidth === 0 && barcodeItem.implicitHeight === 0
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment