diff --git a/fscomm/conf/portaudio.conf.xml b/fscomm/conf/portaudio.conf.xml index 39caf9243b..41b9f44a0d 100644 --- a/fscomm/conf/portaudio.conf.xml +++ b/fscomm/conf/portaudio.conf.xml @@ -8,11 +8,11 @@ - + - - + + diff --git a/fscomm/mod_qsettings/mod_qsettings.cpp b/fscomm/mod_qsettings/mod_qsettings.cpp index 5ab2074710..cef4720b45 100644 --- a/fscomm/mod_qsettings/mod_qsettings.cpp +++ b/fscomm/mod_qsettings/mod_qsettings.cpp @@ -66,12 +66,15 @@ switch_xml_t XMLBinding::getConfigXML(QString tmpl) /* Open template file and expand all strings based on QSettings */ QByteArray tmplContents(tmplFile.readAll()); tmplFile.close(); - _settings->beginGroup("FreeSIWTCH/conf"); + + _settings->beginGroup("FreeSWITCH/conf"); _settings->beginGroup(tmpl); foreach(QString k, _settings->childKeys()) { switch_event_add_header_string(e, SWITCH_STACK_BOTTOM, k.toAscii().constData(), _settings->value(k).toByteArray().constData()); } + _settings->endGroup(); + _settings->endGroup(); char *res = switch_event_expand_headers(e, tmplContents.data()); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Template %s as follows:\n%s", tmpl.toAscii().constData(), res); diff --git a/fscomm/prefdialog.cpp b/fscomm/prefdialog.cpp index 8f842a5c41..3dc2ca9acd 100644 --- a/fscomm/prefdialog.cpp +++ b/fscomm/prefdialog.cpp @@ -7,6 +7,8 @@ PrefDialog::PrefDialog(QWidget *parent) : ui(new Ui::PrefDialog) { ui->setupUi(this); + _settings = new QSettings(); + connect(this, SIGNAL(accepted()), this, SLOT(configAccepted())); getPaDevlist(); } @@ -15,6 +17,25 @@ PrefDialog::~PrefDialog() delete ui; } +void PrefDialog::configAccepted() +{ + _settings->beginGroup("FreeSWITCH/conf"); + + _settings->beginGroup("portaudio.conf"); + _settings->setValue("cid-name", ui->PaCallerIdNameEdit->text()); + _settings->setValue("cid-num", ui->PaCallerIdNumEdit->text()); + _settings->setValue("indev", ui->PaIndevCombo->currentIndex()); + _settings->setValue("outdev", ui->PaOutdevCombo->currentIndex()); + _settings->setValue("ringdev", ui->PaRingdevCombo->currentIndex()); + _settings->setValue("ring-file", ui->PaRingFileEdit->text()); + _settings->setValue("ring-interval", ui->PaRingIntervalSpin->value()); + _settings->setValue("hold-file", ui->PaHoldFileEdit->text()); + _settings->endGroup(); + + _settings->endGroup(); + +} + void PrefDialog::getPaDevlist() { QString result; diff --git a/fscomm/prefdialog.h b/fscomm/prefdialog.h index 4a73498f11..913ced9d52 100644 --- a/fscomm/prefdialog.h +++ b/fscomm/prefdialog.h @@ -3,6 +3,7 @@ #include #include +#include #include namespace Ui { @@ -18,10 +19,14 @@ public: protected: void changeEvent(QEvent *e); +private slots: + void configAccepted(); + private: void getPaDevlist(void); Ui::PrefDialog *ui; QDomDocument _xmlPaDevList; + QSettings *_settings; }; #endif // PREFDIALOG_H diff --git a/fscomm/prefdialog.ui b/fscomm/prefdialog.ui index 68c1683647..9ffe34bded 100644 --- a/fscomm/prefdialog.ui +++ b/fscomm/prefdialog.ui @@ -6,317 +6,301 @@ 0 0 - 477 - 356 + 661 + 437 Preferences - - - + + + + + + 120 + 0 + + + + + 120 + 16777215 + + + + false + + + QAbstractItemView::NoDragDrop + + + + 96 + 84 + + + + QListView::Static + + + QListView::LeftToRight + + + true + + + 12 + + + QListView::IconMode + - - - - 120 - 0 - - - - - 120 - 16777215 - - - - false - - - QAbstractItemView::NoDragDrop - - - - 96 - 84 - - - - QListView::Static - - - QListView::LeftToRight - - - true - - - 12 - - - QListView::IconMode - - - - Sofia - - - - :/images/pref_sip.png:/images/pref_sip.png - - - - - PortAudio - - - - :/images/pref_audio.gif:/images/pref_audio.gif - - - + + Sofia + + + + :/images/pref_sip.png:/images/pref_sip.png + - - - 1 - - - - - - - Global Settings - - - - - - log-level - - - - - - - - - - auto-restart - - - - - - - - - - debug-presence - - - - - - - - - - - - - Softphone Profile - - - - - - user-agent-string - - - - - - - - - - debug - - - - - - - - - - sip-trace - - - - - - - - - - - - - - - - - Devices - - - - - 72 - 34 - 34 - 17 - + + PortAudio + + + + :/images/pref_audio.gif:/images/pref_audio.gif + + + + + General + + + + :/images/pref_general.jpg:/images/pref_general.jpg + + + + + + + + 1 + + + + + + + Global Settings + + + + + + log-level + + + + + + + + + auto-restart + + + + + + + + + + debug-presence + + + + + + + + + + + + + Softphone Profile + + + + + + user-agent-string + + + + + + + + + + debug + + + + + + + + + + sip-trace + + + + + + + + + + + + + + + + + Devices + + + + indev - - - - 111 - 32 - 111 - 26 - - - + + + + + - - - 63 - 64 - 43 - 17 - - outdev - - - - 111 - 62 - 111 - 26 - - - + + + + + - - - 59 - 94 - 47 - 17 - - rindgev - - - - 111 - 92 - 111 - 26 - + + + + + + + + + + + Files + + + + + + ring-file - - - - - - Files - - - - - - ring-file - - - - - - - tone_stream://%(2000,4000,440.0,480.0);loops=20 - - - - - - - ring-interval - - - - - - - - - - hold-file - - - - - - - - - - - - - - + + + + + tone_stream://%(2000,4000,440.0,480.0);loops=20 + + + + + + + ring-interval + + + + + + + + + + hold-file + + + + + + + + + + + + + + + + + User Information + + + + + + CallerID Name: + + + + + + + + + + CallerID Number: + + + + + + + + + + + + - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + diff --git a/fscomm/resources.qrc b/fscomm/resources.qrc index 992ac3b6ff..8c6ac288ed 100644 --- a/fscomm/resources.qrc +++ b/fscomm/resources.qrc @@ -3,6 +3,7 @@ resources/splash.png resources/pref_sip.png resources/pref_audio.gif + resources/pref_general.jpg conf/freeswitch.xml diff --git a/fscomm/resources/pref_general.jpg b/fscomm/resources/pref_general.jpg new file mode 100644 index 0000000000..105ce3f8bb Binary files /dev/null and b/fscomm/resources/pref_general.jpg differ