diff --git a/src/gui/official/PhoneLine.cpp b/src/gui/official/PhoneLine.cpp index 0898f15f617b0528b70ba9641f58cb0a686e7d78..97c91c921fc6c39c82f37961d0c75283f4ab4670 100644 --- a/src/gui/official/PhoneLine.cpp +++ b/src/gui/official/PhoneLine.cpp @@ -50,6 +50,16 @@ PhoneLine::setLineStatus(const QString &status) void PhoneLine::setAction(const QString &status) +{ + mActionTimer->stop(); + mAction = status; + if(mSelected) { + emit actionChanged(mAction); + } +} + +void +PhoneLine::setTempAction(const QString &status) { mActionTimer->stop(); mActionTimer->start(3000); @@ -98,6 +108,7 @@ PhoneLine::select(bool hardselect) } else { setLineStatus("Ready."); + setAction(""); } } @@ -226,7 +237,7 @@ void PhoneLine::hold() { if(mCall) { - setAction("Holded."); + setAction("Holding..."); _debug("PhoneLine %d: Trying to Hold.\n", mLine); mCall->hold(); } diff --git a/src/gui/official/PhoneLine.hpp b/src/gui/official/PhoneLine.hpp index e874060de426a0e0db6f10bc80d4a65835f505c3..1fa152f5a3f30db8cf9c2ecd24130b9817def694 100644 --- a/src/gui/official/PhoneLine.hpp +++ b/src/gui/official/PhoneLine.hpp @@ -63,6 +63,7 @@ public: public slots: void setLineStatus(const QString &); void setAction(const QString &); + void setTempAction(const QString &); void resetAction(); void incomming(const Call &call); diff --git a/src/gui/official/SFLPhoneApp.cpp b/src/gui/official/SFLPhoneApp.cpp index 48ea876aabeb7d6d6e9a9ff7ae0235af208fa5b7..3286efabeccdde00e38ff3169b159db01ec25e9b 100644 --- a/src/gui/official/SFLPhoneApp.cpp +++ b/src/gui/official/SFLPhoneApp.cpp @@ -25,11 +25,11 @@ SFLPhoneApp::SFLPhoneApp(int argc, char **argv) Requester::instance().registerObject< PermanentRequest >(QString("answer")); Requester::instance().registerObject< PermanentRequest >(QString("notavailable")); Requester::instance().registerObject< PermanentRequest >(QString("refuse")); - Requester::instance().registerObject< TemporaryRequest >(QString("senddtmf")); Requester::instance().registerObject< PermanentRequest >(QString("call")); + Requester::instance().registerObject< PermanentRequest >(QString("hangup")); Requester::instance().registerObject< TemporaryRequest >(QString("hold")); Requester::instance().registerObject< TemporaryRequest >(QString("unhold")); - Requester::instance().registerObject< PermanentRequest >(QString("hangup")); + Requester::instance().registerObject< TemporaryRequest >(QString("senddtmf")); } void diff --git a/src/gui/official/SFLRequest.cpp b/src/gui/official/SFLRequest.cpp index 7e5cff722b84b5718ae0779824ca9edd00a10c0b..9df1bce98a4c8d8084938b12ec3933fee330a583 100644 --- a/src/gui/official/SFLRequest.cpp +++ b/src/gui/official/SFLRequest.cpp @@ -151,52 +151,32 @@ TemporaryRequest::TemporaryRequest(const QString &sequenceId, void TemporaryRequest::onError(Call call, - const QString &, + const QString &code, const QString &message) { - PhoneLine *line = PhoneLineManager::instance().getLine(call); - if(line) { - PhoneLineLocker guard(line, false); - line->setAction(message); - } - else { - _debug("We received an error on a temporary call " - "related request that doesn't have a phone " - "line (%s).\n", - call.id().toStdString().c_str()); - } + onSuccess(call, code, message); } void TemporaryRequest::onEntry(Call call, - const QString &, + const QString &code, const QString &message) { - PhoneLine *line = PhoneLineManager::instance().getLine(call); - if(line) { - PhoneLineLocker guard(line, false); - line->setAction(message); - } - else { - _debug("We received a status on a temporary call " - "related request that doesn't have a phone " - "line (%s).\n", - call.id().toStdString().c_str()); - } + onSuccess(call, code, message); } void TemporaryRequest::onSuccess(Call call, - const QString &, + const QString &, const QString &message) { PhoneLine *line = PhoneLineManager::instance().getLine(call); if(line) { PhoneLineLocker guard(line, false); - line->setAction(message); + line->setTempAction(message); } else { - _debug("We received a success on a temporary call " + _debug("We received an answer on a temporary call " "related request that doesn't have a phone " "line (%s).\n", call.id().toStdString().c_str());