@@ -8,6 +8,29 @@ import "asset:///otherfunctions.js" as CamFunctions
8
8
Page {
9
9
id: startpage
10
10
attachedObjects: [
11
+ Timer {
12
+ id: sxTimer
13
+ interval: 5500
14
+ onTimeout: {
15
+ getThis .StatRequest (Settings .getSettings (" password" , " " )," sx" )
16
+
17
+ }
18
+ },
19
+ // SE TIMER every 10 seconds
20
+ Timer {
21
+ id: seTimer
22
+ interval: 5000
23
+
24
+ onTimeout: {
25
+ getThis .StatRequest (Settings .getSettings (" password" , " " )," se" )
26
+ console .debug (" seTimer" )
27
+ if (responseArea .text = " Connecting..." )
28
+ {
29
+ responseArea .text = " Connected!"
30
+ }
31
+ }
32
+ visible: false
33
+ },
11
34
SystemToast {
12
35
id: cancelledAlert
13
36
body: " You will need to restart the app if you want to connect it later on"
@@ -24,23 +47,45 @@ Page {
24
47
25
48
onStatsReceived: {
26
49
// reset NoStat counter
27
- CamFunctions .StatsReceived (response, batterypercent, batteryBars, mode)
50
+ CamFunctions .StatsReceived (response, batterypercent, mode)
51
+ }
52
+
53
+ onStatSXReceived: {
54
+ CamFunctions .StatSXReceived (batteryBars)
55
+
28
56
}
29
57
30
58
onPasswordReceived: {
31
59
inProcess .stop ()
32
60
seTimer .start ()
33
- sxTimer .Start ()
61
+ sxTimer .start ()
34
62
responseArea .text = " Connecting..."
35
63
}
36
64
37
65
onTimerTimesOut: {
38
66
seTimer .stop ()
39
- // sxTimer.stop()
67
+ sxTimer .stop ()
40
68
}
41
69
42
70
onSignalNotGetPassword: {
43
- CamFunctions .NotGetPassword ()
71
+ // CamFunctions.NotGetPassword()
72
+ var pcount = Settings .getSettings (" GetPassword" , 0 );
73
+ // console.debug("pcount:", pcount)
74
+ pcount++ ;
75
+ Settings .setSettings (" GetPassword" , pcount);
76
+
77
+ if (pcount != 3 ) {
78
+ // console.debug("pcount:", pcount)
79
+ // console.debug("2nd or 3rd Getpassword")
80
+ GetPassword ();
81
+ responseArea .text = " Attempt to get password..." ;
82
+ }
83
+ if (pcount == 3 ) {
84
+ // console.debug("Start retryDialog and pcount=",pcount)
85
+ inProcess .stop ();
86
+ retryDialog .open ();
87
+ responseArea .text = " Cannot connect to GoPro" ;
88
+ }
44
89
45
90
}
46
91
@@ -49,14 +94,6 @@ Page {
49
94
}
50
95
51
96
},
52
- Timer {
53
- id: sxTimer
54
- interval: 35000
55
- onTimeout: {
56
- getThis .StatRequest (Settings .getSettings (" password" , " " )," sx" )
57
-
58
- }
59
- },
60
97
RetryConnectionDialog {
61
98
id: retryDialog
62
99
onSendRestart: {
@@ -74,21 +111,6 @@ Page {
74
111
Container {
75
112
id: rootContainer
76
113
layout: DockLayout {}
77
- // SE TIMER every 10 seconds
78
- Timer {
79
- id: seTimer
80
- interval: 5000
81
-
82
- onTimeout: {
83
- getThis .StatRequest (Settings .getSettings (" password" , " " )," se" )
84
- console .debug (" seTimer" )
85
- if (responseArea .text = " Connecting..." )
86
- {
87
- responseArea .text = " Connected!"
88
- }
89
- }
90
- visible: false
91
- }
92
114
93
115
ImageView {
94
116
imageSource: " asset:///backgrounds/1.jpg"
@@ -163,7 +185,7 @@ Page {
163
185
}
164
186
ImageView {
165
187
id: batteryImage
166
- imageSource: " asset:///images/battery-full-icon .png"
188
+ imageSource: " asset:///images/battery-full-icon3 .png"
167
189
scaleX: 0.75
168
190
scaleY: 0.75
169
191
translationY: - 30.0
0 commit comments