Added a button to incoming call notifications to mute the phone ringing.
REVIEW: 121854
This commit is contained in:
parent
81a2855f30
commit
f6e7b04514
3 changed files with 15 additions and 2 deletions
|
@ -60,4 +60,4 @@ Comment[uk]=Показ сповіщень щодо дзвінків і SMS (ск
|
|||
Comment[x-test]=xxShow notifications for calls and SMS (answering coming soon)xx
|
||||
|
||||
X-KdeConnect-SupportedPackageType=kdeconnect.telephony
|
||||
X-KdeConnect-OutgoingPackageType=
|
||||
X-KdeConnect-OutgoingPackageType=kdeconnect.telephony
|
||||
|
|
|
@ -22,9 +22,9 @@
|
|||
|
||||
#include <KLocalizedString>
|
||||
#include <KIcon>
|
||||
|
||||
#include <core/kdebugnamespace.h>
|
||||
|
||||
|
||||
K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< TelephonyPlugin >(); )
|
||||
K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_telephony", "kdeconnect-plugins") )
|
||||
|
||||
|
@ -77,6 +77,11 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
|
|||
notification->setTitle(title);
|
||||
notification->setText(content);
|
||||
|
||||
if (event == "ringing") {
|
||||
notification->setActions( QStringList(i18n("Mute call")) );
|
||||
connect(notification, SIGNAL(action1Activated()), this, SLOT(sendMutePackage()));
|
||||
}
|
||||
|
||||
return notification;
|
||||
|
||||
}
|
||||
|
@ -99,3 +104,10 @@ bool TelephonyPlugin::receivePackage(const NetworkPackage& np)
|
|||
return true;
|
||||
|
||||
}
|
||||
|
||||
void TelephonyPlugin::sendMutePackage()
|
||||
{
|
||||
NetworkPackage package(PACKAGE_TYPE_TELEPHONY);
|
||||
package.set<QString>( "action", "mute" );
|
||||
sendPackage(package);
|
||||
}
|
||||
|
|
|
@ -40,6 +40,7 @@ public:
|
|||
public Q_SLOTS:
|
||||
virtual bool receivePackage(const NetworkPackage& np);
|
||||
virtual void connected() { }
|
||||
void sendMutePackage();
|
||||
|
||||
private:
|
||||
KNotification* createNotification(const NetworkPackage& np);
|
||||
|
|
Loading…
Reference in a new issue