4 import com.nokia.extras 1.0
18 // anchors.centerIn: parent
19 // text: qsTr("Hello world!")
27 // anchors.fill: parent
28 // anchors.left: menuList.right
30 source: ":/rc/pic/logo.png"
41 logoFile: ":/rc/pic/oldclock.png"
48 name: "Addition before"
50 logoFile: ":/rc/pic/addbefore.png"
55 name: "Addition after"
57 logoFile: ":/rc/pic/addafter.png"
64 logoFile: ":/rc/pic/pausebefore.png"
71 logoFile: ":/rc/pic/pauseafter.png"
78 logoFile:":/rc/pic/hourglass.png"
88 anchors.left: bigLogo.right
89 anchors.right: parent.right
90 anchors.top: parent.top
91 anchors.bottom: parent.bottom
105 onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
113 anchors.topMargin: 12
119 onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
135 property bool askAddition
137 onAccepted: pageStack.push(clocksPage)
145 text: newGameDialog.name
158 // anchors.top: parent.top
159 // anchors.horizontalCenter: parent.horizontalCenter
163 // width: rowRow.width - rowRow.spacing - switchComponent.width - whiteSmall.width - blackSmall.width
164 // height: switchComponent.height
165 verticalAlignment: Text.AlignVCenter
178 blackInitialTime.text = whiteInitialTime.text
179 blackAdditionalTime.text = whiteAdditionalTime.text
180 blackTurnsPerAddition.text = whiteTurnsPerAddition.text
189 source: ":/rc/pic/white_small.png"
195 source: ":/rc/pic/black_small.png"
204 // anchors.top: rowRow.bottom
205 // anchors.horizontalCenter: parent.horizontalCenter
215 onTextChanged: {if (equalTimesSwitch.checked) blackInitialTime.text = text}
220 onClicked: {timePicker.timeType = "initial"; timePicker.player = "white"; timePicker.open()}
229 enabled: !equalTimesSwitch.checked
238 onClicked: {timePicker.timeType = "initial"; timePicker.player = "black"; timePicker.open()}
246 id: additionalTimeText
247 text: "Additional time"
250 visible: newGameDialog.askAddition
251 // anchors.top: initialTimeText.bottom
252 // anchors.horizontalCenter: parent.horizontalCenter
259 id: whiteAdditionalTime
260 visible: newGameDialog.askAddition
263 onTextChanged: {if (equalTimesSwitch.checked) blackAdditionalTime.text = text}
268 onClicked: {timePicker.timeType = "additional"; timePicker.player = "white"; timePicker.open()}
274 id: blackAdditionalTime
275 visible: newGameDialog.askAddition
276 enabled: !equalTimesSwitch.checked
282 onClicked: {timePicker.timeType = "additional"; timePicker.player = "black"; timePicker.open()}
290 text: "Turns per addition"
293 visible: newGameDialog.askAddition
294 // anchors.top: additionalTimeText.bottom
295 // anchors.horizontalCenter: parent.horizontalCenter
299 id: whiteTurnsPerAddition
300 visible: newGameDialog.askAddition
305 onTextChanged: {if (equalTimesSwitch.checked) blackTurnsPerAddition.text = text}
310 id: blackTurnsPerAddition
311 visible: newGameDialog.askAddition
312 enabled: !equalTimesSwitch.checked
330 onClicked: newGameDialog.accept()
338 property string timeType
339 property string player
340 property string result
343 titleText: "Choose " + timeType + " time for " + player
344 rejectButtonText: "Cancel"
345 acceptButtonText: "Ok"
346 hourMode: DateTime.TwentyFourHours
349 result = hour + " h " + minute + " min " + second + " s"
350 if (timeType == "initial")
351 if (player == "white")
352 whiteInitialTime.text = result
354 blackInitialTime.text = result
356 else if (player == "white")
357 whiteAdditionalTime.text = result
359 blackAdditionalTime.text = result