Skip to content
Snippets Groups Projects
Commit f2eeca32 authored by Jérémy Quentin's avatar Jérémy Quentin
Browse files

Commit functional.

parent 40bf8d34
Branches
Tags
No related merge requests found
...@@ -65,10 +65,12 @@ Account * Account::buildExistingAccountFromId(QString _accountId) ...@@ -65,10 +65,12 @@ Account * Account::buildExistingAccountFromId(QString _accountId)
a->accountDetails = new MapStringString( ConfigurationManagerInterfaceSingleton::getInstance().getAccountDetails(_accountId).value() ); a->accountDetails = new MapStringString( ConfigurationManagerInterfaceSingleton::getInstance().getAccountDetails(_accountId).value() );
a->initAccountItem(); a->initAccountItem();
if(a->item->checkState() == Qt::Checked) if(a->item->checkState() == Qt::Checked)
{
if(a->getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED) if(a->getAccountDetail(* new QString(ACCOUNT_STATUS)) == ACCOUNT_STATE_REGISTERED)
a->item->setTextColor(Qt::darkGreen); a->item->setTextColor(Qt::darkGreen);
else else
a->item->setTextColor(Qt::red); a->item->setTextColor(Qt::red);
}
return a; return a;
} }
......
...@@ -53,7 +53,8 @@ const function Call::actionPerformedFunctionMap[11][5] = ...@@ -53,7 +53,8 @@ const function Call::actionPerformedFunctionMap[11][5] =
/*ERROR */ {&Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing } /*ERROR */ {&Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing , &Call::nothing }
}; };
const QIcon Call::historyIcons[3] = {QIcon(ICON_HISTORY_INCOMING), QIcon(ICON_HISTORY_OUTGOING), QIcon(ICON_HISTORY_MISSED)}; const char * Call::historyIcons[3] = {ICON_HISTORY_INCOMING, ICON_HISTORY_OUTGOING, ICON_HISTORY_MISSED};
Call::Call(call_state startState, QString callId, QString from, QString account) Call::Call(call_state startState, QString callId, QString from, QString account)
{ {
...@@ -64,6 +65,7 @@ Call::Call(call_state startState, QString callId, QString from, QString account) ...@@ -64,6 +65,7 @@ Call::Call(call_state startState, QString callId, QString from, QString account)
this->recording = false; this->recording = false;
this->currentState = startState; this->currentState = startState;
this->historyItem = NULL; this->historyItem = NULL;
} }
Call::~Call() Call::~Call()
...@@ -112,6 +114,7 @@ daemon_call_state Call::toDaemonCallState(const QString & stateName) ...@@ -112,6 +114,7 @@ daemon_call_state Call::toDaemonCallState(const QString & stateName)
return DAEMON_CALL_STATE_FAILURE; return DAEMON_CALL_STATE_FAILURE;
} }
qDebug() << "stateChanged signal received with unknown state."; qDebug() << "stateChanged signal received with unknown state.";
return DAEMON_CALL_STATE_FAILURE;
} }
QListWidgetItem * Call::getItem() QListWidgetItem * Call::getItem()
...@@ -123,8 +126,8 @@ QListWidgetItem * Call::getHistoryItem() ...@@ -123,8 +126,8 @@ QListWidgetItem * Call::getHistoryItem()
{ {
if(historyItem == NULL) if(historyItem == NULL)
{ {
historyItem = new QListWidgetItem("<H1>"+peer+"</H1>"); historyItem = new QListWidgetItem(peer);
historyItem->setIcon(historyIcons[historyState]); historyItem->setIcon(QIcon(historyIcons[historyState]));
} }
return historyItem; return historyItem;
} }
...@@ -197,7 +200,7 @@ void Call::accept(QString number) ...@@ -197,7 +200,7 @@ void Call::accept(QString number)
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
qDebug() << "Accepting call. callId : " << callId; qDebug() << "Accepting call. callId : " << callId;
callManager.accept(callId); callManager.accept(callId);
this->startTime = & QDateTime::currentDateTime(); this->startTime = new QDateTime(QDateTime::currentDateTime());
this->historyState = INCOMING; this->historyState = INCOMING;
} }
...@@ -206,7 +209,7 @@ void Call::refuse(QString number) ...@@ -206,7 +209,7 @@ void Call::refuse(QString number)
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
qDebug() << "Refusing call. callId : " << callId; qDebug() << "Refusing call. callId : " << callId;
callManager.refuse(callId); callManager.refuse(callId);
this->startTime = & QDateTime::currentDateTime(); this->startTime = new QDateTime(QDateTime::currentDateTime());
this->historyState = MISSED; this->historyState = MISSED;
} }
...@@ -267,7 +270,7 @@ void Call::transfer(QString number) ...@@ -267,7 +270,7 @@ void Call::transfer(QString number)
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance(); CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
qDebug() << "Transfering call to number : " << number << ". callId : " << callId; qDebug() << "Transfering call to number : " << number << ". callId : " << callId;
callManager.transfert(callId, number); callManager.transfert(callId, number);
this->stopTime = & QDateTime::currentDateTime(); this->stopTime = new QDateTime(QDateTime::currentDateTime());
} }
void Call::unhold(QString number) void Call::unhold(QString number)
......
...@@ -103,7 +103,7 @@ private: ...@@ -103,7 +103,7 @@ private:
static const call_state actionPerformedStateMap [11][5]; static const call_state actionPerformedStateMap [11][5];
static const function actionPerformedFunctionMap [11][5]; static const function actionPerformedFunctionMap [11][5];
static const call_state stateChangedStateMap [11][6]; static const call_state stateChangedStateMap [11][6];
static const QIcon historyIcons[3]; static const char * historyIcons[3];
call_state currentState; call_state currentState;
bool recording; bool recording;
......
This diff is collapsed.
...@@ -8,14 +8,12 @@ ...@@ -8,14 +8,12 @@
#include "SFLPhone.h" #include "SFLPhone.h"
#include <QErrorMessage> #include <QErrorMessage>
class SFLPhone; class SFLPhone;
class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog class ConfigurationDialog : public QDialog, private Ui::ConfigurationDialog
{ {
Q_OBJECT Q_OBJECT
private: private:
AccountList * accountList; AccountList * accountList;
QErrorMessage * errorWindow; QErrorMessage * errorWindow;
...@@ -39,15 +37,24 @@ public: ...@@ -39,15 +37,24 @@ public:
void setPage(int page); void setPage(int page);
void updateCodecListCommands();
void updateAccountListCommands();
private slots: private slots:
void on_button_delAccount_clicked(); void on_toolButton_codecUp_clicked();
void on_button_newAccount_clicked(); void on_toolButton_codecDown_clicked();
void on_edit1_Alias_textChanged(const QString & text); void on_button_accountUp_clicked();
void on_listWidgetComptes_currentItemChanged ( QListWidgetItem * current, QListWidgetItem * previous ); void on_button_accountDown_clicked();
void on_spinBox_PortSIP_valueChanged ( int value ); void on_button_accountAdd_clicked();
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_spinBox_SIPPort_valueChanged ( int value );
void on_buttonBoxDialog_clicked(QAbstractButton * button); 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);
};
#endif #endif
This diff is collapsed.
...@@ -43,8 +43,8 @@ SFLPhone::~SFLPhone() ...@@ -43,8 +43,8 @@ SFLPhone::~SFLPhone()
void SFLPhone::loadWindow() void SFLPhone::loadWindow()
{ {
ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance();
actionAfficher_les_barres_de_volume->setChecked(daemon.getVolumeControls()); action_displayVolumeControls->setChecked(daemon.getVolumeControls());
actionAfficher_le_clavier->setChecked(daemon.getDialpad()); action_displayDialpad->setChecked(daemon.getDialpad());
updateWindowCallState(); updateWindowCallState();
updateRecordButton(); updateRecordButton();
updateVolumeButton(); updateVolumeButton();
...@@ -154,7 +154,6 @@ void SFLPhone::updateWindowCallState() ...@@ -154,7 +154,6 @@ void SFLPhone::updateWindowCallState()
} }
else else
{ {
CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
Call * call = (*callList)[item]; Call * call = (*callList)[item];
call_state state = call->getState(); call_state state = call->getState();
//qDebug() << "calling getIsRecording on " << call->getCallId(); //qDebug() << "calling getIsRecording on " << call->getCallId();
...@@ -239,7 +238,7 @@ void SFLPhone::updateWindowCallState() ...@@ -239,7 +238,7 @@ void SFLPhone::updateWindowCallState()
} }
} }
//qDebug() << "mi"; //qDebug() << "mi";
if (item) if (item && iconFile)
{ {
qDebug() << "rentre " << item; qDebug() << "rentre " << item;
item->setIcon(QIcon(iconFile)); item->setIcon(QIcon(iconFile));
...@@ -400,14 +399,14 @@ void SFLPhone::updateDialpad() ...@@ -400,14 +399,14 @@ void SFLPhone::updateDialpad()
************ Autoconnect ************* ************ Autoconnect *************
************************************************************/ ************************************************************/
void SFLPhone::on_actionAfficher_les_barres_de_volume_toggled() void SFLPhone::on_action_displayVolumeControls_toggled()
{ {
ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance();
daemon.setVolumeControls(); daemon.setVolumeControls();
updateVolumeControls(); updateVolumeControls();
} }
void SFLPhone::on_actionAfficher_le_clavier_toggled() void SFLPhone::on_action_displayDialpad_toggled()
{ {
ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance(); ConfigurationManagerInterface & daemon = ConfigurationManagerInterfaceSingleton::getInstance();
daemon.setDialpad(); daemon.setDialpad();
...@@ -427,7 +426,7 @@ void SFLPhone::on_pushButton_0_clicked() { typeString("0"); } ...@@ -427,7 +426,7 @@ void SFLPhone::on_pushButton_0_clicked() { typeString("0"); }
void SFLPhone::on_pushButton_diese_clicked() { typeString("#"); } void SFLPhone::on_pushButton_diese_clicked() { typeString("#"); }
void SFLPhone::on_pushButton_etoile_clicked() { typeString("*"); } void SFLPhone::on_pushButton_etoile_clicked() { typeString("*"); }
void SFLPhone::on_label_searchHistory_textChanged(const QString & text) void SFLPhone::on_label_searchHistory_textChanged()
{ {
qDebug() << "on_label_searchHistory_textEdited"; qDebug() << "on_label_searchHistory_textEdited";
updateSearchHistory(); updateSearchHistory();
...@@ -530,21 +529,21 @@ void SFLPhone::on_listWidget_callHistory_currentItemChanged() ...@@ -530,21 +529,21 @@ void SFLPhone::on_listWidget_callHistory_currentItemChanged()
updateWindowCallState(); updateWindowCallState();
} }
void SFLPhone::on_actionConfigurer_les_comptes_triggered() void SFLPhone::on_action_configureAccounts_triggered()
{ {
configDialog->loadOptions(); configDialog->loadOptions();
configDialog->setPage(PAGE_ACCOUNTS); configDialog->setPage(PAGE_ACCOUNTS);
configDialog->show(); configDialog->show();
} }
void SFLPhone::on_actionConfigurer_le_son_triggered() void SFLPhone::on_action_configureAudio_triggered()
{ {
configDialog->loadOptions(); configDialog->loadOptions();
configDialog->setPage(PAGE_AUDIO); configDialog->setPage(PAGE_AUDIO);
configDialog->show(); configDialog->show();
} }
void SFLPhone::on_actionConfigurer_SFLPhone_triggered() void SFLPhone::on_action_configureSflPhone_triggered()
{ {
configDialog->loadOptions(); configDialog->loadOptions();
configDialog->setPage(PAGE_GENERAL); configDialog->setPage(PAGE_GENERAL);
...@@ -698,7 +697,7 @@ void SFLPhone::on1_incomingMessage(const QString &accountID, const QString &mess ...@@ -698,7 +697,7 @@ void SFLPhone::on1_incomingMessage(const QString &accountID, const QString &mess
void SFLPhone::on1_voiceMailNotify(const QString &accountID, int count) void SFLPhone::on1_voiceMailNotify(const QString &accountID, int count)
{ {
qDebug() << "on_voiceMailNotify !"; qDebug() << "on_voiceMailNotify ! " << count << " new voice mails for account " << accountID;
} }
void SFLPhone::on1_volumeChanged(const QString &device, double value) void SFLPhone::on1_volumeChanged(const QString &device, double value)
......
...@@ -48,11 +48,11 @@ private slots: ...@@ -48,11 +48,11 @@ private slots:
} }
} }
void on_actionAfficher_les_barres_de_volume_toggled(); void on_action_displayVolumeControls_toggled();
void on_actionAfficher_le_clavier_toggled(); void on_action_displayDialpad_toggled();
void on_actionConfigurer_les_comptes_triggered(); void on_action_configureAccounts_triggered();
void on_actionConfigurer_le_son_triggered(); void on_action_configureAudio_triggered();
void on_actionConfigurer_SFLPhone_triggered(); void on_action_configureSflPhone_triggered();
void on_action_accept_triggered(); void on_action_accept_triggered();
void on_action_refuse_triggered(); void on_action_refuse_triggered();
void on_action_hold_triggered(); void on_action_hold_triggered();
...@@ -75,7 +75,7 @@ private slots: ...@@ -75,7 +75,7 @@ private slots:
void on_pushButton_diese_clicked(); void on_pushButton_diese_clicked();
void on_pushButton_etoile_clicked(); void on_pushButton_etoile_clicked();
void on_label_searchHistory_textChanged(const QString & text); void on_label_searchHistory_textChanged();
void on_slider_recVol_valueChanged(int value); void on_slider_recVol_valueChanged(int value);
void on_slider_sndVol_valueChanged(int value); void on_slider_sndVol_valueChanged(int value);
......
#include <QApplication> #include <QApplication>
#include "kapplication.h"
#include "kcmdlineargs.h"
#include "kaboutdata.h"
#include <QtGui> #include <QtGui>
#include "ConfigDialog.h" #include "ConfigDialog.h"
#include "SFLPhone.h" #include "SFLPhone.h"
int main(int argc, char *argv[]) static const char description[] = I18N_NOOP("A KDE 4 Client for SflPhone");
static const char version[] = "0.1";
int main(int argc, char **argv)
{ {
try try
{ {
QApplication app(argc, argv); 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" );
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
//options.add("+[URL]", ki18n( "Document to open" ));
KApplication app;
QString locale = QLocale::system().name(); QString locale = QLocale::system().name();
......
<RCC> <RCC>
<qresource prefix="images" > <qresource prefix="images" >
<file>icons/add.png</file>
<file>icons/remove.png</file>
<file>icons/del_off.png</file> <file>icons/del_off.png</file>
<file>icons/del_on.png</file> <file>icons/del_on.png</file>
<file>icons/accept.svg</file> <file>icons/accept.svg</file>
......
...@@ -368,12 +368,12 @@ ...@@ -368,12 +368,12 @@
<property name="title" > <property name="title" >
<string>&amp;Configuration</string> <string>&amp;Configuration</string>
</property> </property>
<addaction name="actionAfficher_les_barres_de_volume" /> <addaction name="action_displayVolumeControls" />
<addaction name="actionAfficher_le_clavier" /> <addaction name="action_displayDialpad" />
<addaction name="separator" /> <addaction name="separator" />
<addaction name="actionConfigurer_les_comptes" /> <addaction name="action_configureAccounts" />
<addaction name="actionConfigurer_le_son" /> <addaction name="action_configureAudio" />
<addaction name="actionConfigurer_SFLPhone" /> <addaction name="action_configureSflPhone" />
</widget> </widget>
<widget class="QMenu" name="menuAide" > <widget class="QMenu" name="menuAide" >
<property name="title" > <property name="title" >
...@@ -465,7 +465,7 @@ ...@@ -465,7 +465,7 @@
<string>&amp;Boîte Vocale</string> <string>&amp;Boîte Vocale</string>
</property> </property>
</action> </action>
<action name="actionConfigurer_les_comptes" > <action name="action_configureAccounts" >
<property name="icon" > <property name="icon" >
<iconset> <iconset>
<normaloff>:/Images/stock_person.svg</normaloff>:/Images/stock_person.svg</iconset> <normaloff>:/Images/stock_person.svg</normaloff>:/Images/stock_person.svg</iconset>
...@@ -474,7 +474,7 @@ ...@@ -474,7 +474,7 @@
<string>Configurer les &amp;comptes</string> <string>Configurer les &amp;comptes</string>
</property> </property>
</action> </action>
<action name="actionConfigurer_le_son" > <action name="action_configureAudio" >
<property name="icon" > <property name="icon" >
<iconset> <iconset>
<normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset> <normaloff>:/Images/icon_volume.svg</normaloff>:/Images/icon_volume.svg</iconset>
...@@ -483,7 +483,7 @@ ...@@ -483,7 +483,7 @@
<string>Configurer le &amp;son</string> <string>Configurer le &amp;son</string>
</property> </property>
</action> </action>
<action name="actionConfigurer_SFLPhone" > <action name="action_configureSflPhone" >
<property name="icon" > <property name="icon" >
<iconset> <iconset>
<normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset> <normaloff>:/Images/sflphone.png</normaloff>:/Images/sflphone.png</iconset>
...@@ -492,7 +492,7 @@ ...@@ -492,7 +492,7 @@
<string>&amp;Configurer SFLPhone</string> <string>&amp;Configurer SFLPhone</string>
</property> </property>
</action> </action>
<action name="actionAfficher_les_barres_de_volume" > <action name="action_displayVolumeControls" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
...@@ -512,7 +512,7 @@ ...@@ -512,7 +512,7 @@
<string>&amp;About</string> <string>&amp;About</string>
</property> </property>
</action> </action>
<action name="actionAfficher_le_clavier" > <action name="action_displayDialpad" >
<property name="checkable" > <property name="checkable" >
<bool>true</bool> <bool>true</bool>
</property> </property>
......
File deleted
<?xml version = '1.0' encoding = 'UTF-8'?>
<!DOCTYPE KDevPrjSession>
<KDevPrjSession>
<DocsAndViews NumberOfDocuments="9" >
<Doc0 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/ConfigDialog.cpp" >
<View0 Encoding="" Type="Source" />
</Doc0>
<Doc1 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/SFLPhone.cpp" >
<View0 Encoding="" line="229" Type="Source" />
</Doc1>
<Doc2 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/Call.cpp" >
<View0 Encoding="" Type="Source" />
</Doc2>
<Doc3 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/Call.h" >
<View0 Encoding="" Type="Source" />
</Doc3>
<Doc4 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/sflphone_const.h" >
<View0 Encoding="" Type="Source" />
</Doc4>
<Doc5 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/SFLPhone.h" >
<View0 Encoding="" Type="Source" />
</Doc5>
<Doc6 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/configurationmanager_interface_singleton.cpp" >
<View0 Encoding="" Type="Source" />
</Doc6>
<Doc7 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/Account.cpp" >
<View0 Encoding="" line="90" Type="Source" />
</Doc7>
<Doc8 NumberOfViews="1" URL="file:///home/jquentin/sflphone/sflphone_kde/sflphone_kdeui.rc" >
<View0 Encoding="" line="8" Type="Source" />
</Doc8>
</DocsAndViews>
<pluginList>
<kdevdebugger>
<breakpointList/>
<showInternalCommands value="0" />
</kdevdebugger>
<kdevastyle>
<Extensions ext="*.cpp *.h *.hpp,*.c *.h,*.cxx *.hxx,*.c++ *.h++,*.cc *.hh,*.C *.H,*.diff ,*.inl,*.java,*.moc,*.patch,*.tlh,*.xpm" />
<AStyle IndentPreprocessors="0" FillCount="4" PadParenthesesOut="1" IndentNamespaces="1" IndentLabels="1" Fill="Tabs" MaxStatement="40" Brackets="Break" MinConditional="-1" IndentBrackets="0" PadParenthesesUn="1" BlockBreak="0" KeepStatements="1" KeepBlocks="1" BlockIfElse="0" IndentSwitches="1" PadOperators="0" FStyle="UserDefined" IndentCases="0" FillEmptyLines="0" BracketsCloseHeaders="0" BlockBreakAll="0" PadParenthesesIn="1" IndentClasses="1" IndentBlocks="0" FillForce="0" />
</kdevastyle>
<kdevbookmarks>
<bookmarks>
<bookmark url="/home/jquentin/sflphone_kde/build/ui_sflphone-qt.h" >
<mark line="36" />
</bookmark>
</bookmarks>
</kdevbookmarks>
<kdevvalgrind>
<executable path="" params="" />
<valgrind path="" params="" />
<calltree path="" params="" />
<kcachegrind path="" />
</kdevvalgrind>
</pluginList>
</KDevPrjSession>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment