Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added signal to DBus interface #70

Merged
merged 1 commit into from
Nov 22, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions rockworkd/dbusinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ DBusPebble::DBusPebble(Pebble *pebble, QObject *parent):
connect(pebble, &Pebble::voiceSessionStream, this, &DBusPebble::voiceSessionStream);
connect(pebble, &Pebble::voiceSessionDumped, this, &DBusPebble::voiceSessionDumped);
connect(pebble, &Pebble::voiceSessionClosed, this, &DBusPebble::voiceSessionClosed);
connect(pebble, &Pebble::appButtonPressed, this, &DBusPebble::AppButtonPressed);
}

QString DBusPebble::Address() const
Expand Down
2 changes: 2 additions & 0 deletions rockworkd/dbusinterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ class DBusPebble: public QObject
void voiceSessionDumped(const QString &dumpFile);
void voiceSessionClosed(const QString &dumpFIle);

void AppButtonPressed(const QString &uuid, const int &key);

public slots:
QString Address() const;
QString Name() const;
Expand Down
1 change: 1 addition & 0 deletions rockworkd/libpebble/appmsgmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ QVariantMap AppMsgManager::mapAppKeys(const QUuid &uuid, const WatchConnection::
data.insert(info.appKeys().key(it.key()), it.value());
} else {
qWarning() << "Unknown appKey value" << it.key() << "for app with GUID" << uuid;
emit appButtonPressed(uuid.toString(), it.key());
data.insert(QString::number(it.key()), it.value());
}
}
Expand Down
1 change: 1 addition & 0 deletions rockworkd/libpebble/appmsgmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public slots:
signals:
void appStarted(const QUuid &uuid);
void appStopped(const QUuid &uuid);
void appButtonPressed(const QString &uuid, const int &key);

private:
WatchConnection::Dict mapAppKeys(const QUuid &uuid, const QVariantMap &data);
Expand Down
6 changes: 6 additions & 0 deletions rockworkd/libpebble/pebble.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ Pebble::Pebble(const QBluetoothAddress &address, QObject *parent):
QObject::connect(m_jskitManager, &JSKitManager::openURL, this, &Pebble::openURL);
QObject::connect(m_jskitManager, &JSKitManager::appNotification, this, &Pebble::insertPin);
QObject::connect(m_appMsgManager, &AppMsgManager::appStarted, this, &Pebble::appStarted);
QObject::connect(m_appMsgManager, &AppMsgManager::appButtonPressed, this, &Pebble::onAppButtonPressed);

m_weatherApp = new WeatherApp(this, getWeatherLocations());
QObject::connect(m_weatherApp, &WeatherApp::locationsChanged, this, &Pebble::saveWeatherLocations);
Expand Down Expand Up @@ -1512,6 +1513,11 @@ void Pebble::appStarted(const QUuid &uuid)
}
}

void Pebble::onAppButtonPressed(const QString &uuid, const int &key)
{
emit appButtonPressed(uuid, key);
}

void Pebble::muteNotificationSource(const QString &source)
{
qDebug() << "Request to mute" << source;
Expand Down
4 changes: 4 additions & 0 deletions rockworkd/libpebble/pebble.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ private slots:

void slotUpdateAvailableChanged();

void onAppButtonPressed(const QString &uuid, const int &key);

signals:
void pebbleConnected();
void pebbleDisconnected();
Expand Down Expand Up @@ -239,6 +241,8 @@ private slots:
void devConServerStateChanged(bool state);
void devConCloudStateChanged(bool state);
void oauthTokenChanged(const QString &token);

void appButtonPressed(const QString &uuid, const int &key);
private:
void setHardwareRevision(HardwareRevision hardwareRevision);

Expand Down