From 729563dd4fd6adb2fa3abcd7eb7e0809d70c1515 Mon Sep 17 00:00:00 2001
From: BirdZhang <0312birdzhang@gmail.com>
Date: Thu, 14 May 2015 00:23:22 +0800
Subject: add Chinese translations
---
app/translations/pebble-zh_CN.ts | 481 +++++++++++++++++++++++++++++++++++++++
1 file changed, 481 insertions(+)
create mode 100644 app/translations/pebble-zh_CN.ts
diff --git a/app/translations/pebble-zh_CN.ts b/app/translations/pebble-zh_CN.ts
new file mode 100644
index 0000000..49004e8
--- /dev/null
+++ b/app/translations/pebble-zh_CN.ts
@@ -0,0 +1,481 @@
+
+
+
+
+ AboutPage
+
+
+ Version
+ 版本
+
+
+
+ All Rights Reserved.
+ 版权所有.
+
+
+
+ Support
+ 支持
+
+
+
+ Your donations help justify development time.
+ 你的捐款帮助证明了开发时间.
+
+
+
+ Thank you for your support!!!
+ 感谢你的支持!!!
+
+
+
+ PayPal Donate
+ 贝宝捐助
+
+
+
+ Bugs?
+ Bugs?
+
+
+
+ Open Bug Tracker
+ 打开的Bug追踪器
+
+
+
+ Forum Thread
+ 论坛主题
+
+
+
+ Send issue e-mail to developer
+ 给开发者发送问题邮件
+
+
+
+ AppConfigDialog
+
+
+ No configuration settings available
+ 没有可用的配置设置
+
+
+
+ AppStorePage
+
+
+ Logout
+ 退出
+
+
+
+ Logging out...
+ 退出中...
+
+
+
+ Hide search
+ 隐藏搜索框
+
+
+
+ Show search
+ 显示搜索框
+
+
+
+ Pebble Appstore
+ Pebble 应用商店
+
+
+
+ Apps
+ 应用
+
+
+
+ Faces
+ 表情
+
+
+
+ Downloading...
+ 下载中...
+
+
+
+ Downloading %1...
+ 下载 %1...
+
+
+
+ CoverPage
+
+
+ connected
+ 已连接
+
+
+
+ disconnected
+ 已断开
+
+
+
+ Disclaimer
+
+
+ Feature unavailable
+ 功能不可用
+
+
+
+ This feature is available for supporters only.
+ 此功能适用于仅支持者.
+
+
+
+ Supporter?
+ 支持者?
+
+
+
+ Send me my code!
+ 发送给我的代码!
+
+
+
+ Activation code
+ 激活码
+
+
+
+ PayPal Donate
+ Paypal捐助
+
+
+
+ FirmwareUpgrade
+
+
+ Firmware upgrade
+ 固件升级
+
+
+
+ Begin upgrade
+ 开始升级
+
+
+
+ InstallAppDialog
+
+
+ Select App files
+ 选择应用文件
+
+
+
+ Install App
+ 安装应用
+
+
+
+ Install
+ 安装
+
+
+
+ Add App file
+ 添加应用文件
+
+
+
+ Delete App file
+ 删除应用文件
+
+
+
+ ManagerPage
+
+
+ Pebble Appstore
+ Pebble 应用商店
+
+
+
+ About
+ 关于
+
+
+
+ Pebble Manager
+ Pebble管理
+
+
+
+ Waiting for watch...
+If it can't be found please check it's available and paired in Bluetooth settings.
+ 等待观看...
+ 如果无法找到,请检查它的提供配对的蓝牙设置。
+
+
+
+ Service
+ 服务
+
+
+
+ Enabled
+ 已启用
+
+
+
+ Automatic startup
+ 自动启动
+
+
+
+ Manual startup
+ 手动启动
+
+
+
+ Active
+ 激活
+
+
+
+ Running
+ 运行中
+
+
+
+ Dead
+ 挂了
+
+
+
+ Connection
+ 连接
+
+
+
+
+ Connected
+ 已连接
+
+
+
+
+ Disconnected
+ 已断开
+
+
+
+ Settings
+ 设置
+
+
+
+ Forward phone calls
+ 前置通话
+
+
+
+ Profiles
+ 个性化
+
+
+
+
+
+
+ no change
+ 未改变
+
+
+
+ Control main volume
+ 控制主音量
+
+
+
+ Pebble music volume buttons change the main phone volume directly instead of through the music player.
+ Pebble音量键直接改变手机主音量,而不是通过音乐播放器
+
+
+
+ Transliterate messages
+ 音译消息
+
+
+
+ Messages are transliterated to ASCII before sending to Pebble
+ 在发送到Pebble之前消息已转换成ASCII码
+
+
+
+ Notifications
+ 通知
+
+
+
+ Messaging
+ 消息
+
+
+
+ SMS and IM
+ 短信和即时消息
+
+
+
+ Missed call
+ 漏接电话
+
+
+
+ Emails
+ 邮件
+
+
+
+ Mitakuuluu
+ Mitakuuluu
+
+
+
+ Twitter
+ Twitter
+
+
+
+ Facebook
+ Facebook
+
+
+
+ Other notifications
+ 其他通知
+
+
+
+ All notifications
+ 所有通知
+
+
+
+ WatchInfo
+
+
+ Address
+ 地址
+
+
+
+ Serial Number
+ 序列号
+
+
+
+ BootLoader
+ BootLoader
+
+
+
+ Firmware
+ 固件
+
+
+
+ Recovery
+ 恢复模式
+
+
+
+ Running
+ 运行中
+
+
+
+ Latest
+ 最新
+
+
+
+ unknown
+ 未知
+
+
+
+ Upgrade Firmware
+ 升级固件
+
+
+
+ WatchPage
+
+
+ Info
+ 信息
+
+
+
+ Ping
+ Ping
+
+
+
+ Sync Time
+ 同步时间
+
+
+
+ Installed applications
+ 已安装应用
+
+
+
+ Your firmware is too old to support SDKv2 applications
+ 你的固件太老不支持SDK v2版本的应用
+
+
+
+ Uninstalling
+ 卸载中...
+
+
+
+ (empty slot)
+ (空槽)
+
+
+
+ (插槽在被不明应用程序使用中)
+
+
+
+
+ Install app...
+ 安装应用...
+
+
+
+ Companion app missing
+ 配套应用缺失
+
+
+
+ Configure...
+ 配置...
+
+
+
+ Uninstall
+ 卸载
+
+
+
--
cgit v1.2.3
From b7481c91163b6bd29201740dfc346050b35716a5 Mon Sep 17 00:00:00 2001
From: 0312birdzhang <0312birdzhang@gmail.com>
Date: Thu, 14 May 2015 10:00:59 +0800
Subject: add translation file to app.pro
---
app/app.pro | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/app.pro b/app/app.pro
index 2872cf7..5d13720 100644
--- a/app/app.pro
+++ b/app/app.pro
@@ -39,4 +39,4 @@ OTHER_FILES += \
pebble.png
CONFIG += sailfishapp_i18n
-TRANSLATIONS += translations/pebble-es.ts translations/pebble-pl.ts
+TRANSLATIONS += translations/pebble-es.ts translations/pebble-pl.ts translations/pebble-zh_CN.ts
--
cgit v1.2.3
From 7116e096e1288170da3820c77e41e377f9bd69be Mon Sep 17 00:00:00 2001
From: Tomasz Sterna
Date: Mon, 18 May 2015 09:35:38 +0200
Subject: Save default settings to DConf if not present
---
app/qml/pages/ManagerPage.qml | 22 +++++++++++-----------
daemon/manager.cpp | 3 +--
daemon/musicmanager.cpp | 4 +---
daemon/notificationmanager.cpp | 21 +++++++--------------
daemon/settings.h | 19 +++++++++++++++++--
5 files changed, 37 insertions(+), 32 deletions(-)
diff --git a/app/qml/pages/ManagerPage.qml b/app/qml/pages/ManagerPage.qml
index b989c64..a69bc89 100644
--- a/app/qml/pages/ManagerPage.qml
+++ b/app/qml/pages/ManagerPage.qml
@@ -12,17 +12,17 @@ Page {
path: "/org/pebbled/settings"
property string profileWhenConnected: ""
property string profileWhenDisconnected: ""
- property bool transliterateMessage: false
- property bool useSystemVolume: true
- property bool incomingCallNotification: true
- property bool notificationsCommhistoryd: true
- property bool notificationsMissedCall: true
- property bool notificationsEmails: false
- property bool notificationsMitakuuluu: true
- property bool notificationsTwitter: true
- property bool notificationsFacebook: true
- property bool notificationsOther: true
- property bool notificationsAll: false
+ property bool transliterateMessage
+ property bool useSystemVolume
+ property bool incomingCallNotification
+ property bool notificationsCommhistoryd
+ property bool notificationsMissedCall
+ property bool notificationsEmails
+ property bool notificationsMitakuuluu
+ property bool notificationsTwitter
+ property bool notificationsFacebook
+ property bool notificationsOther
+ property bool notificationsAll
}
DBusInterface {
diff --git a/daemon/manager.cpp b/daemon/manager.cpp
index e6ebf26..93b6b13 100644
--- a/daemon/manager.cpp
+++ b/daemon/manager.cpp
@@ -130,8 +130,7 @@ void Manager::onActiveVoiceCallChanged()
{
qCDebug(l) << "Manager::onActiveVoiceCallChanged()";
- QVariant incomingCallNotification = settings->property("incomingCallNotification");
- if (incomingCallNotification.isValid() && !incomingCallNotification.toBool()) {
+ if (!settings->property("incomingCallNotification").toBool()) {
qCDebug(l) << "Ignoring ActiveVoiceCallChanged because of setting!";
return;
}
diff --git a/daemon/musicmanager.cpp b/daemon/musicmanager.cpp
index 5ae1786..2a426db 100644
--- a/daemon/musicmanager.cpp
+++ b/daemon/musicmanager.cpp
@@ -148,11 +148,9 @@ void MusicManager::callMprisMethod(const QString &method)
void MusicManager::handleMusicControl(WatchConnector::MusicControl operation)
{
qCDebug(l) << "operation from watch:" << operation;
- QVariant useSystemVolumeVar = settings->property("useSystemVolume");
- bool useSystemVolume = (useSystemVolumeVar.isValid() && useSystemVolumeVar.toBool());
// System volume controls
- if (useSystemVolume && _pulseBus != NULL &&
+ if (settings->property("useSystemVolume").toBool() && _pulseBus != NULL &&
(operation == WatchConnector::musicVOLUME_UP || operation == WatchConnector::musicVOLUME_DOWN)) {
// Query current volume
QDBusMessage call = QDBusMessage::createMethodCall("com.Meego.MainVolume2", "/com/meego/mainvolume2",
diff --git a/daemon/notificationmanager.cpp b/daemon/notificationmanager.cpp
index d983539..d357a3c 100644
--- a/daemon/notificationmanager.cpp
+++ b/daemon/notificationmanager.cpp
@@ -126,8 +126,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
setDelayedReply(true);
if (app_name == "messageserver5") {
- QVariant notificationsEmails = settings->property("notificationsEmails");
- if (!notificationsEmails.isValid() || !notificationsEmails.toBool()) {
+ if (!settings->property("notificationsEmails").toBool()) {
qCDebug(l) << "Ignoring email notification because of setting!";
return 0;
}
@@ -149,14 +148,12 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
QString category = hints.value("category", "").toString();
if (category == "x-nemo.call.missed") {
- QVariant notificationsMissedCall = settings->property("notificationsMissedCall");
- if (notificationsMissedCall.isValid() && !notificationsMissedCall.toBool()) {
+ if (!settings->property("notificationsMissedCall").toBool()) {
qCDebug(l) << "Ignoring MissedCall notification because of setting!";
return 0;
}
} else {
- QVariant notificationsCommhistoryd = settings->property("notificationsCommhistoryd");
- if (notificationsCommhistoryd.isValid() && !notificationsCommhistoryd.toBool()) {
+ if (!settings->property("notificationsCommhistoryd").toBool()) {
qCDebug(l) << "Ignoring commhistoryd notification because of setting!";
return 0;
}
@@ -166,8 +163,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
);
}
} else if (app_name == "harbour-mitakuuluu2-server") {
- QVariant notificationsMitakuuluu = settings->property("notificationsMitakuuluu");
- if (notificationsMitakuuluu.isValid() && !notificationsMitakuuluu.toBool()) {
+ if (!settings->property("notificationsMitakuuluu").toBool()) {
qCDebug(l) << "Ignoring mitakuuluu notification because of setting!";
return 0;
}
@@ -176,8 +172,7 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
hints.value("x-nemo-preview-summary", "default").toString()
);
} else if (app_name == "twitter-notifications-client") {
- QVariant notificationsTwitter = settings->property("notificationsTwitter");
- if (notificationsTwitter.isValid() && !notificationsTwitter.toBool()) {
+ if (!settings->property("notificationsTwitter").toBool()) {
qCDebug(l) << "Ignoring twitter notification because of setting!";
return 0;
}
@@ -195,14 +190,12 @@ uint NotificationManager::Notify(const QString &app_name, uint replaces_id, cons
qCDebug(l) << "MSG Prio:" << prio;
- QVariant notificationsAll = settings->property("notificationsAll");
- if ((!notificationsAll.isValid() || !notificationsAll.toBool()) && prio <= 10) {
+ if (!settings->property("notificationsAll").toBool() && prio <= 10) {
qCDebug(l) << "Ignoring notification because of setting! (all)";
return 0;
}
- QVariant notificationsOther = settings->property("notificationsOther");
- if (notificationsOther.isValid() && !notificationsOther.toBool() && prio < 90) {
+ if (!settings->property("notificationsOther").toBool() && prio < 90) {
qCDebug(l) << "Ignoring notification because of setting! (other)";
return 0;
}
diff --git a/daemon/settings.h b/daemon/settings.h
index 3c38473..a247dc5 100644
--- a/daemon/settings.h
+++ b/daemon/settings.h
@@ -39,8 +39,23 @@ class Settings : public MDConfGroup
public:
explicit Settings(QObject *parent = 0) :
- MDConfGroup("/org/pebbled/settings", parent, BindProperties)
- { resolveMetaObject(); }
+ MDConfGroup("/org/pebbled/settings", parent, BindProperties),
+ transliterateMessage(false),
+ useSystemVolume(true),
+ incomingCallNotification(true),
+ notificationsCommhistoryd(true),
+ notificationsMissedCall(true),
+ notificationsEmails(false),
+ notificationsMitakuuluu(true),
+ notificationsTwitter(true),
+ notificationsFacebook(true),
+ notificationsOther(true),
+ notificationsAll(false)
+ {
+ resolveMetaObject();
+ QMetaObject::invokeMethod(this, "propertyChanged", Qt::DirectConnection);
+ sync();
+ }
signals:
void profileWhenConnectedChanged();
--
cgit v1.2.3
From 2a6d3f807d8031c4c6980107782714c804b47e6b Mon Sep 17 00:00:00 2001
From: Tomasz Sterna
Date: Tue, 19 May 2015 09:34:41 +0200
Subject: Chineese translation fix
---
app/translations/pebble-zh_CN.ts | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/app/translations/pebble-zh_CN.ts b/app/translations/pebble-zh_CN.ts
index 49004e8..092ce00 100644
--- a/app/translations/pebble-zh_CN.ts
+++ b/app/translations/pebble-zh_CN.ts
@@ -437,6 +437,11 @@ If it can't be found please check it's available and paired in Bluetoo
Installed applications
已安装应用
+
+
+ (slot in use by unknown app)
+ (插槽在被不明应用程序使用中)
+
Your firmware is too old to support SDKv2 applications
@@ -452,11 +457,6 @@ If it can't be found please check it's available and paired in Bluetoo
(empty slot)
(空槽)
-
-
- (插槽在被不明应用程序使用中)
-
-
Install app...
--
cgit v1.2.3
From bf74abf554c4f333fcccf4a5cea707ec9dd2157d Mon Sep 17 00:00:00 2001
From: Tomasz Sterna
Date: Tue, 19 May 2015 09:35:08 +0200
Subject: Release 1.2
---
rpm/pebble.changes | 4 ++++
rpm/pebble.spec | 2 +-
rpm/pebble.yaml | 2 +-
3 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/rpm/pebble.changes b/rpm/pebble.changes
index 2d60c1d..0a2350c 100644
--- a/rpm/pebble.changes
+++ b/rpm/pebble.changes
@@ -1,3 +1,7 @@
+* Tue May 19 2015 Tomasz Sterna 1.2
+- Automatic time synchronization with watch
+- Chinese translation
+
* Mon May 11 2015 Tomasz Sterna 1.1
- Do not reconnect to the watch if Bluetooth is switched off
- AppStore logout remorse timer
diff --git a/rpm/pebble.spec b/rpm/pebble.spec
index 395b441..bc1612d 100644
--- a/rpm/pebble.spec
+++ b/rpm/pebble.spec
@@ -13,7 +13,7 @@ Name: pebble
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Support for Pebble watch in SailfishOS
-Version: 1.1
+Version: 1.2
Release: 1
Group: Qt/Qt
License: GPL3
diff --git a/rpm/pebble.yaml b/rpm/pebble.yaml
index 4b9ebac..7c115c8 100644
--- a/rpm/pebble.yaml
+++ b/rpm/pebble.yaml
@@ -1,6 +1,6 @@
Name: pebble
Summary: Support for Pebble watch in SailfishOS
-Version: 1.1
+Version: 1.2
Release: 1
Group: Qt/Qt
URL: http://getpebble.com/
--
cgit v1.2.3
From 7d7dd8aae50816e86d32b5c5c3b34391131b3607 Mon Sep 17 00:00:00 2001
From: Tomasz Sterna
Date: Sun, 7 Jun 2015 22:34:06 +0200
Subject: Updated HardwareRevision for Pebble Time
- https://github.com/pebble/libpebble/blob/master/pebblecomm/
- http://pebbledev.org/wiki/Firmware_Updates
---
app/pebblefirmware.cpp | 2 +-
daemon/watchconnector.cpp | 20 ++++++++++++--------
daemon/watchconnector.h | 21 +++++++++++++--------
3 files changed, 26 insertions(+), 17 deletions(-)
diff --git a/app/pebblefirmware.cpp b/app/pebblefirmware.cpp
index f42c29b..4e0fc08 100644
--- a/app/pebblefirmware.cpp
+++ b/app/pebblefirmware.cpp
@@ -16,7 +16,7 @@ PebbleFirmware::PebbleFirmware(QObject *parent) :
void PebbleFirmware::updateLatest(QString hw)
{
QNetworkRequest req;
- req.setUrl(firmwareURL.arg(hw).arg("release-v2"));
+ req.setUrl(firmwareURL.arg(hw).arg(hw.startsWith("snowy_") ? "release-v3" : "release-v2"));
req.setRawHeader("Cache-Control", "no-cache");
nm->get(req);
}
diff --git a/daemon/watchconnector.cpp b/daemon/watchconnector.cpp
index 2c17a0b..d9cdd67 100644
--- a/daemon/watchconnector.cpp
+++ b/daemon/watchconnector.cpp
@@ -73,14 +73,18 @@ WatchConnector::WatchConnector(QObject *parent) :
timeSyncTimer.setInterval(4 * 60 * 60 * 1000); // sync time every 4 hours
firmwareMapping.insert(UNKNOWN, "unknown");
- firmwareMapping.insert(PEBBLE_ONE_EV1, "ev1");
- firmwareMapping.insert(PEBBLE_ONE_EV2, "ev2");
- firmwareMapping.insert(PEBBLE_ONE_EV2_3, "ev2_3");
- firmwareMapping.insert(PEBBLE_ONE_EV2_4, "ev2_4");
- firmwareMapping.insert(PEBBLE_ONE_POINT_FIVE, "v1_5");
- firmwareMapping.insert(PEBBLE_TWO_POINT_ZERO, "v2_0");
- firmwareMapping.insert(PEBBLE_ONE_BIGBOARD_2, "bb2");
- firmwareMapping.insert(PEBBLE_ONE_BIGBOARD, "bigboard");
+ firmwareMapping.insert(TINTIN_EV1, "ev1");
+ firmwareMapping.insert(TINTIN_EV2, "ev2");
+ firmwareMapping.insert(TINTIN_EV2_3, "ev2_3");
+ firmwareMapping.insert(TINTIN_EV2_4, "ev2_4");
+ firmwareMapping.insert(TINTIN_V1_5, "v1_5");
+ firmwareMapping.insert(BIANCA, "v2_0");
+ firmwareMapping.insert(SNOWY_EVT2, "snowy_evt2");
+ firmwareMapping.insert(SNOWY_DVT, "snowy_dvt");
+ firmwareMapping.insert(TINTIN_BB, "bigboard");
+ firmwareMapping.insert(TINTIN_BB2, "bb2");
+ firmwareMapping.insert(SNOWY_BB, "snowy_bb");
+ firmwareMapping.insert(SNOWY_BB2, "snowy_bb2");
setEndpointHandler(watchVERSION, [this](const QByteArray &data) {
Unpacker u(data);
diff --git a/daemon/watchconnector.h b/daemon/watchconnector.h
index f9576a3..518493b 100644
--- a/daemon/watchconnector.h
+++ b/daemon/watchconnector.h
@@ -150,14 +150,19 @@ public:
enum HardwareRevision {
UNKNOWN = 0,
- PEBBLE_ONE_EV1 = 1,
- PEBBLE_ONE_EV2 = 2,
- PEBBLE_ONE_EV2_3 = 3,
- PEBBLE_ONE_EV2_4 = 4,
- PEBBLE_ONE_POINT_FIVE = 5,
- PEBBLE_TWO_POINT_ZERO = 6,
- PEBBLE_ONE_BIGBOARD_2 = 254,
- PEBBLE_ONE_BIGBOARD = 255
+ TINTIN_EV1 = 1,
+ TINTIN_EV2 = 2,
+ TINTIN_EV2_3 = 3,
+ TINTIN_EV2_4 = 4,
+ TINTIN_V1_5 = 5,
+ BIANCA = 6,
+ SNOWY_EVT2 = 7,
+ SNOWY_DVT = 8,
+
+ TINTIN_BB = 0xFF,
+ TINTIN_BB2 = 0xFE,
+ SNOWY_BB = 0xFD,
+ SNOWY_BB2 = 0xFC
};
QMap firmwareMapping;
--
cgit v1.2.3
From 882b7b9327edb3dd73fa3e82eba83c0405f91b83 Mon Sep 17 00:00:00 2001
From: Tomasz Sterna
Date: Tue, 9 Jun 2015 16:14:42 +0200
Subject: Handle multiple paired Pebbles
Moved Pebble discovery to WatchConnector.
Removed empty DBusConnector.
Minor firmware handling fixes.
---
app/pebblefirmware.cpp | 1 +
app/qml/pages/WatchInfo.qml | 10 +--
app/qml/pebble.qml | 2 +
app/translations/pebble-es.ts | 2 +
app/translations/pebble-pl.ts | 2 +
app/translations/pebble-zh_CN.ts | 2 +
app/translations/pebble.ts | 2 +
daemon/daemon.pro | 2 -
daemon/dbusconnector.cpp | 77 -----------------------
daemon/dbusconnector.h | 31 ---------
daemon/manager.cpp | 22 +------
daemon/manager.h | 17 ++---
daemon/watchconnector.cpp | 132 +++++++++++++++++++++++++++++----------
daemon/watchconnector.h | 22 +++----
14 files changed, 133 insertions(+), 191 deletions(-)
delete mode 100644 daemon/dbusconnector.cpp
delete mode 100644 daemon/dbusconnector.h
diff --git a/app/pebblefirmware.cpp b/app/pebblefirmware.cpp
index 4e0fc08..33460e5 100644
--- a/app/pebblefirmware.cpp
+++ b/app/pebblefirmware.cpp
@@ -18,6 +18,7 @@ void PebbleFirmware::updateLatest(QString hw)
QNetworkRequest req;
req.setUrl(firmwareURL.arg(hw).arg(hw.startsWith("snowy_") ? "release-v3" : "release-v2"));
req.setRawHeader("Cache-Control", "no-cache");
+ qDebug() << "Getting latest firmware" << req.url();
nm->get(req);
}
diff --git a/app/qml/pages/WatchInfo.qml b/app/qml/pages/WatchInfo.qml
index af4a740..a1c421c 100644
--- a/app/qml/pages/WatchInfo.qml
+++ b/app/qml/pages/WatchInfo.qml
@@ -28,7 +28,7 @@ Page {
text: qsTr("Address")
}
Label {
- text: pebbled.info.address
+ text: pebbled.info.address || ""
}
Label {
@@ -36,7 +36,7 @@ Page {
text: qsTr("Serial Number")
}
Label {
- text: pebbled.info.serial
+ text: pebbled.info.serial || ""
}
Label {
@@ -69,7 +69,7 @@ Page {
text: qsTr("Recovery")
}
Label {
- text: app.recoveryVersion
+ text: app.recoveryVersion || qsTr("unknown")
}
Label {
@@ -77,7 +77,7 @@ Page {
text: qsTr("Running")
}
Label {
- text: app.firmwareVersion
+ text: app.firmwareVersion || qsTr("unknown")
}
Label {
@@ -89,7 +89,7 @@ Page {
}
}
Button {
- visible: app.firmwareLatest && app.firmwareVersion && app.firmwareVersion !== app.firmwareLatest
+ visible: app.firmwareLatest && app.firmwareVersion !== app.firmwareLatest
text: qsTr("Upgrade Firmware")
anchors {
left: parent.left
diff --git a/app/qml/pebble.qml b/app/qml/pebble.qml
index 380ff7e..0643f79 100644
--- a/app/qml/pebble.qml
+++ b/app/qml/pebble.qml
@@ -22,6 +22,8 @@ ApplicationWindow
recoveryVersion = firmware.version
} else {
firmwareVersion = firmware.version
+ }
+ if (firmware.hardware) {
hardwareVersion = firmware.hardware
}
})
diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts
index 28ddd18..8ca8b7f 100644
--- a/app/translations/pebble-es.ts
+++ b/app/translations/pebble-es.ts
@@ -425,6 +425,8 @@ Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente.
+
+
unknown
diff --git a/app/translations/pebble-pl.ts b/app/translations/pebble-pl.ts
index 4e11b08..8d431d8 100644
--- a/app/translations/pebble-pl.ts
+++ b/app/translations/pebble-pl.ts
@@ -453,6 +453,8 @@ Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany
Najnowszy
+
+
unknown
nie wiadomo
diff --git a/app/translations/pebble-zh_CN.ts b/app/translations/pebble-zh_CN.ts
index 092ce00..655d162 100644
--- a/app/translations/pebble-zh_CN.ts
+++ b/app/translations/pebble-zh_CN.ts
@@ -405,6 +405,8 @@ If it can't be found please check it's available and paired in Bluetoo
最新
+
+
unknown
未知
diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts
index 843ceef..0479dc1 100644
--- a/app/translations/pebble.ts
+++ b/app/translations/pebble.ts
@@ -404,6 +404,8 @@ If it can't be found please check it's available and paired in Bluetoo
+
+
unknown
diff --git a/daemon/daemon.pro b/daemon/daemon.pro
index 40d3290..4520b57 100644
--- a/daemon/daemon.pro
+++ b/daemon/daemon.pro
@@ -16,7 +16,6 @@ SOURCES += \
voicecallhandler.cpp \
notificationmanager.cpp \
watchconnector.cpp \
- dbusconnector.cpp \
appmanager.cpp \
musicmanager.cpp \
datalogmanager.cpp \
@@ -36,7 +35,6 @@ HEADERS += \
voicecallhandler.h \
notificationmanager.h \
watchconnector.h \
- dbusconnector.h \
settings.h \
appmanager.h \
musicmanager.h \
diff --git a/daemon/dbusconnector.cpp b/daemon/dbusconnector.cpp
deleted file mode 100644
index ccc127d..0000000
--- a/daemon/dbusconnector.cpp
+++ /dev/null
@@ -1,77 +0,0 @@
-#include "dbusconnector.h"
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-//dbus-send --system --dest=org.bluez --print-reply / org.bluez.Manager.ListAdapters
-//dbus-send --system --dest=org.bluez --print-reply $path org.bluez.Adapter.GetProperties
-//dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Device.GetProperties
-//dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Input.Connect
-
-DBusConnector::DBusConnector(QObject *parent) :
- QObject(parent), l(metaObject()->className())
-{}
-
-bool DBusConnector::findPebble()
-{
- QDBusConnection system = QDBusConnection::systemBus();
-
- QDBusReply> ListAdaptersReply = system.call(
- QDBusMessage::createMethodCall("org.bluez", "/", "org.bluez.Manager",
- "ListAdapters"));
- if (not ListAdaptersReply.isValid()) {
- qCCritical(l) << ListAdaptersReply.error().message();
- return false;
- }
-
- QList adapters = ListAdaptersReply.value();
-
- if (adapters.isEmpty()) {
- qCDebug(l) << "No BT adapters found";
- return false;
- }
-
- QDBusReply AdapterPropertiesReply = system.call(
- QDBusMessage::createMethodCall("org.bluez", adapters[0].path(), "org.bluez.Adapter",
- "GetProperties"));
- if (not AdapterPropertiesReply.isValid()) {
- qCCritical(l) << AdapterPropertiesReply.error().message();
- return false;
- }
-
- QList devices;
- AdapterPropertiesReply.value()["Devices"].value() >> devices;
-
- foreach (QDBusObjectPath path, devices) {
- QDBusReply DevicePropertiesReply = system.call(
- QDBusMessage::createMethodCall("org.bluez", path.path(), "org.bluez.Device",
- "GetProperties"));
- if (not DevicePropertiesReply.isValid()) {
- qCCritical(l) << DevicePropertiesReply.error().message();
- continue;
- }
-
- const QVariantMap &dict = DevicePropertiesReply.value();
-
- QString tmp = dict["Name"].toString();
- qCDebug(l) << "Found BT device:" << tmp;
- if (tmp.startsWith("Pebble")) {
- qCDebug(l) << "Found Pebble:" << tmp;
- QBluetoothAddress addr(dict["Address"].toString());
- QBluetoothLocalDevice dev;
- if (dev.pairingStatus(addr) == QBluetoothLocalDevice::AuthorizedPaired) {
- pebbleProps = dict;
- emit pebbleChanged();
- return true;
- }
- }
- }
-
- return false;
-}
diff --git a/daemon/dbusconnector.h b/daemon/dbusconnector.h
deleted file mode 100644
index 6b48f99..0000000
--- a/daemon/dbusconnector.h
+++ /dev/null
@@ -1,31 +0,0 @@
-#ifndef DBUSCONNECTOR_H
-#define DBUSCONNECTOR_H
-
-#include
-#include
-#include
-#include
-
-// TODO Remove this.
-
-class DBusConnector : public QObject
-{
- Q_OBJECT
- QLoggingCategory l;
-
- Q_PROPERTY(QVariantMap pebble READ pebble NOTIFY pebbleChanged)
- QVariantMap pebbleProps;
-
-public:
- explicit DBusConnector(QObject *parent = 0);
-
- QVariantMap pebble() const { return pebbleProps; }
-
-signals:
- void pebbleChanged();
-
-public slots:
- bool findPebble();
-};
-
-#endif // DBUSCONNECTOR_H
diff --git a/daemon/manager.cpp b/daemon/manager.cpp
index 93b6b13..179d05e 100644
--- a/daemon/manager.cpp
+++ b/daemon/manager.cpp
@@ -10,7 +10,6 @@ Manager::Manager(Settings *settings, QObject *parent) :
QObject(parent), l(metaObject()->className()), settings(settings),
proxy(new PebbledProxy(this)),
watch(new WatchConnector(this)),
- dbus(new DBusConnector(this)),
upload(new UploadManager(watch, this)),
apps(new AppManager(this)),
bank(new BankManager(watch, upload, apps, this)),
@@ -67,8 +66,8 @@ Manager::Manager(Settings *settings, QObject *parent) :
session.registerObject("/org/pebbled/Watch", proxy);
session.registerService("org.pebbled");
- connect(dbus, &DBusConnector::pebbleChanged, proxy, &PebbledProxy::NameChanged);
- connect(dbus, &DBusConnector::pebbleChanged, proxy, &PebbledProxy::AddressChanged);
+ connect(watch, &WatchConnector::pebbleChanged, proxy, &PebbledProxy::NameChanged);
+ connect(watch, &WatchConnector::pebbleChanged, proxy, &PebbledProxy::AddressChanged);
connect(watch, &WatchConnector::connectedChanged, proxy, &PebbledProxy::ConnectedChanged);
connect(watch, &WatchConnector::versionsChanged, proxy, &PebbledProxy::InfoChanged);
connect(bank, &BankManager::slotsChanged, proxy, &PebbledProxy::AppSlotsChanged);
@@ -79,11 +78,7 @@ Manager::Manager(Settings *settings, QObject *parent) :
// Set BT icon for notification
notification.setImage("icon-system-bluetooth-device");
- if (btDevice.isValid()) {
- qCDebug(l) << "BT local name:" << btDevice.name();
- connect(dbus, SIGNAL(pebbleChanged()), SLOT(onPebbleChanged()));
- dbus->findPebble();
- }
+ watch->findPebbles();
}
Manager::~Manager()
@@ -100,17 +95,6 @@ void Manager::onSettingsChanged()
qCWarning(l) << __FUNCTION__ << "Not implemented!";
}
-void Manager::onPebbleChanged()
-{
- const QVariantMap & pebble = dbus->pebble();
- QString name = pebble["Name"].toString();
- if (name.isEmpty()) {
- qCDebug(l) << "Pebble gone";
- } else {
- watch->deviceConnect(name, pebble["Address"].toString());
- }
-}
-
void Manager::onConnectedChanged()
{
QString message = QString("%1 %2")
diff --git a/daemon/manager.h b/daemon/manager.h
index 2079de0..a605ed1 100644
--- a/daemon/manager.h
+++ b/daemon/manager.h
@@ -2,7 +2,6 @@
#define MANAGER_H
#include "watchconnector.h"
-#include "dbusconnector.h"
#include "uploadmanager.h"
#include "voicecallmanager.h"
#include "notificationmanager.h"
@@ -15,7 +14,6 @@
#include "settings.h"
#include
-#include
#include
#include
#include
@@ -35,14 +33,11 @@ class Manager : public QObject, protected QDBusContext
friend class PebbledProxy;
- QBluetoothLocalDevice btDevice;
-
Settings *settings;
PebbledProxy *proxy;
WatchConnector *watch;
- DBusConnector *dbus;
UploadManager *upload;
AppManager *apps;
BankManager *bank;
@@ -79,7 +74,6 @@ public slots:
private slots:
void onSettingChanged(const QString &key);
void onSettingsChanged();
- void onPebbleChanged();
void onConnectedChanged();
void onActiveVoiceCallChanged();
void onVoiceError(const QString &message);
@@ -113,16 +107,15 @@ class PebbledProxy : public QObject, protected QDBusContext
Q_PROPERTY(QVariantList AllApps READ AllApps NOTIFY AllAppsChanged)
inline Manager* manager() const { return static_cast(parent()); }
- inline QVariantMap pebble() const { return manager()->dbus->pebble(); }
public:
inline explicit PebbledProxy(QObject *parent)
: QObject(parent), l(metaObject()->className()) {}
- inline QString Name() const { return pebble()["Name"].toString(); }
- inline QString Address() const { return pebble()["Address"].toString(); }
- inline QVariantMap Info() const { return manager()->watch->versions().toMap(); }
- inline bool Connected() const { return manager()->watch->isConnected(); }
+ inline QString Name() const { qCDebug(l) << manager()->watch->name(); return manager()->watch->name(); }
+ inline QString Address() const { qCDebug(l) << manager()->watch->address().toString(); return manager()->watch->address().toString(); }
+ inline QVariantMap Info() const { qCDebug(l) << manager()->watch->versions().toMap(); return manager()->watch->versions().toMap(); }
+ inline bool Connected() const { qCDebug(l) << manager()->watch->isConnected(); return manager()->watch->isConnected(); }
inline QString AppUuid() const { return manager()->currentAppUuid.toString(); }
QStringList AppSlots() const;
@@ -131,7 +124,7 @@ public:
public slots:
inline void Disconnect() { manager()->watch->disconnect(); }
- inline void Reconnect() { manager()->watch->reconnect(); }
+ inline void Reconnect() { manager()->watch->connect(); }
inline void Ping(uint val) { manager()->watch->ping(val); }
inline void SyncTime() { manager()->watch->time(); }
diff --git a/daemon/watchconnector.cpp b/daemon/watchconnector.cpp
index d9cdd67..09006c0 100644
--- a/daemon/watchconnector.cpp
+++ b/daemon/watchconnector.cpp
@@ -1,6 +1,12 @@
#include
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
#include "unpacker.h"
#include "watchconnector.h"
@@ -64,12 +70,13 @@ bool WatchConnector::WatchVersions::isEmpty() const
}
WatchConnector::WatchConnector(QObject *parent) :
- QObject(parent), l(metaObject()->className()), socket(nullptr), is_connected(false)
+ QObject(parent), l(metaObject()->className()),
+ socket(nullptr), is_connected(false), currentPebble(0), _last_address(0)
{
reconnectTimer.setSingleShot(true);
- connect(&reconnectTimer, SIGNAL(timeout()), SLOT(reconnect()));
+ QObject::connect(&reconnectTimer, SIGNAL(timeout()), SLOT(connect()));
timeSyncTimer.setSingleShot(true);
- connect(&timeSyncTimer, SIGNAL(timeout()), SLOT(time()));
+ QObject::connect(&timeSyncTimer, SIGNAL(timeout()), SLOT(time()));
timeSyncTimer.setInterval(4 * 60 * 60 * 1000); // sync time every 4 hours
firmwareMapping.insert(UNKNOWN, "unknown");
@@ -128,28 +135,71 @@ WatchConnector::~WatchConnector()
{
}
-void WatchConnector::deviceDiscovered(const QBluetoothDeviceInfo &device)
+//dbus-send --system --dest=org.bluez --print-reply / org.bluez.Manager.ListAdapters
+//dbus-send --system --dest=org.bluez --print-reply $path org.bluez.Adapter.GetProperties
+//dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Device.GetProperties
+//dbus-send --system --dest=org.bluez --print-reply $devpath org.bluez.Input.Connect
+bool WatchConnector::findPebbles()
{
- //FIXME TODO: Configurable
- if (device.name().startsWith("Pebble")) {
- qCDebug(l) << "Found Pebble:" << device.name() << '(' << device.address().toString() << ')';
- handleWatch(device.name(), device.address().toString());
- } else {
- qCDebug(l) << "Found other device:" << device.name() << '(' << device.address().toString() << ')';
+ pebbles.clear();
+ currentPebble = 0;
+
+ QDBusConnection system = QDBusConnection::systemBus();
+
+ QDBusReply> ListAdaptersReply = system.call(
+ QDBusMessage::createMethodCall("org.bluez", "/", "org.bluez.Manager",
+ "ListAdapters"));
+ if (not ListAdaptersReply.isValid()) {
+ qCCritical(l) << ListAdaptersReply.error().message();
+ return false;
}
-}
-void WatchConnector::deviceConnect(const QString &name, const QString &address)
-{
- if (name.startsWith("Pebble")) handleWatch(name, address);
-}
+ QList adapters = ListAdaptersReply.value();
-void WatchConnector::reconnect()
-{
- qCDebug(l) << "reconnect" << _last_name;
- if (!_last_name.isEmpty() && !_last_address.isEmpty()) {
- deviceConnect(_last_name, _last_address);
+ if (adapters.isEmpty()) {
+ qCDebug(l) << "No BT adapters found";
+ return false;
+ }
+
+ QDBusReply AdapterPropertiesReply = system.call(
+ QDBusMessage::createMethodCall("org.bluez", adapters[0].path(), "org.bluez.Adapter",
+ "GetProperties"));
+ if (not AdapterPropertiesReply.isValid()) {
+ qCCritical(l) << AdapterPropertiesReply.error().message();
+ return false;
+ }
+
+ QList devices;
+ AdapterPropertiesReply.value()["Devices"].value() >> devices;
+
+ foreach (QDBusObjectPath path, devices) {
+ QDBusReply DevicePropertiesReply = system.call(
+ QDBusMessage::createMethodCall("org.bluez", path.path(), "org.bluez.Device",
+ "GetProperties"));
+ if (not DevicePropertiesReply.isValid()) {
+ qCCritical(l) << DevicePropertiesReply.error().message();
+ continue;
+ }
+
+ const QVariantMap &dict = DevicePropertiesReply.value();
+
+ QString tmp = dict["Name"].toString();
+ qCDebug(l) << "Found BT device:" << tmp;
+ if (tmp.startsWith("Pebble")) {
+ qCDebug(l) << "Found Pebble:" << tmp;
+ QBluetoothAddress addr(dict["Address"].toString());
+ QBluetoothLocalDevice dev;
+ if (dev.pairingStatus(addr) == QBluetoothLocalDevice::AuthorizedPaired) {
+ pebbles.insert(dict["Name"].toString(), addr);
+ }
+ }
}
+
+ if (pebbles.size()) {
+ scheduleReconnect();
+ }
+
+ return true;
}
void WatchConnector::disconnect()
@@ -162,11 +212,23 @@ void WatchConnector::disconnect()
qCDebug(l) << "stopped timers";
}
-void WatchConnector::handleWatch(const QString &name, const QString &address)
+void WatchConnector::connect()
{
- qCDebug(l) << "handleWatch" << name << address;
+ if (currentPebble >= pebbles.count()) {
+ currentPebble = 0;
+ }
+
+ QString _name = pebbles.keys().at(currentPebble);
+ QBluetoothAddress _address = pebbles.value(_name);
+
+ qCDebug(l) << "connect watch" << currentPebble << _name << _address.toString();
reconnectTimer.stop();
+ if (_address.isNull()) {
+ qCWarning(l) << "No known pebble";
+ return;
+ }
+
// Check if bluetooth is on
QBluetoothLocalDevice host;
bool btOff = host.hostMode() == QBluetoothLocalDevice::HostPoweredOff;
@@ -181,20 +243,18 @@ void WatchConnector::handleWatch(const QString &name, const QString &address)
socket->deleteLater();
}
- _last_name = name;
- _last_address = address;
_versions.clear();
qCDebug(l) << "Creating socket";
socket = new QBluetoothSocket(QBluetoothServiceInfo::RfcommProtocol);
- connect(socket, SIGNAL(readyRead()), SLOT(onReadSocket()));
- connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(onBytesWritten(qint64)));
- connect(socket, SIGNAL(connected()), SLOT(onConnected()));
- connect(socket, SIGNAL(disconnected()), SLOT(onDisconnected()));
- connect(socket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(onError(QBluetoothSocket::SocketError)));
+ QObject::connect(socket, SIGNAL(readyRead()), SLOT(onReadSocket()));
+ QObject::connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(onBytesWritten(qint64)));
+ QObject::connect(socket, SIGNAL(connected()), SLOT(onConnected()));
+ QObject::connect(socket, SIGNAL(disconnected()), SLOT(onDisconnected()));
+ QObject::connect(socket, SIGNAL(error(QBluetoothSocket::SocketError)), this, SLOT(onError(QBluetoothSocket::SocketError)));
// FIXME: Assuming port 1 (with Pebble)
- socket->connectToService(QBluetoothAddress(address), 1);
+ socket->connectToService(_address, 1);
}
QString WatchConnector::decodeEndpoint(uint val)
@@ -319,7 +379,9 @@ void WatchConnector::onConnected()
}
sendMessage(watchVERSION, QByteArray(1, 0));
emit connectedChanged();
- if (name() != _last_name) emit nameChanged();
+ quint64 new_address = address().toUInt64();
+ if (new_address != _last_address) emit pebbleChanged();
+ _last_address = new_address;
time();
}
}
@@ -358,7 +420,11 @@ void WatchConnector::scheduleReconnect()
void WatchConnector::onError(QBluetoothSocket::SocketError error)
{
if (error == QBluetoothSocket::UnknownSocketError) {
- qCDebug(l) << error << socket->errorString();
+ QString errorString = socket->errorString();
+ qCDebug(l) << error << errorString;
+ if (errorString.endsWith(" down")) {
+ currentPebble++;
+ }
} else {
qCCritical(l) << "error connecting Pebble:" << error << socket->errorString();
}
@@ -369,7 +435,7 @@ void WatchConnector::sendData(const QByteArray &data)
writeData.append(data);
if (socket == nullptr) {
qCDebug(l) << "no socket - reconnecting";
- reconnect();
+ connect();
} else if (is_connected) {
qCDebug(l) << "writing" << data.length() << "bytes to socket";
if (PROTOCOL_DEBUG) qCDebug(l) << data.toHex();
diff --git a/daemon/watchconnector.h b/daemon/watchconnector.h
index 518493b..fa65f6b 100644
--- a/daemon/watchconnector.h
+++ b/daemon/watchconnector.h
@@ -8,10 +8,8 @@
#include
#include
#include
-#include
-#include
#include
-#include
+#include
#include
class WatchConnector : public QObject
@@ -21,7 +19,7 @@ class WatchConnector : public QObject
Q_ENUMS(Endpoint)
- Q_PROPERTY(QString name READ name NOTIFY nameChanged)
+ Q_PROPERTY(QString name READ name NOTIFY pebbleChanged)
Q_PROPERTY(QString connected READ isConnected NOTIFY connectedChanged)
public:
@@ -205,7 +203,8 @@ public:
virtual ~WatchConnector();
inline bool isConnected() const { return is_connected; }
- inline QString name() const { return socket != nullptr ? socket->peerName() : ""; }
+ inline QString name() const { return pebbles.keys(address()).at(0); }
+ inline QBluetoothAddress address() const { return socket != nullptr ? socket->peerAddress() : QBluetoothAddress(); }
inline WatchVersions versions() const { return _versions; }
void setEndpointHandler(uint endpoint, const EndpointHandlerFunc &func);
@@ -215,15 +214,15 @@ public:
static QString decodeEndpoint(uint val);
signals:
- void nameChanged();
+ void pebbleChanged();
void versionsChanged();
void connectedChanged();
public slots:
- void deviceConnect(const QString &name, const QString &address);
+ bool findPebbles();
void scheduleReconnect();
+ void connect();
void disconnect();
- void reconnect();
void sendMessage(uint endpoint, const QByteArray &data, const EndpointHandlerFunc &callback = EndpointHandlerFunc());
void ping(uint cookie);
@@ -248,8 +247,6 @@ public slots:
void endPhoneCall(uint cookie=0);
private slots:
- void deviceDiscovered(const QBluetoothDeviceInfo&);
- void handleWatch(const QString &name, const QString &address);
void onReadSocket();
void onBytesWritten(qint64);
void onConnected();
@@ -267,8 +264,9 @@ private:
QByteArray writeData;
QTimer reconnectTimer;
QTimer timeSyncTimer;
- QString _last_name;
- QString _last_address;
+ QMap pebbles;
+ int currentPebble;
+ quint64 _last_address;
WatchVersions _versions;
};
--
cgit v1.2.3