Commit 19a0ad8b authored by Emmanuel Lepage's avatar Emmanuel Lepage

[#7021] Refactor KDE client dbus handling, add a missing call in daemon and...

[#7021] Refactor KDE client dbus handling, add a missing call in daemon and port the DataEngine to the new API
parent f4ad4a50
......@@ -1108,6 +1108,7 @@ void ManagerImpl::removeParticipant (const std::string& call_id)
removeStream(call_id);
getMainBuffer()->stateInfo();
_dbus.getCallManager()->conferenceChanged (conf->getConfID(), conf->getStateStr());
}
void ManagerImpl::processRemainingParticipant (const std::string &current_call_id, Conference *conf)
......
......@@ -10,49 +10,34 @@
#include "../../src/lib/sflphone_const.h"
SFLPhoneEngine::SFLPhoneEngine(QObject* parent, const QVariantList& args)
: Plasma::DataEngine(parent, args), CallModelConvenience(ActiveCall)
: Plasma::DataEngine(parent, args)
{
Q_UNUSED(args)
initCall();
initHistory();
m_pModel = new CallModelConvenience(CallModelConvenience::ActiveCall);
m_pModel->initCall();
m_pModel->initHistory();
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
connect(&callManager, SIGNAL(callStateChanged(const QString&, const QString&)),
this, SLOT(callStateChangedSignal(const QString&, const QString&)));
connect(&callManager, SIGNAL(incomingCall(const QString&, const QString&, const QString&)),
this, SLOT(incomingCallSignal(const QString&, const QString&)));
connect(&callManager, SIGNAL(conferenceCreated(const QString&)),
this, SLOT(conferenceCreatedSignal(const QString&)));
connect(&callManager, SIGNAL(conferenceChanged(const QString&, const QString&)),
this, SLOT(conferenceChangedSignal(const QString&, const QString&)));
connect(&callManager, SIGNAL(conferenceRemoved(const QString&)),
this, SLOT(conferenceRemovedSignal(const QString&)));
connect(&callManager, SIGNAL(incomingMessage(const QString&, const QString&)),
this, SLOT(incomingMessageSignal(const QString&, const QString&)));
connect(&callManager, SIGNAL(voiceMailNotify(const QString&, int)),
this, SLOT(voiceMailNotifySignal(const QString&, int)));
connect(&configurationManager, SIGNAL(accountsChanged()),
this, SLOT(accountChanged()));
connect(&configurationManager, SIGNAL(accountsChanged()),
getAccountList(), SLOT(updateAccounts()));
//setMinimumPollingInterval(1000);
connect(m_pModel , SIGNAL( callStateChanged(Call*)) , this , SLOT(callStateChangedSignal(Call*) ));
connect(&callManager , SIGNAL( incomingCall(Call*)) , this , SLOT(incomingCallSignal(Call*) ));
connect(&callManager , SIGNAL( conferenceCreated(Call*)) , this , SLOT(conferenceCreatedSignal(Call*) ));
connect(&callManager , SIGNAL( conferenceChanged(Call*)) , this , SLOT(conferenceChangedSignal(Call*) ));
}
bool SFLPhoneEngine::sourceRequestEvent(const QString &name)
{
if (name == "history") {
if ( name == "history" ) {
updateHistory();
}
else if (name == "calls") {
else if ( name == "calls" ) {
updateCallList();
}
else if (name == "conferences") {
else if ( name == "conferences" ) {
updateConferenceList();
}
else if (name == "info") {
else if ( name == "info" ) {
updateInfo();
}
return true;//updateSourceEvent(name);
......@@ -100,22 +85,22 @@ QString SFLPhoneEngine::getCallStateName(call_state state)
void SFLPhoneEngine::updateHistory()
{
foreach (Call* oldCall, getHistory()) {
historyCall[oldCall->getCallId()]["Name"] = oldCall->getPeerName();
historyCall[oldCall->getCallId()]["Number"] = oldCall->getPeerPhoneNumber();
historyCall[oldCall->getCallId()]["Date"] = oldCall->getStopTimeStamp();
foreach (Call* oldCall, m_pModel->getHistory()) {
historyCall[oldCall->getCallId()][ "Name" ] = oldCall->getPeerName();
historyCall[oldCall->getCallId()][ "Number" ] = oldCall->getPeerPhoneNumber();
historyCall[oldCall->getCallId()][ "Date" ] = oldCall->getStopTimeStamp();
setData("history", I18N_NOOP(oldCall->getCallId()), historyCall[oldCall->getCallId()]);
}
}
void SFLPhoneEngine::updateCallList()
{
foreach (Call* call, getCalls()) {
if ((!isConference(call)) && (call->getState() != CALL_STATE_OVER)) {
currentCall[call->getCallId()]["Name"] = call->getPeerName();
currentCall[call->getCallId()]["Number"] = call->getPeerPhoneNumber();
currentCall[call->getCallId()]["StateName"] = getCallStateName(call->getState());
currentCall[call->getCallId()]["State"] = call->getState();
foreach (Call* call, m_pModel->getCalls()) {
if ((!m_pModel->isConference(call)) && (call->getState() != CALL_STATE_OVER)) {
currentCall[call->getCallId()][ "Name" ] = call->getPeerName();
currentCall[call->getCallId()][ "Number" ] = call->getPeerPhoneNumber();
currentCall[call->getCallId()][ "StateName" ] = getCallStateName(call->getState());
currentCall[call->getCallId()][ "State" ] = call->getState();
setData("calls", call->getCallId(), currentCall[call->getCallId()]);
}
}
......@@ -123,8 +108,8 @@ void SFLPhoneEngine::updateCallList()
void SFLPhoneEngine::updateConferenceList()
{
foreach (Call* call, getCalls()) {
if (isConference(call)) {
foreach (Call* call, m_pModel->getCalls()) {
if (m_pModel->isConference(call)) {
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
currentConferences[call->getConfId()] = callManager.getParticipantList(call->getConfId());
setData("conferences", call->getConfId(), currentConferences[call->getConfId()]);
......@@ -139,54 +124,34 @@ void SFLPhoneEngine::updateContacts()
void SFLPhoneEngine::updateInfo()
{
qDebug() << "Currentaccount: " << getCurrentAccountId();
setData("info", I18N_NOOP("Account"), getCurrentAccountId());
qDebug() << "Currentaccount: " << m_pModel->getCurrentAccountId();
setData("info", I18N_NOOP("Account"), m_pModel->getCurrentAccountId());
}
void SFLPhoneEngine::callStateChangedSignal(const QString& callId, const QString& state)
void SFLPhoneEngine::callStateChangedSignal(Call* call)
{
qDebug() << "Signal : Call State Changed for call " << callId << " . New state : " << state;
Call* call = findCallByCallId(callId);
if(!call) {
if(state == CALL_STATE_CHANGE_RINGING) {
call = addRingingCall(callId);
//addCallToCallList(call);
}
else {
qDebug() << "Call doesn't exist in this client. Might have been initialized by another client instance before this one started.";
return;
}
}
else {
call->stateChanged(state);
}
Q_UNUSED(call)
updateCallList();
}
void SFLPhoneEngine::incomingCallSignal(const QString& accountId, const QString& callId)
void SFLPhoneEngine::incomingCallSignal(Call* call)
{
Q_UNUSED(accountId)
addIncomingCall(callId);
Q_UNUSED(call)
updateCallList();
}
void SFLPhoneEngine::conferenceCreatedSignal(const QString& confId)
void SFLPhoneEngine::conferenceCreatedSignal(Call* conf)
{
addConference(confId);
Q_UNUSED(conf)
updateConferenceList();
}
void SFLPhoneEngine::conferenceChangedSignal(const QString& confId, const QString& state)
void SFLPhoneEngine::conferenceChangedSignal(Call* conf)
{
conferenceChanged(confId, state);
Q_UNUSED(conf)
updateConferenceList();
}
void SFLPhoneEngine::conferenceRemovedSignal(const QString& confId)
{
conferenceRemoved(confId);
}
void SFLPhoneEngine::incomingMessageSignal(const QString& accountId, const QString& message)
{
Q_UNUSED(accountId)
......
......@@ -16,7 +16,7 @@
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
**************************************************************************/
#ifndef SFLPHONEENGINE_H
#define SFLPHONEENGINE_H
......@@ -27,8 +27,9 @@
#include "../../src/lib/CallModel.h"
typedef QHash<QString,QVariant> HashStringString;
class SFLPhoneEngine : public Plasma::DataEngine, public CallModelConvenience
class Call;
class SFLPhoneEngine : public Plasma::DataEngine
{
Q_OBJECT
......@@ -41,23 +42,24 @@ class SFLPhoneEngine : public Plasma::DataEngine, public CallModelConvenience
bool updateSourceEvent(const QString& source);
private:
QHash<QString, HashStringString > historyCall;
QHash<QString, HashStringString > currentCall;
QHash<QString, QStringList> currentConferences;
QHash<QString, HashStringString > historyCall ;
QHash<QString, HashStringString > currentCall ;
QHash<QString, QStringList> currentConferences ;
CallModelConvenience* m_pModel;
QString getCallStateName(call_state state);
void updateHistory();
void updateCallList();
void updateContacts();
void updateConferenceList();
void updateHistory ();
void updateCallList ();
void updateContacts ();
void updateConferenceList ();
void updateInfo();
private slots:
void callStateChangedSignal(const QString& callId, const QString& state);
void incomingCallSignal(const QString& accountId, const QString& callId);
void conferenceCreatedSignal(const QString& confId);
void conferenceChangedSignal(const QString& confId, const QString& state);
void conferenceRemovedSignal(const QString& confId);
void incomingMessageSignal(const QString& accountId, const QString& message);
void voiceMailNotifySignal(const QString& accountId, int count);
void callStateChangedSignal (Call* call);
void incomingCallSignal (Call* conf);
void conferenceCreatedSignal (Call* conf);
void conferenceChangedSignal (Call* conf);
//void conferenceRemovedSignal(const QString& confId);
void incomingMessageSignal( const QString& accountId, const QString& message );
void voiceMailNotifySignal( const QString& accountId, int count );
void accountChanged();
};
......
This diff is collapsed.
......@@ -24,10 +24,10 @@ class CallTreeItemDelegate : public QItemDelegate
typedef CallModel<CallTreeItem*,QTreeWidgetItem*> TreeWidgetCallModel;
class CallView : public QTreeWidget, public TreeWidgetCallModel {
class CallView : public QTreeWidget/*, public TreeWidgetCallModel*/ {
Q_OBJECT
public:
CallView(QWidget* parent =0,ModelType type = ActiveCall);
CallView(QWidget* parent =0);
bool selectItem(Call* item);
Call* getCurrentItem();
bool removeItem(Call* item);
......@@ -35,10 +35,6 @@ class CallView : public QTreeWidget, public TreeWidgetCallModel {
void setTitle(QString title);
bool dropMimeData(QTreeWidgetItem *parent, int index, const QMimeData *data, Qt::DropAction action);
virtual QMimeData* mimeData( const QList<QTreeWidgetItem *> items) const;
virtual Call* addCall(Call* call, Call* parent =0);
virtual Call* addConference(const QString &confID);
virtual bool conferenceChanged(const QString &confId, const QString &state);
virtual void conferenceRemoved(const QString &confId);
private:
QTreeWidgetItem* extractItem(QString callId);
......@@ -58,12 +54,18 @@ class CallView : public QTreeWidget, public TreeWidgetCallModel {
void destroyCall(Call* toDestroy);
void itemDoubleClicked(QTreeWidgetItem* item, int column);
void itemClicked(QTreeWidgetItem* item, int column);
Call* addCall(Call* call, Call* parent =0);
Call* addConference(Call* conf);
bool conferenceChanged(Call* conf);
void conferenceRemoved(Call* conf);
//D-Bus handling
// void callStateChangedSignal(const QString& callId, const QString& state);
// void incomingCallSignal(const QString& accountId, const QString& callId);
void conferenceCreatedSignal(const QString& confId);
void conferenceChangedSignal(const QString& confId, const QString& state);
void conferenceRemovedSignal(const QString& confId);
// void conferenceCreatedSignal(const QString& confId);
// void conferenceChangedSignal(const QString& confId, const QString& state);
// void conferenceRemovedSignal(const QString& confId);
// void incomingMessageSignal(const QString& accountId, const QString& message);
// void voiceMailNotifySignal(const QString& accountId, int count);
......
......@@ -40,6 +40,7 @@
#include "conf/ConfigurationSkeleton.h"
SFLPhone* SFLPhone::m_sApp = NULL;
TreeWidgetCallModel* SFLPhone::m_pModel = NULL;
SFLPhone::SFLPhone(QWidget *parent)
: KXmlGuiWindow(parent),
......@@ -48,7 +49,7 @@ SFLPhone::SFLPhone(QWidget *parent)
{
setupActions();
m_sApp = this;
}
}
SFLPhone* SFLPhone::app()
{
......@@ -59,9 +60,13 @@ SFLPhoneView* SFLPhone::view()
{
return m_pView;
}
CallView* SFLPhone::model()
TreeWidgetCallModel* SFLPhone::model()
{
return m_pView->model();
if (!m_pModel) {
m_pModel = new TreeWidgetCallModel(TreeWidgetCallModel::ActiveCall);
m_pModel->initCall();
}
return m_pModel;
}
ContactDock* SFLPhone::contactDock()
......
......@@ -47,6 +47,8 @@
class SFLPhoneView;
class CallView;
typedef CallModel<CallTreeItem*,QTreeWidgetItem*> TreeWidgetCallModel;
/**
* This class represents the SFLphone main window
* It implements the methods relative to windowing
......@@ -83,7 +85,6 @@ private:
KAction * action_hold;
KAction * action_transfer;
KAction * action_record;
QActionGroup * action_screen;
KAction * action_main;
KAction * action_mailBox;
KAction * action_close;
......@@ -92,6 +93,7 @@ private:
KAction * action_displayDialpad;
KAction * action_configureSflPhone;
KAction * action_accountCreationWizard;
QActionGroup * action_screen;
SFLPhoneView * m_pView;
QMenu *trayIconMenu;
......@@ -105,7 +107,7 @@ private:
BookmarkDock* m_pBookmarkDW;
static SFLPhone* m_sApp;
static TreeWidgetCallModel* m_pModel;
private:
void setObjectNames();
......@@ -127,7 +129,7 @@ public:
static SFLPhone* app();
SFLPhoneView* view();
CallView* model();
static TreeWidgetCallModel* model();
ContactDock* contactDock();
HistoryDock* historyDock();
......
......@@ -61,7 +61,7 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
setupUi(this);
ConfigurationManagerInterface& configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
//CallManagerInterface& callManager = CallManagerInterfaceSingleton::getInstance();
errorWindow = new QErrorMessage(this);
callTreeModel->setTitle("Calls");
......@@ -71,35 +71,36 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
setPalette(pal);
//BEGIN Port to CallModel
connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)),
connect(SFLPhone::model(), SIGNAL(incomingCall(Call*)),
this, SLOT(on1_incomingCall(Call*)));
connect(SFLPhone::model(), SIGNAL(voiceMailNotify(const QString &, int)),
this, SLOT(on1_voiceMailNotify(const QString &, int)));
connect(SFLPhone::model(), SIGNAL(volumeChanged(const QString &, double)),
this, SLOT(on1_volumeChanged(const QString &, double)));
connect(SFLPhone::model(), SIGNAL(callStateChanged(Call*)),
this, SLOT(updateWindowCallState()));
/*connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)),
this, SLOT(on1_callStateChanged(const QString &, const QString &)));
connect(&callManager, SIGNAL(incomingCall(const QString &, const QString &, const QString &)),
this, SLOT(on1_incomingCall(const QString &, const QString &)));
connect(&callManager, SIGNAL(conferenceCreated(const QString &)),
this, SLOT(on1_incomingConference(const QString &)));
connect(&callManager, SIGNAL(conferenceChanged(const QString &, const QString &)),
this, SLOT(on1_changingConference(const QString &, const QString &)));
connect(&callManager, SIGNAL(conferenceRemoved(const QString &)),
this, SLOT(on1_conferenceRemoved(const QString &)));
connect(&callManager, SIGNAL(voiceMailNotify(const QString &, int)),
this, SLOT(on1_voiceMailNotify(const QString &, int)));
connect(&callManager, SIGNAL(volumeChanged(const QString &, double)),
this, SLOT(on1_volumeChanged(const QString &, double)));
connect(&configurationManager, SIGNAL(accountsChanged()),
CallView::getAccountList(), SLOT(updateAccounts()));
this, SLOT(on1_conferenceRemoved(const QString &)));*/
//END Port to Call Model
//connect(configDialog, SIGNAL(changesApplied()),
//this, SLOT(loadWindow()));
connect(CallView::getAccountList(), SIGNAL(accountListUpdated()),
connect(TreeWidgetCallModel::getAccountList(), SIGNAL(accountListUpdated()),
this, SLOT(updateStatusMessage()));
connect(CallView::getAccountList(), SIGNAL(accountListUpdated()),
connect(TreeWidgetCallModel::getAccountList(), SIGNAL(accountListUpdated()),
this, SLOT(updateWindowCallState()));
connect(&configurationManager, SIGNAL(accountsChanged()),
TreeWidgetCallModel::getAccountList(), SLOT(updateAccounts()));
CallView::getAccountList()->updateAccounts();
TreeWidgetCallModel::getAccountList()->updateAccounts();
}
......@@ -131,10 +132,10 @@ QErrorMessage * SFLPhoneView::getErrorWindow()
return errorWindow;
}
CallView* SFLPhoneView::model()
{
return callTreeModel;
}
// CallView* SFLPhoneView::model()
// {
// return callTreeModel;
// }
void SFLPhoneView::typeString(QString str)
{
......@@ -151,7 +152,7 @@ void SFLPhoneView::typeString(QString str)
}
}
foreach (Call* call2, callTreeModel->getCallList()) {
foreach (Call* call2, SFLPhone::model()->getCallList()) {
if(currentCall != call2 && call2->getState() == CALL_STATE_CURRENT) {
action(call2, CALL_ACTION_HOLD);
}
......@@ -162,7 +163,7 @@ void SFLPhoneView::typeString(QString str)
if(!currentCall && !candidate) {
qDebug() << "Typing when no item is selected. Opening an item.";
candidate = callTreeModel->addDialingCall();
candidate = SFLPhone::model()->addDialingCall();
}
if(!currentCall && candidate) {
......@@ -258,12 +259,12 @@ void SFLPhoneView::updateWindowCallState()
QString buttonIconFiles[6] = {ICON_CALL, ICON_HANGUP, ICON_HOLD, ICON_TRANSFER, ICON_REC_DEL_OFF, ICON_MAILBOX};
QString actionTexts[6] = {ACTION_LABEL_CALL, ACTION_LABEL_HANG_UP, ACTION_LABEL_HOLD, ACTION_LABEL_TRANSFER, ACTION_LABEL_RECORD, ACTION_LABEL_MAILBOX};
Call* call;
Call* call = 0;
bool transfer = false;
bool recordActivated = false; //tells whether the call is in recording position
enabledActions[SFLPhone::Mailbox] = CallView::getCurrentAccount() && ! CallView::getCurrentAccount()->getAccountDetail(ACCOUNT_MAILBOX).isEmpty();
enabledActions[SFLPhone::Mailbox] = SFLPhone::model()->getCurrentAccount() && ! SFLPhone::model()->getCurrentAccount()->getAccountDetail(ACCOUNT_MAILBOX).isEmpty();
call = callTreeModel->getCurrentItem();
if (!call) {
......@@ -277,6 +278,8 @@ void SFLPhoneView::updateWindowCallState()
call_state state = call->getState();
recordActivated = call->getRecording();
qDebug() << "State" << state << "call" << call;
switch (state) {
case CALL_STATE_INCOMING:
qDebug() << "Reached CALL_STATE_INCOMING with call " << call->getCallId();
......@@ -488,7 +491,7 @@ void SFLPhoneView::updateDialpad()
void SFLPhoneView::updateStatusMessage()
{
qDebug() << "updateStatusMessage";
Account * account = CallView::getCurrentAccount();
Account * account = SFLPhone::model()->getCurrentAccount();
if(account == NULL) {
emit statusMessageChangeAsked(i18n("No registered accounts"));
......@@ -515,7 +518,7 @@ void SFLPhoneView::displayVolumeControls(bool checked)
void SFLPhoneView::displayDialpad(bool checked)
{
qDebug() << "Max res2: " << ConfigurationSkeleton::displayDialpad() << "\n\n\n\n\n\n";
qDebug() << "Max res2: " << ConfigurationSkeleton::displayDialpad();
ConfigurationSkeleton::setDisplayDialpad(checked);
updateDialpad();
}
......@@ -626,16 +629,16 @@ void SFLPhoneView::contextMenuEvent(QContextMenuEvent *event)
menu.addSeparator();
QAction * action = new ActionSetAccountFirst(NULL, &menu);
action->setChecked(CallView::getPriorAccoundId().isEmpty());
action->setChecked(SFLPhone::model()->getPriorAccoundId().isEmpty());
connect(action, SIGNAL(setFirst(Account *)),
this , SLOT(setAccountFirst(Account *)));
menu.addAction(action);
QVector<Account *> accounts = CallView::getAccountList()->registeredAccounts();
QVector<Account *> accounts = SFLPhone::model()->getAccountList()->registeredAccounts();
for (int i = 0 ; i < accounts.size() ; i++) {
Account * account = accounts.at(i);
QAction * action = new ActionSetAccountFirst(account, &menu);
action->setChecked(account->getAccountId() == CallView::getPriorAccoundId());
action->setChecked(account->getAccountId() == SFLPhone::model()->getPriorAccoundId());
connect(action, SIGNAL(setFirst(Account *)),
this , SLOT(setAccountFirst(Account *)));
menu.addAction(action);
......@@ -653,7 +656,7 @@ void SFLPhoneView::editBeforeCall()
QString newNumber = QInputDialog::getText(this, i18n("Edit before call"), QString(), QLineEdit::Normal, number, &ok);
if(ok) {
changeScreen(SCREEN_MAIN);
Call* call = callTreeModel->addDialingCall(name);
Call* call = SFLPhone::model()->addDialingCall(name);
call->appendText(newNumber);
//callTreeModel->selectItem(addCallToCallList(call));
action(call, CALL_ACTION_ACCEPT);
......@@ -664,12 +667,12 @@ void SFLPhoneView::setAccountFirst(Account * account)
{
qDebug() << "setAccountFirst : " << (account ? account->getAlias() : QString()) << (account ? account->getAccountId() : QString());
if(account) {
CallView::setPriorAccountId(account->getAccountId());
SFLPhone::model()->setPriorAccountId(account->getAccountId());
}
else {
CallView::setPriorAccountId(QString());
SFLPhone::model()->setPriorAccountId(QString());
}
qDebug() << "Current account id" << CallView::getCurrentAccountId();
qDebug() << "Current account id" << SFLPhone::model()->getCurrentAccountId();
updateStatusMessage();
}
......@@ -700,14 +703,14 @@ void SFLPhoneView::accept()
Call* call = callTreeModel->getCurrentItem();
if(!call) {
qDebug() << "Calling when no item is selected. Opening an item.";
callTreeModel->addDialingCall();
SFLPhone::model()->addDialingCall();
}
else {
int state = call->getState();
if(state == CALL_STATE_RINGING || state == CALL_STATE_CURRENT || state == CALL_STATE_HOLD || state == CALL_STATE_BUSY)
{
qDebug() << "Calling when item currently ringing, current, hold or busy. Opening an item.";
callTreeModel->addDialingCall();
SFLPhone::model()->addDialingCall();
}
else {
action(call, CALL_ACTION_ACCEPT);
......@@ -761,44 +764,24 @@ void SFLPhoneView::record()
void SFLPhoneView::mailBox()
{
Account * account = CallView::getCurrentAccount();
Account * account = SFLPhone::model()->getCurrentAccount();
QString mailBoxNumber = account->getAccountDetail(ACCOUNT_MAILBOX);
Call * call = callTreeModel->addDialingCall();
Call * call = SFLPhone::model()->addDialingCall();
call->appendText(mailBoxNumber);
action(call, CALL_ACTION_ACCEPT);
}
void SFLPhoneView::on1_callStateChanged(const QString &callID, const QString &state)
{
//This code is part of the CallModel iterface too
qDebug() << "Signal : Call State Changed for call " << callID << " . New state : " << state;
Call* call = callTreeModel->findCallByCallId(callID);
if(!call) {
if(state == CALL_STATE_CHANGE_RINGING) {
call = callTreeModel->addRingingCall(callID);
}
else {
qDebug() << "Call doesn't exist in this client. Might have been initialized by another client instance before this one started.";
return;
}
}
else {
call->stateChanged(state);
}
updateWindowCallState(); //NEED_PORT
}
void SFLPhoneView::on1_error(MapStringString details)
{
qDebug() << "Signal : Daemon error : " << details;
}
void SFLPhoneView::on1_incomingCall(const QString & /*accountID*/, const QString & callID)
void SFLPhoneView::on1_incomingCall(Call* call)
{
qDebug() << "Signal : Incoming Call ! ID = " << callID;
Call* call = callTreeModel->addIncomingCall(callID);
qDebug() << "Signal : Incoming Call ! ID = " << call->getCallId();
//Call* call = SFLPhone::model()->addIncomingCall(callID);
//NEED_PORT
changeScreen(SCREEN_MAIN);
......@@ -809,18 +792,6 @@ void SFLPhoneView::on1_incomingCall(const QString & /*accountID*/, const QString
emit incomingCall(call);
}
void SFLPhoneView::on1_incomingConference(const QString &confID) {
callTreeModel->conferenceCreatedSignal(confID);
}
void SFLPhoneView::on1_changingConference(const QString &confID, const QString &state) {
callTreeModel->conferenceChangedSignal(confID, state);
}
void SFLPhoneView::on1_conferenceRemoved(const QString &confId) {
callTreeModel->conferenceRemovedSignal(confId);