Skip to content

Commit 9c066b8

Browse files
committed
power and icon
working power on
1 parent 582f9de commit 9c066b8

14 files changed

+55
-39
lines changed

arm/Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: libDoIt.so.1.0.0
3-
# Generated by qmake (2.01a) (Qt 4.8.5) on: lun. 20. janv. 14:49:11 2014
3+
# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Jan 23 23:17:49 2014
44
# Project: ../DoIt.pro
55
# Template: lib
66
# Command: c:/bbndk/host_10_2_0_15/win32/x86/usr/bin/qmake.exe -spec c:/bbndk/target_10_2_0_1155/qnx6/usr/share/qt4/mkspecs/blackberry-armv7le-qcc CONFIG+=debug_and_release CONFIG+=device -o Makefile ../DoIt.pro

arm/Makefile.Debug

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: o.le-v7-g/DoIt
3-
# Generated by qmake (2.01a) (Qt 4.8.5) on: lun. 20. janv. 14:49:11 2014
3+
# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Jan 23 23:17:49 2014
44
# Project: ../DoIt.pro
55
# Template: app
66
#############################################################################
@@ -180,6 +180,7 @@ o.le-v7-g/.obj/applicationui.o: ../src/applicationui.cpp ..\src\applicationui.hp
180180
$(CXX) -c -Wc,-include -Wc,o.le-v7-g/.obj/DoIt $(CXXFLAGS) $(INCPATH) -o o.le-v7-g/.obj/applicationui.o ../src/applicationui.cpp
181181

182182
o.le-v7-g/.obj/main.o: ../src/main.cpp ..\src\applicationui.hpp \
183+
..\src\GetterRequest.h \
183184
o.le-v7-g/.obj/DoIt.gch/c++
184185
$(CXX) -c -Wc,-include -Wc,o.le-v7-g/.obj/DoIt $(CXXFLAGS) $(INCPATH) -o o.le-v7-g/.obj/main.o ../src/main.cpp
185186

arm/Makefile.Release

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#############################################################################
22
# Makefile for building: libDoIt.so.1.0.0
3-
# Generated by qmake (2.01a) (Qt 4.8.5) on: lun. 20. janv. 14:49:11 2014
3+
# Generated by qmake (2.01a) (Qt 4.8.5) on: Thu Jan 23 23:17:49 2014
44
# Project: ../DoIt.pro
55
# Template: lib
66
#############################################################################
@@ -206,6 +206,7 @@ o.le-v7/.obj/applicationui.o: ../src/applicationui.cpp ..\src\applicationui.hpp
206206
$(CXX) -c -Wc,-include -Wc,o.le-v7/.obj/DoIt $(CXXFLAGS) $(INCPATH) -o o.le-v7/.obj/applicationui.o ../src/applicationui.cpp
207207

208208
o.le-v7/.obj/main.o: ../src/main.cpp ..\src\applicationui.hpp \
209+
..\src\GetterRequest.h \
209210
o.le-v7/.obj/DoIt.gch/c++
210211
$(CXX) -c -Wc,-include -Wc,o.le-v7/.obj/DoIt $(CXXFLAGS) $(INCPATH) -o o.le-v7/.obj/main.o ../src/main.cpp
211212

arm/o.le-v7-g/.moc/moc_GetterRequest.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,19 @@ static const uint qt_meta_data_GetterRequest[] = {
3131

3232
// signals: signature, parameters, type, tag, flags
3333
20, 15, 14, 14, 0x05,
34-
50, 38, 14, 14, 0x05,
34+
58, 46, 14, 14, 0x05,
3535

3636
// slots: signature, parameters, type, tag, flags
37-
66, 14, 14, 14, 0x0a,
38-
79, 14, 14, 14, 0x08,
37+
76, 14, 14, 14, 0x0a,
38+
89, 14, 14, 14, 0x08,
3939

4040
0 // eod
4141
};
4242

4343
static const char qt_meta_stringdata_GetterRequest[] = {
44-
"GetterRequest\0\0info\0complete(QString)\0"
45-
"commandSent\0complete2(QUrl)\0GetRequest()\0"
46-
"onGetReply()\0"
44+
"GetterRequest\0\0info\0responseReceived(QString)\0"
45+
"commandSent\0commandSent(QUrl)\0"
46+
"GetRequest()\0onGetReply()\0"
4747
};
4848

4949
void GetterRequest::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _id, void **_a)
@@ -52,8 +52,8 @@ void GetterRequest::qt_static_metacall(QObject *_o, QMetaObject::Call _c, int _i
5252
Q_ASSERT(staticMetaObject.cast(_o));
5353
GetterRequest *_t = static_cast<GetterRequest *>(_o);
5454
switch (_id) {
55-
case 0: _t->complete((*reinterpret_cast< const QString(*)>(_a[1]))); break;
56-
case 1: _t->complete2((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
55+
case 0: _t->responseReceived((*reinterpret_cast< const QString(*)>(_a[1]))); break;
56+
case 1: _t->commandSent((*reinterpret_cast< const QUrl(*)>(_a[1]))); break;
5757
case 2: _t->GetRequest(); break;
5858
case 3: _t->onGetReply(); break;
5959
default: ;
@@ -101,14 +101,14 @@ int GetterRequest::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
101101
}
102102

103103
// SIGNAL 0
104-
void GetterRequest::complete(const QString & _t1)
104+
void GetterRequest::responseReceived(const QString & _t1)
105105
{
106106
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
107107
QMetaObject::activate(this, &staticMetaObject, 0, _a);
108108
}
109109

110110
// SIGNAL 1
111-
void GetterRequest::complete2(const QUrl & _t1)
111+
void GetterRequest::commandSent(const QUrl & _t1)
112112
{
113113
void *_a[] = { 0, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) };
114114
QMetaObject::activate(this, &staticMetaObject, 1, _a);

arm/o.le-v7-g/DoIt

6.24 KB
Binary file not shown.

assets/main.qml

+14-10
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ import Network.GetterRequest 1.0
33

44
Page {
55
Container {
6-
//Todo: fill me with QML
6+
77
Label {
88
// Localized text with the dynamic translation and locale updates support
9-
text: qsTr("GoPro App") + Retranslate.onLocaleOrLanguageChanged
9+
text: qsTr("DoIt GoPro") + Retranslate.onLocaleOrLanguageChanged
1010
textStyle.base: SystemDefaults.TextStyles.BigText
1111
}
1212
TextField {
13-
id: myTextField
13+
id: passwordField
1414
text: "GoPro Password here"
1515
horizontalAlignment: HorizontalAlignment.Left
1616
verticalAlignment: VerticalAlignment.Center
@@ -24,24 +24,28 @@ Page {
2424
attachedObjects: [
2525
GetterRequest {
2626
id: getThis
27-
onComplete2: {
28-
myTextArea.text = commandSent;
27+
onCommandSent: {
28+
commandArea.text = commandSent;
2929
}
30-
onComplete: {
31-
//myTextArea.text = info;
30+
onResponseReceived: {
31+
responseArea.text = info;
3232
}
3333
}
3434
]
3535
}
3636
Button {
3737
text: "Power Off"
3838
onClicked: {
39-
myTextArea.text="Turned Off"
39+
commandArea.text="Turned Off"
4040
}
4141
}
4242
TextArea {
43-
id: myTextArea
44-
text: "Enter text above then click button to insert the text here. MOTHERFUCKER"
43+
id: commandArea
44+
text: "Command here."
45+
}
46+
TextArea {
47+
id: responseArea
48+
text: "Response here."
4549
}
4650
}
4751
}

bar-descriptor.xml

-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
<!-- <copyright></copyright> -->
5353

5454
<!-- Name of author which is used for signing. Must match the developer name of your development certificate. -->
55-
<author>Example Inc.</author>
5655
<configuration name="Device-Debug">
5756
<platformArchitecture>armle-v7</platformArchitecture>
5857
<asset path="arm/o.le-v7-g/DoIt" entry="true" type="Qnx/Elf">DoIt</asset>

copy.zip

591 KB
Binary file not shown.

icon.png

-2.29 KB
Loading

icon.png.back

17 KB
Binary file not shown.

iconfull.png

14.4 KB
Loading

src/GetterRequest.cpp

+20-9
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
#include <QNetworkAccessManager>
1616
#include <QNetworkReply>
1717
#include <QNetworkRequest>
18-
#include <QSslConfiguration>
18+
#include <iostream>
19+
1920
#include <QUrl>
2021

2122

@@ -28,17 +29,27 @@ GetterRequest::GetterRequest(QObject* parent)
2829

2930
void GetterRequest::GetRequest()
3031
{
31-
//const QUrl::fromEncoded command1("http%3A%2F%2F10.5.5.9%2Fbacpac%2FPW%3Ft%3DEvilation01%26p%3D%2501");
32-
//QUrl command1 = QUrl::fromEncoded("http%3A%2F%2F10.5.5.9%2Fbacpac%2FPW%3Ft%3DEvilation01%26p%3D%2501", QUrl::StrictMode);
33-
//QUrl command1 = QUrl::fromPercentEncoding("http%3A%2F%2F10.5.5.9%2Fbacpac%2FPW%3Ft%3DEvilation01%26p%3D%2501");
34-
const QUrl command("http://10.5.5.9/bacpac/PW?t=Evilation01&p=%01");
32+
//QUrl command("%1")
3533

36-
QNetworkRequest request(command);
3734

38-
QNetworkReply* response = m_networkAccessManager->get(request);
35+
QUrl command (QString("%1%2").arg("http://10.5.5.9/").arg("bacpac/PW"));
36+
//QUrl command("http://10.5.5.9/bacpac/PW");
37+
//QString("%1%2%3%4").arg("=t").arg("Evilation01").arg("&p=").arg("%01")
38+
39+
std::string rawString("t=Evilation01&p=%01");
40+
QByteArray rawQuery(rawString.c_str(),rawString.length());
41+
42+
//QByteArray rawQuery("t=Evilation01&p=%01");
43+
44+
command.setEncodedQuery(rawQuery);
3945

46+
QNetworkRequest request(command);
47+
QNetworkReply* response = m_networkAccessManager->get(request);
4048
QString urltostring; urltostring = command.toEncoded();
41-
emit complete2(urltostring);
49+
50+
emit commandSent(urltostring);
51+
52+
4253

4354
bool ok = connect(response, SIGNAL(finished()),this,SLOT(onGetReply()));
4455
Q_ASSERT(ok);
@@ -108,7 +119,7 @@ void GetterRequest::onGetReply()
108119
response = tr("Unable to retrieve request headers");
109120
}
110121

111-
emit complete(response);
122+
emit responseReceived(response);
112123
}
113124

114125
GetterRequest::~GetterRequest() {

src/GetterRequest.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#ifndef GETTERREQUEST_H_
99
#define GETTERREQUEST_H_
1010

11-
#include <QtCore/QObject>
11+
#include <QObject>
1212

1313
class QNetworkAccessManager;
1414

@@ -23,9 +23,9 @@ public Q_SLOTS:
2323
void GetRequest();
2424

2525
Q_SIGNALS:
26-
void complete(const QString &info);
26+
void responseReceived(const QString &info);
2727

28-
void complete2(const QUrl &commandSent);
28+
void commandSent(const QUrl &commandSent);
2929

3030
private Q_SLOTS:
3131
void onGetReply();

translations/DoIt.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
<context>
55
<name>GetterRequest</name>
66
<message>
7-
<location filename="../src/GetterRequest.cpp" line="100"/>
7+
<location filename="../src/GetterRequest.cpp" line="111"/>
88
<source>Error: %1 status: %2</source>
99
<translation type="unfinished"></translation>
1010
</message>
1111
<message>
12-
<location filename="../src/GetterRequest.cpp" line="108"/>
12+
<location filename="../src/GetterRequest.cpp" line="119"/>
1313
<source>Unable to retrieve request headers</source>
1414
<translation type="unfinished"></translation>
1515
</message>
@@ -18,7 +18,7 @@
1818
<name>main</name>
1919
<message>
2020
<location filename="../assets/main.qml" line="9"/>
21-
<source>GoPro App</source>
21+
<source>DoIt GoPro</source>
2222
<translation type="unfinished"></translation>
2323
</message>
2424
</context>

0 commit comments

Comments
 (0)