Commit df4f2f31 authored by Alexandre Savard's avatar Alexandre Savard

Merge branch 'master' into m_savard

parents 180c0cf9 c75dbed0
......@@ -118,9 +118,42 @@ sflphone-client-gnome/stamp-h1
/sflphone-client-gnome/tests/check_global
/sflphone-client-gnome/src/dbus/marshaller.c
/sflphone-client-gnome/src/dbus/marshaller.h
/sflphone-client-gnome/ltmain.sh
# Ignore sflphone_kde stuff
/sflphone-client-kde/build
/sflphone-client-kde/*.moc
/sflphone-client-kde/src/moc_*.cpp
/sflphone-client-kde/src/ui_*.h
/sflphone-client-kde/po/
/sflphone-client-kde/po/*
/sflphone-client-kde/doc/
/sflphone-client-kde/man/
/sflphone-client-kde/data/
/sflphone-client-kde/CMakeCache.txt
/sflphone-client-kde/CMakeLists.txt.user
/sflphone-client-kde/CTestTestfile.cmake
/sflphone-client-kde/*.cmake
/sflphone-client-kde/Makefile
/sflphone-client-kde/CMakeFiles/*
/sflphone-client-kde/CMakeTmp/
/sflphone-client-kde/qtcreator-build/
/sflphone-client-kde/src/.directory
/sflphone-client-kde/src/Makefile
/sflphone-client-kde/src/CTestTestfile.cmake
/sflphone-client-kde/src/CMakeFiles/
/sflphone-client-kde/src/*.moc
/sflphone-client-kde/src/callmanager_dbus_interface.*
/sflphone-client-kde/src/configurationmanager_dbus_interface.*
/sflphone-client-kde/src/instance_dbus_interface.*
/sflphone-client-kde/src/sflphone-client-kde_automoc.cpp
/sflphone-client-kde/src/sflphone-client-kde_automoc.cpp.files
/sflphone-client-kde/src/cmake_install.cmake
/sflphone-client-kde/src/kcfg_settings.cpp
/sflphone-client-kde/src/kcfg_settings.h
/sflphone-client-kde/src/qrc_resources.cxx
/sflphone-client-kde/src/sflphone-client-kde
/sflphone-client-kde/src/sflphone-client-kde.shell
# Ignore sub-modules stuff
## libiax2
......
......@@ -2,7 +2,7 @@ Installation Instructions
*************************
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005,
2006, 2007, 2008 Free Software Foundation, Inc.
2006, 2007, 2008, 2009 Free Software Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
......@@ -159,7 +159,7 @@ Particular systems
CC is not installed, it is recommended to use the following options in
order to use an ANSI C compiler:
./configure CC="cc -Ae"
./configure CC="cc -Ae -D_XOPEN_SOURCE=500"
and if that doesn't work, install pre-built binaries of GCC for HP-UX.
......@@ -174,6 +174,16 @@ and if that doesn't work, try
./configure CC="cc -nodtk"
On Solaris, don't put `/usr/ucb' early in your `PATH'. This
directory contains several dysfunctional programs; working variants of
these programs are available in `/usr/bin'. So, if you need `/usr/ucb'
in your `PATH', put it _after_ `/usr/bin'.
On Haiku, software installed for all users goes in `/boot/common',
not `/usr/local'. It is recommended to use the following options:
./configure --prefix=/boot/common
Specifying the System Type
==========================
......@@ -189,7 +199,8 @@ type, such as `sun4', or a canonical name which has the form:
where SYSTEM can have one of these forms:
OS KERNEL-OS
OS
KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
......
From now on, those coding guideline must be applied to prevent more fragmentation of the coding style:
-Class name must start with a caps
-Funtion and variables names must -not- start with a caps
-Words in functions must be separated by caps "addNewCall"
-Pointer symbol should be merge with the type QWidget* aWidget
-Indentation must be 3 (three) -space- wide, every IDE have options to set that
-Classes and functions bracket must look like:
void MyClass::myFunction()
{
}
-If, while, case and for most look like this:
if () {
}
else {
}
-One line if without braces are allowed
-The .h HAVE TO BE COMMENTED following the doxygen syntax
-"Autoconnect" functions are allowed
-Qt STL and macro are recommaded
-KDE class are prefered over pure Qt classes
FIND_LIBRARY(KABC_LIBRARY NAMES kabc)
FIND_PATH(KABC_INCLUDE_DIR kabc_export.h /usr/include/kabc /usr/local/include/kabc )
FIND_PATH(KABC_INCLUDE_DIR kabc_export.h /usr/include/kabc /usr/local/include/kabc $ENV{KDEDIR}/include/kabc )
IF (KABC_INCLUDE_DIR AND KABC_LIBRARY)
......
File mode changed from 100755 to 100644
......@@ -3,4 +3,5 @@ add_subdirectory(icons)
INSTALL( FILES sflphone-client-kde.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} )
INSTALL( FILES sflphone-client-kdeui.rc DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde )
INSTALL( FILES sflphone-client-kde.notifyrc DESTINATION ${DATA_INSTALL_DIR}/sflphone-client-kde)
[Global]
Name=sflphone-client-kde
IconName=sflphone-client-kde
Comment=SFLphone VoIP KDE4 client
[Event/contact online]
Name=Contact Online
Comment=A contact has come online
Sound=
Action=Sound|Popup
[Event/test_notification]
Name=test message
Comment=Test message
Contexts=call
Action=Sound|Popup|Taskbar
Persistant=true
Sound=
[Event/test_notification2]
Name=test message2
Comment=Test message2
Sound=KDE-Im-New-Mail.ogg
Action=None
......@@ -5,10 +5,8 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0
http://www.kde.org/standards/kxmlgui/1.0/kxmlgui.xsd" >
-->
-->
<gui name="sflphone-client-kde" version="1">
<MenuBar>
<Menu name="Actions" >
<text>Actions</text>
......@@ -38,18 +36,15 @@
</Menu>
</MenuBar>
<ToolBar name="callsToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="true" newline="true" >
<Action name="action_accept" />
<Action name="action_refuse" />
<Action name="action_hold" />
<Action name="action_transfer" />
<Action name="action_record" />
<Action name="action_mailBox" />
</ToolBar>
<ToolBar name="screenToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="true" newline="true" >
<ToolBar name="mainToolBar" iconText="icononly" position="Top" noMerge="1" fullWidth="false" newline="true" >
<Action name="action_accept" />
<Action name="action_mailBox" />
<Action name="action_refuse" />
<Action name="action_hold" />
<Action name="action_transfer" />
<Action name="action_record" />
<Action name="action_main" />
<Action name="action_history" />
<Action name="action_addressBook" />
</ToolBar>
</gui>
\ No newline at end of file
</gui>
File mode changed from 100644 to 100755
/***************************************************************************
* Copyright (C) 2009 by Savoir-Faire Linux *
* Author : Jérémy Quentin *
* jeremy.quentin@savoirfairelinux.com *
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -30,25 +30,25 @@
const QString account_state_name(QString & s)
{
if(s == QString(ACCOUNT_STATE_REGISTERED))
return i18n("Registered" );
if(s == QString(ACCOUNT_STATE_UNREGISTERED))
return i18n("Not Registered");
if(s == QString(ACCOUNT_STATE_TRYING))
return i18n("Trying...");
if(s == QString(ACCOUNT_STATE_ERROR))
return i18n("Error");
if(s == QString(ACCOUNT_STATE_ERROR_AUTH))
return i18n("Authentication Failed");
if(s == QString(ACCOUNT_STATE_ERROR_NETWORK))
return i18n("Network unreachable");
if(s == QString(ACCOUNT_STATE_ERROR_HOST))
return i18n("Host unreachable");
if(s == QString(ACCOUNT_STATE_ERROR_CONF_STUN))
return i18n("Stun configuration error");
if(s == QString(ACCOUNT_STATE_ERROR_EXIST_STUN))
return i18n("Stun server invalid");
return i18n("Invalid");
if(s == QString(ACCOUNT_STATE_REGISTERED))
return i18n("Registered" );
if(s == QString(ACCOUNT_STATE_UNREGISTERED))
return i18n("Not Registered");
if(s == QString(ACCOUNT_STATE_TRYING))
return i18n("Trying...");
if(s == QString(ACCOUNT_STATE_ERROR))
return i18n("Error");
if(s == QString(ACCOUNT_STATE_ERROR_AUTH))
return i18n("Authentication Failed");
if(s == QString(ACCOUNT_STATE_ERROR_NETWORK))
return i18n("Network unreachable");
if(s == QString(ACCOUNT_STATE_ERROR_HOST))
return i18n("Host unreachable");
if(s == QString(ACCOUNT_STATE_ERROR_CONF_STUN))
return i18n("Stun configuration error");
if(s == QString(ACCOUNT_STATE_ERROR_EXIST_STUN))
return i18n("Stun server invalid");
return i18n("Invalid");
}
//Constructors
......@@ -60,135 +60,125 @@ Account::Account():accountId(NULL)
void Account::initItem()
{
if(item != NULL)
{
delete item;
}
item = new QListWidgetItem();
item->setSizeHint(QSize(140,25));
item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled);
initItemWidget();
if(item != NULL)
delete item;
item = new QListWidgetItem();
item->setSizeHint(QSize(140,25));
item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled);
initItemWidget();
}
void Account::initItemWidget()
{
if(itemWidget != NULL)
{
delete itemWidget;
}
bool enabled = getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE;
itemWidget = new AccountItemWidget();
itemWidget->setEnabled(enabled);
itemWidget->setAccountText(getAccountDetail(ACCOUNT_ALIAS));
if(isNew() || !enabled)
{
itemWidget->setState(AccountItemWidget::Unregistered);
}
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
{
itemWidget->setState(AccountItemWidget::Registered);
}
else
{
itemWidget->setState(AccountItemWidget::NotWorking);
}
connect(itemWidget, SIGNAL(checkStateChanged(bool)), this, SLOT(setEnabled(bool)));
if(itemWidget != NULL)
delete itemWidget;
bool enabled = getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE;
itemWidget = new AccountItemWidget();
itemWidget->setEnabled(enabled);
itemWidget->setAccountText(getAccountDetail(ACCOUNT_ALIAS));
if(isNew() || !enabled)
itemWidget->setState(AccountItemWidget::Unregistered);
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
itemWidget->setState(AccountItemWidget::Registered);
else
itemWidget->setState(AccountItemWidget::NotWorking);
connect(itemWidget, SIGNAL(checkStateChanged(bool)), this, SLOT(setEnabled(bool)));
}
Account * Account::buildExistingAccountFromId(QString _accountId)
{
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
Account * a = new Account();
a->accountId = new QString(_accountId);
a->accountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() );
a->initItem();
return a;
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
Account * a = new Account();
a->accountId = new QString(_accountId);
a->accountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() );
a->initItem();
return a;
}
Account * Account::buildNewAccountFromAlias(QString alias)
{
Account * a = new Account();
a->accountDetails = new MapStringString();
a->setAccountDetail(ACCOUNT_ALIAS,alias);
a->initItem();
return a;
Account * a = new Account();
a->accountDetails = new MapStringString();
a->setAccountDetail(ACCOUNT_ALIAS,alias);
a->initItem();
return a;
}
Account::~Account()
{
delete accountId;
delete accountDetails;
delete item;
delete accountId;
delete accountDetails;
delete item;
}
//Getters
bool Account::isNew() const
{
return (accountId == NULL);
return (accountId == NULL);
}
bool Account::isChecked() const
{
return itemWidget->getEnabled();
return itemWidget->getEnabled();
}
const QString & Account::getAccountId() const
{
if (isNew())
{
qDebug() << "Error : getting AccountId of a new account.";
}
return *accountId;
if (isNew())
qDebug() << "Error : getting AccountId of a new account.";
return *accountId;
}
MapStringString & Account::getAccountDetails() const
{
return *accountDetails;
return *accountDetails;
}
QListWidgetItem * Account::getItem()
{
return item;
return item;
}
AccountItemWidget * Account::getItemWidget()
{
return itemWidget;
return itemWidget;
}
QString Account::getStateName(QString & state)
{
return account_state_name(state);
return account_state_name(state);
}
QColor Account::getStateColor()
{
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
{ return Qt::black; }
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
{ return Qt::darkGreen; }
return Qt::red;
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
return Qt::black;
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
return Qt::darkGreen;
return Qt::red;
}
QString Account::getStateColorName()
{
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
{ return "black"; }
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
{ return "darkGreen"; }
return "red";
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_UNREGISTERED)
return "black";
if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
return "darkGreen";
return "red";
}
QString Account::getAccountDetail(QString param) const
{
return (*accountDetails)[param];
return (*accountDetails)[param];
}
QString Account::getAlias() const
{
return getAccountDetail(ACCOUNT_ALIAS);
return getAccountDetail(ACCOUNT_ALIAS);
}
......@@ -196,70 +186,67 @@ QString Account::getAlias() const
void Account::setAccountDetails(MapStringString m)
{
*accountDetails = m;
*accountDetails = m;
}
void Account::setAccountDetail(QString param, QString val)
{
(*accountDetails)[param] = val;
(*accountDetails)[param] = val;
}
void Account::setAccountId(QString id)
{
qDebug() << "accountId = " << accountId;
if (! isNew())
{
qDebug() << "Error : setting AccountId of an existing account.";
}
accountId = new QString(id);
qDebug() << "accountId = " << accountId;
if (! isNew())
qDebug() << "Error : setting AccountId of an existing account.";
accountId = new QString(id);
}
void Account::setEnabled(bool checked)
{
qDebug() << "setEnabled = " << checked;
setAccountDetail(ACCOUNT_ENABLED, checked ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE);
setAccountDetail(ACCOUNT_ENABLED, checked ? ACCOUNT_ENABLED_TRUE : ACCOUNT_ENABLED_FALSE);
}
bool Account::isEnabled() const
{
return (getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE);
qDebug() << "isEnabled = " << getAccountDetail(ACCOUNT_ENABLED);
return (getAccountDetail(ACCOUNT_ENABLED) == ACCOUNT_ENABLED_TRUE);
}
bool Account::isRegistered() const
{
return (getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED);
qDebug() << "isRegistered = " << getAccountDetail(ACCOUNT_STATUS);
return (getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED);
}
void Account::updateState()
{
qDebug() << "updateState";
if(! isNew())
{
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
MapStringString details = configurationManager.getAccountDetails(getAccountId()).value();
AccountItemWidget * itemWidget = getItemWidget();
QString status = details[ACCOUNT_STATUS];
setAccountDetail(ACCOUNT_STATUS, status);
if(getAccountDetail(ACCOUNT_ENABLED) != ACCOUNT_ENABLED_TRUE )
{
qDebug() << "itemWidget->setState(AccountItemWidget::Unregistered);";
itemWidget->setState(AccountItemWidget::Unregistered);
}
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED)
{
qDebug() << "itemWidget->setState(AccountItemWidget::Registered);";
itemWidget->setState(AccountItemWidget::Registered);
}
else
{
qDebug() << "itemWidget->setState(AccountItemWidget::NotWorking);";
itemWidget->setState(AccountItemWidget::NotWorking);
}
}
qDebug() << "updateState";
if(! isNew()) {
ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
MapStringString details = configurationManager.getAccountDetails(getAccountId()).value();
AccountItemWidget * itemWidget = getItemWidget();
QString status = details[ACCOUNT_STATUS];
setAccountDetail(ACCOUNT_STATUS, status);
if(getAccountDetail(ACCOUNT_ENABLED) != ACCOUNT_ENABLED_TRUE ) {
qDebug() << "itemWidget->setState(AccountItemWidget::Unregistered);";
itemWidget->setState(AccountItemWidget::Unregistered);
}
else if(getAccountDetail(ACCOUNT_STATUS) == ACCOUNT_STATE_REGISTERED) {
qDebug() << "itemWidget->setState(AccountItemWidget::Registered);";
itemWidget->setState(AccountItemWidget::Registered);
}
else {
qDebug() << "itemWidget->setState(AccountItemWidget::NotWorking);";
itemWidget->setState(AccountItemWidget::NotWorking);
}
}
}
//Operators
bool Account::operator==(const Account& a)const
{
return *accountId == *a.accountId;
return *accountId == *a.accountId;
}
/***************************************************************************
* Copyright (C) 2009 by Savoir-Faire Linux *
* Author : Jérémy Quentin *
* jeremy.quentin@savoirfairelinux.com *
* Copyright (C) 2009-2010 by Savoir-Faire Linux *
* Author : Jérémy Quentin <jeremy.quentin@savoirfairelinux.com> *
* Emmanuel Lepage Vallee <emmanuel.lepage@savoirfairelinux.com>*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
......@@ -36,54 +36,54 @@ class Account : public QObject, public Item<AccountItemWidget>{
Q_OBJECT
private:
QString * accountId;
MapStringString * accountDetails;
// QListWidgetItem * item;
// AccountItemWidget * itemWidget;
QString * accountId;
MapStringString * accountDetails;
// QListWidgetItem * item;
// AccountItemWidget * itemWidget;
Account();
Account();
public:
~Account();
//Constructors
static Account * buildExistingAccountFromId(QString _accountId);
static Account * buildNewAccountFromAlias(QString alias);