2010-01-04 15:49:22 -05:00
|
|
|
#include <QtGui>
|
|
|
|
#include "prefdialog.h"
|
|
|
|
#include "ui_prefdialog.h"
|
2010-01-05 21:08:25 -05:00
|
|
|
#include "prefportaudio.h"
|
2010-01-07 01:43:51 -05:00
|
|
|
#include "prefsofia.h"
|
2010-01-07 18:00:34 -05:00
|
|
|
#include "accountdialog.h"
|
2010-01-04 15:49:22 -05:00
|
|
|
|
|
|
|
PrefDialog::PrefDialog(QWidget *parent) :
|
|
|
|
QDialog(parent),
|
|
|
|
ui(new Ui::PrefDialog)
|
|
|
|
{
|
|
|
|
ui->setupUi(this);
|
2010-01-05 17:16:46 -05:00
|
|
|
_settings = new QSettings();
|
2010-01-05 21:08:25 -05:00
|
|
|
connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
|
2010-01-07 18:00:34 -05:00
|
|
|
connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
|
2010-01-05 21:08:25 -05:00
|
|
|
|
2010-01-07 18:00:34 -05:00
|
|
|
_accDlg = NULL;
|
2010-01-05 21:08:25 -05:00
|
|
|
_mod_portaudio = new PrefPortaudio(ui, this);
|
2010-01-07 01:43:51 -05:00
|
|
|
_mod_sofia = new PrefSofia(ui, this);
|
2010-01-05 21:08:25 -05:00
|
|
|
readConfig();
|
2010-01-04 15:49:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
PrefDialog::~PrefDialog()
|
|
|
|
{
|
|
|
|
delete ui;
|
|
|
|
}
|
|
|
|
|
2010-01-07 18:00:34 -05:00
|
|
|
void PrefDialog::addAccountBtnClicked()
|
|
|
|
{
|
|
|
|
if (!_accDlg)
|
|
|
|
_accDlg = new AccountDialog();
|
|
|
|
|
|
|
|
_accDlg->show();
|
|
|
|
_accDlg->raise();
|
|
|
|
_accDlg->activateWindow();
|
|
|
|
}
|
|
|
|
|
2010-01-05 21:08:25 -05:00
|
|
|
void PrefDialog::writeConfig()
|
|
|
|
{
|
|
|
|
_mod_portaudio->writeConfig();
|
2010-01-07 01:43:51 -05:00
|
|
|
/*_mod_sofia->writeConfig();*/
|
2010-01-04 15:49:22 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
void PrefDialog::changeEvent(QEvent *e)
|
|
|
|
{
|
|
|
|
QDialog::changeEvent(e);
|
|
|
|
switch (e->type()) {
|
|
|
|
case QEvent::LanguageChange:
|
|
|
|
ui->retranslateUi(this);
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2010-01-05 21:08:25 -05:00
|
|
|
|
|
|
|
void PrefDialog::readConfig()
|
|
|
|
{
|
|
|
|
_mod_portaudio->readConfig();
|
2010-01-07 01:43:51 -05:00
|
|
|
/*_mod_sofia->readConfig();*/
|
2010-01-05 21:08:25 -05:00
|
|
|
}
|