Fix latest error

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16206 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
João Mesquita 2010-01-08 00:41:10 +00:00
parent c52c8ba226
commit c2acaa0e6f
3 changed files with 27 additions and 2 deletions

View File

@ -40,8 +40,7 @@ HEADERS += mainwindow.h \
preferences/accountdialog.h preferences/accountdialog.h
FORMS += mainwindow.ui \ FORMS += mainwindow.ui \
preferences/prefdialog.ui \ preferences/prefdialog.ui \
preferences/accountdialog.ui \ preferences/accountdialog.ui
../aboutdialog.ui
RESOURCES += resources.qrc RESOURCES += resources.qrc
OTHER_FILES += conf/portaudio.conf.xml \ OTHER_FILES += conf/portaudio.conf.xml \
conf/event_socket.conf.xml \ conf/event_socket.conf.xml \

View File

@ -1,3 +1,4 @@
#include <QSettings>
#include "accountdialog.h" #include "accountdialog.h"
#include "ui_accountdialog.h" #include "ui_accountdialog.h"
@ -6,6 +7,8 @@ AccountDialog::AccountDialog(QWidget *parent) :
ui(new Ui::AccountDialog) ui(new Ui::AccountDialog)
{ {
ui->setupUi(this); ui->setupUi(this);
_settings = new QSettings;
connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
} }
AccountDialog::~AccountDialog() AccountDialog::~AccountDialog()
@ -15,7 +18,27 @@ AccountDialog::~AccountDialog()
void AccountDialog::writeConfig() 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) void AccountDialog::changeEvent(QEvent *e)

View File

@ -7,6 +7,8 @@ namespace Ui {
class AccountDialog; class AccountDialog;
} }
class QSettings;
class AccountDialog : public QDialog { class AccountDialog : public QDialog {
Q_OBJECT Q_OBJECT
public: public:
@ -21,6 +23,7 @@ protected:
private: private:
Ui::AccountDialog *ui; Ui::AccountDialog *ui;
QSettings *_settings;
}; };
#endif // ACCOUNTDIALOG_H #endif // ACCOUNTDIALOG_H