diff --git a/fscomm/FSComm.pro b/fscomm/FSComm.pro index 2c3e716532..47a3629ecd 100644 --- a/fscomm/FSComm.pro +++ b/fscomm/FSComm.pro @@ -40,8 +40,7 @@ HEADERS += mainwindow.h \ preferences/accountdialog.h FORMS += mainwindow.ui \ preferences/prefdialog.ui \ - preferences/accountdialog.ui \ - ../aboutdialog.ui + preferences/accountdialog.ui RESOURCES += resources.qrc OTHER_FILES += conf/portaudio.conf.xml \ conf/event_socket.conf.xml \ diff --git a/fscomm/preferences/accountdialog.cpp b/fscomm/preferences/accountdialog.cpp index 76063bde3f..75e6d1df35 100644 --- a/fscomm/preferences/accountdialog.cpp +++ b/fscomm/preferences/accountdialog.cpp @@ -1,3 +1,4 @@ +#include #include "accountdialog.h" #include "ui_accountdialog.h" @@ -6,6 +7,8 @@ AccountDialog::AccountDialog(QWidget *parent) : ui(new Ui::AccountDialog) { ui->setupUi(this); + _settings = new QSettings; + connect(this, SIGNAL(accepted()), this, SLOT(writeConfig())); } AccountDialog::~AccountDialog() @@ -15,7 +18,27 @@ AccountDialog::~AccountDialog() void AccountDialog::writeConfig() { + _settings->beginGroup("FreeSWITCH/conf/accounts"); + _settings->beginGroup(ui->sofiaGwNameEdit->text()); + _settings->setValue("username", ui->sofiaGwUsernameEdit->text()); + _settings->setValue("realm", ui->sofiaGwRealmEdit->text()); + _settings->setValue("from-user", ui->sofiaGwFromUserEdit->text()); + _settings->setValue("from-domain", ui->sofiaGwFromDomainEdit->text()); + _settings->setValue("password", ui->sofiaGwPasswordEdit->text()); + _settings->setValue("extension", ui->sofiaGwExtensionEdit->text()); + _settings->setValue("proxy", ui->sofiaGwProxyEdit->text()); + _settings->setValue("register-proxy", ui->sofiaGwRegisterProxyEdit->text()); + _settings->setValue("expire-seconds", ui->sofiaGwExpireSecondsSpin->value()); + _settings->setValue("register", ui->sofiaGwRegisterCombo->currentText()); + _settings->setValue("register-transport", ui->sofiaGwRegisterTransportCombo->currentText()); + _settings->setValue("retry-seconds", ui->sofiaGwRetrySecondsSpin->value()); + _settings->setValue("caller-id-in-from", ui->sofiaGwCallerIdInFromCombo->currentText()); + _settings->setValue("contact-params", ui->sofiaGwContactParamsEdit->text()); + _settings->setValue("ping", ui->sofiaGwPingSpin->value()); + _settings->endGroup(); + + _settings->endGroup(); } void AccountDialog::changeEvent(QEvent *e) diff --git a/fscomm/preferences/accountdialog.h b/fscomm/preferences/accountdialog.h index c8afc1d279..b7e408d7e1 100644 --- a/fscomm/preferences/accountdialog.h +++ b/fscomm/preferences/accountdialog.h @@ -7,6 +7,8 @@ namespace Ui { class AccountDialog; } +class QSettings; + class AccountDialog : public QDialog { Q_OBJECT public: @@ -21,6 +23,7 @@ protected: private: Ui::AccountDialog *ui; + QSettings *_settings; }; #endif // ACCOUNTDIALOG_H