Commit 8f2b65ee authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

Restore and improve support for Call history

parent 7ef79e87
...@@ -27,6 +27,7 @@ SET( sflphone_client_kde_SRCS ...@@ -27,6 +27,7 @@ SET( sflphone_client_kde_SRCS
AccountWizard.cpp AccountWizard.cpp
AccountItemWidget.cpp AccountItemWidget.cpp
widgets/CallTreeItem.cpp widgets/CallTreeItem.cpp
widgets/HistoryTreeItem.cpp
ActionSetAccountFirst.cpp ActionSetAccountFirst.cpp
conf/ConfigurationDialog.cpp conf/ConfigurationDialog.cpp
conf/dlggeneral.cpp conf/dlggeneral.cpp
......
...@@ -41,7 +41,7 @@ SFLPhone* SFLPhone::m_sApp = NULL; ...@@ -41,7 +41,7 @@ SFLPhone* SFLPhone::m_sApp = NULL;
SFLPhone::SFLPhone(QWidget *parent) SFLPhone::SFLPhone(QWidget *parent)
: KXmlGuiWindow(parent), : KXmlGuiWindow(parent),
initialized_(false), initialized_(false),
view(new SFLPhoneView(this)) m_pView(new SFLPhoneView(this))
{ {
setupActions(); setupActions();
m_sApp = this; m_sApp = this;
...@@ -52,6 +52,15 @@ SFLPhone* SFLPhone::app() ...@@ -52,6 +52,15 @@ SFLPhone* SFLPhone::app()
return m_sApp; return m_sApp;
} }
SFLPhoneView* SFLPhone::view()
{
return m_pView;
}
CallView* SFLPhone::model()
{
return m_pView->model();
}
SFLPhone::~SFLPhone() SFLPhone::~SFLPhone()
{ {
saveState(); saveState();
...@@ -73,25 +82,26 @@ bool SFLPhone::initialize() ...@@ -73,25 +82,26 @@ bool SFLPhone::initialize()
addDockWidget(Qt::TopDockWidgetArea,m_pContactCD); addDockWidget(Qt::TopDockWidgetArea,m_pContactCD);
// tell the KXmlGuiWindow that this is indeed the main widget // tell the KXmlGuiWindow that this is indeed the main widget
//setCentralWidget(view); //setCentralWidget(m_pView);
m_pCentralDW = new QDockWidget(this); m_pCentralDW = new QDockWidget(this);
m_pCentralDW->setWidget(view); m_pCentralDW->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
m_pCentralDW->setWidget(m_pView);
m_pCentralDW->setWindowTitle("Call"); m_pCentralDW->setWindowTitle("Call");
m_pCentralDW->setFeatures(QDockWidget::NoDockWidgetFeatures); m_pCentralDW->setFeatures(QDockWidget::NoDockWidgetFeatures);
m_pView->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Expanding);
m_pCentralDW->setStyleSheet("\ m_pCentralDW->setStyleSheet("\
QDockWidget::title {\ QDockWidget::title {\
display:none;\ margin:0px;\
margin:0px;\ padding:0px;\
padding:0px;\ spacing:0px;\
spacing:0px;\ max-height:0px;\
max-height:0px;\ }\
}\ \
\
"); ");
m_pCentralDW->setTitleBarWidget(new QWidget()); m_pCentralDW->setTitleBarWidget(new QWidget());
m_pCentralDW->setContentsMargins(0,0,0,0); m_pCentralDW->setContentsMargins(0,0,0,0);
view->setContentsMargins(0,0,0,0); m_pView->setContentsMargins(0,0,0,0);
addDockWidget(Qt::TopDockWidgetArea,m_pCentralDW); addDockWidget(Qt::TopDockWidgetArea,m_pCentralDW);
...@@ -118,8 +128,8 @@ bool SFLPhone::initialize() ...@@ -118,8 +128,8 @@ bool SFLPhone::initialize()
setObjectNames(); setObjectNames();
QMetaObject::connectSlotsByName(this); QMetaObject::connectSlotsByName(this);
view->on_stackedWidget_screen_currentChanged(SCREEN_MAIN); m_pView->on_stackedWidget_screen_currentChanged(SCREEN_MAIN);
view->loadWindow(); m_pView->loadWindow();
move(QCursor::pos().x() - geometry().width()/2, QCursor::pos().y() - geometry().height()/2); move(QCursor::pos().x() - geometry().width()/2, QCursor::pos().y() - geometry().height()/2);
//if( ! configurationManager.isStartHidden()) { //if( ! configurationManager.isStartHidden()) {
...@@ -137,7 +147,7 @@ bool SFLPhone::initialize() ...@@ -137,7 +147,7 @@ bool SFLPhone::initialize()
void SFLPhone::setObjectNames() void SFLPhone::setObjectNames()
{ {
view->setObjectName("view"); m_pView->setObjectName("m_pView");
statusBar()->setObjectName("statusBar"); statusBar()->setObjectName("statusBar");
trayIcon->setObjectName("trayIcon"); trayIcon->setObjectName("trayIcon");
} }
...@@ -177,7 +187,7 @@ void SFLPhone::setupActions() ...@@ -177,7 +187,7 @@ void SFLPhone::setupActions()
action_close = KStandardAction::close(this, SLOT(close()), this); action_close = KStandardAction::close(this, SLOT(close()), this);
action_quit = KStandardAction::quit(this, SLOT(quitButton()), this); action_quit = KStandardAction::quit(this, SLOT(quitButton()), this);
action_configureSflPhone = KStandardAction::preferences(view, SLOT(configureSflPhone()), this); action_configureSflPhone = KStandardAction::preferences(m_pView, SLOT(configureSflPhone()), this);
action_configureSflPhone->setText(i18n("Configure SFLphone")); action_configureSflPhone->setText(i18n("Configure SFLphone"));
action_displayVolumeControls = new KAction(KIcon(QIcon(ICON_DISPLAY_VOLUME_CONSTROLS)), i18n("Display volume controls"), this); action_displayVolumeControls = new KAction(KIcon(QIcon(ICON_DISPLAY_VOLUME_CONSTROLS)), i18n("Display volume controls"), this);
...@@ -189,16 +199,16 @@ void SFLPhone::setupActions() ...@@ -189,16 +199,16 @@ void SFLPhone::setupActions()
action_displayDialpad->setChecked(/*configurationManager.getDialpad()*/true); action_displayDialpad->setChecked(/*configurationManager.getDialpad()*/true);
action_accountCreationWizard = new KAction(i18n("Account creation wizard"), this); action_accountCreationWizard = new KAction(i18n("Account creation wizard"), this);
connect(action_accept, SIGNAL(triggered()), view, SLOT(accept())); connect(action_accept, SIGNAL(triggered()), m_pView, SLOT(accept()));
connect(action_refuse, SIGNAL(triggered()), view, SLOT(refuse())); connect(action_refuse, SIGNAL(triggered()), m_pView, SLOT(refuse()));
connect(action_hold, SIGNAL(triggered()), view, SLOT(hold())); connect(action_hold, SIGNAL(triggered()), m_pView, SLOT(hold()));
connect(action_transfer, SIGNAL(triggered()), view, SLOT(transfer())); connect(action_transfer, SIGNAL(triggered()), m_pView, SLOT(transfer()));
connect(action_record, SIGNAL(triggered()), view, SLOT(record())); connect(action_record, SIGNAL(triggered()), m_pView, SLOT(record()));
connect(action_screen, SIGNAL(triggered(QAction *)), this, SLOT(updateScreen(QAction *))); connect(action_screen, SIGNAL(triggered(QAction *)), this , SLOT(updateScreen(QAction *)));
connect(action_mailBox, SIGNAL(triggered()), view, SLOT(mailBox())); connect(action_mailBox, SIGNAL(triggered()), m_pView, SLOT(mailBox()));
connect(action_displayVolumeControls, SIGNAL(toggled(bool)), view, SLOT(displayVolumeControls(bool))); connect(action_displayVolumeControls, SIGNAL(toggled(bool)), m_pView, SLOT(displayVolumeControls(bool)));
connect(action_displayDialpad, SIGNAL(toggled(bool)), view, SLOT(displayDialpad(bool))); connect(action_displayDialpad, SIGNAL(toggled(bool)), m_pView, SLOT(displayDialpad(bool)));
connect(action_accountCreationWizard, SIGNAL(triggered()), view, SLOT(accountCreationWizard())); connect(action_accountCreationWizard, SIGNAL(triggered()), m_pView, SLOT(accountCreationWizard()));
action_screen->addAction(action_main); action_screen->addAction(action_main);
action_screen->addAction(action_history); action_screen->addAction(action_history);
...@@ -245,7 +255,7 @@ void SFLPhone::setupActions() ...@@ -245,7 +255,7 @@ void SFLPhone::setupActions()
SFLPhoneView * SFLPhone::getView() SFLPhoneView * SFLPhone::getView()
{ {
return view; return m_pView;
} }
bool SFLPhone::queryClose() bool SFLPhone::queryClose()
...@@ -258,12 +268,12 @@ bool SFLPhone::queryClose() ...@@ -258,12 +268,12 @@ bool SFLPhone::queryClose()
void SFLPhone::quitButton() void SFLPhone::quitButton()
{ {
InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); InstanceInterface & instance = InstanceInterfaceSingleton::getInstance();
//qDebug() << "quitButton : " << view->callTree->count() << " calls open."; //qDebug() << "quitButton : " << m_pView->callTree->count() << " calls open.";
//if(view->callTree->count() > 0 && instance.getRegistrationCount() <= 1) { //if(m_pView->callTree->count() > 0 && instance.getRegistrationCount() <= 1) {
//qDebug() << "Attempting to quit when still having some calls open."; //qDebug() << "Attempting to quit when still having some calls open.";
//} //}
view->saveState(); m_pView->saveState();
instance.Unregister(getpid()); instance.Unregister(getpid());
qApp->quit(); qApp->quit();
} }
...@@ -293,21 +303,21 @@ void SFLPhone::changeEvent(QEvent* event) ...@@ -293,21 +303,21 @@ void SFLPhone::changeEvent(QEvent* event)
} }
} }
void SFLPhone::on_view_statusMessageChangeAsked(const QString & message) void SFLPhone::on_m_pView_statusMessageChangeAsked(const QString & message)
{ {
qDebug() << "on_view_statusMessageChangeAsked : " + message; qDebug() << "on_m_pView_statusMessageChangeAsked : " + message;
statusBarWidget->setText(message); statusBarWidget->setText(message);
} }
void SFLPhone::on_view_windowTitleChangeAsked(const QString & message) void SFLPhone::on_m_pView_windowTitleChangeAsked(const QString & message)
{ {
qDebug() << "on_view_windowTitleChangeAsked : " + message; qDebug() << "on_m_pView_windowTitleChangeAsked : " + message;
setWindowTitle(message); setWindowTitle(message);
} }
void SFLPhone::on_view_enabledActionsChangeAsked(const bool * enabledActions) void SFLPhone::on_m_pView_enabledActionsChangeAsked(const bool * enabledActions)
{ {
qDebug() << "on_view_enabledActionsChangeAsked"; qDebug() << "on_m_pView_enabledActionsChangeAsked";
action_accept->setVisible(enabledActions[SFLPhone::Accept]); action_accept->setVisible(enabledActions[SFLPhone::Accept]);
action_refuse->setVisible(enabledActions[SFLPhone::Refuse]); action_refuse->setVisible(enabledActions[SFLPhone::Refuse]);
action_hold->setVisible(enabledActions[SFLPhone::Hold]); action_hold->setVisible(enabledActions[SFLPhone::Hold]);
...@@ -316,9 +326,9 @@ void SFLPhone::on_view_enabledActionsChangeAsked(const bool * enabledActions) ...@@ -316,9 +326,9 @@ void SFLPhone::on_view_enabledActionsChangeAsked(const bool * enabledActions)
action_mailBox->setVisible(enabledActions[SFLPhone::Mailbox]); action_mailBox->setVisible(enabledActions[SFLPhone::Mailbox]);
} }
void SFLPhone::on_view_actionIconsChangeAsked(const QString * actionIcons) void SFLPhone::on_m_pView_actionIconsChangeAsked(const QString * actionIcons)
{ {
qDebug() << "on_view_actionIconsChangeAsked"; qDebug() << "on_m_pView_actionIconsChangeAsked";
action_accept->setIcon(QIcon(actionIcons[SFLPhone::Accept])); action_accept->setIcon(QIcon(actionIcons[SFLPhone::Accept]));
action_refuse->setIcon(QIcon(actionIcons[SFLPhone::Refuse])); action_refuse->setIcon(QIcon(actionIcons[SFLPhone::Refuse]));
action_hold->setIcon(QIcon(actionIcons[SFLPhone::Hold])); action_hold->setIcon(QIcon(actionIcons[SFLPhone::Hold]));
...@@ -327,9 +337,9 @@ void SFLPhone::on_view_actionIconsChangeAsked(const QString * actionIcons) ...@@ -327,9 +337,9 @@ void SFLPhone::on_view_actionIconsChangeAsked(const QString * actionIcons)
action_mailBox->setIcon(QIcon(actionIcons[SFLPhone::Mailbox])); action_mailBox->setIcon(QIcon(actionIcons[SFLPhone::Mailbox]));
} }
void SFLPhone::on_view_actionTextsChangeAsked(const QString * actionTexts) void SFLPhone::on_m_pView_actionTextsChangeAsked(const QString * actionTexts)
{ {
qDebug() << "on_view_actionTextsChangeAsked"; qDebug() << "on_m_pView_actionTextsChangeAsked";
action_accept->setText(actionTexts[SFLPhone::Accept]); action_accept->setText(actionTexts[SFLPhone::Accept]);
action_refuse->setText(actionTexts[SFLPhone::Refuse]); action_refuse->setText(actionTexts[SFLPhone::Refuse]);
action_hold->setText(actionTexts[SFLPhone::Hold]); action_hold->setText(actionTexts[SFLPhone::Hold]);
...@@ -339,13 +349,13 @@ void SFLPhone::on_view_actionTextsChangeAsked(const QString * actionTexts) ...@@ -339,13 +349,13 @@ void SFLPhone::on_view_actionTextsChangeAsked(const QString * actionTexts)
} }
void SFLPhone::on_view_transferCheckStateChangeAsked(bool transferCheckState) void SFLPhone::on_m_pView_transferCheckStateChangeAsked(bool transferCheckState)
{ {
qDebug() << "Changing transfer action checkState"; qDebug() << "Changing transfer action checkState";
action_transfer->setChecked(transferCheckState); action_transfer->setChecked(transferCheckState);
} }
void SFLPhone::on_view_recordCheckStateChangeAsked(bool recordCheckState) void SFLPhone::on_m_pView_recordCheckStateChangeAsked(bool recordCheckState)
{ {
qDebug() << "Changing record action checkState"; qDebug() << "Changing record action checkState";
action_record->setChecked(recordCheckState); action_record->setChecked(recordCheckState);
...@@ -353,14 +363,14 @@ void SFLPhone::on_view_recordCheckStateChangeAsked(bool recordCheckState) ...@@ -353,14 +363,14 @@ void SFLPhone::on_view_recordCheckStateChangeAsked(bool recordCheckState)
void SFLPhone::updateScreen(QAction * action) void SFLPhone::updateScreen(QAction * action)
{ {
if(action == action_main) view->changeScreen(SCREEN_MAIN); if(action == action_main) m_pView->changeScreen(SCREEN_MAIN);
else if(action == action_history) view->changeScreen(SCREEN_HISTORY); else if(action == action_history) m_pView->changeScreen(SCREEN_HISTORY);
else if(action == action_addressBook) view->changeScreen(SCREEN_ADDRESS); else if(action == action_addressBook) m_pView->changeScreen(SCREEN_ADDRESS);
} }
void SFLPhone::on_view_screenChanged(int screen) void SFLPhone::on_m_pView_screenChanged(int screen)
{ {
qDebug() << "on_view_screenChanged"; qDebug() << "on_m_pView_screenChanged";
if(screen == SCREEN_MAIN) action_main->setChecked(true); if(screen == SCREEN_MAIN) action_main->setChecked(true);
else if(screen == SCREEN_HISTORY) action_history->setChecked(true); else if(screen == SCREEN_HISTORY) action_history->setChecked(true);
else if(screen == SCREEN_ADDRESS) action_addressBook->setChecked(true); else if(screen == SCREEN_ADDRESS) action_addressBook->setChecked(true);
...@@ -378,7 +388,7 @@ QList<QAction*> SFLPhone::getCallActions() ...@@ -378,7 +388,7 @@ QList<QAction*> SFLPhone::getCallActions()
return callActions; return callActions;
} }
void SFLPhone::on_view_incomingCall(const Call * call) void SFLPhone::on_m_pView_incomingCall(const Call * call)
{ {
//ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); //ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
//trayIconSignal(); //trayIconSignal();
...@@ -391,7 +401,7 @@ void SFLPhone::on_view_incomingCall(const Call * call) ...@@ -391,7 +401,7 @@ void SFLPhone::on_view_incomingCall(const Call * call)
//} //}
} }
void SFLPhone::on_view_addressBookEnableAsked(bool enabled) void SFLPhone::on_m_pView_addressBookEnableAsked(bool enabled)
{ {
action_addressBook->setVisible(enabled); action_addressBook->setVisible(enabled);
} }
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include "widgets/SFLPhoneTray.h" #include "widgets/SFLPhoneTray.h"
class SFLPhoneView; class SFLPhoneView;
class CallView;
/** /**
* This class represents the SFLphone main window * This class represents the SFLphone main window
...@@ -94,7 +95,7 @@ private: ...@@ -94,7 +95,7 @@ private:
KAction * action_configureSflPhone; KAction * action_configureSflPhone;
KAction * action_accountCreationWizard; KAction * action_accountCreationWizard;
SFLPhoneView * view; SFLPhoneView * m_pView;
QMenu *trayIconMenu; QMenu *trayIconMenu;
bool iconChanged; bool iconChanged;
SFLPhoneTray *trayIcon; SFLPhoneTray *trayIcon;
...@@ -128,19 +129,21 @@ public: ...@@ -128,19 +129,21 @@ public:
friend class SFLPhoneView; friend class SFLPhoneView;
static SFLPhone* app(); static SFLPhone* app();
SFLPhoneView* view();
CallView* model();
private slots: private slots:
void on_view_statusMessageChangeAsked(const QString & message); void on_m_pView_statusMessageChangeAsked(const QString & message);
void on_view_windowTitleChangeAsked(const QString & message); void on_m_pView_windowTitleChangeAsked(const QString & message);
void on_view_enabledActionsChangeAsked(const bool * enabledActions); void on_m_pView_enabledActionsChangeAsked(const bool * enabledActions);
void on_view_actionIconsChangeAsked(const QString * actionIcons); void on_m_pView_actionIconsChangeAsked(const QString * actionIcons);
void on_view_actionTextsChangeAsked(const QString * actionTexts); void on_m_pView_actionTextsChangeAsked(const QString * actionTexts);
void on_view_transferCheckStateChangeAsked(bool transferCheckState); void on_m_pView_transferCheckStateChangeAsked(bool transferCheckState);
void on_view_recordCheckStateChangeAsked(bool recordCheckState); void on_m_pView_recordCheckStateChangeAsked(bool recordCheckState);
void on_view_addressBookEnableAsked(bool enabled); void on_m_pView_addressBookEnableAsked(bool enabled);
void on_view_screenChanged(int screen); void on_m_pView_screenChanged(int screen);
void on_view_incomingCall(const Call * call); void on_m_pView_incomingCall(const Call * call);
void updateScreen(QAction * action); void updateScreen(QAction * action);
......
...@@ -57,9 +57,9 @@ using namespace KABC; ...@@ -57,9 +57,9 @@ using namespace KABC;
SFLPhoneView::SFLPhoneView(QWidget *parent) SFLPhoneView::SFLPhoneView(QWidget *parent)
: QWidget(parent), : QWidget(parent),
wizard(0), wizard(0),
addressBookTree(CallView::Address), addressBookTree(new CallView(CallView::Address)),
callTreeModel(CallView::ActiveCall), callTreeModel(new CallView(CallView::ActiveCall)),
historyTreeModel(CallView::History) historyTreeModel(new CallView(CallView::History))
{ {
setupUi(this); setupUi(this);
...@@ -74,15 +74,15 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) ...@@ -74,15 +74,15 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
//historyTree = new CallTreeWidget(page_callHistory); //historyTree = new CallTreeWidget(page_callHistory);
//callTree = new CallTreeWidget(this); //callTree = new CallTreeWidget(this);
//historyTree = new CallTreeWidget(this); //historyTree = new CallTreeWidget(this);
callTreeModel.setTitle("Calls"); callTreeModel->setTitle("Calls");
historyTreeModel.setTitle("History"); historyTreeModel->setTitle("History");
page_callList->layout()->addWidget(callTreeModel.getWidget()); page_callList->layout()->addWidget(callTreeModel->getWidget());
page_callHistory->layout()->addWidget(historyTreeModel.getWidget()); page_callHistory->layout()->addWidget(historyTreeModel->getWidget());
historyLoaded = false; historyLoaded = false;
// for(int i = 0 ; i < callTreeModel.size() ; i++) { // for(int i = 0 ; i < callTreeModel->size() ; i++) {
// Call * call = (*callList)[i]; // Call * call = (*callList)[i];
// if(call->getState() == CALL_STATE_OVER) { // if(call->getState() == CALL_STATE_OVER) {
// addCallToCallHistory(call); // addCallToCallHistory(call);
...@@ -142,11 +142,11 @@ SFLPhoneView::SFLPhoneView(QWidget *parent) ...@@ -142,11 +142,11 @@ SFLPhoneView::SFLPhoneView(QWidget *parent)
connect(CallView::getAccountList(), SIGNAL(accountListUpdated()), connect(CallView::getAccountList(), SIGNAL(accountListUpdated()),
this, SLOT(updateWindowCallState())); this, SLOT(updateWindowCallState()));
connect(callTreeModel.getWidget(), SIGNAL(itemChanged()), //currentItemChanged connect(callTreeModel->getWidget(), SIGNAL(itemChanged()), //currentItemChanged
this, SLOT(on_callTree_currentItemChanged())); this, SLOT(on_callTree_currentItemChanged()));
connect(callTreeModel.getWidget(), SIGNAL(itemChanged()), //ITem changed connect(callTreeModel->getWidget(), SIGNAL(itemChanged()), //ITem changed
this, SLOT(on_callTree_itemChanged())); this, SLOT(on_callTree_itemChanged()));
connect(callTreeModel.getWidget(), SIGNAL(doubleClicked(const QModelIndex &)), connect(callTreeModel->getWidget(), SIGNAL(doubleClicked(const QModelIndex &)),
this, SLOT(on_callTree_itemDoubleClicked(const QModelIndex&))); this, SLOT(on_callTree_itemDoubleClicked(const QModelIndex&)));
...@@ -161,7 +161,7 @@ SFLPhoneView::~SFLPhoneView() ...@@ -161,7 +161,7 @@ SFLPhoneView::~SFLPhoneView()
void SFLPhoneView::saveState() void SFLPhoneView::saveState()
{ {
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
configurationManager.setHistory(callTreeModel.getHistory()); configurationManager.setHistory(callTreeModel->getHistoryCallId());
} }
void SFLPhoneView::loadWindow() void SFLPhoneView::loadWindow()
...@@ -186,10 +186,15 @@ QErrorMessage * SFLPhoneView::getErrorWindow() ...@@ -186,10 +186,15 @@ QErrorMessage * SFLPhoneView::getErrorWindow()
return errorWindow; return errorWindow;
} }
CallView* SFLPhoneView::model()
{
return callTreeModel;
}
// Call* SFLPhoneView::addCallToCallList(Call * call) // Call* SFLPhoneView::addCallToCallList(Call * call)
// { // {
// // return callTree->insert(call); // // return callTree->insert(call);
// return callTreeModel.addCall(call); // return callTreeModel->addCall(call);
// } // }
// Call* SFLPhoneView::addCallToCallHistory(Call * call) // Call* SFLPhoneView::addCallToCallHistory(Call * call)
...@@ -216,7 +221,7 @@ void SFLPhoneView::typeString(QString str) ...@@ -216,7 +221,7 @@ void SFLPhoneView::typeString(QString str)
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
if(stackedWidget_screen->currentWidget() == page_callList) { if(stackedWidget_screen->currentWidget() == page_callList) {
Call* call = callTreeModel.getCurrentItem(); Call* call = callTreeModel->getCurrentItem();
callManager.playDTMF(str); callManager.playDTMF(str);
Call *currentCall = 0; Call *currentCall = 0;
Call *candidate = 0; Call *candidate = 0;
...@@ -227,13 +232,13 @@ void SFLPhoneView::typeString(QString str) ...@@ -227,13 +232,13 @@ void SFLPhoneView::typeString(QString str)
} }
} }
// for(int i = callTreeModel.size() - 1 ; i >= 0 ; i--) // for(int i = callTreeModel->size() - 1 ; i >= 0 ; i--)
// { // {
// Call *call2 = (*callList)[i]; // Call *call2 = (*callList)[i];
// //
// //
// } // }
foreach (Call* call2, callTreeModel.getCallList()) { foreach (Call* call2, callTreeModel->getCallList()) {
if(currentCall != call2 && call2->getState() == CALL_STATE_CURRENT) { if(currentCall != call2 && call2->getState() == CALL_STATE_CURRENT) {
action(call2, CALL_ACTION_HOLD); action(call2, CALL_ACTION_HOLD);
} }
...@@ -244,9 +249,9 @@ void SFLPhoneView::typeString(QString str) ...@@ -244,9 +249,9 @@ void SFLPhoneView::typeString(QString str)
if(!currentCall && !candidate) { if(!currentCall && !candidate) {
qDebug() << "Typing when no item is selected. Opening an item."; qDebug() << "Typing when no item is selected. Opening an item.";
candidate = callTreeModel.addDialingCall(); candidate = callTreeModel->addDialingCall();
//callTree->setCurrentRow(callTree->count() + 1); //TODO //callTree->setCurrentRow(callTree->count() + 1); //TODO
//callTreeModel.selectItem(addCallToCallList(candidate)); //callTreeModel->selectItem(addCallToCallList(candidate));
} }
if(!currentCall && candidate) { if(!currentCall && candidate) {
...@@ -270,19 +275,19 @@ void SFLPhoneView::backspace() ...@@ -270,19 +275,19 @@ void SFLPhoneView::backspace()
qDebug() << "backspace"; qDebug() << "backspace";
if(stackedWidget_screen->currentWidget() == page_callList) { if(stackedWidget_screen->currentWidget() == page_callList) {
qDebug() << "In call list."; qDebug() << "In call list.";
Call* call = callTreeModel.getCurrentItem(); Call* call = callTreeModel->getCurrentItem();
if(!call) { if(!call) {
qDebug() << "Error : Backspace on unexisting call."; qDebug() << "Error : Backspace on unexisting call.";
} }
else { else {
call->backspaceItemText(); call->backspaceItemText();
if(call->getState() == CALL_STATE_OVER) { if(call->getState() == CALL_STATE_OVER) {
if (callTreeModel.getCurrentItem()) if (callTreeModel->getCurrentItem())
callTreeModel.removeItem(callTreeModel.getCurrentItem()); callTreeModel->removeItem(callTreeModel->getCurrentItem());
if(call->getHistoryState() != NONE) { if(call->getHistoryState() != NONE) {
//historyTree->insert(call); //historyTree->insert(call);
historyTreeModel.addCall(call); historyTreeModel->addCall(call);
} }
} }
} }
...@@ -294,7 +299,7 @@ void SFLPhoneView::escape() ...@@ -294,7 +299,7 @@ void SFLPhoneView::escape()
qDebug() << "escape"; qDebug() << "escape";
if(stackedWidget_screen->currentWidget() == page_callList ) { if(stackedWidget_screen->currentWidget() == page_callList ) {
qDebug() << "In call list."; qDebug() << "In call list.";
Call* call = callTreeModel.getCurrentItem(); Call* call = callTreeModel->getCurrentItem();
if(!call) { if(!cal