Commit 5ef841a9 authored by yanmorin's avatar yanmorin
Browse files

Fix flashing button bug
parent 3f11928a
SFLphoned (0.7.0) / 2006-..-..
* partially fix: click on a flashing button (only if the button is not red)
* fix: click on flashing buttons
* fix: send ringing, hangup, busy message
* fix for using call command two times in a row
* add --disable-sflphoneqt 2006-05-01
......
......@@ -65,6 +65,11 @@ public:
void setPeerName(const std::string& name) { _peerName = name; }
const std::string& getPeerName() { return _peerName; }
/**
* Tell if the call is incoming
*/
bool isIncoming() { return (_type == Incoming) ? true : false; }
/**
* Set the connection state of the call (protected by mutex)
*/
......
/*
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Copyright (C) 2004-2006 Savoir-Faire Linux inc.
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
* Author: Jean-Philippe Barrette-LaPierre
* <jean-philippe.barrette-lapierre@savoirfairelinux.com>
*
......@@ -41,6 +42,7 @@ PhoneLineButton::PhoneLineButton(unsigned int line,
this, SLOT(swap()));
connect(this, SIGNAL(clicked()),
this, SLOT(sendClicked()));
mIsFlashing = false;
}
void
......@@ -65,6 +67,7 @@ void
PhoneLineButton::suspend()
{
setDown(false);
mIsFlashing = true;
mTimer->start(500);
}
......@@ -72,11 +75,18 @@ void
PhoneLineButton::sendClicked()
{
if(isOn()) {
mIsFlashing = false;
mTimer->stop();
emit selected(mLine);
}
else {
emit unselected(mLine);
if (mIsFlashing) {
mIsFlashing = false;
mTimer->stop();
emit selected(mLine);
} else {
emit unselected(mLine);
}
}
}
/*
* Copyright (C) 2004-2005 Savoir-Faire Linux inc.
* Copyright (C) 2004-2006 Savoir-Faire Linux inc.
* Author: Yan Morin <yan.morin@savoirfairelinux.com>
* Author: Jean-Philippe Barrette-LaPierre
* <jean-philippe.barrette-lapierre@savoirfairelinux.com>
*
......@@ -59,7 +60,12 @@ private:
unsigned int mLine;
QTimer *mTimer;
unsigned int mFace;
/**
* If the line is flashing, we want to retreive it
* on or off
*/
bool mIsFlashing;
};
#endif // defined(__J_PUSH_BUTTON_H__)
......@@ -389,9 +389,13 @@ ManagerImpl::refuseCall (const CallID& id)
return false;
}
bool returnValue = getAccountLink(accountid)->refuse(id);
removeWaitingCall(id);
removeCallAccount(id);
switchCall("");
// if the call was outgoing or established, we didn't refuse it
// so the method did nothing
if (returnValue) {
removeWaitingCall(id);
removeCallAccount(id);
switchCall("");
}
return returnValue;
}
......
......@@ -773,8 +773,16 @@ bool
SIPVoIPLink::refuse (const CallID& id)
{
SIPCall* call = getSIPCall(id);
if (call==0) { _debug("Call doesn't exist\n"); return false; }
// can't refuse outgoing call or connected
if (!call->isIncoming() || call->getConnectionState() == Call::Connected) {
_debug("It's not an incoming call, or it's already answered\n");
return false;
}
osip_message_t *answerMessage = NULL;
eXosip_lock();
// not BUSY.. where decline the invitation!
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment