diff options
| author | Javier <dev.git@javispedro.com> | 2014-12-14 00:45:55 +0100 |
|---|---|---|
| committer | Javier <dev.git@javispedro.com> | 2014-12-14 00:45:55 +0100 |
| commit | df30ca18eebd2dfec03c589b607d45a5891cf2b2 (patch) | |
| tree | 2d916ddf017f299759e1c2e41d6861b3ee02be06 /app/pebbledinterface.h | |
| parent | 93ec9b745032b4e9c02756dd0361de3a364b6742 (diff) | |
add UI to install/remove apps from watch
Diffstat (limited to 'app/pebbledinterface.h')
| -rw-r--r-- | app/pebbledinterface.h | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/app/pebbledinterface.h b/app/pebbledinterface.h index f506e67..e468505 100644 --- a/app/pebbledinterface.h +++ b/app/pebbledinterface.h @@ -3,6 +3,8 @@ #include <QObject> #include <QUrl> +#include <QHash> +#include <QUuid> #include <QDBusInterface> class OrgPebbledWatchInterface; @@ -17,6 +19,9 @@ class PebbledInterface : public QObject Q_PROPERTY(QString address READ address NOTIFY addressChanged) Q_PROPERTY(QString appUuid READ appUuid NOTIFY appUuidChanged) + Q_PROPERTY(QStringList appSlots READ appSlots NOTIFY appSlotsChanged) + Q_PROPERTY(QVariantList allApps READ allApps NOTIFY allAppsChanged) + public: explicit PebbledInterface(QObject *parent = 0); @@ -27,6 +32,15 @@ public: QString address() const; QString appUuid() const; + QStringList appSlots() const; + QVariantList allApps() const; + + Q_INVOKABLE QVariantMap appInfoByUuid(const QString& uuid) const; + + Q_INVOKABLE QUrl configureApp(const QString &uuid); + + Q_INVOKABLE bool isAppInstalled(const QString &uuid); + signals: void enabledChanged(); void activeChanged(); @@ -34,6 +48,8 @@ signals: void nameChanged(); void addressChanged(); void appUuidChanged(); + void appSlotsChanged(); + void allAppsChanged(); public slots: void setEnabled(bool); @@ -43,18 +59,29 @@ public slots: void disconnect(); void reconnect(); - QUrl configureApp(const QString &uuid); void setAppConfiguration(const QString &uuid, const QString &data); + void launchApp(const QString &uuid); + void uploadApp(const QString &uuid, int slot); + void unloadApp(int slot); + private slots: + void onWatchConnectedChanged(); void getUnitProperties(); void onPropertiesChanged(QString interface, QMap<QString, QVariant> changed, QStringList invalidated); + void refreshAppSlots(); + void refreshAllApps(); private: QDBusInterface *systemd; OrgPebbledWatchInterface *watch; QDBusObjectPath unitPath; QVariantMap unitProperties; + + // Cached properties + QStringList _appSlots; + QVariantList _apps; + QHash<QUuid, int> _appsByUuid; }; #endif // PEBBLEDINTERFACE_H |
