aboutsummaryrefslogtreecommitdiffstats
path: root/homescreen/src
diff options
context:
space:
mode:
Diffstat (limited to 'homescreen/src')
-rw-r--r--homescreen/src/main.cpp10
-rw-r--r--homescreen/src/statusbarmodel.cpp19
2 files changed, 7 insertions, 22 deletions
diff --git a/homescreen/src/main.cpp b/homescreen/src/main.cpp
index cf7f02e..4e3073f 100644
--- a/homescreen/src/main.cpp
+++ b/homescreen/src/main.cpp
@@ -26,10 +26,9 @@
#include <QQuickWindow>
#include <QTimer>
-#if 0
#include <weather.h>
#include <bluetooth.h>
-#endif
+
#include "applicationlauncher.h"
#include "statusbarmodel.h"
#include "mastervolume.h"
@@ -299,10 +298,9 @@ int main(int argc, char *argv[])
context->setContextProperty("homescreenHandler", homescreenHandler);
context->setContextProperty("launcher", launcher);
-#if 0
- context->setContextProperty("weather", new Weather(bindingAddress));
- context->setContextProperty("bluetooth", new Bluetooth(bindingAddress, context));
-#endif
+ context->setContextProperty("weather", new Weather());
+ context->setContextProperty("bluetooth", new Bluetooth(false, context));
+
// we add it here even if we don't use it
context->setContextProperty("shell", aglShell);
diff --git a/homescreen/src/statusbarmodel.cpp b/homescreen/src/statusbarmodel.cpp
index 8b46cd1..447466d 100644
--- a/homescreen/src/statusbarmodel.cpp
+++ b/homescreen/src/statusbarmodel.cpp
@@ -17,9 +17,8 @@
#include "statusbarmodel.h"
#include "statusbarserver.h"
-#if 0
-#include "network.h"
-#endif
+#include <network.h>
+#include <wifiadapter.h>
class StatusBarModel::Private
{
@@ -31,10 +30,8 @@ private:
public:
StatusBarServer server;
QString iconList[StatusBarServer::SupportedCount];
-#if 0
Network *network;
WifiAdapter *wifi_a;
-#endif
};
StatusBarModel::Private::Private(StatusBarModel *parent)
@@ -64,8 +61,7 @@ StatusBarModel::~StatusBarModel()
void StatusBarModel::init(QQmlContext *context)
{
-#if 0
- d->network = new Network(url, context);
+ d->network = new Network(false, context);
context->setContextProperty("network", d->network);
d->wifi_a = static_cast<WifiAdapter*>(d->network->findAdapter("wifi"));
Q_CHECK_PTR(d->wifi_a);
@@ -78,12 +74,10 @@ void StatusBarModel::init(QQmlContext *context)
this, &StatusBarModel::onWifiStrengthChanged);
setWifiStatus(d->wifi_a->wifiConnected(), d->wifi_a->wifiEnabled(), d->wifi_a->wifiStrength());
-#endif
}
void StatusBarModel::setWifiStatus(bool connected, bool enabled, int strength)
{
-#if 0
if (enabled && connected)
if (strength < 30)
d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_1Bar-01.png"));
@@ -95,29 +89,22 @@ void StatusBarModel::setWifiStatus(bool connected, bool enabled, int strength)
d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_Full-01.png"));
else
d->server.setStatusIcon(0, QStringLiteral("qrc:/images/Status/HMI_Status_Wifi_NoBars-01.png"));
-#endif
}
void StatusBarModel::onWifiConnectedChanged(bool connected)
{
-#if 0
setWifiStatus(connected, d->wifi_a->wifiEnabled(), d->wifi_a->wifiStrength());
-#endif
}
void StatusBarModel::onWifiEnabledChanged(bool enabled)
{
-#if 0
setWifiStatus(d->wifi_a->wifiConnected(), enabled, d->wifi_a->wifiStrength());
-#endif
}
void StatusBarModel::onWifiStrengthChanged(int strength)
{
-#if 0
qInfo() << "Strength changed: " << strength;
setWifiStatus(d->wifi_a->wifiConnected(), d->wifi_a->wifiEnabled(), strength);
-#endif
}
int StatusBarModel::rowCount(const QModelIndex &parent) const