Warning, /utilities/qrca/src/contents/ui/main.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  SPDX-FileCopyrightText: 2019 Jonah BrĂ¼chert <jbb@kaidan.im>
0003  *  SPDX-FileCopyrightText: 2019 Simon Schmeisser <s.schmeisser@gmx.net>
0004  *
0005  *  SPDX-License-Identifier: GPL-3.0-or-later
0006  */
0007 
0008 import QtQuick 2.1
0009 import org.kde.kirigami 2.19 as Kirigami
0010 import QtQuick.Controls 2.0 as Controls
0011 import org.kde.qrca 1.0
0012 
0013 Kirigami.ApplicationWindow {
0014     id: window 
0015 
0016     title: i18n("QR Code Scanner")
0017 
0018     function passiveNotification(text) {
0019         showPassiveNotification(text, "long")
0020     }
0021 
0022     Component.onCompleted: {
0023         Qrca.passiveNotificationRequested.connect(passiveNotification)
0024         if (Qrca.encodeText) {
0025             qrCodeEncoderAction.trigger()
0026         } else {
0027             qrCodeScannerAction.trigger()
0028         }
0029     }
0030 
0031     Kirigami.PagePool {
0032         id: mainPagePool
0033     }
0034 
0035     readonly property list<Kirigami.PagePoolAction> navigationActions: [
0036         Kirigami.PagePoolAction {
0037             id: qrCodeScannerAction
0038             text: i18n("Scan")
0039             icon.name: "camera-photo-symbolic"
0040             pagePool: mainPagePool
0041             page: "QrCodeScannerPage.qml"
0042         },
0043         Kirigami.PagePoolAction {
0044             id: qrCodeEncoderAction
0045             text: i18n("Create")
0046             icon.name: "document-new-symbolic"
0047             pagePool: mainPagePool
0048             page: "QrCodeEncoderPage.qml"
0049         },
0050         Kirigami.PagePoolAction {
0051             text: i18n("About")
0052             icon.name: "help-feedback"
0053             pagePool: mainPagePool
0054             page: "AboutPage.qml"
0055         }
0056     ]
0057 
0058     globalDrawer: Kirigami.GlobalDrawer {
0059         title: i18n("QR-Code Scanner")
0060         isMenu: window.wideScreen
0061         actions: window.wideScreen ? navigationActions : []
0062         enabled: window.wideScreen
0063     }
0064 
0065     footer: Kirigami.NavigationTabBar {
0066         visible: !window.wideScreen
0067         actions: navigationActions
0068     }
0069 
0070     contextDrawer: Kirigami.ContextDrawer {}
0071 }