20
20
Qt.include("../common/ClockUtils.js")
21
Qt.include("../common/Constants.js")
23
22
// Function to return total seconds.
24
23
function totalSeconds ( hou, min, sec ) {
35
34
return Utils.hmsToString(hor, min, sec);
38
// Show/Hide Timer Page
39
function showTimerPage ( mode ) {
40
analogTimer.visible = mode;
42
// TODO: Remove these anchor changes once the flickable is implemented.
44
timerPage.viewState = "TIMER";
45
buttonTimer.visible = true
46
buttonTimer.anchors.bottom = timerPage.bottom;
47
buttonTimer.anchors.bottomMargin = units.gu(1);
49
addPreset.visible = true;
50
editPreset.visible = true;
51
deletePreset.visible = false;
53
toolbarTimer.back.visible = false;
54
toolbarTimer.lock = false;
55
toolbarTimer.active = false;
59
// Show/Hide Add Preset Page
60
function showAddPresetPage ( mode ) {
61
analogTimer.visible = mode;
62
addPresetCircleDone.visible = mode;
63
namePreset.visible = mode;
64
buttonTimer.visible = !mode
67
timerPage.viewState = "ADDPRESET";
71
// Show/Hide View Preset Page
72
function showViewPresetPage ( mode ) {
73
listPreset.visible = mode;
75
//TODO: These anchors changes should be removed once a flickable is used.
77
timerPage.viewState = "SAVEDPRESETS";
78
buttonTimer.visible = true
79
buttonTimer.anchors.bottom = topTimerRow.bottom;
80
buttonTimer.anchors.bottomMargin = -units.gu(10);
84
37
// Call Workerscript to populate the preset list
85
38
function populatePreset () {
86
39
var msg = {'action': 'appendPreset', 'model': listModel, 'array': storageTimer.getTimerValue()};
87
40
worker.sendMessage(msg);
41
timerPage.lastindex = -1;
90
44
// Read preset from internal databese and populate the preset list