0c05d5be7d138176397fff42b3892c231342ac45
[chessclock] / qml / ClocksPage.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 import QtQuick 1.0
23 import com.meego 1.0
24 import QtQuick 1.1 
25 import ChessClocks 1.0
26
27
28
29 Page
30 {
31     id: clocksPage
32
33     property int timeControl //properties cannot be declared as enumerations in QML
34                              //...must be a valid enum from WrappedClocksWidget
35     property int whiteInitialTime
36     property int blackInitialTime
37     property int whiteAdditionalTime
38     property int blackAdditionalTime
39     property int whiteTurnsPerAddition
40     property int blackTurnsPerAddition
41
42     orientationLock: PageOrientation.LockLandscape
43
44     onStatusChanged:
45     {
46         if (status == PageStatus.Activating)
47             wrappedClocksWidget.startGame(timeControl,whiteInitialTime,whiteAdditionalTime,whiteTurnsPerAddition,blackInitialTime,blackAdditionalTime,blackTurnsPerAddition)
48     }
49
50
51
52     tools: ToolBarLayout
53     {
54         ToolIcon { iconId: "toolbar-back"; onClicked: pageStack.pop() }
55
56         ToolIcon
57         {
58             iconId: "toolbar-mediacontrol-pause"
59             onClicked:
60                 {
61                     wrappedClocksWidget.pause()
62                 }
63         }
64
65         Item{}  //placeholder needed to put pause button in the middle
66     }
67
68
69
70
71     WrappedClocksWidget
72     {
73         id: wrappedClocksWidget
74     }
75
76
77
78 }