From 6003bf81107dd9be51589c074b74c5af82bfc8ab Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 7 May 2013 01:37:21 +0200 Subject: testing qml notifications --- metawatch/metawatch.cpp | 3 ++- metawatch/metawatchdigital.cpp | 13 ++----------- metawatch/metawatchscanner.cpp | 2 +- .../qml/com/javispedro/sowatch/metawatch/MWTitle.qml | 12 ++++++++++++ metawatch/res/graphics/idle_call.bmp | Bin 134 -> 0 bytes metawatch/res/graphics/idle_mail.bmp | Bin 134 -> 0 bytes metawatch/res/graphics/idle_msg.bmp | Bin 134 -> 0 bytes 7 files changed, 17 insertions(+), 13 deletions(-) delete mode 100644 metawatch/res/graphics/idle_call.bmp delete mode 100644 metawatch/res/graphics/idle_mail.bmp delete mode 100644 metawatch/res/graphics/idle_msg.bmp (limited to 'metawatch') diff --git a/metawatch/metawatch.cpp b/metawatch/metawatch.cpp index 01dec25..782e47f 100644 --- a/metawatch/metawatch.cpp +++ b/metawatch/metawatch.cpp @@ -125,7 +125,8 @@ MetaWatch::MetaWatch(ConfigKey* settings, QObject* parent) : connect(_localDev, SIGNAL(hostModeStateChanged(QBluetoothLocalDevice::HostMode)), SLOT(localDevModeChanged(QBluetoothLocalDevice::HostMode))); // Check to see if we can connect right away - if (_localDev->hostMode() != QBluetoothLocalDevice::HostPoweredOff) { + if (_localDev->isValid() && + _localDev->hostMode() != QBluetoothLocalDevice::HostPoweredOff) { // Do an initial connection attempt after a short delay // (To give time for other plugins to initialize, etc.) scheduleConnect(); diff --git a/metawatch/metawatchdigital.cpp b/metawatch/metawatchdigital.cpp index de55db6..e099f76 100644 --- a/metawatch/metawatchdigital.cpp +++ b/metawatch/metawatchdigital.cpp @@ -48,7 +48,7 @@ QString MetaWatchDigital::model() const void MetaWatchDigital::displayIdleScreen() { - qDebug() << "displaying idle screen"; + qDebug() << "entering idle screen"; MetaWatch::displayIdleScreen(); // Usually, idle screen is kept updated, so we can flip it right away. @@ -57,22 +57,13 @@ void MetaWatchDigital::displayIdleScreen() void MetaWatchDigital::displayNotification(Notification *n) { - qDebug() << "display notification" << n->title() << n->body(); - - // Render the notification and display it before invoking haptic feedback - _currentMode = NotificationMode; - changeMode(_currentMode); - - renderNotification(n); - - // This will trigger haptic feedback, etc. + qDebug() << "entering notification mode"; MetaWatch::displayNotification(n); } void MetaWatchDigital::displayApplication() { qDebug() << "entering application mode"; - MetaWatch::displayApplication(); } diff --git a/metawatch/metawatchscanner.cpp b/metawatch/metawatchscanner.cpp index 0c1d88e..e560195 100644 --- a/metawatch/metawatchscanner.cpp +++ b/metawatch/metawatchscanner.cpp @@ -45,7 +45,7 @@ void MetaWatchScanner::handleDiscoveredService(const QBluetoothServiceInfo &info foundInfo["driver"] = QString("metawatch-digital"); foundInfo["next-watchlet-button"] = QString("A"); foundInfo["idle-watchlet"] = QString("com.javispedro.sowatch.metawatch.watchface"); - foundInfo["notification-watchlet"] = QString("com.javispedro.sowatch.metawatch.notificationwatchlet"); + foundInfo["notification-watchlet"] = QString("com.javispedro.sowatch.metawatch.notification"); emit watchFound(foundInfo); } } diff --git a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml index b5ad787..d6d4c42 100644 --- a/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml +++ b/metawatch/qml/com/javispedro/sowatch/metawatch/MWTitle.qml @@ -26,6 +26,17 @@ Rectangle { visible: text != "" } + MWLabel { + id: status + anchors.top: parent.top + anchors.left: parent.left + anchors.leftMargin: 1 + height: 8 + font.family: "MetaWatch Large caps 8pt" + font.pixelSize: 8 + text: "" + } + MWLabel { id: time anchors.right: parent.right @@ -40,6 +51,7 @@ Rectangle { function updateStatusBar() { var now = new Date time.text = Qt.formatDate(now, "ddd") + " " + Qt.formatTime(now) + status.text = notifications.fullCount() > 0 ? "*" : "" } Timer { diff --git a/metawatch/res/graphics/idle_call.bmp b/metawatch/res/graphics/idle_call.bmp deleted file mode 100644 index 2b69eea..0000000 Binary files a/metawatch/res/graphics/idle_call.bmp and /dev/null differ diff --git a/metawatch/res/graphics/idle_mail.bmp b/metawatch/res/graphics/idle_mail.bmp deleted file mode 100644 index 253b5bf..0000000 Binary files a/metawatch/res/graphics/idle_mail.bmp and /dev/null differ diff --git a/metawatch/res/graphics/idle_msg.bmp b/metawatch/res/graphics/idle_msg.bmp deleted file mode 100644 index 0035d4b..0000000 Binary files a/metawatch/res/graphics/idle_msg.bmp and /dev/null differ -- cgit v1.2.3