diff --git a/sflphone_kde/AccountWizard.cpp b/sflphone_kde/AccountWizard.cpp new file mode 100644 index 0000000000000000000000000000000000000000..6433a230caf9e965dcb1259a612d08c57c71f66d --- /dev/null +++ b/sflphone_kde/AccountWizard.cpp @@ -0,0 +1,371 @@ +/*************************************************************************** + * 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 "AccountWizard.h" +#include <QVBoxLayout> +#include <QFormLayout> +#include "sflphone_const.h" + + +/*************************************************************************** + * Class AccountWizard * + * Widget of the wizard for creating an account. * + ***************************************************************************/ + +AccountWizard::AccountWizard(QWidget *parent) + : QWizard(parent) +{ + + + setPage(Page_Intro, new WizardIntroPage); + setPage(Page_AutoMan, new WizardAccountAutoManualPage); + setPage(Page_Type, new WizardAccountTypePage); + setPage(Page_Email, new WizardAccountEmailAddressPage); + setPage(Page_SIPForm, new WizardAccountFormPage(SIP)); + setPage(Page_IAXForm, new WizardAccountFormPage(IAX)); + setPage(Page_Stun, new WizardAccountStunPage); + setPage(Page_Conclusion, new WizardAccountConclusionPage); + + setStartId(Page_Intro); + //setPixmap(QWizard::BannerPixmap, QPixmap(":/images/icons/dial.svg")); + setWindowTitle(tr("Account Wizard")); + setPixmap(QWizard::LogoPixmap, QPixmap(":/images/icons/sflphone.png")); + +} + + +AccountWizard::~AccountWizard() +{ +} + +void AccountWizard::accept() + { + QByteArray className = field("className").toByteArray(); + QByteArray baseClass = field("baseClass").toByteArray(); + QByteArray macroName = field("macroName").toByteArray(); + QByteArray baseInclude = field("baseInclude").toByteArray(); + + QString outputDir = field("outputDir").toString(); + QString header = field("header").toString(); + QString implementation = field("implementation").toString(); + + QDialog::accept(); + } + + +/*************************************************************************** + * Class WizardIntroPage * + * Widget of the introduction page of the wizard * + ***************************************************************************/ + +WizardIntroPage::WizardIntroPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Account Creation Wizard")); + setSubTitle(tr("Welcome to the Account creation wizard of SFLPhone")); + + introLabel = new QLabel(tr("This wizard will help you setting up an account.")); + introLabel->setWordWrap(true); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(introLabel); + setLayout(layout); +} + + +WizardIntroPage::~WizardIntroPage() +{ + delete introLabel; +} + +int WizardIntroPage::nextId() const +{ + return AccountWizard::Page_AutoMan; +} + +/*************************************************************************** + * Class WizardAccountAutoManualPage * + * Page in which user choses to create an account on * + * sflphone.org or register a new one. * + ***************************************************************************/ + +WizardAccountAutoManualPage::WizardAccountAutoManualPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Accounts")); + setSubTitle(tr("Please choose between those options :")); + + radioButton_SFL = new QRadioButton(tr("Create a free SIP/IAX2 account on sflphone.org")); + radioButton_manual = new QRadioButton(tr("Register an existing SIP/IAX2 account")); + radioButton_SFL->setChecked(true); + + registerField("SFL", radioButton_SFL); + registerField("manual", radioButton_manual); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(radioButton_SFL); + layout->addWidget(radioButton_manual); + setLayout(layout); +} + + +WizardAccountAutoManualPage::~WizardAccountAutoManualPage() +{ + delete radioButton_SFL; + delete radioButton_manual; +} + +int WizardAccountAutoManualPage::nextId() const +{ + if(radioButton_SFL->isChecked()) + { + return AccountWizard::Page_Email; + } + else + { + return AccountWizard::Page_Type; + } +} + +/*************************************************************************** + * Class WizardAccountTypePage * + * Page in which user choses between SIP and IAX account. * + ***************************************************************************/ + +WizardAccountTypePage::WizardAccountTypePage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("VoIP Protocols")); + setSubTitle(tr("Choose the account type :")); + + radioButton_SIP = new QRadioButton(tr("Create a SIP (Session Initiation Protocol) account")); + radioButton_IAX = new QRadioButton(tr("Create a IAX2 (InterAsterisk eXchange) account")); + radioButton_SIP->setChecked(true); + + registerField("SIP", radioButton_SIP); + registerField("IAX", radioButton_IAX); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(radioButton_SIP); + layout->addWidget(radioButton_IAX); + setLayout(layout); +} + + +WizardAccountTypePage::~WizardAccountTypePage() +{ + delete radioButton_SIP; + delete radioButton_IAX; +} + +int WizardAccountTypePage::nextId() const +{ + if(radioButton_SIP->isChecked()) + { + return AccountWizard::Page_SIPForm; + } + else + { + return AccountWizard::Page_IAXForm; + } +} + +/*************************************************************************** + * Class WizardAccountEmailAddressPage * + * Page in which user choses between SIP and IAX account. * + ***************************************************************************/ + +WizardAccountEmailAddressPage::WizardAccountEmailAddressPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Optionnal Email Address")); + setSubTitle(tr("This email address will be used to send your voicemail messages.")); + + label_emailAddress = new QLabel(tr("Email address")); + lineEdit_emailAddress = new QLineEdit(); + + registerField("emailAddress", lineEdit_emailAddress); + + QFormLayout *layout = new QFormLayout; + layout->setWidget(0, QFormLayout::LabelRole, label_emailAddress); + layout->setWidget(0, QFormLayout::FieldRole, lineEdit_emailAddress); + setLayout(layout); +} + + +WizardAccountEmailAddressPage::~WizardAccountEmailAddressPage() +{ + delete label_emailAddress; + delete lineEdit_emailAddress; +} + +int WizardAccountEmailAddressPage::nextId() const +{ + return AccountWizard::Page_Stun; +} + +/*************************************************************************** + * Class WizardAccountFormPage * + * Page of account settings. * + ***************************************************************************/ + +WizardAccountFormPage::WizardAccountFormPage(int type, QWidget *parent) + : QWizardPage(parent) +{ + this->type = type; + if(type == SIP) + { + setTitle(tr("SIP Account Settings")); + } + else + { + setTitle(tr("IAX2 Account Settings")); + } + setSubTitle(tr("Please full these settings fields.")); + + label_alias = new QLabel(tr("Alias")); + label_server = new QLabel(tr("Server")); + label_user = new QLabel(tr("User")); + label_password = new QLabel(tr("Password")); + + lineEdit_alias = new QLineEdit; + lineEdit_server = new QLineEdit; + lineEdit_user = new QLineEdit; + lineEdit_password = new QLineEdit; + + lineEdit_password->setEchoMode(QLineEdit::PasswordEchoOnEdit); + + if(type == SIP) + { + registerField("alias_SIP", lineEdit_alias); + registerField("server_SIP", lineEdit_server); + registerField("user_SIP", lineEdit_user); + registerField("password_SIP", lineEdit_password); + } + else + { + registerField("alias_IAX", lineEdit_alias); + registerField("server_IAX", lineEdit_server); + registerField("user_IAX", lineEdit_user); + registerField("password_IAX", lineEdit_password); + } + + QFormLayout *layout = new QFormLayout; + + + layout->setWidget(0, QFormLayout::LabelRole, label_alias); + layout->setWidget(0, QFormLayout::FieldRole, lineEdit_alias); + layout->setWidget(1, QFormLayout::LabelRole, label_server); + layout->setWidget(1, QFormLayout::FieldRole, lineEdit_server); + layout->setWidget(2, QFormLayout::LabelRole, label_user); + layout->setWidget(2, QFormLayout::FieldRole, lineEdit_user); + layout->setWidget(3, QFormLayout::LabelRole, label_password); + layout->setWidget(3, QFormLayout::FieldRole, lineEdit_password); + + setLayout(layout); +} + + +WizardAccountFormPage::~WizardAccountFormPage() +{ + delete label_alias; + delete label_server; + delete label_user; + delete label_password; + delete lineEdit_alias; + delete lineEdit_server; + delete lineEdit_user; + delete lineEdit_password; +} + +int WizardAccountFormPage::nextId() const +{ + if(type == SIP) + { + return AccountWizard::Page_Stun; + } + else + { + return AccountWizard::Page_Conclusion; + } +} + +/*************************************************************************** + * Class WizardAccountStunPage * + * Page of Stun settings. * + ***************************************************************************/ + +WizardAccountStunPage::WizardAccountStunPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Network Address Translation (NAT)")); + setSubTitle(tr("You should probably enable this option if you're placed under a firewall :")); + + checkBox_enableStun = new QCheckBox(tr("Enable STUN")); + label_StunServer = new QLabel(tr("Stun Server")); + lineEdit_StunServer = new QLineEdit(); + + registerField("enableStun", checkBox_enableStun); + registerField("stunServer", lineEdit_StunServer); + + QFormLayout *layout = new QFormLayout; + layout->addWidget(checkBox_enableStun); + layout->addWidget(label_StunServer); + layout->addWidget(lineEdit_StunServer); + setLayout(layout); +} + + +WizardAccountStunPage::~WizardAccountStunPage() +{ + delete checkBox_enableStun; + delete label_StunServer; + delete lineEdit_StunServer; +} + +int WizardAccountStunPage::nextId() const +{ + return AccountWizard::Page_Conclusion; +} + +/*************************************************************************** + * Class WizardAccountConclusionPage * + * Conclusion page. * + ***************************************************************************/ + +WizardAccountConclusionPage::WizardAccountConclusionPage(QWidget *parent) + : QWizardPage(parent) +{ + setTitle(tr("Account Definition Finished")); + setSubTitle(tr("After checking the settings you chose, click \"Finish\" to create the account.")); + + QVBoxLayout *layout = new QVBoxLayout; + setLayout(layout); +} + +WizardAccountConclusionPage::~WizardAccountConclusionPage() +{ + //delete label_emailAddress; +} + +int WizardAccountConclusionPage::nextId() const +{ + return -1; +} diff --git a/sflphone_kde/AccountWizard.h b/sflphone_kde/AccountWizard.h new file mode 100644 index 0000000000000000000000000000000000000000..d5aa52358f0b658d5fd37bfff3ef845e61cc853c --- /dev/null +++ b/sflphone_kde/AccountWizard.h @@ -0,0 +1,190 @@ +/*************************************************************************** + * 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 ACCOUNTWIZARD_H +#define ACCOUNTWIZARD_H + +#include <QWizard> +#include <QLabel> +#include <QRadioButton> +#include <QLineEdit> +#include <QCheckBox> + +/** + @author Jérémy Quentin <jeremy.quentin@gmail.com> +*/ +class AccountWizard : public QWizard +{ +Q_OBJECT +public: + + enum { Page_Intro, Page_AutoMan, Page_Type, Page_Email, Page_SIPForm, Page_IAXForm, Page_Stun, Page_Conclusion }; + + AccountWizard(QWidget *parent = 0); + ~AccountWizard(); + void accept(); + +}; + +/*************************************************************************** + * Class WizardIntroPage * + * Widget of the introduction page of the wizard * + ***************************************************************************/ + +class WizardIntroPage : public QWizardPage +{ + Q_OBJECT + +public: + WizardIntroPage(QWidget *parent = 0); + ~WizardIntroPage(); + int nextId() const; + +private: + QLabel * introLabel; +}; + +/*************************************************************************** + * Class WizardAccountAutoManualPage * + * Page in which user choses to create an account on * + * sflphone.org or register a new one. * + ***************************************************************************/ + +class WizardAccountAutoManualPage : public QWizardPage +{ + Q_OBJECT + +public: + WizardAccountAutoManualPage(QWidget *parent = 0); + ~WizardAccountAutoManualPage(); + int nextId() const; + +private: + QRadioButton * radioButton_SFL; + QRadioButton * radioButton_manual; +}; + +/*************************************************************************** + * Class WizardAccountTypePage * + * Page in which user choses between SIP and IAX account. * + ***************************************************************************/ + +class WizardAccountTypePage : public QWizardPage +{ + Q_OBJECT + +public: + WizardAccountTypePage(QWidget *parent = 0); + ~WizardAccountTypePage(); + int nextId() const; + +private: + QRadioButton * radioButton_SIP; + QRadioButton * radioButton_IAX; +}; + +/*************************************************************************** + * Class WizardAccountEmailAddressPage * + * Page in which user choses between SIP and IAX account. * + ***************************************************************************/ + +class WizardAccountEmailAddressPage : public QWizardPage +{ + Q_OBJECT + +public: + WizardAccountEmailAddressPage(QWidget *parent = 0); + ~WizardAccountEmailAddressPage(); + int nextId() const; + +private: + QLabel * label_emailAddress; + QLineEdit * lineEdit_emailAddress; +}; + +/*************************************************************************** + * Class WizardAccountFormPage * + * Page of account settings. * + ***************************************************************************/ + +class WizardAccountFormPage : public QWizardPage +{ + Q_OBJECT + +public: + + WizardAccountFormPage(int type, QWidget *parent = 0); + ~WizardAccountFormPage(); + int nextId() const; + +private: + int type; + + QLabel * label_alias; + QLabel * label_server; + QLabel * label_user; + QLabel * label_password; + + QLineEdit * lineEdit_alias; + QLineEdit * lineEdit_server; + QLineEdit * lineEdit_user; + QLineEdit * lineEdit_password; +}; + +/*************************************************************************** + * Class WizardAccountStunPage * + * Page of Stun settings. * + ***************************************************************************/ + +class WizardAccountStunPage : public QWizardPage +{ + Q_OBJECT + +public: + WizardAccountStunPage(QWidget *parent = 0); + ~WizardAccountStunPage(); + int nextId() const; + +private: + QCheckBox * checkBox_enableStun; + QLabel * label_StunServer; + QLineEdit * lineEdit_StunServer; +}; + +/*************************************************************************** + * Class WizardAccountConclusionPage * + * Conclusion page. * + ***************************************************************************/ + +class WizardAccountConclusionPage : public QWizardPage +{ + Q_OBJECT + +public: + WizardAccountConclusionPage(QWidget *parent = 0); + ~WizardAccountConclusionPage(); + int nextId() const; + +private: + //QLabel * label_emailAddress; + //QLineEdit * lineEdit_emailAddress; +}; + +#endif diff --git a/sflphone_kde/CMakeLists.txt b/sflphone_kde/CMakeLists.txt index fc127f03a61cc50de9fd06125e667658fcf6420e..d12fd80b512b93097e6533c52de995cb6ffec63b 100644 --- a/sflphone_kde/CMakeLists.txt +++ b/sflphone_kde/CMakeLists.txt @@ -20,6 +20,7 @@ SET( configurationmanager_interface_singleton.cpp callmanager_interface.cpp callmanager_interface_singleton.cpp + AccountWizard.cpp ) SET(QtApp_RCCS resources.qrc) diff --git a/sflphone_kde/Call.cpp b/sflphone_kde/Call.cpp index 1d3b7097bcc64ad0a25c5f0d1fd418c667f6bb2d..9e78d9bb1803ff6683a776b8b09c5ad51aa20816 100644 --- a/sflphone_kde/Call.cpp +++ b/sflphone_kde/Call.cpp @@ -5,7 +5,7 @@ #include "SFLPhone.h" #include "sflphone_const.h" -const char * Call::callStateIcons[11] = {ICON_INCOMING, ICON_RINGING, ICON_CURRENT, ICON_DIALING, ICON_HOLD, ICON_FAILURE, ICON_BUSY, ICON_TRANSFER, ICON_TRANSF_HOLD, "", ""}; + const call_state Call::actionPerformedStateMap [11][5] = { @@ -55,52 +55,76 @@ const function Call::actionPerformedFunctionMap[11][5] = /*ERROR */ {&Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing } }; +const char * Call::callStateIcons[11] = {ICON_INCOMING, ICON_RINGING, ICON_CURRENT, ICON_DIALING, ICON_HOLD, ICON_FAILURE, ICON_BUSY, ICON_TRANSFER, ICON_TRANSF_HOLD, "", ""}; + const char * Call::historyIcons[3] = {ICON_HISTORY_INCOMING, ICON_HISTORY_OUTGOING, ICON_HISTORY_MISSED}; void Call::initCallItem() { + qDebug() << "initCallItem"; item = new QListWidgetItem(); - item->setSizeHint(QSize(140,25)); + item->setSizeHint(QSize(140,30)); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled); + itemWidget = new QWidget(); - QLabel * labelIcon = new QLabel(itemWidget); - QLabel * labelCallNumber = new QLabel(peer, itemWidget); - QLabel * labelTransferTo = new QLabel("Transfer to : ", itemWidget); - QLabel * labelTransferNumber = new QLabel(itemWidget); + labelIcon = new QLabel(itemWidget); + labelCallNumber = new QLabel(peer, itemWidget); + labelTransferTo = new QLabel("Transfer to : ", itemWidget); + labelTransferNumber = new QLabel(itemWidget); + QSpacerItem * horizontalSpacer = new QSpacerItem(16777215, 20, QSizePolicy::Preferred, QSizePolicy::Minimum); labelIcon->setObjectName(QString(CALL_ITEM_ICON)); labelCallNumber->setObjectName(QString(CALL_ITEM_CALL_NUMBER)); + labelTransferTo->setObjectName(QString(CALL_ITEM_TRANSFER_LABEL)); labelTransferNumber->setObjectName(QString(CALL_ITEM_TRANSFER_NUMBER)); QGridLayout * layout = new QGridLayout(itemWidget); - layout->setMargin(0); - layout->setSpacing(0); + layout->setMargin(3); + layout->setSpacing(3); layout->addWidget(labelIcon, 0, 0, 2, 1); layout->addWidget(labelCallNumber, 0, 1, 1, 2); - layout->addWidget(labelTransferTo, 1, 2, 1, 1); - layout->addWidget(labelTransferNumber, 1, 1, 1, 1); - labelIcon->raise(); - labelCallNumber->raise(); - labelTransferTo->raise(); - labelTransferNumber->raise(); - itemWidget->setLayoutDirection(Qt::LeftToRight); + layout->addWidget(labelTransferTo, 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)); + //item->setSizeHint(itemWidget->sizeHint()); + //setItemIcon(QString(ICON_REFUSE)); + updateItem(); } -void Call::setItemIcon(const QString & pixmap) +void Call::setItemIcon(const QString pixmap) { - itemWidget->findChild<QLabel * >(QString(CALL_ITEM_ICON))->setPixmap(QPixmap(pixmap)); + qDebug() << "setItemIcon(" << pixmap << ");"; + QString str(CALL_ITEM_ICON); + qDebug() << "str = " << str; + qDebug() << "setItemIcon1"; + //QLabel * labelIcon = itemWidget->findChild<QLabel * >(str); + qDebug() << "setItemIcon2"; + //QPixmap icon(pixmap); + QPixmap * icon = new QPixmap(":/images/icons/dial.svg"); + qDebug() << "setItemIcon2b"; + labelIcon->setPixmap(*icon); + qDebug() << "setItemIcon3"; } Call::Call(call_state startState, QString callId, QString from, QString account) { + for(int i = 0 ; i < 100 ; i++) + { + qDebug() << i << " :"; + QString str(callStateIcons[startState]); + qDebug() << str; + } + qDebug() << "<<<<Done>>>>"; this->callId = callId; this->peer = from; + changeCurrentState(startState); initCallItem(); - //this->item = new QListWidgetItem(from); this->account = account; this->recording = false; - changeCurrentState(startState); this->historyItem = NULL; } @@ -373,6 +397,25 @@ void Call::changeCurrentState(call_state newState) void Call::updateItem() { - setItemIcon(QString(callStateIcons[currentState])); - + qDebug() << callStateIcons[currentState]; + qDebug() << "updateItem0"; + QString str(callStateIcons[currentState]); + qDebug() << "updateItem1"; + setItemIcon(str); + qDebug() << "updateItem2"; + bool transfer = currentState == CALL_STATE_TRANSFER || currentState == CALL_STATE_TRANSF_HOLD; + qDebug() << "updateItem3"; + qDebug() << "transfer : " << transfer; + qDebug() << "updateItem4"; + QLabel * transferLabel = itemWidget->findChild<QLabel *>(QString(CALL_ITEM_TRANSFER_LABEL)); + qDebug() << "updateItem5"; + QLabel * transferNumber = itemWidget->findChild<QLabel *>(QString(CALL_ITEM_TRANSFER_NUMBER)); + qDebug() << "updateItem6"; + transferLabel->setVisible(transfer); + qDebug() << "updateItem7"; + transferNumber->setVisible(transfer); + qDebug() << "updateItem8"; + if(!transfer) + transferNumber->setText(""); + qDebug() << "updateItem9"; } diff --git a/sflphone_kde/Call.h b/sflphone_kde/Call.h index 60381693be157750d4a32f39ab9aaffb10920a20..d3938fea931346dc1b97e93442ed213f817e75ef 100644 --- a/sflphone_kde/Call.h +++ b/sflphone_kde/Call.h @@ -98,6 +98,11 @@ private: QDateTime * stopTime; QListWidgetItem * item; QWidget * itemWidget; + QLabel * labelIcon; + QLabel * labelCallNumber; + QLabel * labelTransferTo; + QLabel * labelTransferNumber; + QListWidgetItem * historyItem; //Automate attributes @@ -146,7 +151,7 @@ public: history_state getHistoryState() const; bool getRecording() const; void appendItemText(QString text); - void setItemIcon(const QString & pixmap); + void setItemIcon(const QString pixmap); void changeCurrentState(call_state newState); void updateItem(); diff --git a/sflphone_kde/ConfigDialog.ui b/sflphone_kde/ConfigDialog.ui index a629a712e9be7f42641bf54751fe797833e3be0b..dad667766bed75c39d699a55806af719b452053c 100644 --- a/sflphone_kde/ConfigDialog.ui +++ b/sflphone_kde/ConfigDialog.ui @@ -17,7 +17,7 @@ </size> </property> <property name="windowTitle" > - <string>Dialog</string> + <string>Configuration Dialog</string> </property> <layout class="QVBoxLayout" name="verticalLayout" > <property name="margin" > @@ -122,17 +122,17 @@ </property> <item> <property name="text" > - <string>Général</string> + <string>General</string> </property> </item> <item> <property name="text" > - <string>Affichage</string> + <string>Display</string> </property> </item> <item> <property name="text" > - <string>Comptes</string> + <string>Accounts</string> </property> </item> <item> @@ -152,7 +152,7 @@ <item> <widget class="QStackedWidget" name="stackedWidget_options" > <property name="currentIndex" > - <number>2</number> + <number>3</number> </property> <widget class="QWidget" name="page_general" > <layout class="QVBoxLayout" name="verticalLayout_18" > @@ -162,7 +162,7 @@ <item> <widget class="QLabel" name="label_configGeneral" > <property name="text" > - <string>Configuration des paramètres généraux</string> + <string>Configure general settings</string> </property> </widget> </item> @@ -182,7 +182,7 @@ </sizepolicy> </property> <property name="title" > - <string>Historique des appels</string> + <string>Call history</string> </property> <layout class="QVBoxLayout" name="verticalLayout_19" > <item> @@ -191,7 +191,7 @@ <item> <widget class="QLabel" name="label_historyCapacity" > <property name="text" > - <string>&Capacité</string> + <string>&Capacity</string> </property> <property name="buddy" > <cstring>horizontalSlider_historyCapacity</cstring> @@ -217,7 +217,7 @@ <item> <widget class="QToolButton" name="toolButton_historyClear" > <property name="text" > - <string>&Effacer l'Historique</string> + <string>C&lear history</string> </property> </widget> </item> @@ -233,7 +233,7 @@ </sizepolicy> </property> <property name="title" > - <string>Connexion</string> + <string>Connection</string> </property> <layout class="QFormLayout" name="formLayout_12" > <property name="fieldGrowthPolicy" > @@ -242,7 +242,10 @@ <item row="0" column="0" > <widget class="QLabel" name="label_SIPPort" > <property name="text" > - <string>Port SIP</string> + <string>SIP &Port</string> + </property> + <property name="buddy" > + <cstring>spinBox_SIPPort</cstring> </property> </widget> </item> @@ -313,7 +316,7 @@ </sizepolicy> </property> <property name="text" > - <string>Configuration de l'affichage</string> + <string>Configure display</string> </property> </widget> </item> @@ -348,7 +351,7 @@ </sizepolicy> </property> <property name="text" > - <string>Activer les notifications du bureau</string> + <string>Enable notifications</string> </property> </widget> </item> @@ -364,14 +367,14 @@ <item> <widget class="QCheckBox" name="checkBox1_notifOnCalls" > <property name="text" > - <string>&Appels entrants</string> + <string>On incoming &calls</string> </property> </widget> </item> <item> <widget class="QCheckBox" name="checkBox2_notifOnMessages" > <property name="text" > - <string>&Messages vocaux</string> + <string>On &messages</string> </property> </widget> </item> @@ -387,7 +390,7 @@ </sizepolicy> </property> <property name="text" > - <string>Faire apparaître la fenêtre principale</string> + <string>Show main window</string> </property> </widget> </item> @@ -403,14 +406,14 @@ <item> <widget class="QCheckBox" name="checkBox1_displayOnStart" > <property name="text" > - <string>Au &démarrage</string> + <string>On &start</string> </property> </widget> </item> <item> <widget class="QCheckBox" name="checkBox2_displayOnCalls" > <property name="text" > - <string>Lors d'un appel &entrant</string> + <string>On &incoming calls</string> </property> </widget> </item> @@ -436,7 +439,7 @@ </sizepolicy> </property> <property name="text" > - <string>Configuration des comptes utilisateur</string> + <string>Configure user accounts</string> </property> </widget> </item> @@ -630,7 +633,7 @@ <item row="1" column="0" > <widget class="QLabel" name="label2_protocol" > <property name="text" > - <string>&Protocole</string> + <string>&Protocol</string> </property> <property name="buddy" > <cstring>edit2_protocol</cstring> @@ -654,7 +657,7 @@ <item row="2" column="0" > <widget class="QLabel" name="label3_server" > <property name="text" > - <string>&Serveur</string> + <string>&Server</string> </property> <property name="buddy" > <cstring>edit3_server</cstring> @@ -674,7 +677,7 @@ <item row="3" column="0" > <widget class="QLabel" name="label4_user" > <property name="text" > - <string>&Usager</string> + <string>&User</string> </property> <property name="buddy" > <cstring>edit4_user</cstring> @@ -687,7 +690,7 @@ <item row="4" column="0" > <widget class="QLabel" name="label5_password" > <property name="text" > - <string>&Mot de Passe</string> + <string>Pass&word</string> </property> <property name="buddy" > <cstring>edit5_password</cstring> @@ -697,14 +700,14 @@ <item row="4" column="1" > <widget class="QLineEdit" name="edit5_password" > <property name="echoMode" > - <enum>QLineEdit::Password</enum> + <enum>QLineEdit::PasswordEchoOnEdit</enum> </property> </widget> </item> <item row="5" column="0" > <widget class="QLabel" name="label6_mailbox" > <property name="text" > - <string>&Boîte Vocale</string> + <string>&Mailbox</string> </property> <property name="buddy" > <cstring>edit6_mailbox</cstring> @@ -717,7 +720,7 @@ <item row="6" column="0" > <widget class="QLabel" name="label7_state" > <property name="text" > - <string>État </string> + <string>State</string> </property> </widget> </item> @@ -728,126 +731,6 @@ </property> </widget> </item> - <item row="7" column="0" > - <widget class="QWidget" native="1" name="widget_3" > - <layout class="QHBoxLayout" name="horizontalLayout_7" > - <property name="spacing" > - <number>0</number> - </property> - <property name="margin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_4" > - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="resources.qrc" >:/images/icons/hang_up.svg</pixmap> - </property> - </widget> - </item> - <item> - <layout class="QVBoxLayout" name="verticalLayout_4" > - <property name="spacing" > - <number>0</number> - </property> - <property name="leftMargin" > - <number>0</number> - </property> - <property name="rightMargin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label_2" > - <property name="text" > - <string>144</string> - </property> - <property name="indent" > - <number>5</number> - </property> - </widget> - </item> - <item> - <layout class="QHBoxLayout" name="horizontalLayout_8" > - <property name="spacing" > - <number>0</number> - </property> - <property name="topMargin" > - <number>0</number> - </property> - <item> - <widget class="QLabel" name="label" > - <property name="text" > - <string><FONT SIZE=2>Transfer to :</FONT></string> - </property> - </widget> - </item> - <item> - <widget class="QLabel" name="label_3" > - <property name="text" > - <string><FONT SIZE=2>122</FONT></string> - </property> - </widget> - </item> - </layout> - </item> - </layout> - </item> - </layout> - </widget> - </item> - <item row="8" column="0" > - <widget class="QWidget" native="1" name="widget_4" > - <layout class="QGridLayout" name="gridLayout_2" > - <property name="margin" > - <number>0</number> - </property> - <property name="spacing" > - <number>0</number> - </property> - <item rowspan="2" row="0" column="0" > - <widget class="QLabel" name="label_5" > - <property name="text" > - <string/> - </property> - <property name="pixmap" > - <pixmap resource="resources.qrc" >:/images/icons/hang_up.svg</pixmap> - </property> - </widget> - </item> - <item row="1" column="1" > - <widget class="QLabel" name="label_7" > - <property name="text" > - <string><FONT SIZE=2>Transfer to :</FONT></string> - </property> - </widget> - </item> - <item row="1" column="2" > - <widget class="QLabel" name="label_8" > - <property name="text" > - <string><FONT SIZE=2>122</FONT></string> - </property> - </widget> - </item> - <item row="0" column="1" colspan="2" > - <widget class="QLabel" name="label_6" > - <property name="text" > - <string>144</string> - </property> - <property name="indent" > - <number>5</number> - </property> - </widget> - </item> - </layout> - <zorder>label_5</zorder> - <zorder>label_5</zorder> - <zorder>label_7</zorder> - <zorder>label_8</zorder> - <zorder>label_6</zorder> - </widget> - </item> </layout> </widget> </item> @@ -863,7 +746,7 @@ <item> <widget class="QLabel" name="label_commonSettings" > <property name="text" > - <string>Les paramètres STUN seront appliqués à tous les comptes</string> + <string>Stun settings will be applied on each account</string> </property> </widget> </item> @@ -875,7 +758,7 @@ <item row="0" column="0" > <widget class="QCheckBox" name="checkBox_stun" > <property name="text" > - <string>Activer Stun</string> + <string>&Enable Stun</string> </property> </widget> </item> @@ -904,7 +787,7 @@ </sizepolicy> </property> <property name="text" > - <string>Configuration des paramètres audio</string> + <string>Configure audio settings</string> </property> </widget> </item> @@ -930,7 +813,7 @@ <item row="0" column="0" > <widget class="QLabel" name="label_interface" > <property name="text" > - <string>&Interface audio</string> + <string>Audio &device</string> </property> <property name="buddy" > <cstring>comboBox_interface</cstring> @@ -960,41 +843,13 @@ <item row="1" column="0" > <widget class="QCheckBox" name="checkBox_ringtones" > <property name="text" > - <string>&Activer les sonneries</string> + <string>&Enable ringtones</string> </property> </widget> </item> <item row="1" column="1" > <widget class="KUrlComboRequester" name="urlComboRequester_ringtone" /> </item> - <item row="2" column="0" > - <widget class="KLed" name="kled" > - <property name="sizePolicy" > - <sizepolicy vsizetype="Preferred" hsizetype="Fixed" > - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="mouseTracking" > - <bool>false</bool> - </property> - <property name="focusPolicy" > - <enum>Qt::NoFocus</enum> - </property> - <property name="layoutDirection" > - <enum>Qt::RightToLeft</enum> - </property> - <property name="state" > - <enum>KLed::On</enum> - </property> - <property name="shape" > - <enum>KLed::Circular</enum> - </property> - <property name="look" > - <enum>KLed::Flat</enum> - </property> - </widget> - </item> </layout> </widget> </item> @@ -1068,17 +923,17 @@ </property> <column> <property name="text" > - <string>Actif</string> + <string>Active</string> </property> </column> <column> <property name="text" > - <string>Nom</string> + <string>Name</string> </property> </column> <column> <property name="text" > - <string>Fréquence</string> + <string>Frequency</string> </property> </column> <column> @@ -1088,7 +943,7 @@ </column> <column> <property name="text" > - <string>Bande Passante</string> + <string>Bandwidth</string> </property> </column> </widget> @@ -1115,7 +970,7 @@ <item> <widget class="QGroupBox" name="groupBox_alsa" > <property name="title" > - <string>Paramètres ALSA</string> + <string>ALSA settings</string> </property> <layout class="QFormLayout" name="formLayout_4" > <item row="2" column="1" > @@ -1131,7 +986,7 @@ <item row="2" column="0" > <widget class="QLabel" name="label2_in" > <property name="text" > - <string>&Entrée</string> + <string>&In</string> </property> <property name="buddy" > <cstring>comboBox2_in</cstring> @@ -1141,7 +996,7 @@ <item row="3" column="0" > <widget class="QLabel" name="label3_out" > <property name="text" > - <string>&Sortie</string> + <string>&Out</string> </property> <property name="buddy" > <cstring>comboBox3_out</cstring> @@ -1161,7 +1016,7 @@ <item row="0" column="0" > <widget class="QLabel" name="label1_alsaPugin" > <property name="text" > - <string>&Greffon ALSA</string> + <string>ALSA &plugin</string> </property> <property name="buddy" > <cstring>comboBox1_alsaPlugin</cstring> @@ -1252,11 +1107,6 @@ </widget> <layoutdefault spacing="4" margin="4" /> <customwidgets> - <customwidget> - <class>KLed</class> - <extends>QWidget</extends> - <header>kled.h</header> - </customwidget> <customwidget> <class>KUrlComboRequester</class> <extends>KUrlRequester</extends> diff --git a/sflphone_kde/SFLPhone.cpp b/sflphone_kde/SFLPhone.cpp index d4ff43f186b470e7fe1e319447952761987b3679..9199bccef872f367974e691cdac075cc895f9aa0 100644 --- a/sflphone_kde/SFLPhone.cpp +++ b/sflphone_kde/SFLPhone.cpp @@ -13,6 +13,9 @@ SFLPhone::SFLPhone(QMainWindow *parent) : QMainWindow(parent) configDialog = new ConfigurationDialog(this); configDialog->setModal(true); + wizard = new AccountWizard(this); + wizard->setModal(false); + CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); connect(&callManager, SIGNAL(callStateChanged(const QString &, const QString &)), this, SLOT(on1_callStateChanged(const QString &, const QString &))); @@ -556,6 +559,12 @@ void SFLPhone::on_action_configureSflPhone_triggered() configDialog->show(); } +void SFLPhone::on_action_accountCreationWizard_triggered() +{ + wizard->show(); +} + + void SFLPhone::on_action_accept_triggered() { if(stackedWidget_screen->currentWidget() == page_callList) diff --git a/sflphone_kde/SFLPhone.h b/sflphone_kde/SFLPhone.h index b7eb4f0733fe800a7c8d0c67dbcec12000fd9979..fb6b520d403621ea04d8041575baafe22964af3c 100644 --- a/sflphone_kde/SFLPhone.h +++ b/sflphone_kde/SFLPhone.h @@ -5,6 +5,7 @@ #include "ui_sflphone-qt.h" #include "ConfigDialog.h" #include "CallList.h" +#include "AccountWizard.h" class ConfigurationDialog; @@ -15,6 +16,7 @@ Q_OBJECT private: ConfigurationDialog * configDialog; + AccountWizard * wizard; CallList * callList; QErrorMessage * errorWindow; @@ -56,6 +58,7 @@ private slots: void on_action_configureAccounts_triggered(); void on_action_configureAudio_triggered(); void on_action_configureSflPhone_triggered(); + void on_action_accountCreationWizard_triggered(); void on_action_accept_triggered(); void on_action_refuse_triggered(); void on_action_hold_triggered(); diff --git a/sflphone_kde/main.cpp b/sflphone_kde/main.cpp index db21401070ec6b164d8e37d9f3862d82e409f4e0..b3c7ab7fcc029ffd08f9ff41b1920f67b63b64a9 100644 --- a/sflphone_kde/main.cpp +++ b/sflphone_kde/main.cpp @@ -5,6 +5,7 @@ #include <QtGui> #include "ConfigDialog.h" #include "SFLPhone.h" +#include "AccountWizard.h" static const char description[] = I18N_NOOP("A KDE 4 Client for SflPhone"); @@ -29,7 +30,6 @@ int main(int argc, char **argv) app.installTranslator(&translator); SFLPhone fenetre; - fenetre.show(); diff --git a/sflphone_kde/sflphone-qt.ui b/sflphone_kde/sflphone-qt.ui index 6189ef6c7c118a56f088f133710bda4e89b601a2..48bc455d9facec54325b12caa29fad66a2d003ba 100644 --- a/sflphone_kde/sflphone-qt.ui +++ b/sflphone_kde/sflphone-qt.ui @@ -356,7 +356,7 @@ <height>25</height> </rect> </property> - <widget class="QMenu" name="menuActions" > + <widget class="QMenu" name="menu_Actions" > <property name="title" > <string>&Actions</string> </property> @@ -367,10 +367,11 @@ <addaction name="action_record" /> <addaction name="separator" /> <addaction name="action_mailBox" /> + <addaction name="action_history" /> </widget> - <widget class="QMenu" name="menu_Configuration" > + <widget class="QMenu" name="menu_Configure" > <property name="title" > - <string>&Configuration</string> + <string>&Configure</string> </property> <addaction name="action_displayVolumeControls" /> <addaction name="action_displayDialpad" /> @@ -378,16 +379,18 @@ <addaction name="action_configureAccounts" /> <addaction name="action_configureAudio" /> <addaction name="action_configureSflPhone" /> + <addaction name="separator" /> + <addaction name="action_accountCreationWizard" /> </widget> - <widget class="QMenu" name="menuAide" > + <widget class="QMenu" name="menu_help" > <property name="title" > - <string>Ai&de</string> + <string>&Help</string> </property> <addaction name="action_About" /> </widget> - <addaction name="menuActions" /> - <addaction name="menu_Configuration" /> - <addaction name="menuAide" /> + <addaction name="menu_Actions" /> + <addaction name="menu_Configure" /> + <addaction name="menu_help" /> </widget> <widget class="QStatusBar" name="statusbar" /> <widget class="QToolBar" name="toolBar" > @@ -415,7 +418,7 @@ <normaloff>:/images/icons/call.svg</normaloff>:/images/icons/call.svg</iconset> </property> <property name="text" > - <string>&Décrocher</string> + <string>&Pick up</string> </property> </action> <action name="action_refuse" > @@ -424,7 +427,7 @@ <normaloff>:/images/icons/hang_up.svg</normaloff>:/images/icons/hang_up.svg</iconset> </property> <property name="text" > - <string>&Raccrocher</string> + <string>&Hang up</string> </property> </action> <action name="action_hold" > @@ -433,7 +436,7 @@ <normaloff>:/images/icons/hold.svg</normaloff>:/images/icons/hold.svg</iconset> </property> <property name="text" > - <string>Mettre en &Attente</string> + <string>H&old</string> </property> </action> <action name="action_transfer" > @@ -445,7 +448,7 @@ <normaloff>:/images/icons/transfert.svg</normaloff>:/images/icons/transfert.svg</iconset> </property> <property name="text" > - <string>&Transférer</string> + <string>&Transfer</string> </property> </action> <action name="action_history" > @@ -457,7 +460,7 @@ <normaloff>:/images/icons/history2.svg</normaloff>:/images/icons/history2.svg</iconset> </property> <property name="text" > - <string>&Historique</string> + <string>H&istory</string> </property> </action> <action name="action_mailBox" > @@ -466,7 +469,7 @@ <normaloff>:/images/icons/mailbox.svg</normaloff>:/images/icons/mailbox.svg</iconset> </property> <property name="text" > - <string>&Boîte Vocale</string> + <string>&Mailbox</string> </property> </action> <action name="action_configureAccounts" > @@ -475,7 +478,7 @@ <normaloff>:/Images/stock_person.svg</normaloff>:/Images/stock_person.svg</iconset> </property> <property name="text" > - <string>Configurer les &comptes</string> + <string>Configure &accounts</string> </property> </action> <action name="action_configureAudio" > @@ -484,7 +487,7 @@ <normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset> </property> <property name="text" > - <string>Configurer le &son</string> + <string>Configure a&udio</string> </property> </action> <action name="action_configureSflPhone" > @@ -493,7 +496,7 @@ <normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset> </property> <property name="text" > - <string>&Configurer SFLPhone</string> + <string>&Configure SFLPhone</string> </property> </action> <action name="action_displayVolumeControls" > @@ -508,7 +511,7 @@ <normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset> </property> <property name="text" > - <string>Afficher les barres de &volume</string> + <string>Display &volume bars</string> </property> </action> <action name="action_About" > @@ -528,7 +531,7 @@ <normaloff>:/Images/icon_dialpad.svg</normaloff>:/Images/icon_dialpad.svg</iconset> </property> <property name="text" > - <string>Afficher le &clavier</string> + <string>Display &dialpad</string> </property> </action> <action name="action_record" > @@ -543,6 +546,11 @@ <string>&Record</string> </property> </action> + <action name="action_accountCreationWizard" > + <property name="text" > + <string>Account creation &wizard</string> + </property> + </action> </widget> <resources> <include location="resources.qrc" /> diff --git a/sflphone_kde/sflphone_const.h b/sflphone_kde/sflphone_const.h index 192c8c10364e44b9c4317f9b1e748b91f7115599..a9c91e378e74b23384d7fd87c068cd261581c232 100644 --- a/sflphone_kde/sflphone_const.h +++ b/sflphone_kde/sflphone_const.h @@ -35,6 +35,8 @@ #define UNUSED __attribute__((__unused__)) +#define SIP 0 +#define IAX 1 #define PAGE_GENERAL 0 #define PAGE_DISPLAY 1 @@ -118,6 +120,7 @@ #define CALL_STATE_CHANGE_UNHOLD_RECORD "UNHOLD_RECORD" #define CALL_ITEM_CALL_NUMBER "callNumber" +#define CALL_ITEM_TRANSFER_LABEL "transferLabel" #define CALL_ITEM_TRANSFER_NUMBER "transferNumber" #define CALL_ITEM_ICON "icon"