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
143 text: newGameDialog.name
156 // anchors.top: parent.top
157 // anchors.horizontalCenter: parent.horizontalCenter
161 // width: rowRow.width - rowRow.spacing - switchComponent.width - whiteSmall.width - blackSmall.width
162 // height: switchComponent.height
163 verticalAlignment: Text.AlignVCenter
176 blackInitialTime.text = whiteInitialTime.text
177 blackAdditionalTime.text = whiteAdditionalTime.text
178 blackTurnsPerAddition.text = whiteTurnsPerAddition.text
187 source: ":/rc/pic/white_small.png"
193 source: ":/rc/pic/black_small.png"
202 // anchors.top: rowRow.bottom
203 // anchors.horizontalCenter: parent.horizontalCenter
213 onTextChanged: {if (equalTimesSwitch.checked) blackInitialTime.text = text}
218 onClicked: {timePicker.timeType = "initial"; timePicker.player = "white"; timePicker.open()}
227 enabled: !equalTimesSwitch.checked
236 onClicked: {timePicker.timeType = "initial"; timePicker.player = "black"; timePicker.open()}
244 id: additionalTimeText
245 text: "Additional time"
248 visible: newGameDialog.askAddition
249 // anchors.top: initialTimeText.bottom
250 // anchors.horizontalCenter: parent.horizontalCenter
257 id: whiteAdditionalTime
258 visible: newGameDialog.askAddition
261 onTextChanged: {if (equalTimesSwitch.checked) blackAdditionalTime.text = text}
266 onClicked: {timePicker.timeType = "additional"; timePicker.player = "white"; timePicker.open()}
272 id: blackAdditionalTime
273 visible: newGameDialog.askAddition
274 enabled: !equalTimesSwitch.checked
280 onClicked: {timePicker.timeType = "additional"; timePicker.player = "black"; timePicker.open()}
288 text: "Turns per addition"
291 visible: newGameDialog.askAddition
292 // anchors.top: additionalTimeText.bottom
293 // anchors.horizontalCenter: parent.horizontalCenter
297 id: whiteTurnsPerAddition
298 visible: newGameDialog.askAddition
303 onTextChanged: {if (equalTimesSwitch.checked) blackTurnsPerAddition.text = text}
308 id: blackTurnsPerAddition
309 visible: newGameDialog.askAddition
310 enabled: !equalTimesSwitch.checked
328 onClicked: newGameDialog.accept()
336 property string timeType
337 property string player
338 property string result
341 titleText: "Choose " + timeType + " time for " + player
342 rejectButtonText: "Cancel"
343 acceptButtonText: "Ok"
344 hourMode: DateTime.TwentyFourHours
347 result = hour + " h " + minute + " min " + second + " s"
348 if (timeType == "initial")
349 if (player == "white")
350 whiteInitialTime.text = result
352 blackInitialTime.text = result
354 else if (player == "white")
355 whiteAdditionalTime.text = result
357 blackAdditionalTime.text = result