Skip to content

Commit 2760cc2

Browse files
committed
black theme,retrydialog; starttimersignal started
1 parent 193c43b commit 2760cc2

9 files changed

+132
-25
lines changed

assets/.assets.index

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
1
2-
15
2+
17
33
About.qml
44
backgrounds/1.jpg
55
CamSettings.qml
@@ -9,9 +9,11 @@ images/battery-full-icon0.png
99
images/battery-full-icon1.png
1010
images/battery-full-icon2.png
1111
images/battery-full-icon4.png
12+
images/dialogframe.png
1213
images/rec.png
1314
LivePreview.qml
1415
main.qml
16+
RetryConnectionDialog.qml
1517
Settings.qml
1618
Start.qml
1719
VideoViewer.qml

assets/RetryConnectionDialog.qml

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
import bb.cascades 1.2
2+
import Network.GetterRequest 1.0
3+
4+
Dialog {
5+
id: retryDialog
6+
attachedObjects: [
7+
GetterRequest {
8+
id: getThis
9+
}
10+
]
11+
Container {
12+
preferredWidth: 768
13+
preferredHeight: 1280
14+
15+
background: Color.create(0.0, 0.0, 0.0, 0.5)
16+
layout: DockLayout {
17+
}
18+
Container {
19+
maxHeight: 397
20+
horizontalAlignment: HorizontalAlignment.Center
21+
verticalAlignment: VerticalAlignment.Center
22+
layout: DockLayout {
23+
}
24+
ImageView {
25+
imageSource: "asset:///images/dialogframe.png"
26+
}
27+
28+
Container {
29+
topPadding: 10
30+
bottomPadding: 143
31+
leftPadding: 23
32+
rightPadding: 23
33+
horizontalAlignment: HorizontalAlignment.Fill
34+
verticalAlignment: VerticalAlignment.Fill
35+
36+
Label {
37+
text: "Can't Connect!"
38+
textStyle.base: SystemDefaults.TextStyles.TitleText
39+
textStyle.color: Color.White
40+
horizontalAlignment: HorizontalAlignment.Center
41+
layoutProperties: StackLayoutProperties {
42+
spaceQuota: 0.7
43+
}
44+
}
45+
Label {
46+
text: " Retry?"
47+
textStyle.base: SystemDefaults.TextStyles.TitleText
48+
textStyle.color: Color.White
49+
layoutProperties: StackLayoutProperties {
50+
spaceQuota: 3.5
51+
}
52+
}
53+
Container {
54+
layout: StackLayout {
55+
orientation: LayoutOrientation.LeftToRight
56+
57+
}
58+
Button {
59+
text: "Retry"
60+
preferredWidth: 262.0
61+
onClicked: {
62+
getThis.startTimer()
63+
retryDialog.close()
64+
}
65+
}
66+
Button {
67+
text: "Cancel"
68+
preferredWidth: 262.0
69+
onClicked: {
70+
retryDialog.close()
71+
}
72+
73+
}
74+
}
75+
76+
}
77+
78+
}
79+
80+
}
81+
82+
}

assets/Start.qml

+33-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Page {
1212
commandArea.text = commandSent;
1313
}
1414
onResponseReceived: {
15+
1516
responseArea.text = info;
1617

1718
}
@@ -24,6 +25,15 @@ Page {
2425
seTimer.start()
2526
responseArea.text = "Connecting..."
2627
}
28+
onTimerTimesOut: {
29+
retryDialog.open()
30+
seTimer.stop()
31+
//sxTimer.stop()
32+
}
33+
onReStartTimerSignal: {
34+
GetPassword();
35+
}
36+
2737
},
2838
QTimer {
2939
id: sxTimer
@@ -32,6 +42,9 @@ Page {
3242
getThis.StatRequest(doitsettings.getSettings("password"),"sx")
3343

3444
}
45+
},
46+
RetryConnectionDialog {
47+
id: retryDialog
3548
}
3649
]
3750

@@ -45,6 +58,10 @@ Page {
4558
onTimeout: {
4659
getThis.StatRequest(doitsettings.getSettings("password"),"se")
4760
console.debug("seTimer")
61+
if (responseArea.text = "Connecting...")
62+
{
63+
responseArea.text = "Connected!"
64+
}
4865
}
4966
visible: false
5067
}
@@ -90,7 +107,19 @@ Page {
90107
orientation: LayoutOrientation.LeftToRight
91108

92109
}
93-
Button {
110+
ToggleButton {
111+
checked: false
112+
onCheckedChanged: {
113+
if (checked == true){
114+
getThis.GetRequest(doitsettings.getSettings("password"), "PW", "01");
115+
}
116+
else {
117+
getThis.GetRequest(doitsettings.getSettings("password"), "PW", "00");
118+
}
119+
}
120+
121+
}
122+
/* Button {
94123
text: qsTr("On") + Retranslate.onLocaleOrLanguageChanged
95124
96125
onClicked: {
@@ -107,7 +136,8 @@ Page {
107136
getThis.GetRequest(doitsettings.getSettings("password"), "PW", "00")
108137
}
109138
preferredWidth: 10.0
110-
}
139+
}*/
140+
111141
Label {
112142
id: labelConnection
113143
text: " Hero3 White"
@@ -271,7 +301,6 @@ Page {
271301
}
272302
onCreationCompleted: {
273303
getThis.GetPassword()
274-
//seTimer.start()
275-
//sxTimer.start()
304+
276305
}
277306
}

assets/images/dialogframe.png

5.71 KB
Loading

bar-descriptor.xml

+2
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
<!-- Copyright information. Optional. -->
5252
<!-- <copyright></copyright> -->
53+
54+
<env var="CASCADES_THEME" value="dark"/>
5355

5456
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
5557
<configuration name="Device-Debug">

dialog.psd

7.52 MB
Binary file not shown.

src/GetterRequest.cpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -383,18 +383,21 @@ void GetterRequest::onGetPassword()
383383
///////////////////////
384384
void GetterRequest::stopReplyTimer()
385385
{
386-
qDebug() << "Stats request aborting...";
386+
qDebug() << "request aborting...";
387387
QTimer* timer = qobject_cast<QTimer*>(sender());
388388

389389
QNetworkReply* response = qobject_cast<QNetworkReply*>(timer->parent());
390-
390+
emit timerTimesOut("neverconnected");
391391
response->abort();
392-
//replyStatsPointer->close();
393-
//replyStatsPointer->deleteLater();
394392
qDebug() << "Aborted";
395393

396394
}
397395

396+
void GetterRequest::startTimer()
397+
{
398+
qDebug() << "restard timer...";
399+
emit reStartTimerSignal();
400+
}
398401
//END/////////////////////
399402
//SLOT called by QNetworkAccessManager
400403
//requests for timeouts

src/GetterRequest.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include <QObject>
1212

1313
class QNetworkAccessManager;
14-
class QNetworkReply;
15-
1614

1715
class GetterRequest : public QObject
1816
{
@@ -26,6 +24,7 @@ public Q_SLOTS:
2624
void GetRequest(const QString &password, const QString &cmd, const QString &cmdbyte);
2725
void StatRequest(const QString &password, const QString &cmd);
2826
void GetPassword();
27+
void startTimer();
2928

3029
void whatEveRequest(const QString &rest);
3130

@@ -35,6 +34,8 @@ public Q_SLOTS:
3534
void statsReceived(const QString &info, const int &info2, const QString &info3);
3635
void passwordReceived(const QString &pass);
3736
void commandSent(const QUrl &commandSent);
37+
void timerTimesOut(const QString &requestName);
38+
void reStartTimerSignal();
3839

3940

4041
private Q_SLOTS:
@@ -49,8 +50,6 @@ private Q_SLOTS:
4950
QString mathMode(QByteArray &hexCode);
5051
//QNetworkReply* replyStatsPointer;
5152

52-
53-
5453
};
5554

5655
#endif

translations/DoIt.ts

+2-12
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,12 @@
4545
<context>
4646
<name>Start</name>
4747
<message>
48-
<location filename="../assets/Start.qml" line="72"/>
48+
<location filename="../assets/Start.qml" line="89"/>
4949
<source>DoIt GoPro</source>
5050
<translation type="unfinished"></translation>
5151
</message>
5252
<message>
53-
<location filename="../assets/Start.qml" line="94"/>
54-
<source>On</source>
55-
<translation type="unfinished"></translation>
56-
</message>
57-
<message>
58-
<location filename="../assets/Start.qml" line="105"/>
59-
<source>Off</source>
60-
<translation type="unfinished"></translation>
61-
</message>
62-
<message>
63-
<location filename="../assets/Start.qml" line="256"/>
53+
<location filename="../assets/Start.qml" line="286"/>
6454
<source>Not Connected</source>
6555
<translation type="unfinished"></translation>
6656
</message>

0 commit comments

Comments
 (0)