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-10 23:40:39 -05:00
|
|
|
#include "prefaccounts.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-13 21:32:20 -05:00
|
|
|
_pref_accounts = new PrefAccounts(ui);
|
2010-01-05 21:08:25 -05:00
|
|
|
_mod_portaudio = new PrefPortaudio(ui, this);
|
2010-01-13 21:32:20 -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-05 21:08:25 -05:00
|
|
|
void PrefDialog::writeConfig()
|
|
|
|
{
|
|
|
|
_mod_portaudio->writeConfig();
|
2010-01-13 21:32:20 -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()
|
|
|
|
{
|
2010-01-13 21:32:20 -05:00
|
|
|
_pref_accounts->readConfig();
|
2010-01-05 21:08:25 -05:00
|
|
|
_mod_portaudio->readConfig();
|
2010-01-13 21:32:20 -05:00
|
|
|
_mod_sofia->readConfig();
|
2010-01-05 21:08:25 -05:00
|
|
|
}
|