Start doing the accounts configurations. It does not work yet, only dialogs are designed.
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16203 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
97e71e9d08
commit
4c6942b437
|
@ -28,18 +28,22 @@ SOURCES += main.cpp \
|
|||
mod_qsettings/mod_qsettings.cpp \
|
||||
preferences/prefdialog.cpp \
|
||||
preferences/prefportaudio.cpp \
|
||||
preferences/prefsofia.cpp
|
||||
preferences/prefsofia.cpp \
|
||||
preferences/accountdialog.cpp
|
||||
HEADERS += mainwindow.h \
|
||||
fshost.h \
|
||||
call.h \
|
||||
mod_qsettings/mod_qsettings.h \
|
||||
preferences/prefdialog.h \
|
||||
preferences/prefportaudio.h \
|
||||
preferences/prefsofia.h
|
||||
preferences/prefsofia.h \
|
||||
preferences/accountdialog.h
|
||||
FORMS += mainwindow.ui \
|
||||
preferences/prefdialog.ui
|
||||
preferences/prefdialog.ui \
|
||||
preferences/accountdialog.ui
|
||||
RESOURCES += resources.qrc
|
||||
OTHER_FILES += conf/portaudio.conf.xml \
|
||||
conf/event_socket.conf.xml \
|
||||
conf/freeswitch.xml \
|
||||
conf/sofia.conf.xml
|
||||
conf/sofia.conf.xml \
|
||||
conf/account.conf.xml
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
<gateway name="${name}">
|
||||
<param name="username" value="${username}"/>
|
||||
<param name="realm" value="${realm}"/>
|
||||
<param name="from-user" value="${from-user}"/>
|
||||
<param name="from-domain" value="${from-domain}"/>
|
||||
<param name="password" value="${password}"/>
|
||||
<param name="extension" value="${extension}"/>
|
||||
<param name="proxy" value="${proxy}"/>
|
||||
<param name="register-proxy" value="${register-proxy}"/>
|
||||
<param name="expire-seconds" value="${expire-seconds}"/>
|
||||
<param name="register" value="${register}"/>
|
||||
<param name="register-transport" value="${register-transport}"/>
|
||||
<param name="retry-seconds" value="${retry-seconds}"/>
|
||||
<param name="caller-id-in-from" value="${caller-id-in-from}"/>
|
||||
<param name="contact-params" value="${contact-params}"/>
|
||||
<param name="ping" value="${ping}"/>
|
||||
</gateway>
|
|
@ -0,0 +1,26 @@
|
|||
#include "accountdialog.h"
|
||||
#include "ui_accountdialog.h"
|
||||
|
||||
AccountDialog::AccountDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::AccountDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
AccountDialog::~AccountDialog()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void AccountDialog::changeEvent(QEvent *e)
|
||||
{
|
||||
QDialog::changeEvent(e);
|
||||
switch (e->type()) {
|
||||
case QEvent::LanguageChange:
|
||||
ui->retranslateUi(this);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
#ifndef ACCOUNTDIALOG_H
|
||||
#define ACCOUNTDIALOG_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
namespace Ui {
|
||||
class AccountDialog;
|
||||
}
|
||||
|
||||
class AccountDialog : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
AccountDialog(QWidget *parent = 0);
|
||||
~AccountDialog();
|
||||
|
||||
protected:
|
||||
void changeEvent(QEvent *e);
|
||||
|
||||
private:
|
||||
Ui::AccountDialog *ui;
|
||||
};
|
||||
|
||||
#endif // ACCOUNTDIALOG_H
|
|
@ -0,0 +1,272 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>AccountDialog</class>
|
||||
<widget class="QDialog" name="AccountDialog">
|
||||
<property name="windowModality">
|
||||
<enum>Qt::WindowModal</enum>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>495</width>
|
||||
<height>573</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Account</string>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwNameEdit"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>username</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwUsernameEdit"/>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>realm</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwRealmEdit"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>from-user</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwFromUserEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="text">
|
||||
<string>from-domain</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwFromDomainEdit"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_6">
|
||||
<property name="text">
|
||||
<string>password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwPasswordEdit"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_7">
|
||||
<property name="text">
|
||||
<string>extension</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwExtensionEdit"/>
|
||||
</item>
|
||||
<item row="7" column="0">
|
||||
<widget class="QLabel" name="label_8">
|
||||
<property name="text">
|
||||
<string>proxy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="7" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwProxyEdit"/>
|
||||
</item>
|
||||
<item row="8" column="0">
|
||||
<widget class="QLabel" name="label_9">
|
||||
<property name="text">
|
||||
<string>register-proxy</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwRegisterProxyEdit"/>
|
||||
</item>
|
||||
<item row="9" column="0">
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="text">
|
||||
<string>expire-seconds</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="9" column="1">
|
||||
<widget class="QSpinBox" name="sofiaGwExpireSecondsSpin">
|
||||
<property name="value">
|
||||
<number>60</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="0">
|
||||
<widget class="QLabel" name="label_11">
|
||||
<property name="text">
|
||||
<string>register</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="10" column="1">
|
||||
<widget class="QComboBox" name="sofiaGwRegisterCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>true</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>false</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="0">
|
||||
<widget class="QLabel" name="label_12">
|
||||
<property name="text">
|
||||
<string>register-transport</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="11" column="1">
|
||||
<widget class="QComboBox" name="sofiaGwRegisterTransportCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>udp</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>tcp</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="0">
|
||||
<widget class="QLabel" name="label_13">
|
||||
<property name="text">
|
||||
<string>retry-seconds</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="12" column="1">
|
||||
<widget class="QSpinBox" name="sofiaGwRetrySecondsSpin">
|
||||
<property name="value">
|
||||
<number>30</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="0">
|
||||
<widget class="QLabel" name="label_15">
|
||||
<property name="text">
|
||||
<string>contact-params</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="13" column="1">
|
||||
<widget class="QLineEdit" name="sofiaGwContactParamsEdit"/>
|
||||
</item>
|
||||
<item row="14" column="0">
|
||||
<widget class="QLabel" name="label_14">
|
||||
<property name="text">
|
||||
<string>caller-id-in-from</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="0">
|
||||
<widget class="QLabel" name="label_16">
|
||||
<property name="text">
|
||||
<string>ping</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="15" column="1">
|
||||
<widget class="QSpinBox" name="sofiaGwPingSpin">
|
||||
<property name="value">
|
||||
<number>25</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="16" column="1">
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="14" column="1">
|
||||
<widget class="QComboBox" name="sofiaGwCallerIdInFromCombo">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>false</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>true</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>AccountDialog</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>AccountDialog</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
|
@ -3,6 +3,7 @@
|
|||
#include "ui_prefdialog.h"
|
||||
#include "prefportaudio.h"
|
||||
#include "prefsofia.h"
|
||||
#include "accountdialog.h"
|
||||
|
||||
PrefDialog::PrefDialog(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
|
@ -11,7 +12,9 @@ PrefDialog::PrefDialog(QWidget *parent) :
|
|||
ui->setupUi(this);
|
||||
_settings = new QSettings();
|
||||
connect(this, SIGNAL(accepted()), this, SLOT(writeConfig()));
|
||||
connect(ui->sofiaGwAddBtn, SIGNAL(clicked()), this, SLOT(addAccountBtnClicked()));
|
||||
|
||||
_accDlg = NULL;
|
||||
_mod_portaudio = new PrefPortaudio(ui, this);
|
||||
_mod_sofia = new PrefSofia(ui, this);
|
||||
readConfig();
|
||||
|
@ -22,6 +25,16 @@ PrefDialog::~PrefDialog()
|
|||
delete ui;
|
||||
}
|
||||
|
||||
void PrefDialog::addAccountBtnClicked()
|
||||
{
|
||||
if (!_accDlg)
|
||||
_accDlg = new AccountDialog();
|
||||
|
||||
_accDlg->show();
|
||||
_accDlg->raise();
|
||||
_accDlg->activateWindow();
|
||||
}
|
||||
|
||||
void PrefDialog::writeConfig()
|
||||
{
|
||||
_mod_portaudio->writeConfig();
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
class PrefPortaudio;
|
||||
class PrefSofia;
|
||||
class AccountDialog;
|
||||
|
||||
namespace Ui {
|
||||
class PrefDialog;
|
||||
|
@ -23,11 +24,13 @@ protected:
|
|||
void changeEvent(QEvent *e);
|
||||
|
||||
private slots:
|
||||
void addAccountBtnClicked();
|
||||
void writeConfig();
|
||||
|
||||
private:
|
||||
void readConfig();
|
||||
QSettings *_settings;
|
||||
AccountDialog *_accDlg;
|
||||
Ui::PrefDialog *ui;
|
||||
PrefPortaudio *_mod_portaudio;
|
||||
PrefSofia *_mod_sofia;
|
||||
|
|
|
@ -64,6 +64,15 @@
|
|||
<normaloff>:/images/pref_general.jpg</normaloff>:/images/pref_general.jpg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Accounts</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../resources.qrc">
|
||||
<normaloff>:/images/pref_accounts.jpg</normaloff>:/images/pref_accounts.jpg</iconset>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>Sofia</string>
|
||||
|
@ -87,9 +96,9 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QStackedWidget" name="stackedWidget">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="page_3">
|
||||
<widget class="QWidget" name="generalPage">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
|
@ -122,7 +131,71 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page">
|
||||
<widget class="QWidget" name="accountsPage">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QTableWidget" name="sofiaGwListWidget">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Enabled</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Name</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||
<item>
|
||||
<widget class="QPushButton" name="sofiaGwAddBtn">
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="sofiaGwRemBtn">
|
||||
<property name="text">
|
||||
<string>Remove</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="sofiaGwEditBtn">
|
||||
<property name="text">
|
||||
<string>Edit</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="sofiaPage">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
|
@ -716,7 +789,7 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="page_2">
|
||||
<widget class="QWidget" name="portaudioPage">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
<file alias="pref_sip.png">resources/pref_sip.png</file>
|
||||
<file alias="pref_audio.gif">resources/pref_audio.gif</file>
|
||||
<file alias="pref_general.jpg">resources/pref_general.jpg</file>
|
||||
<file alias="pref_accounts.jpg">resources/pref_accounts.jpg</file>
|
||||
</qresource>
|
||||
<qresource prefix="/confs">
|
||||
<file alias="freeswitch.xml">conf/freeswitch.xml</file>
|
||||
|
@ -11,6 +12,7 @@
|
|||
<file alias="event_socket.conf.xml">conf/event_socket.conf.xml</file>
|
||||
<file alias="portaudio.conf.xml">conf/portaudio.conf.xml</file>
|
||||
<file alias="sofia.conf.xml">conf/sofia.conf.xml</file>
|
||||
<file alias="account.conf.xml">conf/account.conf.xml</file>
|
||||
</qresource>
|
||||
<qresource prefix="/sounds">
|
||||
<file alias="test.wav">resources/test.wav</file>
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
Loading…
Reference in New Issue