diff options
author | Scott Murray <scott.murray@konsulko.com> | 2022-01-28 17:02:52 -0500 |
---|---|---|
committer | Scott Murray <scott.murray@konsulko.com> | 2022-01-28 17:09:11 -0500 |
commit | b7b156ece9492401f7bfe7676e7521f4cdd32905 (patch) | |
tree | 066a41e772b4d420f9a8a28edd7b77cafc3ccdbb /homescreen/src | |
parent | a3c4beb8a9d1a01a4a29434e8319be7ce3f0d42f (diff) |
Re-enable status barmarlin_12.92.0marlin/12.92.012.92.0
Re-enable the status bar Bluetooth and Wifi status monitoring via
the libqtappfw provided objects, and also hook up the currently
stubbed weather support so it'll start working if it is updated
in libqtappfw.
Bug-AGL: SPEC-4182
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Change-Id: I3aeb98dc01c0bc09550824f44bcb1d40f324e49e
Diffstat (limited to 'homescreen/src')
-rw-r--r-- | homescreen/src/main.cpp | 10 | ||||
-rw-r--r-- | homescreen/src/statusbarmodel.cpp | 19 |
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 |