1 /**************************************************************************
5 This file is part of Chess Clock software.
7 (This file) Copyright (c) Heli Hyvättinen 2011
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.
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.
20 **************************************************************************/
25 import ChessClocks 1.1
34 property int timeControl //properties cannot be declared as enumerations in QML
35 //...must be a valid enum from WrappedClocksWidget
36 property int whiteInitialTime
37 property int blackInitialTime
38 property int whiteAdditionalTime
39 property int blackAdditionalTime
40 property int whiteTurnsPerAddition
41 property int blackTurnsPerAddition
43 orientationLock: PageOrientation.LockLandscape
47 if (status == PageStatus.Activating)
49 wrappedClocksWidget.startGame(timeControl,whiteInitialTime,whiteAdditionalTime,whiteTurnsPerAddition,blackInitialTime,blackAdditionalTime,blackTurnsPerAddition)
50 pauseButton.visible = false
54 property bool appActive: applicationActive
58 if (appActive == false)
60 wrappedClocksWidget.pause()
61 pauseButton.visible = false
69 iconId: "toolbar-back"
72 wrappedClocksWidget.pause()
73 pauseButton.visible = false
74 confirmationDialog.open()
81 iconId: "toolbar-mediacontrol-pause"
84 wrappedClocksWidget.pause()
89 Item{} //placeholder needed to put pause button in the middle
99 id: wrappedClocksWidget
100 onUnPaused: pauseButton.visible = true
106 id: confirmationDialog
108 message: "Are you sure you want to quit the game?"
109 acceptButtonText: "Quit"
110 rejectButtonText: "Continue play"