Failed attempt to change a QML property from C++
[chessclock] / qml / main.qml
1 /**************************************************************************
2
3    Chess Clock
4
5    This file is part of Chess Clock software.
6
7    (This file) Copyright (c) Heli Hyvättinen 2011
8
9    Chess Clock is free software: you can redistribute it and/or modify
10    it under the terms of the GNU General Public License as published by
11    the Free Software Foundation, either version 3 of the License, or
12    (at your option) any later version.
13
14    Chess Clock is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18
19
20 **************************************************************************/
21
22
23 import QtQuick 1.1
24 import com.meego 1.0
25
26 PageStackWindow {
27     id: appWindow
28
29
30     property bool applicationActive: true //This is supposed to be set from C++
31
32     onApplicationActiveChanged:
33     {
34         if (applicationActive == false)
35             wrappedClocksWidget.pause()
36             theme.inverted = false
37     }
38
39
40     Component.onCompleted: theme.inverted = true
41
42     initialPage: mainPage
43
44     MainPage{id: mainPage}
45
46     AboutPage{id: aboutPage}
47
48     ClocksPage{id: clocksPage}
49
50     NewGameDialogPage{id: newGameDialogPage}
51
52     ToolBarLayout {
53         id: commonTools
54         visible: true
55         ToolIcon { platformIconId: "toolbar-view-menu";
56              anchors.right: parent===undefined ? undefined : parent.right
57              onClicked: (myMenu.status == DialogStatus.Closed) ? myMenu.open() : myMenu.close()
58         }
59     }
60
61     Menu {
62         id: myMenu
63         visualParent: pageStack
64         MenuLayout {
65             MenuItem
66             {
67                 text: "Visit web page"
68                 onClicked: Qt.openUrlExternally("http://chessclock.garage.maemo.org/")
69             }
70             MenuItem
71             {
72                 text: "About"
73                 onClicked: pageStack.push(aboutPage)
74             }
75         }
76     }
77 }