diff --git a/dialer/src/call-manager.cpp b/dialer/src/call-manager.cpp index aadca07b..8872108c 100644 --- a/dialer/src/call-manager.cpp +++ b/dialer/src/call-manager.cpp @@ -16,6 +16,9 @@ */ #include "call-manager.h" #include "dialerutils.h" + +#include +#include // #include "call-window.h" // #include "approver.h" // #include "../libktpcall/call-channel-handler.h" @@ -30,6 +33,9 @@ struct CallManager::Private // QPointer callWindow; // QPointer approver; DialerUtils *dialerUtils; + KNotification *ringingNotification; + KNotification *callsNotification; + uint missedCalls; }; CallManager::CallManager(const Tp::CallChannelPtr &callChannel, DialerUtils *dialerUtils, QObject *parent) @@ -107,6 +113,11 @@ void CallManager::onCallStateChanged(Tp::CallState state) //show approver; (void) d->callChannel->setRinging(); + if (!d->ringingNotification) { + d->ringingNotification = new KNotification("ringing", KNotification::Persistent | KNotification::LoopSound, 0); + d->ringingNotification->setComponentName("plasma_dialer"); + } + d->ringingNotification->sendEvent(); } break; case Tp::CallStateAccepted: @@ -117,6 +128,9 @@ void CallManager::onCallStateChanged(Tp::CallState state) // d->callWindow.data()->setStatus(CallWindow::StatusRemoteAccepted); } else { //hide approver & show call window + if (d->ringingNotification) { + d->ringingNotification->close(); + } // delete d->approver.data(); // ensureCallWindow(); // d->callWindow.data()->setStatus(CallWindow::StatusConnecting); @@ -135,6 +149,9 @@ void CallManager::onCallStateChanged(Tp::CallState state) break; case Tp::CallStateEnded: d->dialerUtils->setCallState("ended"); + if (d->ringingNotification) { + d->ringingNotification->close(); + } //if we requested the call, make sure we have a window to show the error (if any) // if (d->callChannel->isRequested()) { // ensureCallWindow(); diff --git a/dialer/src/dialerutils.cpp b/dialer/src/dialerutils.cpp index 5b07c7bf..7146cf2e 100644 --- a/dialer/src/dialerutils.cpp +++ b/dialer/src/dialerutils.cpp @@ -126,20 +126,4 @@ void DialerUtils::resetMissedCalls() m_callsNotification.clear(); } -void DialerUtils::notifyRinging() -{ - if (!m_ringingNotification) { - m_ringingNotification = new KNotification("ringing", KNotification::Persistent, 0); - m_ringingNotification->setComponentName("plasma_dialer"); - } - m_ringingNotification->sendEvent(); -} - -void DialerUtils::stopRinging() -{ - if (m_ringingNotification) { - m_ringingNotification->close(); - } -} - #include "moc_dialerutils.cpp" diff --git a/dialer/src/dialerutils.h b/dialer/src/dialerutils.h index 6856eb98..b108c501 100644 --- a/dialer/src/dialerutils.h +++ b/dialer/src/dialerutils.h @@ -39,8 +39,6 @@ public: Q_INVOKABLE void notifyMissedCall(const QString &caller, const QString &description); Q_INVOKABLE void resetMissedCalls(); - Q_INVOKABLE void notifyRinging(); - Q_INVOKABLE void stopRinging(); Q_INVOKABLE void dial(const QString &number); Q_SIGNALS: