Diff
Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro (16132 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro 2010-01-04 04:31:29 UTC (rev 16132)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/FSPhone.pro 2010-01-04 06:03:36 UTC (rev 16133)
@@ -24,10 +24,13 @@
mainwindow.cpp \
fshost.cpp \
call.cpp \
- mod_qsettings/mod_qsettings.cpp
+ mod_qsettings/mod_qsettings.cpp \
+ prefdialog.cpp
HEADERS += mainwindow.h \
fshost.h \
call.h \
- mod_qsettings/mod_qsettings.h
-FORMS += mainwindow.ui
+ mod_qsettings/mod_qsettings.h \
+ prefdialog.h
+FORMS += mainwindow.ui \
+ prefdialog.ui
RESOURCES += resources.qrc
Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp (16132 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp 2010-01-04 04:31:29 UTC (rev 16132)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.cpp 2010-01-04 06:03:36 UTC (rev 16133)
@@ -34,7 +34,8 @@
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
- ui(new Ui::MainWindow)
+ ui(new Ui::MainWindow),
+ preferences(NULL)
{
ui->setupUi(this);
@@ -77,6 +78,7 @@
connect(ui->answerBtn, SIGNAL(clicked()), this, SLOT(paAnswer()));
connect(ui->hangupBtn, SIGNAL(clicked()), this, SLOT(paHangup()));
connect(ui->listCalls, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(callListDoubleClick(QListWidgetItem*)));
+ connect(ui->action_Preferences, SIGNAL(triggered()), this, SLOT(prefTriggered()));
}
MainWindow::~MainWindow()
@@ -87,6 +89,16 @@
g_FSHost.wait();
}
+void MainWindow::prefTriggered()
+{
+ if (!preferences)
+ preferences = new PrefDialog();
+
+ preferences->raise();
+ preferences->show();
+ preferences->activateWindow();
+}
+
void MainWindow::coreLoadingError(QString err)
{
QMessageBox::warning(this, "Error Loading Core...", err, QMessageBox::Ok);
Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h (16132 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h 2010-01-04 04:31:29 UTC (rev 16132)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.h 2010-01-04 06:03:36 UTC (rev 16133)
@@ -37,6 +37,7 @@
#include <switch.h>
#include <fshost.h>
#include <call.h>
+#include <prefdialog.h>
namespace Ui {
class MainWindow;
@@ -55,6 +56,7 @@
void dtmfDialed(QString);
private slots:
+ void prefTriggered();
void coreLoadingError(QString);
void gwStateChanged(QString, int);
void dialDTMF(QString);
@@ -72,6 +74,7 @@
private:
Ui::MainWindow *ui;
QSignalMapper *dialpadMapper;
+ PrefDialog *preferences;
};
#endif // MAINWINDOW_H
Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui (16132 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui 2010-01-04 04:31:29 UTC (rev 16132)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/mainwindow.ui 2010-01-04 06:03:36 UTC (rev 16133)
@@ -271,9 +271,18 @@
<x>0</x>
<y>0</y>
<width>579</width>
- <height>22</height>
+ <height>24</height>
</rect>
</property>
+ <widget class="QMenu" name="menu_File">
+ <property name="title">
+ <string>&File</string>
+ </property>
+ <addaction name="action_Preferences"/>
+ <addaction name="separator"/>
+ <addaction name="action_Exit"/>
+ </widget>
+ <addaction name="menu_File"/>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
@@ -284,6 +293,16 @@
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
+ <action name="action_Preferences">
+ <property name="text">
+ <string>&Preferences</string>
+ </property>
+ </action>
+ <action name="action_Exit">
+ <property name="text">
+ <string>&Exit</string>
+ </property>
+ </action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
Added: freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.cpp (0 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.cpp (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.cpp 2010-01-04 06:03:36 UTC (rev 16133)
@@ -0,0 +1,26 @@
+#include "prefdialog.h"
+#include "ui_prefdialog.h"
+
+PrefDialog::PrefDialog(QWidget *parent) :
+ QDialog(parent),
+ ui(new Ui::PrefDialog)
+{
+ ui->setupUi(this);
+}
+
+PrefDialog::~PrefDialog()
+{
+ delete ui;
+}
+
+void PrefDialog::changeEvent(QEvent *e)
+{
+ QDialog::changeEvent(e);
+ switch (e->type()) {
+ case QEvent::LanguageChange:
+ ui->retranslateUi(this);
+ break;
+ default:
+ break;
+ }
+}
Added: freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.h (0 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.h (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.h 2010-01-04 06:03:36 UTC (rev 16133)
@@ -0,0 +1,23 @@
+#ifndef PREFDIALOG_H
+#define PREFDIALOG_H
+
+#include <QDialog>
+
+namespace Ui {
+ class PrefDialog;
+}
+
+class PrefDialog : public QDialog {
+ Q_OBJECT
+public:
+ PrefDialog(QWidget *parent = 0);
+ ~PrefDialog();
+
+protected:
+ void changeEvent(QEvent *e);
+
+private:
+ Ui::PrefDialog *ui;
+};
+
+#endif // PREFDIALOG_H
Added: freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.ui (0 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.ui (rev 0)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/prefdialog.ui 2010-01-04 06:03:36 UTC (rev 16133)
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>PrefDialog</class>
+ <widget class="QDialog" name="PrefDialog">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>450</width>
+ <height>337</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Preferences</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QListWidget" name="listSections">
+ <property name="maximumSize">
+ <size>
+ <width>120</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="showDropIndicator" stdset="0">
+ <bool>false</bool>
+ </property>
+ <property name="dragDropMode">
+ <enum>QAbstractItemView::NoDragDrop</enum>
+ </property>
+ <property name="iconSize">
+ <size>
+ <width>96</width>
+ <height>84</height>
+ </size>
+ </property>
+ <property name="movement">
+ <enum>QListView::Static</enum>
+ </property>
+ <property name="flow">
+ <enum>QListView::LeftToRight</enum>
+ </property>
+ <property name="isWrapping" stdset="0">
+ <bool>true</bool>
+ </property>
+ <property name="spacing">
+ <number>12</number>
+ </property>
+ <property name="viewMode">
+ <enum>QListView::IconMode</enum>
+ </property>
+ <item>
+ <property name="text">
+ <string>Sofia</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/images/pref_sip.png</normaloff>:/images/pref_sip.png</iconset>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>PortAudio</string>
+ </property>
+ <property name="icon">
+ <iconset resource="resources.qrc">
+ <normaloff>:/images/pref_audio.gif</normaloff>:/images/pref_audio.gif</iconset>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <widget class="QStackedWidget" name="stackedWidget">
+ <property name="currentIndex">
+ <number>1</number>
+ </property>
+ <widget class="QWidget" name="page">
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="title">
+ <string>Global Settings</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>log-level</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QSpinBox" name="spinBox"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>auto-restart</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="comboBox"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string>debug-presence</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QSpinBox" name="spinBox_2"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupBox_2">
+ <property name="title">
+ <string>Softphone Profile</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_2">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_4">
+ <property name="text">
+ <string>user-agent-string</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QLineEdit" name="lineEdit"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_5">
+ <property name="text">
+ <string>debug</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QSpinBox" name="spinBox_3"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_6">
+ <property name="text">
+ <string>sip-trace</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="comboBox_2"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="page_2">
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <widget class="QGroupBox" name="groupBox_3">
+ <property name="title">
+ <string>Audio</string>
+ </property>
+ <layout class="QFormLayout" name="formLayout_3">
+ <item row="0" column="0">
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>indev</string>
+ </property>
+ </widget>
+ </item>
+ <item row="0" column="1">
+ <widget class="QComboBox" name="comboBox_3"/>
+ </item>
+ <item row="1" column="0">
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>outdev</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="1">
+ <widget class="QComboBox" name="comboBox_4"/>
+ </item>
+ <item row="2" column="0">
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>rindgev</string>
+ </property>
+ </widget>
+ </item>
+ <item row="2" column="1">
+ <widget class="QComboBox" name="comboBox_5"/>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <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>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ <resources>
+ <include location="resources.qrc"/>
+ </resources>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>PrefDialog</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>544</x>
+ <y>224</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>246</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>PrefDialog</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>544</x>
+ <y>230</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>246</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>listSections</sender>
+ <signal>currentRowChanged(int)</signal>
+ <receiver>stackedWidget</receiver>
+ <slot>setCurrentIndex(int)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>180</x>
+ <y>83</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>524</x>
+ <y>102</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
Added: freeswitch/trunk/contrib/jmesquita/FSPhone/resources/pref_audio.gif
(Binary files differ)
Property changes on: freeswitch/trunk/contrib/jmesquita/FSPhone/resources/pref_audio.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: freeswitch/trunk/contrib/jmesquita/FSPhone/resources/pref_sip.png
(Binary files differ)
Property changes on: freeswitch/trunk/contrib/jmesquita/FSPhone/resources/pref_sip.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc (16132 => 16133)
--- freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc 2010-01-04 04:31:29 UTC (rev 16132)
+++ freeswitch/trunk/contrib/jmesquita/FSPhone/resources.qrc 2010-01-04 06:03:36 UTC (rev 16133)
@@ -1,6 +1,8 @@
<RCC>
<qresource prefix="/images">
<file alias="splash.png">resources/splash.png</file>
+ <file alias="pref_sip.png">resources/pref_sip.png</file>
+ <file alias="pref_audio.gif">resources/pref_audio.gif</file>
</qresource>
<qresource prefix="/confs">
<file alias="freeswitch.xml">conf/freeswitch.xml</file>