Commit 6481c872 authored by llea's avatar llea

Add VoIP link management interface

parent 6500328a
......@@ -72,6 +72,8 @@ OBJS = \
gui/qt/configurationpanelui.moc.o \
gui/qt/url_inputui.o \
gui/qt/url_inputui.moc.o \
gui/qt/voIPLinkmanagementui.o \
gui/qt/voIPLinkmanagementui.moc.o \
main.o \
manager.o \
sipcall.o \
......@@ -95,7 +97,7 @@ endif
.cpp.o:
$(CXX) $(DEFVARS) $(CXXFLAGS) -c -o $@ $<
prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui
prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui gui/qt/voIPLinkmanagement.ui
@echo "Making User Interface files..."
$(UIC) -o gui/qt/phonebookui.h gui/qt/phonebook.ui
$(UIC) -o gui/qt/phonebookui.cpp -impl gui/qt/phonebookui.h gui/qt/phonebook.ui
......@@ -103,6 +105,8 @@ prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/url_inputui.cpp -impl gui/qt/url_inputui.h gui/qt/url_input.ui
$(UIC) -o gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/configurationpanelui.cpp -impl gui/qt/configurationpanelui.h gui/qt/configurationpanel.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
$(UIC) -o gui/qt/voIPLinkmanagementui.cpp -impl gui/qt/voIPLinkmanagementui.h gui/qt/voIPLinkmanagement.ui
%.moc.cpp: %.h
$(MOC) -o $@ $<
......
/****************************************************************************
** Form implementation generated from reading ui file 'gui/qt/configurationpanel.ui'
**
** Created: Tue May 24 16:49:53 2005
** Created: Wed May 25 16:13:45 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'gui/qt/configurationpanel.ui'
**
** Created: Tue May 24 16:49:53 2005
** Created: Wed May 25 16:13:45 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form implementation generated from reading ui file 'gui/qt/phonebook.ui'
**
** Created: Tue May 24 16:49:52 2005
** Created: Wed May 25 16:13:44 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'gui/qt/phonebook.ui'
**
** Created: Tue May 24 16:49:52 2005
** Created: Wed May 25 16:13:44 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
......@@ -46,6 +46,7 @@
#include "../../user_cfg.h"
#include "../../skin.h"
#include "configurationpanelui.h"
#include "voIPLinkmanagementui.h"
#include "jpushbutton.h"
#include "numerickeypadtools.h"
#include "point.h"
......@@ -108,8 +109,10 @@ QtGUIMainWindow::QtGUIMainWindow (QWidget *parent, const char *name, WFlags f,
_TabIncomingCalls[i] = -1;
}
// Create configuration _panel
// Create configuration_panel
_panel = new ConfigurationPanel (0, 0, false);
//VoIPLinkManagement* vlm = new VoIPLinkManagement();
//vlm->show();
// Address book dialog
......@@ -717,6 +720,7 @@ QtGUIMainWindow::incomingCall (short id)
_TabIncomingCalls[i] = id;
_debug("Phoneline %d associated to id %d\n", i, id);
if (getPhoneLine(id) != NULL) {
_lcd->setInFunction(false);
// Set boolean to true to blink pixmap to notify the ringing line
getPhoneLine(id)->setbRinging(true);
// Set the status to the phoneline
......@@ -754,6 +758,12 @@ QtGUIMainWindow::peerHungupCall (short id)
stopCallTimer(id);
_callmanager->displayStatus(HUNGUP_STATUS);
setCurrentLine(-1);
} else {
// Stop the call timer when hang up
if (getPhoneLine(id)->timer != NULL) {
getPhoneLine(id)->stopTimer();
}
getPhoneLine(id)->first = true;
}
getPhoneLine(id)->setStatus(QString(getCall(id)->getStatus()));
changeLineStatePixmap(line, FREE);
......@@ -974,13 +984,13 @@ QtGUIMainWindow::toggleLine (int line)
return -1;
} else if (call->isBusy()){
// If call is busy, put this call on hold
_debug("CASE 1\n");
_debug("CASE 1: Put Call %d on-hold\n", id);
changeLineStatePixmap(line, ONHOLD);
displayStatus(ONHOLD_STATUS);
qt_onHoldCall(id);
} else if (call->isOnHold()) {
// If call is on hold, put this call on busy state
_debug("CASE 2\n");
_debug("CASE 2: Put Call %d off-hold\n", id);
changeLineStatePixmap(line, BUSY);
putOnHoldBusyLine(busyLine);
if (getChooseLine()) {
......@@ -994,7 +1004,7 @@ QtGUIMainWindow::toggleLine (int line)
displayContext(id);
} else if (call->isIncomingType()) {
// If incoming call occurs
_debug("CASE 3\n");
_debug("CASE 3: Answer call %d\n", id);
changeLineStatePixmap(line, BUSY);
putOnHoldBusyLine(busyLine);
qt_answerCall(id);
......@@ -1004,7 +1014,7 @@ QtGUIMainWindow::toggleLine (int line)
}
} else {
// If just click on free line
_debug("CASE 4\n");
_debug("CASE 4: New line off-hook\n");
phLines[line]->button()->setPixmap(TabLinePixmap[line][BUSY]);
displayStatus(ENTER_NUMBER_STATUS);
setChooseLine(true);
......@@ -1068,6 +1078,11 @@ QtGUIMainWindow::hangupLine (void)
_lcd->clear(QString(ENTER_NUMBER_STATUS));
}
if (id > 0 and getCall(id)->isProgressing()) {
// If I want to cancel a call before ringing, i have to wait.
return;
}
if (line >= 0 and id > 0) {
qt_hangupCall(id);
changeLineStatePixmap(line, FREE);
......@@ -1075,6 +1090,7 @@ QtGUIMainWindow::hangupLine (void)
setChooseLine(false);
} else if ((i = isThereIncomingCall()) > 0){
// To refuse new incoming call
_debug("Refuse call %d\n", id);
qt_refuseCall(i);
changeLineStatePixmap(id2line(i), FREE);
} else if (line >= 0) {
......
/****************************************************************************
** Form implementation generated from reading ui file 'gui/qt/url_input.ui'
**
** Created: Tue May 24 16:49:53 2005
** Created: Wed May 25 16:13:45 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
/****************************************************************************
** Form interface generated from reading ui file 'gui/qt/url_input.ui'
**
** Created: Tue May 24 16:49:52 2005
** Created: Wed May 25 16:13:45 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>VoIPLinkManagement</class>
<widget class="QWidget">
<property name="name">
<cstring>VoIPLinkManagement</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>589</width>
<height>323</height>
</rect>
</property>
<property name="caption">
<string>VoIP Link management</string>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout15</cstring>
</property>
<property name="geometry">
<rect>
<x>11</x>
<y>31</y>
<width>563</width>
<height>280</height>
</rect>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout30</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QListBox">
<item>
<property name="text">
<string>SIP sfl</string>
</property>
</item>
<item>
<property name="text">
<string>SIP fwd</string>
</property>
</item>
<item>
<property name="text">
<string>IAX sfl</string>
</property>
</item>
<property name="name">
<cstring>listVoiplink</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="cursor">
<cursor>13</cursor>
</property>
<property name="currentItem">
<number>0</number>
</property>
<property name="selectionMode">
<enum>Single</enum>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonAddVoiplink</cstring>
</property>
<property name="text">
<string>Add VoIP Link</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonRemoveVoiplink</cstring>
</property>
<property name="text">
<string>Remove VoIP Link</string>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>up</cstring>
</property>
<property name="text">
<string></string>
</property>
<property name="pixmap">
<pixmap>image0</pixmap>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>down</cstring>
</property>
<property name="text">
<string></string>
</property>
<property name="pixmap">
<pixmap>image1</pixmap>
</property>
</widget>
</vbox>
</widget>
<widget class="QGroupBox" row="0" column="1">
<property name="name">
<cstring>parameters</cstring>
</property>
<property name="title">
<string></string>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout14</cstring>
</property>
<property name="geometry">
<rect>
<x>12</x>
<y>22</y>
<width>390</width>
<height>230</height>
</rect>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout26</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0">
<property name="name">
<cstring>layout24</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>
<property name="text">
<string>Your name</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
<property name="text">
<string>User part of URL</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel3</cstring>
</property>
<property name="text">
<string>Host part of URL</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel4</cstring>
</property>
<property name="text">
<string>Authorization user</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel5</cstring>
</property>
<property name="text">
<string>Password</string>
</property>
</widget>
<widget class="QLabel">
<property name="name">
<cstring>textLabel6</cstring>
</property>
<property name="text">
<string>Proxy</string>
</property>
</widget>
</vbox>
</widget>
<widget class="QLayoutWidget" row="0" column="1">
<property name="name">
<cstring>layout23</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLineEdit">
<property name="name">
<cstring>yourName</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>userPart</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>hostPart</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>authUser</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>password</cstring>
</property>
</widget>
<widget class="QLineEdit">
<property name="name">
<cstring>proxy</cstring>
</property>
</widget>
</vbox>
</widget>
</grid>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>autoRegister</cstring>
</property>
<property name="text">
<string>Auto-register</string>
</property>
</widget>
</vbox>
</widget>
</widget>
</grid>
</widget>
</widget>
<images>
<image name="image0">
<data format="PNG" length="206">89504e470d0a1a0a0000000d494844520000000d000000100806000000cda3f53900000095494441542891dd91310ec3200c451f4c8c9c23b90139bf19b3710f4636772911b856d5b95f42089ef0c310dadd600009fae8e49461c0514ead55c25caf3cf6d1b78d3e3a473915a0944b3d1edadd3e0c985863f40c36d6186785522ef7803d985306a98282fe3aa40a41e1abc14b902a4f4f735eaf3a1f61e54f4f2b58e371f79fd6783c6e8677456bb27cfba759d19a2cffc79e5e4048dcd70eb2adc50000000049454e44ae426082</data>
</image>
<image name="image1">
<data format="PNG" length="194">89504e470d0a1a0a0000000d494844520000000d000000100806000000cda3f53900000089494441542891dd913112c33008040f2a957a87d3e5ff6fa043efa0a4538a58194494d86e7d8d34dc2c37cc918a020ea000e6865a2ab6e7a3635713a5ecb3b94d037343d4cae7f1a9a5028ef71bb4f2794ad837e6a4ec73dcf0d99892b27fc79ba8031d17c54d94ae004d94d8dc70166ca234dd74040ee0aba75f6004963d6530027f7b1a604e18fe0b9785c55de7faf4530000000049454e44ae426082</data>
</image>
</images>
<connections>
<connection>
<sender>listVoiplink</sender>
<signal>clicked(QListBoxItem*)</signal>
<receiver>VoIPLinkManagement</receiver>
<slot>changeParamSlot()</slot>
</connection>
<connection>
<sender>up</sender>
<signal>clicked()</signal>
<receiver>VoIPLinkManagement</receiver>
<slot>moveUpItemSlot()</slot>
</connection>
<connection>
<sender>down</sender>
<signal>clicked()</signal>
<receiver>VoIPLinkManagement</receiver>
<slot>moveDownItemSlot()</slot>
</connection>
<connection>
<sender>buttonRemoveVoiplink</sender>
<signal>clicked()</signal>
<receiver>VoIPLinkManagement</receiver>
<slot>removeVoIPLinkSlot()</slot>
</connection>
<connection>
<sender>buttonAddVoiplink</sender>
<signal>clicked()</signal>
<receiver>VoIPLinkManagement</receiver>
<slot>addVoIPLinkSlot()</slot>
</connection>
</connections>
<tabstops>
<tabstop>yourName</tabstop>
<tabstop>userPart</tabstop>
<tabstop>hostPart</tabstop>
<tabstop>authUser</tabstop>
<tabstop>password</tabstop>
<tabstop>proxy</tabstop>
<tabstop>autoRegister</tabstop>
<tabstop>listVoiplink</tabstop>
<tabstop>buttonAddVoiplink</tabstop>
<tabstop>buttonRemoveVoiplink</tabstop>
<tabstop>up</tabstop>
<tabstop>down</tabstop>
</tabstops>
<includes>
<include location="local" impldecl="in implementation">voIPLinkmanagement.ui.h</include>
</includes>
<slots>
<slot>changeParamSlot()</slot>
<slot>moveUpItemSlot()</slot>
<slot>moveDownItemSlot()</slot>
<slot>addVoIPLinkSlot()</slot>
<slot>removeVoIPLinkSlot()</slot>
</slots>
<functions>
<function access="private" specifier="non virtual">init()</function>
</functions>
<layoutdefaults spacing="6" margin="11"/>
</UI>
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you want to add, delete, or rename functions or slots, use
** Qt Designer to update this file, preserving your code.
**
** You should not define a constructor or destructor in this file.
** Instead, write your code in functions called init() and destroy().
** These will automatically be called by the form's constructor and
** destructor.
*****************************************************************************/
void VoIPLinkManagement::init()
{
parameters->setTitle(listVoiplink->text(0));
}
void VoIPLinkManagement::changeParamSlot()
{
int index = listVoiplink->currentItem();
parameters->setTitle(listVoiplink->text(index));
}
void VoIPLinkManagement::moveUpItemSlot()
{
int i = listVoiplink->currentItem();
if (i > 0) {
QString temp = listVoiplink->text(i - 1);
listVoiplink->changeItem( listVoiplink->text(i), i - 1);
listVoiplink ->changeItem(temp, i);
listVoiplink ->setCurrentItem(i - 1);
}
}
void VoIPLinkManagement::moveDownItemSlot()
{
int i = listVoiplink->currentItem();
if (i < (int)listVoiplink->count() - 1) {
QString temp = listVoiplink->text(i + 1);
listVoiplink->changeItem( listVoiplink->text(i), i + 1);
listVoiplink ->changeItem(temp, i);
listVoiplink ->setCurrentItem(i + 1);
}
}
void VoIPLinkManagement::addVoIPLinkSlot()
{
listVoiplink->insertItem(QString("TOTO"));
}
void VoIPLinkManagement::removeVoIPLinkSlot()
{
listVoiplink->removeItem(listVoiplink->currentItem());
}
/****************************************************************************
** Form implementation generated from reading ui file 'gui/qt/voIPLinkmanagement.ui'
**
** Created: Wed May 25 16:13:46 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "gui/qt/voIPLinkmanagementui.h"
#include <qvariant.h>
#include <qpushbutton.h>
#include <qlistbox.h>
#include <qgroupbox.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>
#include "voIPLinkmanagement.ui.h"
static const unsigned char image0_data[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0xcd, 0xa3, 0xf5, 0x39, 0x00, 0x00, 0x00,
0x95, 0x49, 0x44, 0x41, 0x54, 0x28, 0x91, 0xdd, 0x91, 0x31, 0x0e, 0xc3,
0x20, 0x0c, 0x45, 0x1f, 0x4c, 0x8c, 0x9c, 0x23, 0xb9, 0x01, 0x39, 0xbf,
0x19, 0xb3, 0x71, 0x0f, 0x46, 0x36, 0x77, 0x29, 0x11, 0xb8, 0x56, 0xd5,
0xb9, 0x5f, 0x42, 0x08, 0x9e, 0xf0, 0xc3, 0x10, 0xda, 0xdd, 0x60, 0x00,
0x09, 0xfa, 0xe8, 0xe4, 0x94, 0x61, 0xc0, 0x51, 0x4e, 0xad, 0x55, 0xc2,
0x5c, 0xaf, 0x3c, 0xf6, 0xd1, 0xb7, 0x8d, 0x3e, 0x3a, 0x47, 0x39, 0x15,
0xa0, 0x94, 0x4b, 0x3d, 0x1e, 0xda, 0xdd, 0x3e, 0x0c, 0x98, 0x58, 0x63,
0xf4, 0x0c, 0x36, 0xd6, 0x18, 0x67, 0x85, 0x52, 0x2e, 0xf7, 0x80, 0x3d,
0x98, 0x53, 0x06, 0xa9, 0x82, 0x82, 0xfe, 0x3a, 0xa4, 0x0a, 0x41, 0xe1,
0xab, 0xc1, 0x4b, 0x90, 0x2a, 0x4f, 0x4f, 0x73, 0x5e, 0xaf, 0x3a, 0x1f,
0x61, 0xe5, 0x4f, 0x4f, 0x2b, 0x58, 0xe3, 0x71, 0xf7, 0x9f, 0xd6, 0x78,
0x3c, 0x6e, 0x86, 0x77, 0x45, 0x6b, 0xb2, 0x7c, 0xfb, 0xa7, 0x59, 0xd1,
0x9a, 0x2c, 0xff, 0xc7, 0x9e, 0x5e, 0x40, 0x48, 0xdc, 0xd7, 0x0e, 0xb2,
0xad, 0xc5, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42,
0x60, 0x82
};
static const unsigned char image1_data[] = {
0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d,
0x49, 0x48, 0x44, 0x52, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x10,
0x08, 0x06, 0x00, 0x00, 0x00, 0xcd, 0xa3, 0xf5, 0x39, 0x00, 0x00, 0x00,