2010-01-07 19:41:10 -05:00
|
|
|
#include <QSettings>
|
2010-01-07 18:00:34 -05:00
|
|
|
#include "accountdialog.h"
|
|
|
|
#include "ui_accountdialog.h"
|
|
|
|
|
|
|
|
AccountDialog::AccountDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::AccountDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2010-01-07 19:41:10 -05:00
|
|
|
_settings = new QSettings;
|
|
|
|
connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
|
2010-01-07 18:00:34 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
AccountDialog::~AccountDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2010-01-07 19:12:54 -05:00
|
|
|
void AccountDialog::writeConfig()
|
|
|
|
{
|
2010-01-07 19:41:10 -05:00
|
|
|
_settings->beginGroup("FreeSWITCH/conf/accounts");
|
2010-01-07 19:12:54 -05:00
|
|
|
|
2010-01-07 19:41:10 -05:00
|
|
|
_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();
|
2010-01-07 19:12:54 -05:00
|
|
|
}
|
|
|
|
|
2010-01-07 18:00:34 -05:00
|
|
|
void AccountDialog::changeEvent(QEvent *e)
|
|
|
|
{
|
|
|
|
QDialog::changeEvent(e);
|
|
|
|
switch (e->type()) {
|
|
|
|
case QEvent::LanguageChange:
|
|
|
|
ui->retranslateUi(this);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|