From 4c6942b4378c918a4710f7e5976b5374751de124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Mesquita?= Date: Thu, 7 Jan 2010 23:00:34 +0000 Subject: [PATCH] Start doing the accounts configurations. It does not work yet, only dialogs are designed. git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16203 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- fscomm/FSComm.pro | 12 +- fscomm/conf/account.conf.xml | 17 ++ fscomm/preferences/accountdialog.cpp | 26 +++ fscomm/preferences/accountdialog.h | 23 +++ fscomm/preferences/accountdialog.ui | 272 +++++++++++++++++++++++++++ fscomm/preferences/prefdialog.cpp | 13 ++ fscomm/preferences/prefdialog.h | 3 + fscomm/preferences/prefdialog.ui | 81 +++++++- fscomm/resources.qrc | 2 + fscomm/resources/pref_accounts.jpg | Bin 0 -> 6582 bytes 10 files changed, 441 insertions(+), 8 deletions(-) create mode 100644 fscomm/conf/account.conf.xml create mode 100644 fscomm/preferences/accountdialog.cpp create mode 100644 fscomm/preferences/accountdialog.h create mode 100644 fscomm/preferences/accountdialog.ui create mode 100644 fscomm/resources/pref_accounts.jpg diff --git a/fscomm/FSComm.pro b/fscomm/FSComm.pro index 0934c124db..47a3629ecd 100644 --- a/fscomm/FSComm.pro +++ b/fscomm/FSComm.pro @@ -28,18 +28,22 @@ SOURCES += main.cpp \ mod_qsettings/mod_qsettings.cpp \ preferences/prefdialog.cpp \ preferences/prefportaudio.cpp \ - preferences/prefsofia.cpp + preferences/prefsofia.cpp \ + preferences/accountdialog.cpp HEADERS += mainwindow.h \ fshost.h \ call.h \ mod_qsettings/mod_qsettings.h \ preferences/prefdialog.h \ preferences/prefportaudio.h \ - preferences/prefsofia.h + preferences/prefsofia.h \ + preferences/accountdialog.h FORMS += mainwindow.ui \ - preferences/prefdialog.ui + preferences/prefdialog.ui \ + preferences/accountdialog.ui RESOURCES += resources.qrc OTHER_FILES += conf/portaudio.conf.xml \ conf/event_socket.conf.xml \ conf/freeswitch.xml \ - conf/sofia.conf.xml + conf/sofia.conf.xml \ + conf/account.conf.xml diff --git a/fscomm/conf/account.conf.xml b/fscomm/conf/account.conf.xml new file mode 100644 index 0000000000..4d65e8e318 --- /dev/null +++ b/fscomm/conf/account.conf.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/fscomm/preferences/accountdialog.cpp b/fscomm/preferences/accountdialog.cpp new file mode 100644 index 0000000000..f690a7d367 --- /dev/null +++ b/fscomm/preferences/accountdialog.cpp @@ -0,0 +1,26 @@ +#include "accountdialog.h" +#include "ui_accountdialog.h" + +AccountDialog::AccountDialog(QWidget *parent) : + QDialog(parent), + ui(new Ui::AccountDialog) +{ + ui->setupUi(this); +} + +AccountDialog::~AccountDialog() +{ + delete ui; +} + +void AccountDialog::changeEvent(QEvent *e) +{ + QDialog::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} diff --git a/fscomm/preferences/accountdialog.h b/fscomm/preferences/accountdialog.h new file mode 100644 index 0000000000..7cb5673a3f --- /dev/null +++ b/fscomm/preferences/accountdialog.h @@ -0,0 +1,23 @@ +#ifndef ACCOUNTDIALOG_H +#define ACCOUNTDIALOG_H + +#include + +namespace Ui { + class AccountDialog; +} + +class AccountDialog : public QDialog { + Q_OBJECT +public: + AccountDialog(QWidget *parent = 0); + ~AccountDialog(); + +protected: + void changeEvent(QEvent *e); + +private: + Ui::AccountDialog *ui; +}; + +#endif // ACCOUNTDIALOG_H diff --git a/fscomm/preferences/accountdialog.ui b/fscomm/preferences/accountdialog.ui new file mode 100644 index 0000000000..acddb9eb05 --- /dev/null +++ b/fscomm/preferences/accountdialog.ui @@ -0,0 +1,272 @@ + + + AccountDialog + + + Qt::WindowModal + + + + 0 + 0 + 495 + 573 + + + + Account + + + + + + name + + + + + + + + + + username + + + + + + + + + + realm + + + + + + + + + + from-user + + + + + + + + + + from-domain + + + + + + + + + + password + + + + + + + + + + extension + + + + + + + + + + proxy + + + + + + + + + + register-proxy + + + + + + + + + + expire-seconds + + + + + + + 60 + + + + + + + register + + + + + + + + true + + + + + false + + + + + + + + register-transport + + + + + + + + udp + + + + + tcp + + + + + + + + retry-seconds + + + + + + + 30 + + + + + + + contact-params + + + + + + + + + + caller-id-in-from + + + + + + + ping + + + + + + + 25 + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + false + + + + + true + + + + + + + + + + buttonBox + accepted() + AccountDialog + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AccountDialog + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/fscomm/preferences/prefdialog.cpp b/fscomm/preferences/prefdialog.cpp index 8a53fc2120..05242f3f1f 100644 --- a/fscomm/preferences/prefdialog.cpp +++ b/fscomm/preferences/prefdialog.cpp @@ -3,6 +3,7 @@ #include "ui_prefdialog.h" #include "prefportaudio.h" #include "prefsofia.h" +#include "accountdialog.h" PrefDialog::PrefDialog(QWidget *parent) : QDialog(parent), @@ -11,7 +12,9 @@ PrefDialog::PrefDialog(QWidget *parent) : ui->setupUi(this); _settings = new QSettings(); connect(this, SIGNAL(accepted()), this, SLOT(writeConfig())); + connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked())); + _accDlg = NULL; _mod_portaudio = new PrefPortaudio(ui, this); _mod_sofia = new PrefSofia(ui, this); readConfig(); @@ -22,6 +25,16 @@ PrefDialog::~PrefDialog() delete ui; } +void PrefDialog::addAccountBtnClicked() +{ + if (!_accDlg) + _accDlg = new AccountDialog(); + + _accDlg->show(); + _accDlg->raise(); + _accDlg->activateWindow(); +} + void PrefDialog::writeConfig() { _mod_portaudio->writeConfig(); diff --git a/fscomm/preferences/prefdialog.h b/fscomm/preferences/prefdialog.h index 5ad01c852e..1c1ee66b04 100644 --- a/fscomm/preferences/prefdialog.h +++ b/fscomm/preferences/prefdialog.h @@ -8,6 +8,7 @@ class PrefPortaudio; class PrefSofia; +class AccountDialog; namespace Ui { class PrefDialog; @@ -23,11 +24,13 @@ protected: void changeEvent(QEvent *e); private slots: + void addAccountBtnClicked(); void writeConfig(); private: void readConfig(); QSettings *_settings; + AccountDialog *_accDlg; Ui::PrefDialog *ui; PrefPortaudio *_mod_portaudio; PrefSofia *_mod_sofia; diff --git a/fscomm/preferences/prefdialog.ui b/fscomm/preferences/prefdialog.ui index 276c89ed4c..2d8c7c7a26 100644 --- a/fscomm/preferences/prefdialog.ui +++ b/fscomm/preferences/prefdialog.ui @@ -64,6 +64,15 @@ :/images/pref_general.jpg:/images/pref_general.jpg + + + Accounts + + + + :/images/pref_accounts.jpg:/images/pref_accounts.jpg + + Sofia @@ -87,9 +96,9 @@ - 0 + 1 - + @@ -122,7 +131,71 @@ - + + + + + + QAbstractItemView::NoEditTriggers + + + + Enabled + + + + + Name + + + + + Username + + + + + + + + + + Add + + + + + + + Remove + + + + + + + Edit + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + @@ -716,7 +789,7 @@ - + diff --git a/fscomm/resources.qrc b/fscomm/resources.qrc index aedbf6a89f..bd71ace462 100644 --- a/fscomm/resources.qrc +++ b/fscomm/resources.qrc @@ -4,6 +4,7 @@ resources/pref_sip.png resources/pref_audio.gif resources/pref_general.jpg + resources/pref_accounts.jpg conf/freeswitch.xml @@ -11,6 +12,7 @@ conf/event_socket.conf.xml conf/portaudio.conf.xml conf/sofia.conf.xml + conf/account.conf.xml resources/test.wav diff --git a/fscomm/resources/pref_accounts.jpg b/fscomm/resources/pref_accounts.jpg new file mode 100644 index 0000000000000000000000000000000000000000..95292c82b6ed41fe1fdd98ab88aec378ce7db7b0 GIT binary patch literal 6582 zcmb7IbyQT{*S;__%z(rU4bml&Qi6nZmw#`!An}d9 zzxww(XWhN-S!dt9?mf?acHPb1Edg)^8F?814Gj&DLrvgr9*_jkQA;$mKN9`V0E7NW z2p9|kV?Z!4{$5Z_7zPv*ih%*U2gAhrGf;Qf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