Dekko
Loading...
Searching...
No Matches
StageStack.qml
1/* Copyright (C) 2016 - 2017 Dan Chapman <dpniel@ubuntu.com>
2
3 This file is part of Dekko email client for Ubuntu devices
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License as
7 published by the Free Software Foundation; either version 2 of
8 the License or (at your option) version 3
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18import QtQuick 2.4
19import Lomiri.Components 1.3
20import Lomiri.Components.Popups 1.3
21import QuickFlux 1.0
22import Dekko.Controls 1.0
23import Dekko.Mail.API 1.0
24import Dekko.Mail.Stores.Views 1.0
25import Dekko.Lomiri.Constants 1.0
26
27// {item: message.page, properties: message.properties}
28StackView {
29 id: stageStack
30
31 delegate: DekkoAnimation.customStackViewDelegate2
32
33 AppListener {
34 waitFor: ViewStore.listenerId
35 Filter {
36 type: ViewKeys.pushStage
37 onDispatched: {
38 Log.logStatus("StageStack::pushStage", "Pushing stage: " + message.stage)
39 stageStack.push({item: Qt.resolvedUrl(message.stage), properties: message.properties})
40 }
41 }
42 Filter {
43 type: ViewKeys.popStage
44 onDispatched: {
45 Log.logStatus("StageStack::popStage", "Popping top stage: ")
46 stageStack.pop()
47 }
48 }
49 Filter {
50 type: ViewKeys.clearStageStack
51 onDispatched: {
52 Log.logStatus("StageStack::clearStageStack", "Clearing stagestack ")
53 stageStack.clear()
54 }
55 }
56 Filter {
57 type: ViewKeys.openMessageComposer
58 onDispatched: {
59 if (dekko.isLargeFF) {
60 PopupUtils.open(Qt.resolvedUrl("../composer/ComposePanelPopup.qml"), dekkoContainer, {})
61 }
62 }
63 }
64 Filter {
65 type: ViewKeys.openAddressBook
66 onDispatched: {
67 Log.logStatus("StageStack::openAddressBook", "Opening addressbook stage ")
68 ViewActions.pushStage("./AddressBookStage.qml", {})
69 }
70 }
71
72 Filter {
73 type: ViewKeys.rewindStageStack
74 onDispatched: {
75 Log.logStatus("StageStack::rewindStageStack", "Rewinding stage stack ")
76 while (stageStack.depth > 1) {
77 stageStack.pop()
78 }
79 }
80 }
81 }
82}
83