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

0001 /* This file is part of Kairo Timer
0002 
0003    SPDX-FileCopyrightText: 2016 (c) Kevin Ottens <ervin@kde.org>
0004 
0005    SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 
0007 */
0008 
0009 import QtQuick 2.0
0010 import Kairo 1.0
0011 
0012 import org.kde.kirigami 2.0 as Kirigami
0013 
0014 
0015 Kirigami.ApplicationWindow {
0016     id: root
0017     visible: true
0018     width: 640
0019     height: 480
0020 
0021     header: Kirigami.ApplicationHeader {}
0022 
0023     pageStack.initialPage: listComponent
0024     pageStack.defaultColumnWidth: width
0025 
0026     Connections {
0027         target: pageStack.contentItem
0028         onContentXChanged: {
0029             if (pageStack.depth > 1 && pageStack.contentItem.contentX === 0)
0030                 pageStack.pop()
0031         }
0032     }
0033 
0034     SoundControl {
0035         id: soundControl
0036     }
0037 
0038     Component {
0039         id: listComponent
0040         CircuitListPage {
0041             onCircuitSelected: {
0042                 var page = controlComponent.createObject(root)
0043                 page.model = circuit
0044                 page.soundControl = soundControl
0045                 root.pageStack.push(page)
0046                 page.start()
0047             }
0048         }
0049     }
0050 
0051     Component {
0052         id: controlComponent
0053         CircuitControlPage {
0054             onCircuitFinished: {
0055                 root.pageStack.currentIndex = 0
0056                 soundControl.playEndBeep()
0057             }
0058         }
0059     }
0060 }