From 3f64297af4e7a070b4f62ebf3f17105ee6b0a3a8 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Thu, 30 Apr 2015 16:33:09 +0200 Subject: Implemented profile changes on watch (dis)connection --- app/qml/pages/ManagerPage.qml | 82 +++++++++++++++++++++++---- app/translations/pebble-es.ts | 125 +++++++++++++++++++++++------------------ app/translations/pebble-pl.ts | 126 +++++++++++++++++++++++++++--------------- app/translations/pebble.ts | 117 +++++++++++++++++++++------------------ 4 files changed, 284 insertions(+), 166 deletions(-) (limited to 'app') diff --git a/app/qml/pages/ManagerPage.qml b/app/qml/pages/ManagerPage.qml index 7fb7369..b989c64 100644 --- a/app/qml/pages/ManagerPage.qml +++ b/app/qml/pages/ManagerPage.qml @@ -2,6 +2,7 @@ import QtQuick 2.0 import QtQml 2.1 import Sailfish.Silica 1.0 import org.nemomobile.configuration 1.0 +import org.nemomobile.dbus 2.0 Page { id: page @@ -9,7 +10,8 @@ Page { ConfigurationGroup { id: settings path: "/org/pebbled/settings" - property bool silentWhenConnected: false + property string profileWhenConnected: "" + property string profileWhenDisconnected: "" property bool transliterateMessage: false property bool useSystemVolume: true property bool incomingCallNotification: true @@ -23,6 +25,25 @@ Page { property bool notificationsAll: false } + DBusInterface { + id: profiled + + service: 'com.nokia.profiled' + iface: 'com.nokia.profiled' + path: '/com/nokia/profiled' + + property var profiles + } + + Component.onCompleted: { + profiled.typedCall('get_profiles', [], function (result) { + console.log('Got profiles: ' + result); + profiled.profiles = result; + }); + } + + + SilicaFlickable { id: flickable anchors.fill: parent @@ -124,15 +145,6 @@ Page { settings.incomingCallNotification = !settings.incomingCallNotification; } } - TextSwitch { - text: qsTr("Silent when connected") - description: qsTr("Sets phone profile to \"silent\" when Pebble is connected") - checked: settings.silentWhenConnected - automaticCheck: false - onClicked: { - settings.silentWhenConnected = !settings.silentWhenConnected; - } - } TextSwitch { text: qsTr("Control main volume") description: qsTr("Pebble music volume buttons change the main phone volume directly instead of through the music player.") @@ -234,6 +246,56 @@ Page { settings.notificationsAll = !settings.notificationsAll; } } + + Label { + text: qsTr("Profiles") + font.family: Theme.fontFamilyHeading + color: Theme.highlightColor + anchors.right: parent.right + anchors.rightMargin: Theme.paddingMedium + } + + ComboBox { + label: qsTr("Connected") + menu: ContextMenu { + MenuItem { + text: qsTr("no change") + font.capitalization: Font.SmallCaps + } + Repeater { + model: profiled.profiles + delegate: MenuItem { + text: modelData + down: modelData === settings.profileWhenConnected + } + } + } + value: settings.profileWhenConnected || qsTr("no change") + onCurrentIndexChanged: { + settings.profileWhenConnected = currentIndex ? currentItem.text : "" + } + } + + ComboBox { + label: qsTr("Disconnected") + menu: ContextMenu { + MenuItem { + text: qsTr("no change") + font.capitalization: Font.SmallCaps + } + Repeater { + model: profiled.profiles + delegate: MenuItem { + text: modelData + down: modelData === settings.profileWhenDisconnected + } + } + } + value: settings.profileWhenDisconnected || qsTr("no change") + onCurrentIndexChanged: { + settings.profileWhenDisconnected = currentIndex ? currentItem.text : "" + } + } } } } diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index fa2c566..bbe2e61 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -65,32 +65,47 @@ AppStorePage - + Logout - + + Logging out... + + + + + Hide search + + + + + Show search + + + + Pebble Appstore - - WatchApps + + Apps - - WatchFaces + + Faces - + Downloading... - + Downloading %1... @@ -149,19 +164,6 @@ ¿Errores? - - FirmwareUpgrade - - - Firmware upgrade - - - - - Begin upgrade - - - InstallAppDialog @@ -192,164 +194,177 @@ ManagerPage - + Pebble Appstore - + About Acerca de - + Pebble Manager - + Waiting for watch... If it can't be found please check it's available and paired in Bluetooth settings. Buscando el reloj Si esto tarda mucho, comprueba que el reloj esté emparejado correctamente. - + Service Servicio - + Enabled Habilitado - + Automatic startup Inicio automático - + Manual startup Inicio manual - + Active Activo - + Running Ejecutándose - + Dead Detenido - + Connection Conexión - + + Connected Conectado - + + Disconnected Desconectado - + Settings Configuración - + Forward phone calls Transferir llamadas - + + Profiles + + + + + + + + no change + + + Silent when connected - Modo silencio automático + Modo silencio automático - Sets phone profile to "silent" when Pebble is connected - Activa el modo silencio cuando se conecte un Pebble + Activa el modo silencio cuando se conecte un Pebble - + Control main volume - + Pebble music volume buttons change the main phone volume directly instead of through the music player. - + Transliterate messages Transliterar mensajes - + Messages are transliterated to ASCII before sending to Pebble Codifica los mensajes entrates a ASCII antes de enviarlos a Pebble - + Notifications Notificaciones - + Messaging Mensajería - + SMS and IM SMS y chat - + Missed call Llamadas perdidas - + Emails Correos electrónicos - + Mitakuuluu - + Twitter Twitter - + Facebook Facebook - + Other notifications Resto de notificaciones - + All notifications Todas las notificaciones diff --git a/app/translations/pebble-pl.ts b/app/translations/pebble-pl.ts index 407c5e9..7163310 100644 --- a/app/translations/pebble-pl.ts +++ b/app/translations/pebble-pl.ts @@ -65,32 +65,55 @@ AppStorePage - + Logout Wyloguj - + + Logging out... + + + + + Hide search + + + + + Show search + + + + Pebble Appstore Pebble Appstore - + + Apps + + + + + Faces + + + WatchApps - Aplikacje + Aplikacje - WatchFaces - Cyferblaty + Cyferblaty - + Downloading... Pobieranie... - + Downloading %1... Pobieranie %1... @@ -176,14 +199,12 @@ FirmwareUpgrade - Firmware upgrade - Aktualizacja firmware + Aktualizacja firmware - Begin upgrade - Rozpocznij aktualizację + Rozpocznij aktualizację @@ -212,164 +233,177 @@ ManagerPage - + Pebble Appstore Pebble Appstore - + About Informacje - + Pebble Manager Pebble Manager - + Waiting for watch... If it can't be found please check it's available and paired in Bluetooth settings. Oczekiwanie na zegarek... Jeśli nie zostaje znaleziony sprawdź czy jest w zasięgu i czy jest sparowany w ustawieniach Bluetooth. - + Service Usługa - + Enabled Włączona - + Automatic startup Start automatyczny - + Manual startup Start ręczny - + Active Aktywna - + Running Pracuje - + Dead Martwa - + Connection Połączenie - + + Connected Połączony - + + Disconnected Rozłączony - + Settings Ustawienia - + Forward phone calls Przekazuj telefony - + + Profiles + + + + + + + + no change + + + Silent when connected - Cichy gdy połączony + Cichy gdy połączony - Sets phone profile to "silent" when Pebble is connected - Ustawia "cichy" profil telefonu gdy Pebble jest połączony + Ustawia "cichy" profil telefonu gdy Pebble jest połączony - + Control main volume Steruj głośnością główną - + Pebble music volume buttons change the main phone volume directly instead of through the music player. Guziki zmiany głośności na Pebble będą zmieniać głośność bezpośrednio, a nie za pomocą odtwarzacza muzyki. - + Transliterate messages Transliteracja wiadomości - + Messages are transliterated to ASCII before sending to Pebble Wiadomości są transliterowane do ASCII przed wysłaniem do Pebble - + Notifications Powiadomienia - + Messaging Wiadomości - + SMS and IM SMS i IM - + Missed call Ominięte telefony - + Emails Emaile - + Mitakuuluu Mitakuuluu - + Twitter Twitter - + Facebook Facebook - + Other notifications Pozostałe powiadomienia - + All notifications Wszystkie powiadomienia diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts index f1679e1..755956e 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -65,32 +65,47 @@ AppStorePage - + Logout - + + Logging out... + + + + + Hide search + + + + + Show search + + + + Pebble Appstore - - WatchApps + + Apps - - WatchFaces + + Faces - + Downloading... - + Downloading %1... @@ -141,19 +156,6 @@ - - FirmwareUpgrade - - - Firmware upgrade - - - - - Begin upgrade - - - InstallAppDialog @@ -180,163 +182,168 @@ ManagerPage - + Pebble Appstore - + About - + Pebble Manager - + 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 - - Silent when connected + + Profiles - - Sets phone profile to "silent" when Pebble is connected + + + + + no change - + Control main volume - + Pebble music volume buttons change the main phone volume directly instead of through the music player. - + Transliterate messages - + Messages are transliterated to ASCII before sending to Pebble - + Notifications - + Messaging - + SMS and IM - + Missed call - + Emails - + Mitakuuluu - + Twitter - + Facebook - + Other notifications - + All notifications -- cgit v1.2.3