Commit 7d410955 authored by llea's avatar llea

Clean up code

parent 4ecd714b
SFLphone (0.4)
* Reorganisation of SFLphone architecture
SFLphone (0.3.1) / 2005-04-21
SFLphone (0.3.1) / 2005-05-27
* Reorganisation of SFLphone architecture
* Handle error messages on screen
* Handle refused call
* Notification of remote RINGING event added
* Management of lines updated
* Call management updated
SFLphone (0.3) / 2005-04-05
* ALSA driver support added
......
This is SFLPhone-0.3 release.
This is SFLPhone-0.3.1 release.
You need ccrtp-1.3.0 which needs commoncpp2>=1.3.0
libeXosip-0.9.0 needs libosip2-2.2.0
......@@ -42,6 +42,9 @@ make install
How to use it ?
---------------
If you have old version, remove your sflphonerc file located in $HOME/.sflphone
1. Lauch it, a setup window appears.
2. If you do have a SIP account, fill the SIP stuff where related. You can use
......
......@@ -72,8 +72,6 @@ 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 \
......@@ -97,16 +95,12 @@ endif
.cpp.o:
$(CXX) $(DEFVARS) $(CXXFLAGS) -c -o $@ $<
prereq: gui/qt/phonebook.ui gui/qt/url_input.ui gui/qt/configurationpanel.ui gui/qt/voIPLinkmanagement.ui
prereq: gui/qt/url_input.ui gui/qt/configurationpanel.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
$(UIC) -o gui/qt/url_inputui.h gui/qt/url_input.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 $@ $<
......
......@@ -326,7 +326,6 @@ AudioRtpRTX::run (void) {
TimerPort::incTimer(frameSize); // 'frameSize' ms
}
// AudioCodec::destroy(_ca->payload);
delete[] data_for_speakers;
delete[] data_from_mic;
delete[] data_from_mic_tmp;
......
......@@ -164,7 +164,6 @@ void DTMFGenerator::getNextSamples(short* buffer, size_t n) throw(DTMFException)
*/
short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
short* ptr;
// double arg1, arg2;
// try {
ptr = new short[SAMPLING_RATE];
......@@ -172,16 +171,6 @@ short* DTMFGenerator::generateSample(unsigned char code) throw (DTMFException) {
//throw new DTMFException("No memory left");
return 0;
}
#if 0
arg1 = (double)2 * (double)M_PI * (double)tones[code].higher / (double)SAMPLING_RATE;
arg2 = (double)2 * (double)M_PI * (double)tones[code].lower / (double)SAMPLING_RATE;
for(unsigned int i = 0; i < SAMPLING_RATE; i++) {
ptr[i] = (short)((double)(AMPLITUDE >> 2) * sin(arg1 * i) + (double)(AMPLITUDE >> 2) * sin(arg2 * i));
};
return ptr;
#endif
generateSin(tones[code].higher, tones[code].lower, AMPLITUDE,
SAMPLING_RATE, ptr);
......
......@@ -51,9 +51,6 @@ public:
class DTMFGenerator : public ToneGenerator
{
private:
// unsigned int samplingRate; // Sampling rate used, default is 8000 Hz
// short amplitude; // Amplitude of the resulting signal
struct DTMFTone {
unsigned char code; // Code of the tone
int lower; // Lower frequency
......
......@@ -18,19 +18,11 @@
*/
#include <iostream>
//#include "audio/audiocodec.h"
#include "call.h"
#include "manager.h"
#include "sipvoiplink.h"
#include "voIPLink.h"
Call::Call (void)
{
initConstructor();
_id = 0;
_manager = NULL;
_voIPLink = NULL;
}
Call::Call (Manager* manager, short id, CallType type, VoIPLink* voiplink)
{
......@@ -104,13 +96,6 @@ Call::getVoIPLink (void)
return _voIPLink;
}
/*
void
Call::setAudioCodec (void)
{
_audiocodec = _voIPLink->getAudioCodec(getId());
}
*/
string
Call::getStatus (void)
{
......@@ -332,13 +317,6 @@ Call::refuse (void)
return i;
}
int
Call::cancel (void)
{
int i = _voIPLink->cancel(_id);
_voIPLink->deleteSipCall(_id);
return i;
}
///////////////////////////////////////////////////////////////////////////////
// Private functions
......@@ -350,5 +328,4 @@ Call::initConstructor(void)
_state = NotExist;
_type = Null;
_voIPLinkId = 1;
// _audiocodec = NULL;
}
......@@ -52,11 +52,8 @@ enum CallType {
#include "manager.h"
//class AudioCodec;
class Call {
public:
Call(void);
Call(Manager* manager, short id, CallType type, VoIPLink* voiplink);
~Call(void);
......@@ -71,7 +68,6 @@ public:
void setVoIPLinkId (short voIPLinkId);
void setVoIPLink (VoIPLink* voIPLink);
VoIPLink* getVoIPLink(void);
// void setAudioCodec(void);
string getStatus (void);
void setStatus (const string& status);
......@@ -113,15 +109,12 @@ public:
int muteOn (void);
int muteOff (void);
int refuse (void);
int cancel (void);
private:
void initConstructor (void);
Manager* _manager;
VoIPLink* _voIPLink;
// AudioCodec* _audiocodec;
short _id;
short _voIPLinkId;
......
......@@ -43,11 +43,6 @@ Config::get (const string& section, const string& key, const string& defval) {
return value;
}
}
/*
string
Config::getschar (const string& section, const string& key) {
return Config::getchar (section, key, "");
}*/
string
Config::getchar (const string& section, const string& key, const string& defval){
......@@ -59,13 +54,7 @@ Config::getchar (const string& section, const string& key, const string& defval)
return value;
}
}
/*
bool
Config::getb (const string& section, const string& key) {
return (bool)Config::get (section, key, 0);
}
*/
int
Config::geti (const string& section, const string& key) {
return Config::get (section, key, 0);
......
......@@ -33,9 +33,7 @@ public:
~Config (void) {};
static string gets (const string&, const string&);
// static string getschar(const string&, const string&);
static int geti (const string&, const string&);
// static bool getb (const string&, const string&);
static string get (const string&, const string&, const string&);
static string getchar (const string&, const string&, const string&);
......
......@@ -17,7 +17,6 @@
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
//#include <stdio.h>
#include <iostream>
#include "eventthread.h"
......
......@@ -32,7 +32,7 @@
#define PREFIX "/usr/local"
#endif
#define VERSION "0.4"
#define VERSION "0.3.1"
#define PROGNAME "sflphone"
#define SKINDIR "skins"
#define PIXDIR "pixmaps"
......
......@@ -116,16 +116,6 @@ GuiFramework::refuseCall (short id)
}
}
int
GuiFramework::cancelCall (short id)
{
if (_manager->cancelCall(id)) {
return 1;
} else {
return 0;
}
}
int
GuiFramework::saveConfig (void)
{
......
......@@ -56,7 +56,6 @@ public:
int muteOn (short id);
int muteOff (short id);
int refuseCall (short id);
int cancelCall (short id);
int saveConfig (void);
int registerVoIPLink (void);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -89,21 +89,19 @@ void ConfigurationPanel::init()
// For preferences tab
SkinChoice->setCurrentText(QString(get_config_fields_str(
PREFERENCES, SKIN_CHOICE)));
PREFERENCES, SKIN_CHOICE)));
confirmationToQuit->setChecked(get_config_fields_int(
PREFERENCES, CONFIRM_QUIT));
PREFERENCES, CONFIRM_QUIT));
zoneToneChoice->setCurrentText(QString(get_config_fields_str(
PREFERENCES, ZONE_TONE)));
PREFERENCES, ZONE_TONE)));
checkedTray->setChecked(get_config_fields_int(
PREFERENCES, CHECKED_TRAY));
PREFERENCES, CHECKED_TRAY));
voicemailNumber->setText(QString(get_config_fields_str(
PREFERENCES, VOICEMAIL_NUM)));
PREFERENCES, VOICEMAIL_NUM)));
// Init tab view order
Tab_Signalisations->show();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->hide();
......@@ -113,12 +111,7 @@ void ConfigurationPanel::init()
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_AUDIO))) ,
"Audio", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_VIDEO))),
"Video", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_NETWORK))),
"Network", Menu );
new QjListBoxPixmap (QjListBoxPixmap::Above,
QPixmap(Skin::getPathPixmap(QString(PIXDIR), QString(PIXMAP_PREFERENCES))),
"Preferences", Menu );
......@@ -149,10 +142,10 @@ void ConfigurationPanel::saveSlot()
Config::set("Audio", "Codecs.codec5", string(codec5->currentText().ascii()));
if (ringsChoice->currentText() != NULL)
Config::set("Audio", "Rings.ringChoice",
string(ringsChoice->currentText().ascii()));
string(ringsChoice->currentText().ascii()));
Config::set("Preferences", "Themes.skinChoice",
string(SkinChoice->currentText().ascii()));
string(SkinChoice->currentText().ascii()));
Config::set("Preferences", "Options.zoneToneChoice",
string(zoneToneChoice->currentText().ascii()));
Config::set("Preferences", "Options.confirmQuit",
......@@ -160,7 +153,7 @@ void ConfigurationPanel::saveSlot()
Config::set("Preferences", "Options.checkedTray", checkedTray->isChecked());
Config::set("Preferences", "Options.voicemailNumber",
string(voicemailNumber->text().ascii()));
string(voicemailNumber->text().ascii()));
#if 0
QMessageBox::information(this, "Save settings",
"You must restart SFLPhone",
......@@ -176,8 +169,6 @@ void ConfigurationPanel::changeTabSlot()
TitleTab->setText("Setup signalisation");
Tab_Signalisations->show();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->hide();
break;
......@@ -185,44 +176,20 @@ void ConfigurationPanel::changeTabSlot()
TitleTab->setText("Setup audio");
Tab_Signalisations->hide();
Tab_Audio->show();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->hide();
break;
case 2:
TitleTab->setText("Setup video");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->show();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->hide();
break;
case 3:
TitleTab->setText("Setup network");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->show();
Tab_Preferences->hide();
Tab_About->hide();
break;
case 4:
TitleTab->setText("Setup preferences");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->show();
Tab_About->hide();
break;
case 5:
case 3:
TitleTab->setText("About");
Tab_Signalisations->hide();
Tab_Audio->hide();
Tab_Video->hide();
Tab_Network->hide();
Tab_Preferences->hide();
Tab_About->show();
break;
......
This diff is collapsed.
/****************************************************************************
** Form interface generated from reading ui file 'gui/qt/configurationpanel.ui'
**
** Created: Thu May 26 16:51:17 2005
** Created: Fri May 27 17:07:54 2005
** by: The User Interface Compiler ($Id$)
**
** WARNING! All changes made in this file will be lost!
......@@ -18,16 +18,16 @@ class QVBoxLayout;
class QHBoxLayout;
class QGridLayout;
class QSpacerItem;
class QFrame;
class QPushButton;
class QListBox;
class QListBoxItem;
class QLabel;
class QFrame;
class QTabWidget;
class QWidget;
class QGroupBox;
class QLineEdit;
class QCheckBox;
class QPushButton;
class QButtonGroup;
class QRadioButton;
class QSpinBox;
......@@ -41,6 +41,11 @@ public:
ConfigurationPanel( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
~ConfigurationPanel();
QFrame* line1;
QPushButton* buttonHelp;
QPushButton* buttonSave;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QListBox* Menu;
QLabel* TitleTab;
QFrame* line2;
......@@ -94,14 +99,8 @@ public:
QLabel* textLabel1_4_5;
QWidget* RingPage;
QComboBox* ringsChoice;
QTabWidget* Tab_Video;
QWidget* DriversPage_2;
QWidget* CodecsPage_2;
QTabWidget* Tab_Network;
QWidget* DriversPage_3;
QWidget* CodecsPage_3;
QTabWidget* Tab_Preferences;
QWidget* DriversPage_4;
QWidget* DriversPage_2;
QComboBox* SkinChoice;
QPushButton* buttonApplySkin;
QWidget* TabPage;
......@@ -112,17 +111,12 @@ public:
QLabel* textLabel1_6;
QLineEdit* voicemailNumber;
QTabWidget* Tab_About;
QWidget* DriversPage_5;
QWidget* DriversPage_3;
QLabel* pixmapLabel1;
QLabel* textLabel2_2;
QWidget* CodecsPage_4;
QWidget* CodecsPage_2;
QLabel* textLabel1;
QLabel* pixmapLabel2;
QFrame* line1;
QPushButton* buttonHelp;
QPushButton* buttonSave;
QPushButton* buttonOk;
QPushButton* buttonCancel;
public slots:
virtual void saveSlot();
......@@ -132,14 +126,16 @@ public slots:
virtual void driverSlot( int id );
protected:
QVBoxLayout* layout20;
QHBoxLayout* layout31;
QGridLayout* ConfigurationPanelLayout;
QVBoxLayout* layout19;
QHBoxLayout* layout28;
QSpacerItem* Horizontal_Spacing2;
QVBoxLayout* layout17;
QVBoxLayout* layout24;
QGridLayout* groupBox1Layout;
QVBoxLayout* layout23;
QSpacerItem* spacer9;
QHBoxLayout* layout19;
QHBoxLayout* layout19_2;
QSpacerItem* spacer7;
QVBoxLayout* stunButtonGroupLayout;
QGridLayout* SettingsDTMFLayout;
......@@ -160,9 +156,6 @@ protected:
QSpacerItem* spacer5;
QHBoxLayout* layout16_2;
QSpacerItem* spacer6_2;
QVBoxLayout* layout19_2;
QHBoxLayout* layout28;
QSpacerItem* Horizontal_Spacing2;
protected slots:
virtual void languageChange();
......
......@@ -34,9 +34,7 @@
#define TEXT_LINE 2
#define TIMER_LINE 4
#define FONT_FAMILY "Courier"
//#define FONT_FAMILY "Monospace"
//#define FONT_FAMILY "Fixed"
//#define FONT_FAMILY "MiscFixed"
// Others fixed font support "Monospace", "Fixed", "MiscFixed"
#define FONT_SIZE 10
///////////////////////////////////////////////////////////////////////////////
......
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>PhoneBook</class>
<widget class="QDialog">
<property name="name">
<cstring>PhoneBook</cstring>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>511</width>
<height>282</height>
</rect>
</property>
<property name="caption">
<string>Phone book</string>
</property>
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="1" column="0" rowspan="1" colspan="2">
<property name="name">
<cstring>Layout1</cstring>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="margin">
<number>0</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<widget class="QPushButton">
<property name="name">
<cstring>buttonHelp</cstring>
</property>
<property name="text">
<string>&amp;Help</string>
</property>
<property name="accel">
<string>F1</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>Horizontal Spacing2</cstring>
</property>
<property name="orientation">
<enum>Horizontal</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
</spacer>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOk</cstring>
</property>
<property name="text">
<string>&amp;OK</string>
</property>
<property name="accel">
<string></string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonCancel</cstring>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
<property name="accel">
<string></string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
</widget>
</hbox>
</widget>
<widget class="QListView" row="0" column="0">
<column>
<property name="text">
<string>Name</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<column>
<property name="text">
<string>Address SIP</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<column>
<property name="text">
<string>Mail</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<column>
<property name="text">
<string>Phone</string>
</property>
<property name="clickable">
<bool>true</bool>
</property>
<property name="resizable">
<bool>true</bool>
</property>
</column>
<property name="name">
<cstring>ContactList</cstring>
</property>
</widget>
<widget class="QLayoutWidget" row="0" column="1">
<property name="name">
<cstring>layout10</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOk_2</cstring>
</property>
<property name="text">
<string>&amp;Add</string>
</property>
<property name="accel">
<string>Alt+A</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOk_3</cstring>
</property>
<property name="text">
<string>&amp;Delete</string>
</property>
<property name="accel">
<string>Alt+D</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<widget class="QPushButton">
<property name="name">
<cstring>buttonOk_4</cstring>
</property>
<property name="text">
<string>&amp;Modify</string>
</property>
<property name="accel">
<string>Alt+M</string>
</property>
<property name="autoDefault">
<bool>true</bool>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacer4</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
<property name="sizeHint">
<size>
<width>21</width>
<height>91</height>
</size>
</property>
</spacer>
</vbox>
</widget>
</grid>
</widget>
<connections>
<connection>
<sender>buttonOk</sender>
<signal>clicked()</signal>