Warning, /graphics/okular/mobile/app/package/contents/ui/Signatures.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2012 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 import QtQuick 2.15
0008 import QtQuick.Controls 2.15 as QQC2
0009 import QtQuick.Window 2.15
0010 import org.kde.kirigami 2.17 as Kirigami
0011 import org.kde.kitemmodels 1.0
0012 
0013 QQC2.ScrollView {
0014     id: root
0015 
0016     signal dialogOpened
0017 
0018     ListView {
0019         model: KDescendantsProxyModel {
0020             model: documentItem.signaturesModel
0021             expandsByDefault: false
0022         }
0023 
0024         delegate: TreeItem {
0025 
0026             function displayString(str) {
0027                 return str ? str : i18n("Not Available");
0028             }
0029 
0030             text: model.display
0031             onClicked: {
0032                 if (!model.isUnsignedSignature) {
0033                     var dialog = dialogComponent.createObject(Window.window, {
0034                         signatureValidityText: model.readableStatus,
0035                         documentModificationsText: model.readableModificationSummary,
0036                         signerNameText: displayString(model.signerName),
0037                         signingTimeText: displayString(model.signingTime),
0038                         signingLocationText: model.signingLocation,
0039                         signingReasonText: model.signingReason,
0040                         certificateModel: model.certificateModel,
0041                         signatureRevisionIndex: model.signatureRevisionIndex
0042                     })
0043                     dialog.open()
0044                     root.dialogOpened();
0045                 }
0046             }
0047         }
0048 
0049         Component {
0050             id: dialogComponent
0051             SignaturePropertiesDialog {
0052                 id: dialog
0053                 onVisibleChanged: if(!visible) {
0054                     destroy(1000)
0055                 }
0056                 onSaveSignatureSignedVersion: (path) => {
0057                     if (!documentItem.signaturesModel.saveSignedVersion(signatureRevisionIndex, path)) {
0058                         dialog.showErrorDialog();
0059                     }
0060                 }
0061             }
0062         }
0063     }
0064 }