From c3a5ca97f6ae402c0e8d9ddbf49002d53daf9230 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Quentin?= <jquentin@jquentin-laptop-kub2.(none)> Date: Wed, 8 Apr 2009 17:08:47 -0400 Subject: [PATCH] Account choice on right click, clean out includes, page address book, fixed bugs... --- sflphone_kde/Account.cpp | 94 +++--- sflphone_kde/Account.h | 20 +- sflphone_kde/AccountItemWidget.cpp | 102 +++++++ sflphone_kde/AccountItemWidget.h | 67 +++++ sflphone_kde/AccountList.cpp | 73 ++++- sflphone_kde/AccountList.h | 11 +- sflphone_kde/AccountWizard.cpp | 28 +- sflphone_kde/ActionSetAccountFirst.cpp | 39 +++ sflphone_kde/ActionSetAccountFirst.h | 50 ++++ sflphone_kde/Automate.cpp | 149 ---------- sflphone_kde/Automate.h | 97 ------ sflphone_kde/CMakeLists.txt | 9 +- sflphone_kde/Call.cpp | 25 +- sflphone_kde/Call.h | 11 +- sflphone_kde/CallList.h | 4 + sflphone_kde/ConfigDialog.cpp | 80 +++-- sflphone_kde/ConfigDialog.h | 20 +- sflphone_kde/ConfigDialog.ui | 84 +++++- sflphone_kde/Contact.cpp | 43 +++ sflphone_kde/Contact.h | 46 +++ sflphone_kde/SFLPhone.cpp | 279 +++++++++++++++--- sflphone_kde/SFLPhone.h | 28 +- .../callmanager_interface_singleton.cpp | 22 +- .../callmanager_interface_singleton.h | 2 +- .../configurationmanager-introspec.xml | 32 ++ .../configurationmanager_interface_p.h | 43 ++- ...nfigurationmanager_interface_singleton.cpp | 10 +- ...configurationmanager_interface_singleton.h | 2 +- sflphone_kde/icons/office-address-book.png | Bin 0 -> 6651 bytes sflphone_kde/icons/x-office-address-book.png | Bin 0 -> 4051 bytes sflphone_kde/instance-introspec.xml | 18 ++ sflphone_kde/instance_interface.cpp | 26 ++ sflphone_kde/instance_interface_p.h | 70 +++++ sflphone_kde/instance_interface_singleton.cpp | 44 +++ sflphone_kde/instance_interface_singleton.h | 44 +++ sflphone_kde/main.cpp | 26 +- sflphone_kde/metatypes.h | 9 +- sflphone_kde/resources.qrc | 2 + sflphone_kde/sflphone-qt.ui | 28 +- sflphone_kde/sflphone_const.cpp | 19 -- sflphone_kde/sflphone_const.h | 54 ++-- 41 files changed, 1323 insertions(+), 487 deletions(-) create mode 100644 sflphone_kde/AccountItemWidget.cpp create mode 100644 sflphone_kde/AccountItemWidget.h create mode 100644 sflphone_kde/ActionSetAccountFirst.cpp create mode 100644 sflphone_kde/ActionSetAccountFirst.h delete mode 100644 sflphone_kde/Automate.cpp delete mode 100644 sflphone_kde/Automate.h create mode 100644 sflphone_kde/Contact.cpp create mode 100644 sflphone_kde/Contact.h create mode 100644 sflphone_kde/icons/office-address-book.png create mode 100644 sflphone_kde/icons/x-office-address-book.png create mode 100644 sflphone_kde/instance-introspec.xml create mode 100644 sflphone_kde/instance_interface.cpp create mode 100644 sflphone_kde/instance_interface_p.h create mode 100644 sflphone_kde/instance_interface_singleton.cpp create mode 100644 sflphone_kde/instance_interface_singleton.h delete mode 100644 sflphone_kde/sflphone_const.cpp diff --git a/sflphone_kde/Account.cpp b/sflphone_kde/Account.cpp index 1247e392ad..4d79eb7a22 100644 --- a/sflphone_kde/Account.cpp +++ b/sflphone_kde/Account.cpp @@ -1,11 +1,10 @@ #include "Account.h" + +#include <QtGui/QApplication> + #include "sflphone_const.h" #include "configurationmanager_interface_singleton.h" -#include "kled.h" - -#include <iostream> -using namespace std; const QString account_state_name(QString & s) { @@ -61,41 +60,26 @@ void Account::setItemText(QString text) void Account::initAccountItem() { - ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + //ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); item = new QListWidgetItem(); item->setSizeHint(QSize(140,25)); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled); bool enabled = getAccountDetail(*(new QString(ACCOUNT_ENABLED))) == ACCOUNT_ENABLED_TRUE; setItemText(getAccountDetail(*(new QString(ACCOUNT_ALIAS)))); - itemWidget = new QWidget(); - QCheckBox * checkbox = new QCheckBox(itemWidget); - checkbox->setObjectName(QString(ACCOUNT_ITEM_CHECKBOX)); - checkbox->setCheckState(enabled ? Qt::Checked : Qt::Unchecked); - KLed * led = new KLed(itemWidget); - led->setObjectName(QString(ACCOUNT_ITEM_LED)); - led->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); - if(! isNew() && enabled) + itemWidget = new AccountItemWidget(); + itemWidget->setEnabled(enabled); + if(isNew() || !enabled) + { + itemWidget->setState(AccountItemWidget::Unregistered); + } + else if(getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) { - led->setState(KLed::On); - if(getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) - { - led->setColor(QColor(0,255,0)); - } - else - { - led->setColor(QColor(255,0,0)); - } + itemWidget->setState(AccountItemWidget::Registered); } else { - led->setState(KLed::Off); + itemWidget->setState(AccountItemWidget::NotWorking); } - QHBoxLayout* hlayout = new QHBoxLayout(); - hlayout->setContentsMargins(0,0,0,0); - hlayout->addWidget(checkbox); - hlayout->addWidget(led); - itemWidget->setLayoutDirection(Qt::LeftToRight); - itemWidget->setLayout(hlayout); } Account * Account::buildExistingAccountFromId(QString _accountId) @@ -112,7 +96,7 @@ Account * Account::buildNewAccountFromAlias(QString alias) { Account * a = new Account(); a->accountDetails = new MapStringString(); - a->setAccountDetail(QString(ACCOUNT_ALIAS),alias); + a->setAccountDetail(ACCOUNT_ALIAS,alias); a->initAccountItem(); return a; } @@ -126,23 +110,26 @@ Account::~Account() //Getters -bool Account::isNew() +bool Account::isNew() const { - qDebug() << accountId; - return(!accountId); + return (accountId == NULL); } -bool Account::isChecked() +bool Account::isChecked() const { - return itemWidget->findChild<QCheckBox *>(QString(ACCOUNT_ITEM_CHECKBOX))->checkState() == Qt::Checked; + return itemWidget->getEnabled(); } QString & Account::getAccountId() { + if (isNew()) + { + qDebug() << "Error : getting AccountId of a new account."; + } return *accountId; } -MapStringString & Account::getAccountDetails() +MapStringString & Account::getAccountDetails() const { return *accountDetails; } @@ -150,14 +137,36 @@ MapStringString & Account::getAccountDetails() QListWidgetItem * Account::getItem() { if(!item) - cout<<"null"<<endl; + qDebug() << "null" ; return item; } -QWidget * Account::getItemWidget() +QListWidgetItem * Account::renewItem() { if(!item) - cout<<"null"<<endl; + qDebug() << "null" ; + item = new QListWidgetItem(*item); + return item; +} + +AccountItemWidget * Account::getItemWidget() +{ + delete itemWidget; + bool enabled = getAccountDetail(*(new QString(ACCOUNT_ENABLED))) == ACCOUNT_ENABLED_TRUE; + itemWidget = new AccountItemWidget(); + itemWidget->setEnabled(enabled); + if(isNew() || !enabled) + { + itemWidget->setState(AccountItemWidget::Unregistered); + } + else if(getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) + { + itemWidget->setState(AccountItemWidget::Registered); + } + else + { + itemWidget->setState(AccountItemWidget::NotWorking); + } return itemWidget; } @@ -185,11 +194,16 @@ QString Account::getStateColorName() return "red"; } -QString Account::getAccountDetail(QString & param) +QString Account::getAccountDetail(QString param) const { return (*accountDetails)[param]; } +QString Account::getAlias() +{ + return getAccountDetail(ACCOUNT_ALIAS); +} + //Setters diff --git a/sflphone_kde/Account.h b/sflphone_kde/Account.h index f3fedda48e..73be6d50fd 100644 --- a/sflphone_kde/Account.h +++ b/sflphone_kde/Account.h @@ -1,8 +1,12 @@ #ifndef ACCOUNT_H #define ACCOUNT_H -#include <QtGui> +#include <QtCore/QString> +#include <QtGui/QListWidgetItem> +#include <QtGui/QColor> + #include "metatypes.h" +#include "AccountItemWidget.h" const QString account_state_name(QString & s); @@ -13,7 +17,7 @@ private: QString * accountId; MapStringString * accountDetails; QListWidgetItem * item; - QWidget * itemWidget; + AccountItemWidget * itemWidget; Account(); @@ -26,16 +30,18 @@ public: ~Account(); //Getters - bool isNew(); - bool isChecked(); + bool isNew() const; + bool isChecked() const; QString & getAccountId(); - MapStringString & getAccountDetails(); + MapStringString & getAccountDetails() const; QListWidgetItem * getItem(); - QWidget * getItemWidget(); + QListWidgetItem * renewItem(); + AccountItemWidget * getItemWidget(); QString getStateName(QString & state); QColor getStateColor(); QString getStateColorName(); - QString getAccountDetail(QString & param); + QString getAccountDetail(QString param) const; + QString getAlias(); //Setters void setItemText(QString text); diff --git a/sflphone_kde/AccountItemWidget.cpp b/sflphone_kde/AccountItemWidget.cpp new file mode 100644 index 0000000000..11b7985d29 --- /dev/null +++ b/sflphone_kde/AccountItemWidget.cpp @@ -0,0 +1,102 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "AccountItemWidget.h" + +#include <QtGui/QHBoxLayout> +#include <QtCore/QDebug> + +#include "sflphone_const.h" + +AccountItemWidget::AccountItemWidget(QWidget *parent) + : QWidget(parent) +{ + checkBox = new QCheckBox(this); + //checkbox->setObjectName(QString(ACCOUNT_ITEM_CHECKBOX)); + led = new KLed(this); + //led->setObjectName(QString(ACCOUNT_ITEM_LED)); + led->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed)); + + QHBoxLayout* hlayout = new QHBoxLayout(); + hlayout->setContentsMargins(0,0,0,0); + hlayout->addWidget(checkBox); + hlayout->addWidget(led); + this->setLayout(hlayout); + state = Unregistered; + enabled = false; + updateDisplay(); +} + + +AccountItemWidget::~AccountItemWidget() +{ +} + + +void AccountItemWidget::updateStateDisplay() +{ + switch(state) + { + case Registered: + led->setState(KLed::On); + led->setColor(QColor(0,255,0)); + break; + case Unregistered: + led->setState(KLed::Off); + led->setColor(QColor(0,255,0)); + break; + case NotWorking: + led->setState(KLed::On); + led->setColor(QColor(255,0,0)); + break; + default: + qDebug() << "Calling AccountItemWidget::setState with value " << state << ", not part of enum AccountItemWidget::State."; + } +} + +void AccountItemWidget::updateEnabledDisplay() +{ + checkBox->setCheckState(enabled ? Qt::Checked : Qt::Unchecked); +} + +void AccountItemWidget::updateDisplay() +{ + updateStateDisplay(); + updateEnabledDisplay(); +} + +void AccountItemWidget::setState(int state) +{ + this->state = state; + updateStateDisplay(); + //emit stateChanged; +} + +void AccountItemWidget::setEnabled(bool enabled) +{ + this->enabled = enabled; + updateEnabledDisplay(); + //emit enabledChanged; +} + +bool AccountItemWidget::getEnabled() +{ + return checkBox->checkState(); +} diff --git a/sflphone_kde/AccountItemWidget.h b/sflphone_kde/AccountItemWidget.h new file mode 100644 index 0000000000..3b5652891f --- /dev/null +++ b/sflphone_kde/AccountItemWidget.h @@ -0,0 +1,67 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef ACCOUNTITEMWIDGET_H +#define ACCOUNTITEMWIDGET_H + +#include <QWidget> +#include <QCheckBox> +#include "kled.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class AccountItemWidget : public QWidget +{ +Q_OBJECT + +private: + + int state; + bool enabled; + KLed * led; + QCheckBox * checkBox; + +public: + + enum State {Registered, Unregistered, NotWorking}; + + AccountItemWidget(QWidget *parent = 0); + + ~AccountItemWidget(); + + void setState(int state); + + void setEnabled(bool enabled); + + void updateStateDisplay(); + + void updateEnabledDisplay(); + + void updateDisplay(); + + int getState(); + + bool getEnabled(); + + +}; + +#endif diff --git a/sflphone_kde/AccountList.cpp b/sflphone_kde/AccountList.cpp index 915189f941..07c1d158cc 100644 --- a/sflphone_kde/AccountList.cpp +++ b/sflphone_kde/AccountList.cpp @@ -1,6 +1,6 @@ #include "AccountList.h" #include "sflphone_const.h" - +#include "configurationmanager_interface_singleton.h" //Constructors /* @@ -15,6 +15,7 @@ AccountList::AccountList(VectorString & _accountIds) */ AccountList::AccountList(QStringList & _accountIds) { + firstAccount = NULL; accounts = new QVector<Account *>(); for (int i = 0; i < _accountIds.size(); ++i){ (*accounts) += Account::buildExistingAccountFromId(_accountIds[i]); @@ -23,6 +24,7 @@ AccountList::AccountList(QStringList & _accountIds) AccountList::AccountList() { + firstAccount = NULL; ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); //ask for the list of accounts ids to the configurationManager QStringList accountIds = configurationManager.getAccountList().value(); @@ -32,6 +34,58 @@ AccountList::AccountList() } } +void AccountList::update() +{ + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + Account * current; + for (int i = 0; i < accounts->size(); i++){ + current = (*accounts)[i]; + if (!(*accounts)[i]->isNew()) + removeAccount(current); + } + //ask for the list of accounts ids to the configurationManager + QStringList accountIds = configurationManager.getAccountList().value(); + for (int i = 0; i < accountIds.size(); ++i){ + accounts->insert(i, Account::buildExistingAccountFromId(accountIds[i])); + } +} + +QVector<Account *> AccountList::registeredAccounts() const +{ + QVector<Account *> registeredAccounts; + Account * current; + for (int i = 0; i < accounts->count(); ++i){ + current = (*accounts)[i]; + if(current->getAccountDetail(ACCOUNT_STATUS) == QString(ACCOUNT_STATE_REGISTERED)) + { + registeredAccounts.append(current); + } + } + return registeredAccounts; +} + +Account * AccountList::firstRegisteredAccount() const +{ + if(firstAccount != NULL) + { + return firstAccount; + } + Account * current; + for (int i = 0; i < accounts->count(); ++i){ + current = (*accounts)[i]; + if(current->getAccountDetail(ACCOUNT_STATUS) == QString(ACCOUNT_STATE_REGISTERED)) + { + return current; + } + } + return NULL; +} + +void AccountList::setAccountFirst(Account * account) +{ + firstAccount = account; +} + AccountList::~AccountList() { delete accounts; @@ -45,11 +99,15 @@ QVector<Account *> & AccountList::getAccounts() Account * AccountList::getAccountById(QString & id) { - qDebug() << "for "; - for (int i = 0; i < accounts->size(); ++i){ - qDebug() << "account " << i << " (*accounts)[i]->getAccountId() " << (*accounts)[i]->getAccountId(); - if ((*accounts)[i]->getAccountId() == id) + qDebug() << "for " << accounts->size(); + for (int i = 0; i < accounts->size(); ++i) + { + qDebug() << "account " << i << " (*accounts)[i]->getAccountId() " << (*accounts)[i]; + if (!(*accounts)[i]->isNew() && (*accounts)[i]->getAccountId() == id) + { + qDebug() << "found "; return (*accounts)[i]; + } } return NULL; } @@ -108,6 +166,11 @@ void AccountList::removeAccount(QListWidgetItem * item) accounts->remove(accounts->indexOf(a)); } +void AccountList::removeAccount(Account * account) +{ + accounts->remove(accounts->indexOf(account)); +} + const Account & AccountList::operator[] (int i) const { return *((*accounts)[i]); diff --git a/sflphone_kde/AccountList.h b/sflphone_kde/AccountList.h index dba419d63f..4c6c95d577 100644 --- a/sflphone_kde/AccountList.h +++ b/sflphone_kde/AccountList.h @@ -1,7 +1,9 @@ #ifndef ACCOUNT_LIST_H #define ACCOUNT_LIST_H -#include <QtGui> + +#include <QtCore/QVector> + #include "Account.h" class AccountList{ @@ -9,11 +11,13 @@ class AccountList{ private: QVector<Account *> * accounts; + Account * firstAccount; public: //Constructors AccountList(QStringList & _accountIds); + AccountList(); ~AccountList(); //Getters @@ -22,14 +26,19 @@ public: QVector<Account *> getAccountByState(QString & state); Account * getAccountByItem(QListWidgetItem * item); int size(); + Account * firstRegisteredAccount() const; //Setters Account * addAccount(QString & alias); + void removeAccount(Account * account); void removeAccount(QListWidgetItem * item); + void setAccountFirst(Account * account); //Operators Account & operator[] (int i); const Account & operator[] (int i) const; + QVector<Account *> registeredAccounts() const; + void update(); }; diff --git a/sflphone_kde/AccountWizard.cpp b/sflphone_kde/AccountWizard.cpp index aaad97d8b5..552cc81723 100644 --- a/sflphone_kde/AccountWizard.cpp +++ b/sflphone_kde/AccountWizard.cpp @@ -173,12 +173,13 @@ void AccountWizard::accept() { QString ret; MapStringString accountDetails; - accountDetails[QString(ACCOUNT_ALIAS)] = QString(); - accountDetails[QString(ACCOUNT_HOSTNAME)] = QString(); - accountDetails[QString(ACCOUNT_USERNAME)] = QString(); - accountDetails[QString(ACCOUNT_PASSWORD)] = QString(); - accountDetails[QString(ACCOUNT_TYPE)] = QString(); - accountDetails[QString(ACCOUNT_MAILBOX)] = QString(); + //accountDetails[QString(ACCOUNT_ALIAS)] = QString(); + //accountDetails[QString(ACCOUNT_HOSTNAME)] = QString(); + //accountDetails[QString(ACCOUNT_USERNAME)] = QString(); + //accountDetails[QString(ACCOUNT_PASSWORD)] = QString(); + //accountDetails[QString(ACCOUNT_TYPE)] = QString(); + //accountDetails[QString(ACCOUNT_MAILBOX)] = QString(); + //accountDetails[QString(ACCOUNT_ENABLED)] = QString(); QString & alias = accountDetails[QString(ACCOUNT_ALIAS)]; QString & server = accountDetails[QString(ACCOUNT_HOSTNAME)]; @@ -186,6 +187,7 @@ void AccountWizard::accept() QString & password = accountDetails[QString(ACCOUNT_PASSWORD)]; QString & protocol = accountDetails[QString(ACCOUNT_TYPE)]; QString & mailbox = accountDetails[QString(ACCOUNT_MAILBOX)]; + QString & enabled = accountDetails[QString(ACCOUNT_ENABLED)]; bool createAccount = false; bool sip = false; @@ -240,25 +242,17 @@ void AccountWizard::accept() } if(createAccount) { - mailbox = QString(ACCOUNT_MAILBOX_DEFAULT_VALUE); - qDebug() << "ligne1"; + mailbox = ACCOUNT_MAILBOX_DEFAULT_VALUE; + enabled = ACCOUNT_ENABLED_TRUE; ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - qDebug() << "ligne2"; QString accountId = configurationManager.addAccount(accountDetails); - qDebug() << "ligne3"; - configurationManager.sendRegister(accountId, 1); - qDebug() << "ligne4"; + //configurationManager.sendRegister(accountId, 1); if(sip) { - qDebug() << "ligne5"; bool enableStun = field(FIELD_ENABLE_STUN).toBool(); - qDebug() << "ligne6"; QString stunServer = field(FIELD_STUN_SERVER).toString(); - qDebug() << "ligne7"; if(enableStun != configurationManager.isStunEnabled()) configurationManager.enableStun(); - qDebug() << "ligne8"; if(enableStun) configurationManager.setStunServer(stunServer); - qDebug() << "ligne9"; } ret += tr("Alias : ") + alias + "\n"; ret += tr("Server : ") + server + "\n"; diff --git a/sflphone_kde/ActionSetAccountFirst.cpp b/sflphone_kde/ActionSetAccountFirst.cpp new file mode 100644 index 0000000000..bef7dbc8cd --- /dev/null +++ b/sflphone_kde/ActionSetAccountFirst.cpp @@ -0,0 +1,39 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "ActionSetAccountFirst.h" + +ActionSetAccountFirst::ActionSetAccountFirst(Account * account, QObject *parent) + : QAction(account->getAlias(), parent) +{ + this->account = account; + connect(this, SIGNAL(triggered()), + this, SLOT(emitSetFirst())); +} + + +ActionSetAccountFirst::~ActionSetAccountFirst() +{ +} + +void ActionSetAccountFirst::emitSetFirst() +{ + emit setFirst(account); +} diff --git a/sflphone_kde/ActionSetAccountFirst.h b/sflphone_kde/ActionSetAccountFirst.h new file mode 100644 index 0000000000..6d53166ff5 --- /dev/null +++ b/sflphone_kde/ActionSetAccountFirst.h @@ -0,0 +1,50 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef ACTION_SET_ACCOUNT_FIRST_H +#define ACTION_SET_ACCOUNT_FIRST_H + +#include <QAction> + +#include "Account.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class ActionSetAccountFirst : public QAction +{ +Q_OBJECT + +private: + Account * account; +public: + ActionSetAccountFirst(Account * account, QObject *parent = 0); + + ~ActionSetAccountFirst(); + +private slots: + void emitSetFirst(); + +signals: + void setFirst(Account * account); + +}; + +#endif diff --git a/sflphone_kde/Automate.cpp b/sflphone_kde/Automate.cpp deleted file mode 100644 index c80fea24f0..0000000000 --- a/sflphone_kde/Automate.cpp +++ /dev/null @@ -1,149 +0,0 @@ - -#include "Automate.h" - -#include "callmanager_interface_p.h" -#include "callmanager_interface_singleton.h" -#include "SFLPhone.h" - - - -const call_state Automate::stateMap [11][5] = -{ -// ACCEPT REFUSE TRANSFER HOLD RECORD -/*INCOMING */ {CALL_STATE_CURRENT , CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_HOLD , CALL_STATE_INCOMING }, -/*RINGING */ {CALL_STATE_ERROR , CALL_STATE_OVER , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_RINGING }, -/*CURRENT */ {CALL_STATE_ERROR , CALL_STATE_OVER , CALL_STATE_TRANSFER , CALL_STATE_HOLD , CALL_STATE_CURRENT }, -/*DIALING */ {CALL_STATE_RINGING , CALL_STATE_OVER , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_DIALING }, -/*HOLD */ {CALL_STATE_ERROR , CALL_STATE_OVER , CALL_STATE_TRANSFER_HOLD , CALL_STATE_CURRENT , CALL_STATE_HOLD }, -/*FAILURE */ {CALL_STATE_ERROR , CALL_STATE_OVER , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR }, -/*BUSY */ {CALL_STATE_ERROR , CALL_STATE_OVER , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR }, -/*TRANSFER */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_CURRENT , CALL_STATE_TRANSFER_HOLD , CALL_STATE_TRANSFER }, -/*TRANSFER_HOLD */ {CALL_STATE_OVER , CALL_STATE_OVER , CALL_STATE_HOLD , CALL_STATE_TRANSFER , CALL_STATE_TRANSFER_HOLD }, -/*OVER */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR }, -/*ERROR */ {CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR , CALL_STATE_ERROR } -}; - -const function Automate::functionMap[11][5] = -{ -// ACCEPT REFUSE TRANSFER HOLD -/*INCOMING */ {&Automate::accept , &Automate::refuse , &Automate::acceptTransf , &Automate::acceptHold , &Automate::switchRecord }, -/*RINGING */ {&Automate::nothing , &Automate::hangUp , &Automate::nothing , &Automate::nothing , &Automate::switchRecord }, -/*CURRENT */ {&Automate::nothing , &Automate::hangUp , &Automate::nothing , &Automate::hold , &Automate::setRecord }, -/*DIALING */ {&Automate::call , &Automate::nothing , &Automate::nothing , &Automate::nothing , &Automate::switchRecord }, -/*HOLD */ {&Automate::nothing , &Automate::hangUp , &Automate::nothing , &Automate::unhold , &Automate::setRecord }, -/*FAILURE */ {&Automate::nothing , &Automate::hangUp , &Automate::nothing , &Automate::nothing , &Automate::nothing }, -/*BUSY */ {&Automate::nothing , &Automate::hangUp , &Automate::nothing , &Automate::nothing , &Automate::nothing }, -/*TRANSFERT */ {&Automate::transfer , &Automate::hangUp , &Automate::nothing , &Automate::hold , &Automate::setRecord }, -/*TRANSFERT_HOLD */ {&Automate::transfer , &Automate::hangUp , &Automate::nothing , &Automate::unhold , &Automate::setRecord }, -/*OVER */ {&Automate::nothing , &Automate::nothing , &Automate::nothing , &Automate::nothing , &Automate::nothing }, -/*ERROR */ {&Automate::nothing , &Automate::nothing , &Automate::nothing , &Automate::nothing , &Automate::nothing } -}; - -call_state Automate::action(call_action action, QString callId, QString number) -{ - call_state previousState = currentState; - //execute the action associated with this transition - (this->*(functionMap[currentState][action]))(callId, number); - //update the state - currentState = stateMap[currentState][action]; - qDebug() << "Calling action " << action << " on call with state " << previousState << ". Become " << currentState; - //return the new state - return currentState; -} - -Automate::Automate(call_state startState) -{ - //this->parent = parent; - recording = false; - currentState = startState; -} - -call_state Automate::getCurrentState() const -{ - return currentState; -} - -void Automate::nothing(QString callId, QString number) -{ -} - -void Automate::accept(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Accepting call. callId : " << callId; - callManager.accept(callId); -} - -void Automate::refuse(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Refusing call. callId : " << callId; - callManager.refuse(callId); -} - -void Automate::acceptTransf(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Accepting call and transfering it to number : " << number << ". callId : " << callId; - callManager.accept(callId); - callManager.transfert(callId, number); -} - -void Automate::acceptHold(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Accepting call and holding it. callId : " << callId; - callManager.accept(callId); - callManager.hold(callId); -} - -void Automate::hangUp(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Hanging up call. callId : " << callId; - callManager.hangUp(callId); -} - -void Automate::hold(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Holding call. callId : " << callId; - callManager.hold(callId); -} - -void Automate::call(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - QString account = SFLPhone::firstAccount(); - qDebug() << "Calling " << number << " with account " << account << ". callId : " << callId; - callManager.placeCall(account, callId, number); -} - -void Automate::transfer(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - QString account = SFLPhone::firstAccount(); - qDebug() << "Transfering call to number : " << number << ". callId : " << callId; - callManager.transfert(callId, number); -} - -void Automate::unhold(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Unholding call. callId : " << callId; - callManager.unhold(callId); -} - -void Automate::switchRecord(QString callId, QString number) -{ - qDebug() << "Switching record state for call automate. callId : " << callId; - recording = !recording; -} - -void Automate::setRecord(QString callId, QString number) -{ - CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - qDebug() << "Setting record for call. callId : " << callId; - callManager.unhold(callId); -} - diff --git a/sflphone_kde/Automate.h b/sflphone_kde/Automate.h deleted file mode 100644 index 8199d92559..0000000000 --- a/sflphone_kde/Automate.h +++ /dev/null @@ -1,97 +0,0 @@ -#ifndef AUTOMATE_H -#define AUTOMATE_H - -#include <QtGui> -//#include "Call.h" - -/** @enum call_state_t - * This enum have all the states a call can take. - */ -typedef enum -{ - /** Ringing incoming call */ - CALL_STATE_INCOMING, - /** Ringing outgoing call */ - CALL_STATE_RINGING, - /** Call to which the user can speak and hear */ - CALL_STATE_CURRENT, - /** Call which numbers are being added by the user */ - CALL_STATE_DIALING, - /** Call is on hold */ - CALL_STATE_HOLD, - /** Call has failed */ - CALL_STATE_FAILURE, - /** Call is busy */ - CALL_STATE_BUSY, - /** Call is being transfered. During this state, the user can enter the new number. */ - CALL_STATE_TRANSFER, - /** Call is on hold for transfer */ - CALL_STATE_TRANSFER_HOLD, - /** Call is over and should not be used */ - CALL_STATE_OVER, - /** This state should never be reached */ - CALL_STATE_ERROR -} call_state; - - -/** @enum call_action - * This enum have all the actions you can make on a call. - */ -typedef enum -{ - /** Green button, accept or new call or place call or place transfer */ - CALL_ACTION_ACCEPT, - /** Red button, refuse or hang up */ - CALL_ACTION_REFUSE, - /** Blue button, put into or out of transfer mode where you can type transfer number */ - CALL_ACTION_TRANSFER, - /** Blue-green button, hold or unhold the call */ - CALL_ACTION_HOLD, - /** Record button, enable or disable recording */ - CALL_ACTION_RECORD -} call_action; - - -class Automate; - -typedef void (Automate::*function)(QString callId, QString number); - -//class Call; - -class Automate -{ -private: - - static const call_state stateMap [11][5]; - - static const function functionMap[11][5]; - - //Call * parent; - call_state currentState; - bool recording; - -public: - - Automate(call_state startState); - call_state action(call_action action, QString callId, QString number = NULL); - call_state getCurrentState() const; - - void nothing(QString callId, QString number); - void accept(QString callId, QString number); - void refuse(QString callId, QString number); - void acceptTransf(QString callId, QString number); - void acceptHold(QString callId, QString number); - void hangUp(QString callId, QString number); - void hold(QString callId, QString number); - void call(QString callId, QString number); - void transfer(QString callId, QString number); - void unhold(QString callId, QString number); - void switchRecord(QString callId, QString number); - void setRecord(QString callId, QString number); - -}; - - - - -#endif \ No newline at end of file diff --git a/sflphone_kde/CMakeLists.txt b/sflphone_kde/CMakeLists.txt index d12fd80b51..1f6176ef09 100644 --- a/sflphone_kde/CMakeLists.txt +++ b/sflphone_kde/CMakeLists.txt @@ -11,7 +11,7 @@ SET( SFLPhone.cpp ConfigDialog.cpp main.cpp - sflphone_const.cpp + sflphone_const.h Account.cpp AccountList.cpp Call.cpp @@ -20,7 +20,12 @@ SET( configurationmanager_interface_singleton.cpp callmanager_interface.cpp callmanager_interface_singleton.cpp + instance_interface.cpp + instance_interface_singleton.cpp AccountWizard.cpp + AccountItemWidget.cpp + ActionSetAccountFirst.cpp + Contact.cpp ) SET(QtApp_RCCS resources.qrc) @@ -38,7 +43,7 @@ kde4_add_kcfg_files(sflphone_kde_SRCS settings.kcfgc ) kde4_add_executable(sflphone_kde ${sflphone_kde_SRCS} ${QtApp_RCC_SRCS}) -target_link_libraries(sflphone_kde ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS}) +target_link_libraries(sflphone_kde ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${KDE4_KABCdef_LIBS}) install(TARGETS sflphone_kde DESTINATION ${BIN_INSTALL_DIR} ) diff --git a/sflphone_kde/Call.cpp b/sflphone_kde/Call.cpp index fa61898d53..36bef1df4f 100644 --- a/sflphone_kde/Call.cpp +++ b/sflphone_kde/Call.cpp @@ -72,6 +72,7 @@ void Call::initCallItem() itemWidget = new QWidget(); labelIcon = new QLabel(itemWidget); + qDebug() << "labelIcon : " << labelIcon; labelCallNumber = new QLabel(peer, itemWidget); labelTransferPrefix = new QLabel("Transfer to : ", itemWidget); labelTransferNumber = new QLabel(itemWidget); @@ -84,14 +85,7 @@ void Call::initCallItem() layout->addWidget(labelTransferPrefix, 1, 1, 1, 1); layout->addWidget(labelTransferNumber, 1, 2, 1, 2); layout->addItem(horizontalSpacer, 0, 3, 1, 3); - //labelIcon->raise(); - //labelCallNumber->raise(); - //labelTransferTo->raise(); - //labelTransferNumber->raise(); - //itemWidget->setLayoutDirection(Qt::LeftToRight); itemWidget->setLayout(layout); - //item->setSizeHint(itemWidget->sizeHint()); - //setItemIcon(QString(ICON_REFUSE)); } void Call::setItemIcon(const QString pixmap) @@ -108,6 +102,9 @@ Call::Call(call_state startState, QString callId, QString from, QString account) this->account = account; this->recording = false; this->historyItem = NULL; + this->historyItemWidget = NULL; + this->startTime = NULL; + this->stopTime = NULL; } Call::~Call() @@ -115,12 +112,9 @@ Call::~Call() delete startTime; delete stopTime; delete item; - delete itemWidget; - delete labelIcon; - delete labelCallNumber; - delete labelTransferPrefix; - delete labelTransferNumber; + //delete itemWidget; delete historyItem; + //delete historyItemWidget; } Call * Call::buildDialingCall(QString callId) @@ -208,6 +202,11 @@ QListWidgetItem * Call::getHistoryItem() return historyItem; } +QWidget * Call::getHistoryItemWidget() +{ + return historyItemWidget; +} + call_state Call::getState() const { return currentState; @@ -332,7 +331,7 @@ void Call::call() { CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); QString number = labelCallNumber->text(); - this->account = SFLPhone::firstAccount(); + this->account = SFLPhone::firstAccountId(); if(!account.isEmpty()) { qDebug() << "Calling " << number << " with account " << account << ". callId : " << callId; diff --git a/sflphone_kde/Call.h b/sflphone_kde/Call.h index 0a788715ac..347ddc673c 100644 --- a/sflphone_kde/Call.h +++ b/sflphone_kde/Call.h @@ -1,7 +1,11 @@ #ifndef CALL_H #define CALL_H -#include <QtGui> -#include "Account.h" + +#include <QtCore/QString> +#include <QtCore/QDateTime> +#include <QtGui/QListWidgetItem> +#include <QtGui/QLabel> +#include <QtGui/QWidget> /** @enum call_state_t * This enum have all the states a call can take. @@ -90,6 +94,7 @@ class Call private: //Call attributes + QString account; QString callId; QString peer; @@ -104,6 +109,7 @@ private: QLabel * labelTransferNumber; QListWidgetItem * historyItem; + QWidget * historyItemWidget; //Automate attributes static const call_state actionPerformedStateMap [11][5]; @@ -144,6 +150,7 @@ public: QListWidgetItem * getItem(); QWidget * getItemWidget(); QListWidgetItem * getHistoryItem(); + QWidget * getHistoryItemWidget(); call_state getState() const; QString getCallId(); call_state stateChanged(const QString & newState); diff --git a/sflphone_kde/CallList.h b/sflphone_kde/CallList.h index 50842d3ca4..8ac1c7898c 100644 --- a/sflphone_kde/CallList.h +++ b/sflphone_kde/CallList.h @@ -1,6 +1,10 @@ #ifndef CALL_LIST_H #define CALL_LIST_H +#include <QtCore/QVector> +#include <QtCore/QString> +#include <QtGui/QListWidgetItem> + #include "Call.h" class CallList diff --git a/sflphone_kde/ConfigDialog.cpp b/sflphone_kde/ConfigDialog.cpp index 461c16c549..43ec28e592 100644 --- a/sflphone_kde/ConfigDialog.cpp +++ b/sflphone_kde/ConfigDialog.cpp @@ -1,15 +1,19 @@ -#include <QtGui> -#include <QtCore> -#include <iostream> -#include <stdarg.h> +#include "ConfigDialog.h" + +#include <QtGui/QStyle> +#include <QErrorMessage> +#include <QtGui/QAbstractItemView> +#include <QtGui/QInputDialog> +#include <QtGui/QHeaderView> + + + #include "sflphone_const.h" #include "metatypes.h" -#include "ConfigDialog.h" #include "configurationmanager_interface_singleton.h" -using namespace std; - +AccountList * ConfigurationDialog::accountList; ConfigurationDialog::ConfigurationDialog(SFLPhone *parent) : QDialog(parent) { @@ -58,6 +62,11 @@ ConfigurationDialog::~ConfigurationDialog() delete codecPayloads; } +AccountList * ConfigurationDialog::getAccountList() +{ + return accountList; +} + void ConfigurationDialog::loadOptions() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); @@ -240,7 +249,7 @@ void ConfigurationDialog::loadAccountList() for (int i = 0; i < accountList->size(); ++i){ addAccountToAccountList(&(*accountList)[i]); } - if (listWidget_accountList->count() > 0) + if (listWidget_accountList->count() > 0 && listWidget_accountList->currentItem() == NULL) listWidget_accountList->setCurrentRow(0); else frame2_editAccounts->setEnabled(false); @@ -277,6 +286,7 @@ void ConfigurationDialog::saveAccountList() currentId = QString(current.getAccountId()); } } + qDebug() << currentId << " : " << current.isChecked(); configurationManager.sendRegister(currentId, current.isChecked() ? 1 : 0 ); } //remove accounts that are in the configurationManager but not in the client @@ -307,11 +317,11 @@ void ConfigurationDialog::loadAccount(QListWidgetItem * item) delete protocolsList; edit2_protocol->setCurrentIndex( (protocolIndex < 0) ? 0 : protocolIndex ); - edit3_server->setText( account->getAccountDetail(*(new QString(ACCOUNT_HOSTNAME)))); - edit4_user->setText( account->getAccountDetail(*(new QString(ACCOUNT_USERNAME)))); - edit5_password->setText( account->getAccountDetail(*(new QString(ACCOUNT_PASSWORD)))); - edit6_mailbox->setText( account->getAccountDetail(*(new QString(ACCOUNT_MAILBOX)))); - QString status = account->getAccountDetail(*(new QString(ACCOUNT_STATUS))); + edit3_server->setText( account->getAccountDetail(ACCOUNT_HOSTNAME)); + edit4_user->setText( account->getAccountDetail(ACCOUNT_USERNAME)); + edit5_password->setText( account->getAccountDetail(ACCOUNT_PASSWORD)); + edit6_mailbox->setText( account->getAccountDetail(ACCOUNT_MAILBOX)); + QString status = account->getAccountDetail(ACCOUNT_STATUS); qDebug() << "Color : " << account->getStateColorName(); edit7_state->setText( "<FONT COLOR=\"" + account->getStateColorName() + "\">" + status + "</FONT>" ); //edit7_Etat->setTextColor( account->getStateColor ); @@ -332,7 +342,7 @@ void ConfigurationDialog::saveAccount(QListWidgetItem * item) account->setAccountDetail(ACCOUNT_USERNAME, edit4_user->text()); account->setAccountDetail(ACCOUNT_PASSWORD, edit5_password->text()); account->setAccountDetail(ACCOUNT_MAILBOX, edit6_mailbox->text()); - //account->setAccountDetail(ACCOUNT_ENABLED, account->getItemWidget()->findChild(*(new QString("checkbox"))).checkState() == Qt::Checked ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); + account->setAccountDetail(ACCOUNT_ENABLED, account->isChecked() ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE); account->setItemText(edit1_alias->text()); } @@ -473,7 +483,7 @@ void ConfigurationDialog::on_spinBox_SIPPort_valueChanged ( int value ) label_WarningSIP->setVisible(true); } -void ConfigurationDialog::on_listWidget_codecs_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) +void ConfigurationDialog::on_listWidget_codecs_currentItemChanged () { qDebug() << "on_listWidget_codecs_currentItemChanged"; updateCodecListCommands(); @@ -513,7 +523,7 @@ void ConfigurationDialog::on_toolButton_codecDown_clicked() void ConfigurationDialog::on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ) { - qDebug() << "on_listWidget_accountList_currentItemChanged"; + qDebug() << "on_listWidget_accountList_currentItemChanged : " << ((accountList->getAccountByItem(current) != NULL) ? accountList->getAccountByItem(current)->getAlias() : "null"); if(previous) saveAccount(previous); if(current) @@ -525,18 +535,35 @@ void ConfigurationDialog::on_button_accountUp_clicked() { qDebug() << "on_button_accountUp_clicked"; int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * item = listWidget_accountList->takeItem(currentRow); + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + Account * account = accountList->getAccountByItem(prevItem); + //we need to build a new item to set the itemWidget back + QListWidgetItem * item = account->renewItem(); + delete prevItem; listWidget_accountList->insertItem(currentRow - 1 , item); + listWidget_accountList->setItemWidget(item, account->getItemWidget()); listWidget_accountList->setCurrentItem(item); + //qDebug() << "setItemWidget " << account->getAccountDetail(ACCOUNT_ALIAS) << " , " << account->getItemWidget(); + } void ConfigurationDialog::on_button_accountDown_clicked() { qDebug() << "on_button_accountDown_clicked"; int currentRow = listWidget_accountList->currentRow(); - QListWidgetItem * item = listWidget_accountList->takeItem(currentRow); + qDebug() << "on_button_accountDown_clicked1"; + QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow); + qDebug() << "on_button_accountDown_clicked2"; + Account * account = accountList->getAccountByItem(prevItem); + QListWidgetItem * item = account->renewItem(); + delete prevItem; + qDebug() << "on_button_accountDown_clicked3"; listWidget_accountList->insertItem(currentRow + 1 , item); + qDebug() << "on_button_accountDown_clicked4 : " << account->getAlias() << " " << account->getItemWidget(); + listWidget_accountList->setItemWidget(item, account->getItemWidget()); + qDebug() << "on_button_accountDown_clicked5"; listWidget_accountList->setCurrentItem(item); + qDebug() << "on_button_accountDown_clicked6"; } void ConfigurationDialog::on_button_accountAdd_clicked() @@ -562,6 +589,12 @@ void ConfigurationDialog::on_button_accountRemove_clicked() listWidget_accountList->setCurrentRow( (r >= listWidget_accountList->count()) ? r-1 : r ); } +void ConfigurationDialog::on_toolButton_accountsApply_clicked() +{ + qDebug() << "on_toolButton_accountsApply_clicked"; + saveAccountList(); +} + void ConfigurationDialog::on_buttonBoxDialog_clicked(QAbstractButton * button) { @@ -586,7 +619,7 @@ void ConfigurationDialog::on_buttonBoxDialog_clicked(QAbstractButton * button) } } -void ConfigurationDialog::on_tableWidget_codecs_currentItemChanged(QTableWidgetItem * current, QTableWidgetItem * previous) +void ConfigurationDialog::on_tableWidget_codecs_currentItemChanged(QTableWidgetItem * current) { qDebug() << "on_tableWidget_codecs_currentItemChanged"; int row = current->row(); @@ -598,7 +631,7 @@ void ConfigurationDialog::on_tableWidget_codecs_currentItemChanged(QTableWidgetI updateCodecListCommands(); } -void ConfigurationDialog::on_tableWidget_codecs_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn) +void ConfigurationDialog::on_tableWidget_codecs_currentCellChanged(int currentRow) { qDebug() << "on_tableWidget_codecs_currentCellChanged"; int nbCol = tableWidget_codecs->columnCount(); @@ -612,6 +645,13 @@ void ConfigurationDialog::on_tableWidget_codecs_currentCellChanged(int currentRo void ConfigurationDialog::on1_accountsChanged() { qDebug() << "on1_accountsChanged"; + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + disconnect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); + accountList->update(); + loadAccountList(); + connect(&configurationManager, SIGNAL(accountsChanged()), + this, SLOT(on1_accountsChanged())); } void ConfigurationDialog::on1_parametersChanged() diff --git a/sflphone_kde/ConfigDialog.h b/sflphone_kde/ConfigDialog.h index 694cbebcd9..f3d32999a4 100644 --- a/sflphone_kde/ConfigDialog.h +++ b/sflphone_kde/ConfigDialog.h @@ -1,12 +1,16 @@ #ifndef HEADER_CONFIGDIALOG #define HEADER_CONFIGDIALOG -#include <QtGui> +#include <QtGui/QTableWidgetItem> +#include <QtGui/QListWidgetItem> +#include <QtCore/QString> +#include <QtGui/QAbstractButton> +#include <QErrorMessage> + #include "ui_ConfigDialog.h" #include "configurationmanager_interface_p.h" #include "AccountList.h" #include "SFLPhone.h" -#include <QErrorMessage> class SFLPhone; @@ -15,13 +19,14 @@ class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog Q_OBJECT private: - AccountList * accountList; + static AccountList * accountList; QErrorMessage * errorWindow; MapStringString * codecPayloads; public: ConfigurationDialog(SFLPhone *parent = 0); ~ConfigurationDialog(); + static AccountList * getAccountList(); void loadAccount(QListWidgetItem * item); void saveAccount(QListWidgetItem * item); @@ -51,14 +56,17 @@ private slots: void on_button_accountRemove_clicked(); void on_edit1_alias_textChanged(const QString & text); void on_listWidget_accountList_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); - void on_listWidget_codecs_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); + void on_listWidget_codecs_currentItemChanged (); void on_spinBox_SIPPort_valueChanged ( int value ); void on_buttonBoxDialog_clicked(QAbstractButton * button); - void on_tableWidget_codecs_currentItemChanged(QTableWidgetItem * current, QTableWidgetItem * previous); - void on_tableWidget_codecs_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn); + void on_tableWidget_codecs_currentItemChanged(QTableWidgetItem * current); + void on_tableWidget_codecs_currentCellChanged(int currentRow); + void on_toolButton_accountsApply_clicked(); + void on1_accountsChanged(); void on1_parametersChanged(); void on1_errorAlert(int code); + }; diff --git a/sflphone_kde/ConfigDialog.ui b/sflphone_kde/ConfigDialog.ui index 03b803514d..a837ca1bcd 100644 --- a/sflphone_kde/ConfigDialog.ui +++ b/sflphone_kde/ConfigDialog.ui @@ -6,8 +6,8 @@ <rect> <x>0</x> <y>0</y> - <width>504</width> - <height>449</height> + <width>508</width> + <height>456</height> </rect> </property> <property name="minimumSize" > @@ -140,6 +140,18 @@ <string>Audio</string> </property> </item> + <item> + <property name="text" > + <string>Record</string> + </property> + </item> + </widget> + </item> + <item> + <widget class="Line" name="line_ConfigGeneral_2" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> </widget> </item> <item> @@ -597,16 +609,16 @@ </widget> </item> <item> - <widget class="QToolButton" name="button_accountUp" > + <widget class="QToolButton" name="button_accountDown" > <property name="text" > - <string>Up</string> + <string>Down</string> </property> </widget> </item> <item> - <widget class="QToolButton" name="button_accountDown" > + <widget class="QToolButton" name="button_accountUp" > <property name="text" > - <string>Down</string> + <string>Up</string> </property> </widget> </item> @@ -623,6 +635,13 @@ </property> </spacer> </item> + <item> + <widget class="QToolButton" name="toolButton_accountsApply" > + <property name="text" > + <string>Apply</string> + </property> + </widget> + </item> </layout> </widget> </item> @@ -1118,6 +1137,59 @@ </item> </layout> </widget> + <widget class="QWidget" name="page_record" > + <layout class="QVBoxLayout" name="verticalLayout_3" > + <item> + <widget class="QLabel" name="label_configRecord" > + <property name="text" > + <string>Configure record settings</string> + </property> + </widget> + </item> + <item> + <widget class="Line" name="line_configRecord" > + <property name="orientation" > + <enum>Qt::Horizontal</enum> + </property> + </widget> + </item> + <item> + <widget class="QGroupBox" name="groupBox1_recordGeneral" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Fixed" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="title" > + <string>General</string> + </property> + <layout class="QFormLayout" name="formLayout" > + <item row="0" column="0" > + <widget class="QLabel" name="label_destinationFolder" > + <property name="text" > + <string>Destination folder</string> + </property> + </widget> + </item> + <item row="0" column="1" > + <widget class="KUrlComboRequester" name="urlcomborequester_destinationFolder" /> + </item> + </layout> + </widget> + </item> + <item> + <widget class="QWidget" native="1" name="widget_fullConfigRecord" > + <property name="sizePolicy" > + <sizepolicy vsizetype="Expanding" hsizetype="Preferred" > + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + </widget> + </item> + </layout> + </widget> </widget> </item> </layout> diff --git a/sflphone_kde/Contact.cpp b/sflphone_kde/Contact.cpp new file mode 100644 index 0000000000..76946a394b --- /dev/null +++ b/sflphone_kde/Contact.cpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "Contact.h" + +Contact::Contact() +{ +} + + +Contact::~Contact() +{ +} + + +//TODO +QListWidgetItem * Contact::getItem() +{ + return item; +} + +QWidget * Contact::getItemWidget() +{ + return itemWidget; +} + diff --git a/sflphone_kde/Contact.h b/sflphone_kde/Contact.h new file mode 100644 index 0000000000..75cf7b881c --- /dev/null +++ b/sflphone_kde/Contact.h @@ -0,0 +1,46 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef CONTACT_H +#define CONTACT_H + +#include <QtGui/QListWidgetItem> +#include <QtGui/QWidget> + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class Contact{ +private: + QListWidgetItem * item; + QWidget * itemWidget; + +public: + Contact(); + + ~Contact(); + + QListWidgetItem * getItem(); + + QWidget * getItemWidget(); + +}; + +#endif diff --git a/sflphone_kde/SFLPhone.cpp b/sflphone_kde/SFLPhone.cpp index 8d93445fb6..bfa9d804c2 100644 --- a/sflphone_kde/SFLPhone.cpp +++ b/sflphone_kde/SFLPhone.cpp @@ -1,8 +1,14 @@ #include "SFLPhone.h" + +#include <QtGui/QContextMenuEvent> + #include "sflphone_const.h" #include "configurationmanager_interface_singleton.h" #include "callmanager_interface_singleton.h" -#include <stdlib.h> +#include "instance_interface_singleton.h" +#include "ActionSetAccountFirst.h" + +ConfigurationDialog * SFLPhone::configDialog; SFLPhone::SFLPhone(QMainWindow *parent) : QMainWindow(parent) { @@ -33,7 +39,6 @@ SFLPhone::SFLPhone(QMainWindow *parent) : QMainWindow(parent) //QDBusConnection::sessionBus().connect("org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", "org.sflphone.SFLphone.CallManager", "incomingCall", // this, SLOT(on_incomingCall(const QString &accountID, const QString &callID, const QString &from))); - loadWindow(); } @@ -41,13 +46,18 @@ SFLPhone::SFLPhone(QMainWindow *parent) : QMainWindow(parent) SFLPhone::~SFLPhone() { delete configDialog; + delete wizard; + delete callList; + delete errorWindow; + InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); + instance.Unregister(getpid()); } void SFLPhone::loadWindow() { - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - action_displayVolumeControls->setChecked(daemon.getVolumeControls()); - action_displayDialpad->setChecked(daemon.getDialpad()); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + action_displayVolumeControls->setChecked(configurationManager.getVolumeControls()); + action_displayDialpad->setChecked(configurationManager.getDialpad()); updateWindowCallState(); updateRecordButton(); updateVolumeButton(); @@ -56,52 +66,75 @@ void SFLPhone::loadWindow() updateVolumeControls(); updateDialpad(); updateSearchHistory(); + updateSearchAddressBook(); } -QString SFLPhone::firstAccount() +/*QString SFLPhone::firstAccount() { - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); //ask for the list of accounts ids to the daemon - QStringList accountIds = daemon.getAccountList().value(); + QStringList accountIds = configurationManager.getAccountList().value(); for (int i = 0; i < accountIds.size(); ++i){ - MapStringString accountDetails = daemon.getAccountDetails(accountIds[i]); + MapStringString accountDetails = configurationManager.getAccountDetails(accountIds[i]); if(accountDetails[QString(ACCOUNT_STATUS)] == QString(ACCOUNT_STATE_REGISTERED)) { return accountIds[i]; } } return QString(); +}*/ + +QString SFLPhone::firstAccountId() +{ + return getAccountList()->firstRegisteredAccount()->getAccountId(); } -QList<Account *> SFLPhone::registeredAccounts() +QVector<Account *> SFLPhone::registeredAccounts() { - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - //ask for the list of accounts ids to the daemon - QStringList accountIds = daemon.getAccountList().value(); - for (int i = 0; i < accountIds.size(); ++i){ - MapStringString accountDetails = daemon.getAccountDetails(accountIds[i]); - if(accountDetails[QString(ACCOUNT_STATUS)] == QString(ACCOUNT_STATE_REGISTERED)) - { - return accountIds[i]; - } - } - return QString(); + return getAccountList()->registeredAccounts(); } +Account * SFLPhone::firstRegisteredAccount() +{ + return getAccountList()->firstRegisteredAccount(); +} + +AccountList * SFLPhone::getAccountList() +{ + return configDialog->getAccountList(); +} + + void SFLPhone::addCallToCallList(Call * call) { QListWidgetItem * item = call->getItem(); QWidget * widget = call->getItemWidget(); - listWidget_callList->addItem(item); - listWidget_callList->setItemWidget(item, widget); + if(item && widget) + { + listWidget_callList->addItem(item); + listWidget_callList->setItemWidget(item, widget); + } } void SFLPhone::addCallToCallHistory(Call * call) { QListWidgetItem * item = call->getHistoryItem(); - if(item) + QWidget * widget = call->getHistoryItemWidget(); + if(item && widget) { listWidget_callHistory->addItem(item); + listWidget_callHistory->setItemWidget(item, widget); + } +} + +void SFLPhone::addContactToContactList(Contact * contact) +{ + QListWidgetItem * item = contact->getItem(); + QWidget * widget = contact->getItemWidget(); + if(item && widget) + { + listWidget_addressBook->addItem(item); + listWidget_addressBook->setItemWidget(item, widget); } } @@ -109,9 +142,10 @@ void SFLPhone::typeString(QString str) { qDebug() << "typeString"; CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); - callManager.playDTMF(str); + if(stackedWidget_screen->currentWidget() == page_callList) { + callManager.playDTMF(str); QListWidgetItem * item = listWidget_callList->currentItem(); if(!item) { @@ -125,7 +159,12 @@ void SFLPhone::typeString(QString str) if(stackedWidget_screen->currentWidget() == page_callHistory) { qDebug() << "In call history."; - label_searchHistory->setText(label_searchHistory->text() + str); + lineEdit_searchHistory->setText(lineEdit_searchHistory->text() + str); + } + if(stackedWidget_screen->currentWidget() == page_addressBook) + { + qDebug() << "In address book."; + lineEdit_addressBook->setText(lineEdit_addressBook->text() + str); } } @@ -134,6 +173,7 @@ void SFLPhone::backspace() qDebug() << "backspace"; if(stackedWidget_screen->currentWidget() == page_callList) { + qDebug() << "In call list."; QListWidgetItem * item = listWidget_callList->currentItem(); if(!item) { @@ -156,10 +196,19 @@ void SFLPhone::backspace() if(stackedWidget_screen->currentWidget() == page_callHistory) { qDebug() << "In call history."; - int textSize = label_searchHistory->text().size(); + int textSize = lineEdit_searchHistory->text().size(); + if(textSize > 0) + { + lineEdit_searchHistory->setText(lineEdit_searchHistory->text().remove(textSize-1, 1)); + } + } + if(stackedWidget_screen->currentWidget() == page_addressBook) + { + qDebug() << "In address book."; + int textSize = lineEdit_addressBook->text().size(); if(textSize > 0) { - label_searchHistory->setText(label_searchHistory->text().remove(textSize-1, 1)); + lineEdit_addressBook->setText(lineEdit_addressBook->text().remove(textSize-1, 1)); } } } @@ -206,7 +255,7 @@ void SFLPhone::updateWindowCallState() QListWidgetItem * item; bool enabledActions[6]= {true,true,true,true,true,true}; - char * buttonIconFiles[3] = {ICON_CALL, ICON_HANGUP, ICON_HOLD}; + QString buttonIconFiles[3] = {ICON_CALL, ICON_HANGUP, ICON_HOLD}; bool transfer = false; //tells whether the call is in recording position bool recordActivated = false; @@ -316,7 +365,32 @@ void SFLPhone::updateWindowCallState() enabledActions[3] = false; enabledActions[4] = false; } - if(!label_searchHistory->text().isEmpty()) + if(!lineEdit_searchHistory->text().isEmpty()) + { + enabledActions[1] = true; + } + } + if(stackedWidget_screen->currentWidget() == page_addressBook) + { + item = listWidget_addressBook->currentItem(); + buttonIconFiles[0] = ICON_ACCEPT; + if (!item) + { + qDebug() << "No item selected. Updating window."; + enabledActions[0] = false; + enabledActions[1] = false; + enabledActions[2] = false; + enabledActions[3] = false; + enabledActions[4] = false; + } + else + { + enabledActions[1] = false; + enabledActions[2] = false; + enabledActions[3] = false; + enabledActions[4] = false; + } + if(!lineEdit_addressBook->text().isEmpty()) { enabledActions[1] = true; } @@ -340,7 +414,13 @@ void SFLPhone::updateWindowCallState() void SFLPhone::updateSearchHistory() { qDebug() << "updateSearchHistory"; - label_searchHistory->setVisible(!label_searchHistory->text().isEmpty()); + lineEdit_searchHistory->setVisible(!lineEdit_searchHistory->text().isEmpty()); +} + +void SFLPhone::updateSearchAddressBook() +{ + qDebug() << "updateAddressBookSearch"; + lineEdit_addressBook->setVisible(!lineEdit_addressBook->text().isEmpty()); } void SFLPhone::updateCallHistory() @@ -352,7 +432,7 @@ void SFLPhone::updateCallHistory() qDebug() << "take item " << item->text(); } //listWidget_callHistory->clear(); - QString textSearched = label_searchHistory->text(); + QString textSearched = lineEdit_searchHistory->text(); for(int i = 0 ; i < callList->size() ; i++) { Call * call = (*callList)[i]; @@ -360,11 +440,40 @@ void SFLPhone::updateCallHistory() if(call->getState() == CALL_STATE_OVER && call->getHistoryState() != NONE && call->getHistoryItem()->text().contains(textSearched)) { qDebug() << "call->getItem()->text()=" << call->getHistoryItem()->text() << " contains textSearched=" << textSearched; - listWidget_callHistory->addItem(call->getHistoryItem()); + addCallToCallHistory(call); + //QListWidgetItem * historyItem = call->getHistoryItem(); + //listWidget_callHistory->addItem(historyItem); + //listWidget_callHistory->setItemWidget(historyItem, call->getHistoryItemWidget()); } } } +void SFLPhone::updateAddressBook() +{ + qDebug() << "updateAddressBook"; + while(listWidget_addressBook->count() > 0) + { + QListWidgetItem * item = listWidget_addressBook->takeItem(0); + qDebug() << "take item " << item->text(); + } + QString textSearched = lineEdit_searchHistory->text(); + QVector<Contact *> contactsFound = findContactsInKAddressBook(textSearched); + for(int i = 0 ; i < contactsFound.size() ; i++) + { + Contact * contact = contactsFound[i]; + qDebug() << "contact->getItem()->text()=" << contact->getItem()->text() << " contains textSearched=" << textSearched; + addContactToContactList(contact); + //QListWidgetItem * item = contact->getItem(); + //listWidget_addressBook->addItem(item); + //listWidget_addressBook->setItemWidget(item, contact->getItemWidget()); + } +} + +QVector<Contact *> SFLPhone::findContactsInKAddressBook(QString textSearched) +{ + return QVector<Contact *>(); +} + void SFLPhone::updateRecordButton() { qDebug() << "updateRecordButton"; @@ -433,8 +542,8 @@ void SFLPhone::updateVolumeBar() void SFLPhone::updateVolumeControls() { qDebug() << "updateVolumeControls"; - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - int display = daemon.getVolumeControls(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + int display = configurationManager.getVolumeControls(); widget_recVol->setVisible(display); widget_sndVol->setVisible(display); } @@ -442,8 +551,8 @@ void SFLPhone::updateVolumeControls() void SFLPhone::updateDialpad() { qDebug() << "updateDialpad"; - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - int display = daemon.getDialpad(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + int display = configurationManager.getDialpad(); widget_dialpad->setVisible(display); } @@ -455,15 +564,15 @@ void SFLPhone::updateDialpad() void SFLPhone::on_action_displayVolumeControls_toggled() { - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - daemon.setVolumeControls(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + configurationManager.setVolumeControls(); updateVolumeControls(); } void SFLPhone::on_action_displayDialpad_toggled() { - ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); - daemon.setDialpad(); + ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); + configurationManager.setDialpad(); updateDialpad(); } @@ -480,14 +589,22 @@ void SFLPhone::on_pushButton_0_clicked() { typeString("0"); } void SFLPhone::on_pushButton_diese_clicked() { typeString("#"); } void SFLPhone::on_pushButton_etoile_clicked() { typeString("*"); } -void SFLPhone::on_label_searchHistory_textChanged() +void SFLPhone::on_lineEdit_searchHistory_textChanged() { - qDebug() << "on_label_searchHistory_textEdited"; + qDebug() << "on_lineEdit_searchHistory_textEdited"; updateSearchHistory(); updateCallHistory(); updateWindowCallState(); } +void SFLPhone::on_lineEdit_addressBook_textChanged() +{ + qDebug() << "on_lineEdit_addressBook_textEdited"; + updateSearchAddressBook(); + updateAddressBook(); + updateWindowCallState(); +} + void SFLPhone::on_slider_recVol_valueChanged(int value) { qDebug() << "on_slider_recVol_valueChanged(" << value << ")"; @@ -588,7 +705,29 @@ void SFLPhone::contextMenuEvent(QContextMenuEvent *event) menu.addAction(action_record); //TODO accounts to choose menu.addSeparator(); + QVector<Account *> accounts = registeredAccounts(); + for (int i = 0 ; i < accounts.size() ; i++) + { + Account * account = accounts.at(i); + QAction * action = new ActionSetAccountFirst(account, &menu); + action->setCheckable(true); + action->setChecked(false); + if(account == firstRegisteredAccount()) + { + action->setChecked(true); + } + connect(action, SIGNAL(setFirst(Account *)), + this , SLOT(setAccountFirst(Account *))); + menu.addAction(action); + } menu.exec(event->globalPos()); + +} + +void SFLPhone::setAccountFirst(Account * account) +{ + qDebug() << "setAccountFirst : " << account->getAlias(); + getAccountList()->setAccountFirst(account); } void SFLPhone::on_listWidget_callHistory_currentItemChanged() @@ -597,6 +736,12 @@ void SFLPhone::on_listWidget_callHistory_currentItemChanged() updateWindowCallState(); } +void SFLPhone::on_listWidget_addressBook_currentItemChanged() +{ + qDebug() << "on_listWidget_addressBook_currentItemChanged"; + updateWindowCallState(); +} + void SFLPhone::on_action_configureAccounts_triggered() { configDialog->loadOptions(); @@ -613,7 +758,7 @@ void SFLPhone::on_action_configureAudio_triggered() void SFLPhone::on_action_configureSflPhone_triggered() { - configDialog->loadOptions(); + SFLPhone::configDialog->loadOptions(); configDialog->setPage(PAGE_GENERAL); configDialog->show(); } @@ -644,6 +789,17 @@ void SFLPhone::on_action_accept_triggered() if(stackedWidget_screen->currentWidget() == page_callHistory) { action_history->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_callList); + Call * call = callList->addDialingCall(); + call->appendItemText(listWidget_callHistory->currentItem()->text()); + addCallToCallList(call); + listWidget_callList->setCurrentRow(listWidget_callList->count() - 1); + actionb(call, CALL_ACTION_ACCEPT); + } + if(stackedWidget_screen->currentWidget() == page_addressBook) + { + action_addressBook->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_callList); Call * call = callList->addDialingCall(); call->appendItemText(listWidget_callHistory->currentItem()->text()); addCallToCallList(call); @@ -668,7 +824,11 @@ void SFLPhone::on_action_refuse_triggered() } if(stackedWidget_screen->currentWidget() == page_callHistory) { - label_searchHistory->clear(); + lineEdit_searchHistory->clear(); + } + if(stackedWidget_screen->currentWidget() == page_addressBook) + { + lineEdit_addressBook->clear(); } } @@ -711,16 +871,39 @@ void SFLPhone::on_action_record_triggered() } } -void SFLPhone::on_action_history_toggled(bool checked) +void SFLPhone::on_action_history_triggered(bool checked) { - stackedWidget_screen->setCurrentWidget(checked ? page_callHistory : page_callList); + if(checked == true) + { + action_addressBook->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_callHistory); + } + else + { + stackedWidget_screen->setCurrentWidget(page_callList); + } + updateWindowCallState(); +} + +void SFLPhone::on_action_addressBook_triggered(bool checked) +{ + if(checked == true) + { + + action_history->setChecked(false); + stackedWidget_screen->setCurrentWidget(page_addressBook); + } + else + { + stackedWidget_screen->setCurrentWidget(page_callList); + } updateWindowCallState(); } void SFLPhone::on_action_mailBox_triggered() { ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance(); - QString account = firstAccount(); + QString account = firstAccountId(); if(account.isEmpty()) { errorWindow->showMessage("No account registered!"); diff --git a/sflphone_kde/SFLPhone.h b/sflphone_kde/SFLPhone.h index 93f5a11984..1298a6861c 100644 --- a/sflphone_kde/SFLPhone.h +++ b/sflphone_kde/SFLPhone.h @@ -1,11 +1,17 @@ #ifndef SFLPHONE_H #define SFLPHONE_H -#include <QtGui> +#include <QtCore/QString> +#include <QtCore/QVector> +#include <QtGui/QListWidgetItem> +#include <QtGui/QKeyEvent> +#include <QErrorMessage> + #include "ui_sflphone-qt.h" #include "ConfigDialog.h" #include "CallList.h" #include "AccountWizard.h" +#include "Contact.h" class ConfigurationDialog; @@ -15,7 +21,7 @@ class SFLPhone : public QMainWindow, private Ui::SFLPhone Q_OBJECT private: - ConfigurationDialog * configDialog; + static ConfigurationDialog * configDialog; AccountWizard * wizard; CallList * callList; QErrorMessage * errorWindow; @@ -27,7 +33,11 @@ public: SFLPhone(QMainWindow *parent = 0); ~SFLPhone(); void loadWindow(); - static QString firstAccount(); + static QString firstAccountId(); + static Account * firstRegisteredAccount(); + static QVector<Account *> registeredAccounts(); + static AccountList * getAccountList(); + QVector<Contact *> findContactsInKAddressBook(QString textSearched); private slots: //void typeChar(QChar c); @@ -38,11 +48,14 @@ private slots: void addCallToCallList(Call * call); void addCallToCallHistory(Call * call); + void addContactToContactList(Contact * contact); void updateCallItem(Call * call); void updateWindowCallState(); void updateSearchHistory(); + void updateSearchAddressBook(); void updateCallHistory(); + void updateAddressBook(); void updateRecordButton(); void updateVolumeButton(); void updateRecordBar(); @@ -81,7 +94,8 @@ private slots: void on_action_hold_triggered(); void on_action_transfer_triggered(); void on_action_record_triggered(); - void on_action_history_toggled(bool checked); + void on_action_history_triggered(bool checked); + void on_action_addressBook_triggered(bool checked); void on_action_mailBox_triggered(); //void on_actionAbout(); @@ -98,7 +112,8 @@ private slots: void on_pushButton_diese_clicked(); void on_pushButton_etoile_clicked(); - void on_label_searchHistory_textChanged(); + void on_lineEdit_searchHistory_textChanged(); + void on_lineEdit_addressBook_textChanged(); void on_slider_recVol_valueChanged(int value); void on_slider_sndVol_valueChanged(int value); @@ -110,6 +125,7 @@ private slots: void on_listWidget_callList_itemChanged(); void on_listWidget_callList_itemDoubleClicked(QListWidgetItem * item); void on_listWidget_callHistory_currentItemChanged(); + void on_listWidget_addressBook_currentItemChanged(); void on1_callStateChanged(const QString &callID, const QString &state); void on1_error(MapStringString details); @@ -117,6 +133,8 @@ private slots: void on1_incomingMessage(const QString &accountID, const QString &message); void on1_voiceMailNotify(const QString &accountID, int count); void on1_volumeChanged(const QString &device, double value); + + void setAccountFirst(Account * account); }; diff --git a/sflphone_kde/callmanager_interface_singleton.cpp b/sflphone_kde/callmanager_interface_singleton.cpp index 2d204919f9..6617204ab3 100644 --- a/sflphone_kde/callmanager_interface_singleton.cpp +++ b/sflphone_kde/callmanager_interface_singleton.cpp @@ -1,14 +1,24 @@ #include "callmanager_interface_singleton.h" -CallManagerInterface * CallManagerInterfaceSingleton::daemon = new CallManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", QDBusConnection::sessionBus()); +CallManagerInterface * CallManagerInterfaceSingleton::interface + = new CallManagerInterface( + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + QDBusConnection::sessionBus()); CallManagerInterface & CallManagerInterfaceSingleton::getInstance(){ - if(!daemon){ - daemon = new CallManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/CallManager", QDBusConnection::sessionBus()); - } - if(!daemon->isValid()) + /*if(!interface){ + interface = new CallManagerInterface( + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/CallManager", + QDBusConnection::sessionBus()); + }*/ + if(!interface->isValid()) + { throw "Error : sflphoned not connected"; - return *daemon; + + } + return *interface; } diff --git a/sflphone_kde/callmanager_interface_singleton.h b/sflphone_kde/callmanager_interface_singleton.h index e4759b7e21..22a1dd3b8a 100644 --- a/sflphone_kde/callmanager_interface_singleton.h +++ b/sflphone_kde/callmanager_interface_singleton.h @@ -8,7 +8,7 @@ class CallManagerInterfaceSingleton private: - static CallManagerInterface * daemon; + static CallManagerInterface * interface; public: diff --git a/sflphone_kde/configurationmanager-introspec.xml b/sflphone_kde/configurationmanager-introspec.xml index ffb70e963f..f51979e239 100644 --- a/sflphone_kde/configurationmanager-introspec.xml +++ b/sflphone_kde/configurationmanager-introspec.xml @@ -85,6 +85,16 @@ <method name="setAudioManager"> <arg type="i" name="api" direction="in"/> </method> + + <method name="getRecordPath"> + <arg type="s" name="rec" direction="out"/> + </method> + + <method name="setRecordPath"> + <arg type="s" name="rec" direction="in"/> + </method> + + <!-- /////////////////////// --> @@ -257,6 +267,28 @@ <arg type="i" name="state" direction="out"/> </method> + <!-- Addressbook configuration --> + <method name="getAddressbookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="out"/> + </method> + + <method name="setAddressbookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringInt"/> + <arg type="a{si}" name="settings" direction="in"/> + </method> + + <!-- Hook configuration --> + <method name="getHookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="out"/> + </method> + + <method name="setHookSettings"> + <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> + <arg type="a{ss}" name="settings" direction="in"/> + </method> + <!-- ///////////////////////////// --> <signal name="parametersChanged"> <annotation name="com.trolltech.QtDBus.QtTypeName.In0" value="MapStringString"/> diff --git a/sflphone_kde/configurationmanager_interface_p.h b/sflphone_kde/configurationmanager_interface_p.h index dcab71c0fd..ec638d23fb 100644 --- a/sflphone_kde/configurationmanager_interface_p.h +++ b/sflphone_kde/configurationmanager_interface_p.h @@ -8,8 +8,8 @@ * Do not edit! All changes made to it will be lost. */ -#ifndef CONFIGURATIONMANAGER_INTERFACE_P_H_1236371540 -#define CONFIGURATIONMANAGER_INTERFACE_P_H_1236371540 +#ifndef CONFIGURATIONMANAGER_INTERFACE_P_H_1238787208 +#define CONFIGURATIONMANAGER_INTERFACE_P_H_1238787208 #include <QtCore/QObject> #include <QtCore/QByteArray> @@ -69,6 +69,12 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("getActiveCodecList"), argumentList); } + inline QDBusReply<MapStringInt> getAddressbookSettings() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getAddressbookSettings"), argumentList); + } + inline QDBusReply<int> getAudioDeviceIndex(const QString &name) { QList<QVariant> argumentList; @@ -125,6 +131,12 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("getDialpad"), argumentList); } + inline QDBusReply<MapStringString> getHookSettings() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getHookSettings"), argumentList); + } + inline QDBusReply<QStringList> getInputAudioPluginList() { QList<QVariant> argumentList; @@ -173,6 +185,12 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("getRecordDeviceList"), argumentList); } + inline QDBusReply<QString> getRecordPath() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getRecordPath"), argumentList); + } + inline QDBusReply<QString> getRingtoneChoice() { QList<QVariant> argumentList; @@ -285,6 +303,13 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("setActiveCodecList"), argumentList); } + inline QDBusReply<void> setAddressbookSettings(MapStringInt settings) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(settings); + return callWithArgumentList(QDBus::Block, QLatin1String("setAddressbookSettings"), argumentList); + } + inline QDBusReply<void> setAudioInputDevice(int index) { QList<QVariant> argumentList; @@ -312,6 +337,13 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("setDialpad"), argumentList); } + inline QDBusReply<void> setHookSettings(MapStringString settings) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(settings); + return callWithArgumentList(QDBus::Block, QLatin1String("setHookSettings"), argumentList); + } + inline QDBusReply<void> setInputAudioPlugin(const QString &audioPlugin) { QList<QVariant> argumentList; @@ -351,6 +383,13 @@ public Q_SLOTS: // METHODS return callWithArgumentList(QDBus::Block, QLatin1String("setPulseAppVolumeControl"), argumentList); } + inline QDBusReply<void> setRecordPath(const QString &rec) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(rec); + return callWithArgumentList(QDBus::Block, QLatin1String("setRecordPath"), argumentList); + } + inline QDBusReply<void> setRingtoneChoice(const QString &tone) { QList<QVariant> argumentList; diff --git a/sflphone_kde/configurationmanager_interface_singleton.cpp b/sflphone_kde/configurationmanager_interface_singleton.cpp index 2af476a4f7..c45202b03b 100644 --- a/sflphone_kde/configurationmanager_interface_singleton.cpp +++ b/sflphone_kde/configurationmanager_interface_singleton.cpp @@ -1,15 +1,15 @@ #include "configurationmanager_interface_singleton.h" -ConfigurationManagerInterface * ConfigurationManagerInterfaceSingleton::daemon = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); +ConfigurationManagerInterface * ConfigurationManagerInterfaceSingleton::interface = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); ConfigurationManagerInterface & ConfigurationManagerInterfaceSingleton::getInstance(){ - if(!daemon){ - daemon = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); + if(!interface){ + interface = new ConfigurationManagerInterface("org.sflphone.SFLphone", "/org/sflphone/SFLphone/ConfigurationManager", QDBusConnection::sessionBus()); } - if(!daemon->isValid()) + if(!interface->isValid()) throw "Error : sflphoned not connected"; - return *daemon; + return *interface; } \ No newline at end of file diff --git a/sflphone_kde/configurationmanager_interface_singleton.h b/sflphone_kde/configurationmanager_interface_singleton.h index 870ff94825..e8a0a22bbd 100644 --- a/sflphone_kde/configurationmanager_interface_singleton.h +++ b/sflphone_kde/configurationmanager_interface_singleton.h @@ -8,7 +8,7 @@ class ConfigurationManagerInterfaceSingleton private: - static ConfigurationManagerInterface * daemon; + static ConfigurationManagerInterface * interface; public: diff --git a/sflphone_kde/icons/office-address-book.png b/sflphone_kde/icons/office-address-book.png new file mode 100644 index 0000000000000000000000000000000000000000..3b00f62c87465a2614920885b1bcee6ae7fea2f9 GIT binary patch literal 6651 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE<t`_ZS!$SkfJR9T^y|-MHc(VZ^|| zAX(xXQ4*Y=R#Ki=l*-_klAn~S;F+74o*I;zm{M7IGS!BGL9*A=#WAGf*4yax9+~Hr zb<6Ygw^#o?k-U4cOOR0i+$}Drx<uWZo-R`;6FREumm*<yN#*~B$r3*wvvdgm=TLAc zXmT(UC_h@zE$gkKYPK=h=2Jx9ldXHVZ7<(meY-q;`IDdb=3c!wb0d#*lk;(zS5M!Z z@%uS%yG?$iSCLG6-DGpgqHxA?(E<?hL3;Pf{~sP1*p?=k%3sl$?G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WVg=y`RDU;>+3mxECgi}K4s_0c}Og} z?L{O7rqyO-FO{(926vgzl&Zwp?X`|)(D;RGk|U$>4*AA1<y?<;Thr6{T5!<7wF z=k9xHRQhar%&u2lcW-iKOnUfZ?dj$2@q4%I_}lrmka3=AvwZN&7c&<g^5>KDnPX9w zlJe=)%*0hsh4OTkPxI`1_rQ12{QX}iEc*Yj_WiHZ%jf@k@ca6ysU^=oJZw%*_m|r} zO>VD7P^hx+(wJ*{chVll7qh;YU_0Th%OcD5XF1n5s7z;EcW2tFfA=*Oc*ZD-r>x}s salL-`@Be(lcmK+(zt?(TUin+TG(}y1>5r@%3=9kmp00i_>zopr0P4xna{vGU literal 0 HcmV?d00001 diff --git a/sflphone_kde/icons/x-office-address-book.png b/sflphone_kde/icons/x-office-address-book.png new file mode 100644 index 0000000000000000000000000000000000000000..fa1be70cd382a67ac38c1ae68caed83df6ce87ab GIT binary patch literal 4051 zcmeAS@N?(olHy`uVBq!ia0y~yU~m9o4mJh`hE<t`_ZS!$I14-?iy0WqV?dbk^zkJ- z85kJYlDyqr82*Fcg1yTpGcfSGdb&7<RNUGc?Y&0zc;vr-uRibUe{4O^dY+`ePuoW0 zZK9E3O+0CajI5ljsm&1zf{bFDIv6^AnXH%S2zZ)xZaUG#lG0eA!O@~5Y^ES`U}H{_ zv%)6}Lq#^p{<)RsYtPv(-@RJvYxvcd@v&Fa&)unhv+MKyRqNd6|J(oTpZix^=ZKgo z!p*yNuHE{!Rk-Wx_qltXJ?Uc26WU<R`fYuKnt4Of@ssOZclxj3<0&y!ogsBiLfy3I z;)YqTZ(WsgyB?_Zj{EH{CI^YtvA6#37k~3P{%7s~JN<Uw7<u~VAKgB`S}arXj;m$$ zw>Q7e&Ni?9TNlsI#%wIrd#1w1Y`NcDBl~~C{<H4?ecM0#y#3GQ9p9e$&Iw78Hx%11 zb^V=%=G;5&<@^6UQU5P9!-w%6i&8-7L7}r{Z2!L<-(SkXkn-5>;gev$RVP?<h1R*R z{{Eu>&#&|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_!x=<&@hDp+a&0X);^S+uC!oO?QBKs)&Ih=Fs>*FMomxZs7t39iEj$w-g zgTkx^H%{3<4V()m7|obEW9qUf*Q)Z1k!sva6<-(4&fj0t$=7`1Rb2fG`6my)iT(RF zng6aWgS52tj=H~AuFt>6`+e-+w9l{d=@D)21D`5F!vmHj1t%C6WN$h0w<YGK-t*<# z(~cdQu6b$d+KqOm+YO@g_jdLEmOq&AHtzTA^HDV~pJ(zhd=g*Q^n2U(?Y|k?c;;>X zYQFrkW`)hH13V0DC$^v7#T8$!{cFQ2{uPV71%>{*-rZ?m+IrfoIU_L5Ipu~;`MrPV z&es3@<K7==7_o6#(rjJED*}doIr??yd>%H6XXab6?tjftnQ9?p_vF@8VGBc-Ezb`~ zB-YC>QGa%9>Hn~2kL)#K-$grc=KtLv@p~HY{s~3%a&}F=`0e&DA&IP+lhfCQ_<t|c z-~XvUo?!#qjOv89EDoF#U#{`p6ec0CRKE538VgIo=U;a8Y4p`Z-v~*m?>_T-C;$9w zoin!dEs~yi_b&5Fp=+yV@P@^u#2nwcV7CS1rDxC7<`{2zer|5?IdhG4Avuk;Ta}iI zFt%>=>j_n0Yq6P;$h`CI?~bVdixmrtr)c>v(wVsWq`=3mMhcf)PEF7<>DKz?_SJot zxzy~3zc_8}YUM7k-Tr22zU}I@ThIRHifG>QN5Jh;>du;{2B7Y@QdLMqNpOBzNqJ&X wDg#5sEp2`M>!;70*7Nhz@wj?g-;15W>;_weK=7#;1_lNOPgg&ebxsLQ012Lu5dZ)H literal 0 HcmV?d00001 diff --git a/sflphone_kde/instance-introspec.xml b/sflphone_kde/instance-introspec.xml new file mode 100644 index 0000000000..90a60d632d --- /dev/null +++ b/sflphone_kde/instance-introspec.xml @@ -0,0 +1,18 @@ +<?xml version="1.0" ?> +<node name="/org/sflphone/SFLphone"> + <interface name="org.sflphone.SFLphone.Instance"> + + <method name="Register"> + <arg type="i" name="pid" direction="in"/> + <arg type="s" name="name" direction="in"/> + </method> + + <method name="Unregister"> + <arg type="i" name="pid" direction="in"/> + </method> + + <method name="getRegistrationCount"> + <arg type="i" name="count" direction="out"/> + </method> + </interface> +</node> diff --git a/sflphone_kde/instance_interface.cpp b/sflphone_kde/instance_interface.cpp new file mode 100644 index 0000000000..9cf8039aec --- /dev/null +++ b/sflphone_kde/instance_interface.cpp @@ -0,0 +1,26 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c InstanceInterface -p instance_interface_p.h:instance_interface.cpp -i metatypes.h instance-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * This file may have been hand-edited. Look for HAND-EDIT comments + * before re-generating it. + */ + +#include "instance_interface_p.h" + +/* + * Implementation of interface class InstanceInterface + */ + +InstanceInterface::InstanceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent) + : QDBusAbstractInterface(service, path, staticInterfaceName(), connection, parent) +{ +} + +InstanceInterface::~InstanceInterface() +{ +} + diff --git a/sflphone_kde/instance_interface_p.h b/sflphone_kde/instance_interface_p.h new file mode 100644 index 0000000000..fa118d8347 --- /dev/null +++ b/sflphone_kde/instance_interface_p.h @@ -0,0 +1,70 @@ +/* + * This file was generated by dbusxml2cpp version 0.6 + * Command line was: dbusxml2cpp -c InstanceInterface -p instance_interface_p.h:instance_interface.cpp -i metatypes.h instance-introspec.xml + * + * dbusxml2cpp is Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies). + * + * This is an auto-generated file. + * Do not edit! All changes made to it will be lost. + */ + +#ifndef INSTANCE_INTERFACE_P_H_1239116391 +#define INSTANCE_INTERFACE_P_H_1239116391 + +#include <QtCore/QObject> +#include <QtCore/QByteArray> +#include <QtCore/QList> +#include <QtCore/QMap> +#include <QtCore/QString> +#include <QtCore/QStringList> +#include <QtCore/QVariant> +#include <QtDBus/QtDBus> +#include "metatypes.h" + +/* + * Proxy class for interface org.sflphone.SFLphone.Instance + */ +class InstanceInterface: public QDBusAbstractInterface +{ + Q_OBJECT +public: + static inline const char *staticInterfaceName() + { return "org.sflphone.SFLphone.Instance"; } + +public: + InstanceInterface(const QString &service, const QString &path, const QDBusConnection &connection, QObject *parent = 0); + + ~InstanceInterface(); + +public Q_SLOTS: // METHODS + inline QDBusReply<void> Register(int pid, const QString &name) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(pid) << qVariantFromValue(name); + return callWithArgumentList(QDBus::Block, QLatin1String("Register"), argumentList); + } + + inline QDBusReply<void> Unregister(int pid) + { + QList<QVariant> argumentList; + argumentList << qVariantFromValue(pid); + return callWithArgumentList(QDBus::Block, QLatin1String("Unregister"), argumentList); + } + + inline QDBusReply<int> getRegistrationCount() + { + QList<QVariant> argumentList; + return callWithArgumentList(QDBus::Block, QLatin1String("getRegistrationCount"), argumentList); + } + +Q_SIGNALS: // SIGNALS +}; + +namespace org { + namespace sflphone { + namespace SFLphone { + typedef ::InstanceInterface Instance; + } + } +} +#endif diff --git a/sflphone_kde/instance_interface_singleton.cpp b/sflphone_kde/instance_interface_singleton.cpp new file mode 100644 index 0000000000..42c35be409 --- /dev/null +++ b/sflphone_kde/instance_interface_singleton.cpp @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#include "instance_interface_singleton.h" + + +InstanceInterface * InstanceInterfaceSingleton::interface + = new InstanceInterface( + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + QDBusConnection::sessionBus()); + + +InstanceInterface & InstanceInterfaceSingleton::getInstance(){ + /*if(!interface){ + interface = new InstanceInterface( + "org.sflphone.SFLphone", + "/org/sflphone/SFLphone/Instance", + QDBusConnection::sessionBus()); + }*/ + if(!interface->isValid()) + { + throw "Error : sflphoned not connected"; + + } + return *interface; +} diff --git a/sflphone_kde/instance_interface_singleton.h b/sflphone_kde/instance_interface_singleton.h new file mode 100644 index 0000000000..e767ed1f6d --- /dev/null +++ b/sflphone_kde/instance_interface_singleton.h @@ -0,0 +1,44 @@ +/*************************************************************************** + * Copyright (C) 2009 by Savoir-Faire Linux * + * Author : Jérémy Quentin * + * jeremy.quentin@savoirfairelinux.com * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 3 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ +#ifndef INSTANCE_INTERFACE_SINGLETON_H +#define INSTANCE_INTERFACE_SINGLETON_H + + +#include "instance_interface_p.h" + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class InstanceInterfaceSingleton +{ + +private: + + static InstanceInterface * interface; + +public: + + //TODO verifier pointeur ou pas pour singleton en c++ + static InstanceInterface & getInstance(); + +}; + +#endif diff --git a/sflphone_kde/main.cpp b/sflphone_kde/main.cpp index 0342788f0c..7d40f3d66f 100644 --- a/sflphone_kde/main.cpp +++ b/sflphone_kde/main.cpp @@ -1,12 +1,17 @@ #include <QApplication> +#include <QtCore/QString> +#include <QtGui/QCursor> #include "kapplication.h" #include "kcmdlineargs.h" #include "kaboutdata.h" -#include <QtGui> +#include <kabc/vcardformat.h> + #include "ConfigDialog.h" #include "SFLPhone.h" #include "AccountWizard.h" - +#include "instance_interface_p.h" +#include "instance_interface_singleton.h" +#include "sflphone_const.h" static const char description[] = I18N_NOOP("A KDE 4 Client for SflPhone"); @@ -14,8 +19,24 @@ static const char version[] = "0.1"; int main(int argc, char **argv) { + FILE *fp; + int status; + char path[PATH_MAX]; + + + fp = popen("ls *", "r"); + if (fp == NULL) + qDebug() << "marche pas"; + while (fgets(path, PATH_MAX, fp) != NULL) + printf("%s", path); + + status = pclose(fp); + + try { + InstanceInterface & instance = InstanceInterfaceSingleton::getInstance(); + instance.Register(getpid(), APP_NAME); KAboutData about("sflphone_kde", 0, ki18n("sflphone_kde"), version, ki18n(description), KAboutData::License_GPL, ki18n("(C) 2009 Jérémy Quentin"), KLocalizedString(), 0, "jeremy.quentin@gsavoirfairelinux.com"); about.addAuthor( ki18n("Jérémy Quentin"), KLocalizedString(), "jeremy.quentin@gmail.com" ); @@ -32,6 +53,7 @@ int main(int argc, char **argv) SFLPhone fenetre; + fenetre.move(QCursor::pos()); fenetre.show(); return app.exec(); diff --git a/sflphone_kde/metatypes.h b/sflphone_kde/metatypes.h index 4f308db1d2..e5ae32d8fd 100644 --- a/sflphone_kde/metatypes.h +++ b/sflphone_kde/metatypes.h @@ -3,20 +3,23 @@ #include <QtCore/QList> #include <QtCore/QMetaType> +#include <QtCore/QMap> +#include <QtCore/QString> #include <QtDBus/QtDBus> -#include <qmap.h> -#include <qstring.h> //class MapStringString:public QMap<QString, QString>{}; typedef QMap<QString, QString> MapStringString; -typedef QVector<QString> VectorString; +typedef QMap<QString, int> MapStringInt; +//typedef QVector<QString> VectorString; Q_DECLARE_METATYPE(MapStringString) +Q_DECLARE_METATYPE(MapStringInt) //Q_DECLARE_METATYPE(VectorString) inline void registerCommTypes() { qDBusRegisterMetaType<MapStringString>(); + qDBusRegisterMetaType<MapStringInt>(); //qDBusRegisterMetaType<VectorString>(); } diff --git a/sflphone_kde/resources.qrc b/sflphone_kde/resources.qrc index 97ac565391..c2032d4914 100644 --- a/sflphone_kde/resources.qrc +++ b/sflphone_kde/resources.qrc @@ -1,5 +1,7 @@ <RCC> <qresource prefix="images" > + <file>icons/office-address-book.png</file> + <file>icons/x-office-address-book.png</file> <file>icons/add.png</file> <file>icons/remove.png</file> <file>icons/del_off.png</file> diff --git a/sflphone_kde/sflphone-qt.ui b/sflphone_kde/sflphone-qt.ui index 48bc455d9f..a8f9bb4dcb 100644 --- a/sflphone_kde/sflphone-qt.ui +++ b/sflphone_kde/sflphone-qt.ui @@ -36,10 +36,20 @@ <widget class="QWidget" name="page_callHistory" > <layout class="QVBoxLayout" name="verticalLayout_3" > <item> - <widget class="QLineEdit" name="label_searchHistory" /> + <widget class="QListWidget" name="listWidget_callHistory" /> </item> <item> - <widget class="QListWidget" name="listWidget_callHistory" /> + <widget class="QLineEdit" name="lineEdit_searchHistory" /> + </item> + </layout> + </widget> + <widget class="QWidget" name="page_addressBook" > + <layout class="QVBoxLayout" name="verticalLayout_5" > + <item> + <widget class="QListWidget" name="listWidget_addressBook" /> + </item> + <item> + <widget class="QLineEdit" name="lineEdit_addressBook" /> </item> </layout> </widget> @@ -368,6 +378,7 @@ <addaction name="separator" /> <addaction name="action_mailBox" /> <addaction name="action_history" /> + <addaction name="action_addressBook" /> </widget> <widget class="QMenu" name="menu_Configure" > <property name="title" > @@ -411,6 +422,7 @@ <addaction name="separator" /> <addaction name="action_mailBox" /> <addaction name="action_history" /> + <addaction name="action_addressBook" /> </widget> <action name="action_accept" > <property name="icon" > @@ -551,6 +563,18 @@ <string>Account creation &wizard</string> </property> </action> + <action name="action_addressBook" > + <property name="checkable" > + <bool>true</bool> + </property> + <property name="icon" > + <iconset resource="resources.qrc" > + <normaloff>:/images/icons/x-office-address-book.png</normaloff>:/images/icons/x-office-address-book.png</iconset> + </property> + <property name="text" > + <string>Address book</string> + </property> + </action> </widget> <resources> <include location="resources.qrc" /> diff --git a/sflphone_kde/sflphone_const.cpp b/sflphone_kde/sflphone_const.cpp deleted file mode 100644 index 6df8222b49..0000000000 --- a/sflphone_kde/sflphone_const.cpp +++ /dev/null @@ -1,19 +0,0 @@ -#include "sflphone_const.h" - -int getProtocolIndexByName(QString protocolName) -{ - if(protocolName == (QString)"SIP") - return 0; - if(protocolName == (QString)"IAX") - return 1; - return -1; -} - -QString getProtocolNameByIndex(int protocolIndex) -{ - if(protocolIndex == 0) - return "SIP"; - if(protocolIndex == 1) - return "IAX"; - return "UNKNOWN PROTOCOLE INDEX"; -} \ No newline at end of file diff --git a/sflphone_kde/sflphone_const.h b/sflphone_kde/sflphone_const.h index f51a9519c3..9b0afdff3f 100644 --- a/sflphone_kde/sflphone_const.h +++ b/sflphone_kde/sflphone_const.h @@ -21,19 +21,21 @@ #define __SFLPHONE_CONST_H #include <libintl.h> -#include <QtGui> +#include <QtCore/QString> /* @file sflphone_const.h * @brief Contains the global variables for the client code */ + +#define APP_NAME "KDE Client" /** Locale */ -#define _(STRING) gettext( STRING ) +#define _(STRING) gettext( STRING ) /** Warnings unused variables **/ -#define UNUSED_VAR(var) (void*)var +#define UNUSED_VAR(var) (void*)var -#define UNUSED __attribute__((__unused__)) +#define UNUSED __attribute__((__unused__)) #define SIP 0 #define IAX 1 @@ -145,49 +147,45 @@ /** Tone to play when no voice mails */ -#define TONE_WITHOUT_MESSAGE 0 +#define TONE_WITHOUT_MESSAGE 0 /** Tone to play when voice mails */ -#define TONE_WITH_MESSAGE 1 +#define TONE_WITH_MESSAGE 1 /** Tells if the main window is reduced to the system tray or not */ -#define MINIMIZED TRUE +#define MINIMIZED TRUE /** Behaviour of the main window on incoming calls */ -#define __POPUP_WINDOW ( dbus_popup_mode() ) +#define __POPUP_WINDOW ( dbus_popup_mode() ) /** Show/Hide the dialpad */ -#define SHOW_DIALPAD ( dbus_get_dialpad() ) +#define SHOW_DIALPAD ( dbus_get_dialpad() ) /** Show/Hide the volume controls */ -#define SHOW_VOLUME ( dbus_get_volume_controls() ) +#define SHOW_VOLUME ( dbus_get_volume_controls() ) /** Show/Hide the dialpad */ -#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) +#define SHOW_SEARCHBAR ( dbus_get_searchbar() ) /** Show/Hide the alsa configuration panel */ -#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) +#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) /** Audio Managers */ -#define ALSA 0 -#define PULSEAUDIO 1 +#define ALSA 0 +#define PULSEAUDIO 1 /** Notification levels */ -#define __NOTIF_LEVEL_MIN 0 -#define __NOTIF_LEVEL_MED 1 -#define __NOTIF_LEVEL_HIGH 2 +#define __NOTIF_LEVEL_MIN 0 +#define __NOTIF_LEVEL_MED 1 +#define __NOTIF_LEVEL_HIGH 2 /** Messages ID for the status bar - Incoming calls */ -#define __MSG_INCOMING_CALL 0 +#define __MSG_INCOMING_CALL 0 /** Messages ID for the status bar - Calling */ -#define __MSG_CALLING 1 +#define __MSG_CALLING 1 /** Messages ID for the status bar - Voice mails notification */ -#define __MSG_VOICE_MAILS 2 +#define __MSG_VOICE_MAILS 2 /** Messages ID for the status bar - Current account */ -#define __MSG_ACCOUNT_DEFAULT 3 +#define __MSG_ACCOUNT_DEFAULT 3 /** Desktop notifications - Time before to close the notification*/ -#define __TIMEOUT_MODE "default" +#define __TIMEOUT_MODE "default" /** Desktop notifications - Time before to close the notification*/ -#define __TIMEOUT_TIME 18000 // 30 secondes +#define __TIMEOUT_TIME 18000 // 30 secondes + -/* -//TODO constantes pour protocoles -int getProtocolIndexByName(QString protocolName); -QString getProtocolNameByIndex(int protocolIndex); -*/ #endif -- GitLab