diff --git a/sflphone-client-kde/src/Account.cpp b/sflphone-client-kde/src/Account.cpp
index 0de2b732a4c2865059337240e229db9fdf8c46b2..f20614bf6a4c3806c81a151f7ea67227bf3764f4 100644
--- a/sflphone-client-kde/src/Account.cpp
+++ b/sflphone-client-kde/src/Account.cpp
@@ -53,12 +53,12 @@ const QString account_state_name(QString & s)
 
 //Constructors
 
-Account::Account():accountId(NULL), item(NULL), itemWidget(NULL)
+Account::Account():accountId(NULL)
 {
 }
 
 
-void Account::initAccountItem()
+void Account::initItem()
 {
 	if(item != NULL)
 	{
@@ -67,10 +67,10 @@ void Account::initAccountItem()
 	item = new QListWidgetItem();
 	item->setSizeHint(QSize(140,25));
 	item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsDragEnabled|Qt::ItemIsDropEnabled|Qt::ItemIsEnabled);
-	initAccountItemWidget();
+	initItemWidget();
 }
 
-void Account::initAccountItemWidget()
+void Account::initItemWidget()
 {
 	if(itemWidget != NULL)
 	{
@@ -102,7 +102,7 @@ Account * Account::buildExistingAccountFromId(QString _accountId)
 	a->accountId = new QString(_accountId);
 	qDebug() << "getAccountDetails 1 sent";
 	a->accountDetails = new MapStringString( configurationManager.getAccountDetails(_accountId).value() );
-	a->initAccountItem();
+	a->initItem();
 	return a;
 }
 
@@ -111,7 +111,7 @@ Account * Account::buildNewAccountFromAlias(QString alias)
 	Account * a = new Account();
 	a->accountDetails = new MapStringString();
 	a->setAccountDetail(ACCOUNT_ALIAS,alias);
-	a->initAccountItem();
+	a->initItem();
 	return a;
 }
 
diff --git a/sflphone-client-kde/src/Account.h b/sflphone-client-kde/src/Account.h
index 65456d57f1526ebd1d8601bd2f5550f349f43b34..37f11f4b23fcdae36e7e90ced18adfe25b4f8eeb 100644
--- a/sflphone-client-kde/src/Account.h
+++ b/sflphone-client-kde/src/Account.h
@@ -28,17 +28,18 @@
 
 #include "typedefs.h"
 #include "AccountItemWidget.h"
+#include "Item.h"
 
 const QString account_state_name(QString & s);
 
-class Account : public QObject{
+class Account : public QObject, public Item<AccountItemWidget>{
 Q_OBJECT
 private:
 
 	QString * accountId;
 	MapStringString * accountDetails;
-	QListWidgetItem * item;
-	AccountItemWidget * itemWidget;
+// 	QListWidgetItem * item;
+// 	AccountItemWidget * itemWidget;
 
 	Account();
 
@@ -69,8 +70,8 @@ public:
 	void setAccountDetail(QString param, QString val);
 	
 	//Updates
-	void initAccountItem();
-	void initAccountItemWidget();
+	void initItem();
+	void initItemWidget();
 	void updateState();
 	
 	//Operators
diff --git a/sflphone-client-kde/src/AccountList.cpp b/sflphone-client-kde/src/AccountList.cpp
index 3f53f475fdb6502359b1db9726ce391bd7364772..82f2afd0bb2c8f3083269455565b58dd6d2eca05 100644
--- a/sflphone-client-kde/src/AccountList.cpp
+++ b/sflphone-client-kde/src/AccountList.cpp
@@ -40,7 +40,10 @@ AccountList::AccountList(bool fill)
 {
 	qDebug() << "AccountList()";
 	accounts = new QVector<Account *>();
-	updateAccounts();
+	if(fill)
+	{
+		updateAccounts();
+	}
 }
 
 void AccountList::update()
diff --git a/sflphone-client-kde/src/CMakeLists.txt b/sflphone-client-kde/src/CMakeLists.txt
index 32540e27410f48052ba8ab62a9999a14b5ae47a6..0d71a14d5c3e6b32874df54db4d44e29ea5d71e6 100644
--- a/sflphone-client-kde/src/CMakeLists.txt
+++ b/sflphone-client-kde/src/CMakeLists.txt
@@ -54,6 +54,10 @@ SET(	   sflphone_client_kde_SRCS
 	conf/dlghooks.cpp
 	conf/ConfigurationSkeleton.cpp
 	Dialpad.cpp
+# 	Codec.cpp
+# 	CodecListModel.cpp
+# 	SortableCodecListWidget.cpp
+	Item.cpp
 )
  
 
diff --git a/sflphone-client-kde/src/Call.cpp b/sflphone-client-kde/src/Call.cpp
index 5539577e4f1e8c408083326099d7b3c35a4636ff..8b235c5cf5d7e9b03eda78b54f067622c89d5fc2 100644
--- a/sflphone-client-kde/src/Call.cpp
+++ b/sflphone-client-kde/src/Call.cpp
@@ -164,24 +164,20 @@ Call::Call(call_state startState, QString callId, QString peerName, QString peer
 	this->stopTime = NULL;
 }
 
-Call::Call(QString callId)
+Call * Call::buildExistingCall(QString callId)
 {
 	CallManagerInterface & callManager = CallManagerInterfaceSingleton::getInstance();
 	MapStringString details = callManager.getCallDetails(callId).value();
 	qDebug() << "Constructing existing call with details : " << details;
-	this->callId = callId;
-	this->peerPhoneNumber = details[CALL_PEER_NUMBER];
-	this->peerName = details[CALL_PEER_NAME];
-	initCallItem();
+	QString peerNumber = details[CALL_PEER_NUMBER];
+	QString peerName = details[CALL_PEER_NAME];
 	call_state startState = getStartStateFromDaemonCallState(details[CALL_STATE], details[CALL_TYPE]);
-	changeCurrentState(startState);
-	this->historyState = getHistoryStateFromDaemonCallState(details[CALL_STATE], details[CALL_TYPE]);
-	this->account = details[CALL_ACCOUNTID];
-	this->recording = false;
-	this->startTime = new QDateTime(QDateTime::currentDateTime());
-	this->stopTime = NULL;
-	this->historyItem = NULL;
-	this->historyItemWidget = NULL;
+	QString account = details[CALL_ACCOUNTID];
+	Call * call = new Call(startState, callId, peerName, peerNumber, account);
+	call->startTime = new QDateTime(QDateTime::currentDateTime());
+	call->recording = callManager.getIsRecording(callId);
+	call->historyState = getHistoryStateFromDaemonCallState(details[CALL_STATE], details[CALL_TYPE]);
+	return call;
 }
 
 Call::~Call()
@@ -251,6 +247,7 @@ history_state Call::getHistoryStateFromType(QString type)
 	{
 		return INCOMING;
 	}
+	return NONE;
 }
 
 call_state Call::getStartStateFromDaemonCallState(QString daemonCallState, QString daemonCallType)
@@ -587,8 +584,8 @@ void Call::call()
 	qDebug() << "account = " << account;
 	if(account.isEmpty())
 	{
-		qDebug() << "account is empty"; 
-		this->account = sflphone_kdeView::firstRegisteredAccount()->getAccountId();
+		qDebug() << "account is empty, taking the first registered.";
+		this->account = sflphone_kdeView::firstRegisteredAccountId();
 	}
 	if(!account.isEmpty())
 	{
@@ -662,7 +659,6 @@ void Call::warning()
 
 void Call::appendItemText(QString text)
 {
-	ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
 	QLabel * editNumber;
 	switch(currentState)
 	{
diff --git a/sflphone-client-kde/src/Call.h b/sflphone-client-kde/src/Call.h
index 8ec2ca9a0f6c4b57aaa56506b816355f063ae522..3d3ae20fc7de786f9c040bd9c78f0309f115dc63 100644
--- a/sflphone-client-kde/src/Call.h
+++ b/sflphone-client-kde/src/Call.h
@@ -113,6 +113,31 @@ class Call;
 
 typedef  void (Call::*function)();
 
+
+/**
+ *  This class represents a call either actual (in the call list
+ *  displayed in main window), either past (in the call history).
+ *  A call is represented by an automate, with a list of states
+ *  (enum call_state) and 2 lists of transition signals
+ *  (call_action when the user performs an action on the UI and 
+ *  daemon_call_state when the daemon sends a stateChanged signal)
+ *  When a transition signal is received, the automate calls a
+ *  function then go to a new state according to the previous state
+ *  of the call and the signal received.
+ *  The functions to call and the new states to go to are placed in
+ *  the maps actionPerformedStateMap, actionPerformedFunctionMap, 
+ *  stateChangedStateMap and stateChangedFunctionMap.
+ *  Those maps are used by actionPerformed and stateChanged functions
+ *  to handle the behavior of the automate.
+ *  When an actual call goes to the state OVER, it becomes part of
+ *  the call history.
+ *
+ *  It may be better to handle call list and call history separately,
+ *  and to use the class Item to handle their display, or a model/view
+ *  way. For this it needs to handle the becoming of a call to a past call
+ *  keeping the information gathered by the call and needed by the history
+ *  call (history state, start time...).
+**/
 class Call
 {
 private:
@@ -144,9 +169,34 @@ private:
 	
 	
 	//Automate attributes
+	/**
+	 *  actionPerformedStateMap[orig_state][action]
+	 *  Map of the states to go to when the action action is 
+	 *  performed on a call in state orig_state.
+	**/
 	static const call_state actionPerformedStateMap [11][5];
+	
+	/**
+	 *  actionPerformedFunctionMap[orig_state][action]
+	 *  Map of the functions to call when the action action is 
+	 *  performed on a call in state orig_state.
+	**/
 	static const function actionPerformedFunctionMap [11][5];
+	
+	/**
+	 *  stateChangedStateMap[orig_state][daemon_new_state]
+	 *  Map of the states to go to when the daemon sends the signal 
+	 *  callStateChanged with arg daemon_new_state
+	 *  on a call in state orig_state.
+	**/
 	static const call_state stateChangedStateMap [11][6];
+	
+	/**
+	 *  stateChangedFunctionMap[orig_state][daemon_new_state]
+	 *  Map of the functions to call when the daemon sends the signal 
+	 *  callStateChanged with arg daemon_new_state
+	 *  on a call in state orig_state.
+	**/
 	static const function stateChangedFunctionMap [11][6];
 	
 	static const char * historyIcons[3];
@@ -161,6 +211,8 @@ private:
 	static daemon_call_state toDaemonCallState(const QString & stateName);
 	
 	//Automate functions
+	// See actionPerformedFunctionMap and stateChangedFunctionMap
+	// to know when it is called.
 	void nothing();
 	void accept();
 	void refuse();
@@ -181,13 +233,14 @@ private:
 public:
 	
 	//Constructors & Destructors
-	Call(QString callId);
 	~Call();
 	void initCallItem();
 	static Call * buildDialingCall(QString callId, const QString & peerName, QString account = "");
-	static Call * buildIncomingCall(const QString & callId/*, const QString & from, const QString & account*/);
+	static Call * buildIncomingCall(const QString & callId);
 	static Call * buildRingingCall(const QString & callId);
 	static Call * buildHistoryCall(const QString & callId, uint startTimeStamp, uint stopTimeStamp, QString account, QString name, QString number, QString type);
+	static Call * buildExistingCall(QString callId);
+	
 	static history_state getHistoryStateFromType(QString type);
 	static call_state getStartStateFromDaemonCallState(QString daemonCallState, QString daemonCallType);
 	static history_state getHistoryStateFromDaemonCallState(QString daemonCallState, QString daemonCallType);
diff --git a/sflphone-client-kde/src/CallList.cpp b/sflphone-client-kde/src/CallList.cpp
index d3415983fbec25f2f037a9654ec968851c1bee41..9f2cb774456cb3f812375a2e78fd720d19bb9e64 100644
--- a/sflphone-client-kde/src/CallList.cpp
+++ b/sflphone-client-kde/src/CallList.cpp
@@ -34,7 +34,7 @@ CallList::CallList()
 	calls = new QVector<Call *>();
 	for(int i = 0 ; i < callList.size() ; i++)
 	{
-		calls->append(new Call(callList[i]));
+		calls->append(Call::buildExistingCall(callList[i]));
 	}
 	MapStringString historyMap = configurationManager.getHistory().value();
 	qDebug() << "Call History = " << historyMap;
diff --git a/sflphone-client-kde/src/Contact.cpp b/sflphone-client-kde/src/Contact.cpp
index 60d32f21a85e7232ac29269f0578b54b70588665..af3ee5ea9644a29387c583e63c4d65456de471b5 100644
--- a/sflphone-client-kde/src/Contact.cpp
+++ b/sflphone-client-kde/src/Contact.cpp
@@ -33,6 +33,7 @@ Contact::Contact(Addressee addressee, const PhoneNumber & number, bool displayPh
 	this->nickName = addressee.nickName();
 	this->phoneNumber = number.number();
 	this->type = number.type();
+	this->displayPhoto = displayPhoto;
 	if(displayPhoto)
 	{
 		this->photo = new Picture(addressee.photo());
@@ -42,7 +43,7 @@ Contact::Contact(Addressee addressee, const PhoneNumber & number, bool displayPh
 		this->photo = NULL;
 	}
 	
-	initItem(displayPhoto);
+	initItem();
 }
 
 
@@ -53,10 +54,15 @@ Contact::~Contact()
 	delete photo;
 }
 
-void Contact::initItem(bool displayPhoto)
+void Contact::initItem()
 {
 	this->item = new QListWidgetItem();
 	this->item->setSizeHint(QSize(140,CONTACT_ITEM_HEIGHT));
+	initItemWidget();
+}
+
+void Contact::initItemWidget()
+{
 	this->itemWidget = new ContactItemWidget(this, displayPhoto);
 }
 
@@ -90,13 +96,4 @@ PhoneNumber::Type Contact::getType() const
 	return type;
 }
 
-QListWidgetItem * Contact::getItem()
-{
-	return item;
-}
-    
-QWidget * Contact::getItemWidget()
-{
-	return itemWidget;
-}
 
diff --git a/sflphone-client-kde/src/Contact.h b/sflphone-client-kde/src/Contact.h
index 383aaa688e72391c83621a22d4e5573f85fe39b4..bf4f4f987ca885bf41ebd3fcf4960b76ea49a7be 100644
--- a/sflphone-client-kde/src/Contact.h
+++ b/sflphone-client-kde/src/Contact.h
@@ -28,25 +28,26 @@
 #include <kabc/picture.h>
 #include <kabc/phonenumber.h>
 
+#include "Item.h"
+#include "ContactItemWidget.h"
+
 using namespace KABC;
 
+class ContactItemWidget;
+
 /**
 	@author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>
 */
-class Contact{
+class Contact : public QObject, public Item<ContactItemWidget>{
 private:
-	QListWidgetItem * item;
-	QWidget * itemWidget;
 	QString firstName;
 	QString secondName;
 	QString nickName;
 	QString phoneNumber;
 	Picture * photo;
 	PhoneNumber::Type type;
+	bool displayPhoto;
 	
-private:
-	void initItem(bool displayPhoto);
-
 public:
 
 	//Constructors & Destructors
@@ -60,8 +61,10 @@ public:
 	QString getSecondName() const;
 	const Picture * getPhoto() const;
 	PhoneNumber::Type getType() const;
-	QListWidgetItem * getItem();
-	QWidget * getItemWidget();
+	void initItem();
+	
+protected:
+	void initItemWidget();
 
 };
 
diff --git a/sflphone-client-kde/src/ContactItemWidget.h b/sflphone-client-kde/src/ContactItemWidget.h
index a3d4e3d41ea41fb45b28ffc8bc27b69af78bc093..517d0a78dc169411fd1e1be48584c6d53cfb3a8c 100644
--- a/sflphone-client-kde/src/ContactItemWidget.h
+++ b/sflphone-client-kde/src/ContactItemWidget.h
@@ -25,6 +25,8 @@
 #include <QtGui/QLabel>
 #include "Contact.h"
 
+class Contact;
+
 /**
 	@author Jérémy Quentin <jeremy.quentin@savoirfairelinux.com>
 */
diff --git a/sflphone-client-kde/src/Item.cpp b/sflphone-client-kde/src/Item.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..705cb2948c4eefbf44912f1b598ed4c4cf23c8d9
--- /dev/null
+++ b/sflphone-client-kde/src/Item.cpp
@@ -0,0 +1,22 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Savoir-Faire Linux                              *
+ *   Author : Jérémy Quentin                                               *
+ *   jeremy.quentin@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  *
+ *   the Free Software Foundation; either version 3 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#include "Item.h"
+
diff --git a/sflphone-client-kde/src/Item.h b/sflphone-client-kde/src/Item.h
new file mode 100644
index 0000000000000000000000000000000000000000..c859375c07cfbabc6091b52b67b13745106e99e9
--- /dev/null
+++ b/sflphone-client-kde/src/Item.h
@@ -0,0 +1,92 @@
+/***************************************************************************
+ *   Copyright (C) 2009 by Savoir-Faire Linux                              *
+ *   Author : Jérémy Quentin                                               *
+ *   jeremy.quentin@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  *
+ *   the Free Software Foundation; either version 3 of the License, or     *
+ *   (at your option) any later version.                                   *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ ***************************************************************************/
+#ifndef ITEM_H
+#define ITEM_H
+
+#include <QObject>
+#include <QListWidgetItem>
+#include <QWidget>
+
+/**
+	@author Jérémy Quentin <jeremy.quentin@gmail.com>
+	Represents an item of a list, that is displayed
+	by an QListWidgetItem with a QWidget inside.
+	The two objects are contained in this class, but their
+	initializations are pure virtual.
+	The template class WIDGET_TYPE should be derived from
+	QWidget.
+	The implementation of initItem should call initItemWidget
+*/
+template<class WIDGET_TYPE>class Item
+{
+protected:
+	QListWidgetItem * item;
+	WIDGET_TYPE * itemWidget;
+	
+
+public:
+	Item(QListWidget *list=0)
+	{
+		item = NULL;
+		itemWidget = NULL;
+	}
+	
+	/**
+	 *   Be careful that it is not already deleted by QObject
+	 *   Commented for safety reasons...
+	 */
+	virtual ~Item()
+	{
+// 		delete item;
+// 		delete itemWidget;
+	}
+	
+	QListWidgetItem * getItem()
+	{
+		return item;
+	}
+	WIDGET_TYPE * getItemWidget()
+	{
+		return itemWidget;
+	}
+	
+	const QListWidgetItem * getItem() const
+	{
+		return item;
+	}
+	const WIDGET_TYPE * getItemWidget() const
+	{
+		return itemWidget;
+	}
+	
+	/**
+	 *   Initializes the item and widget
+	 *   Implementation should call initItemWidget!
+	 */
+	virtual void initItem() = 0;
+	
+protected:
+	virtual void initItemWidget() = 0;
+	
+	
+};
+
+#endif
diff --git a/sflphone-client-kde/src/conf/dlgaccounts.cpp b/sflphone-client-kde/src/conf/dlgaccounts.cpp
index 14a2089c95045ca1188f3ebd8114c61fae839d1a..a2efb52bbb623d837d97b7d6b67e21422a8420a6 100644
--- a/sflphone-client-kde/src/conf/dlgaccounts.cpp
+++ b/sflphone-client-kde/src/conf/dlgaccounts.cpp
@@ -33,7 +33,6 @@ DlgAccounts::DlgAccounts(KConfigDialog *parent)
 	setupUi(this);
 	
 	ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
-	QStyle * style = QApplication::style();
 	button_accountUp->setIcon(KIcon("go-up"));
 	button_accountDown->setIcon(KIcon("go-down"));
 	button_accountAdd->setIcon(KIcon("list-add"));
@@ -237,7 +236,7 @@ void DlgAccounts::on_button_accountUp_clicked()
 	QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow);
 	Account * account = accountList->getAccountByItem(prevItem);
 	//we need to build a new item to set the itemWidget back
-	account->initAccountItem();
+	account->initItem();
 	QListWidgetItem * item = account->getItem();
 	AccountItemWidget * widget = account->getItemWidget();
 	accountList->upAccount(currentRow);
@@ -254,7 +253,7 @@ void DlgAccounts::on_button_accountDown_clicked()
 	QListWidgetItem * prevItem = listWidget_accountList->takeItem(currentRow);
 	Account * account = accountList->getAccountByItem(prevItem);
 	//we need to build a new item to set the itemWidget back
-	account->initAccountItem();
+	account->initItem();
 	QListWidgetItem * item = account->getItem();
 	AccountItemWidget * widget = account->getItemWidget();
 	accountList->downAccount(currentRow);
diff --git a/sflphone-client-kde/src/conf/dlgaudio.cpp b/sflphone-client-kde/src/conf/dlgaudio.cpp
index dba951041646efb354ad4631e262db625021f71c..0700c61bfb418e8ea04748dbbd78a302157c8f5d 100644
--- a/sflphone-client-kde/src/conf/dlgaudio.cpp
+++ b/sflphone-client-kde/src/conf/dlgaudio.cpp
@@ -33,8 +33,6 @@ DlgAudio::DlgAudio(KConfigDialog *parent)
 {
 	setupUi(this);
 	
-	ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
-	QStyle * style = QApplication::style();
 	KUrlRequester_ringtone->setMode(KFile::File | KFile::ExistingOnly);
 	KUrlRequester_ringtone->lineEdit()->setObjectName("kcfg_ringtone"); 
 	KUrlRequester_ringtone->lineEdit()->setReadOnly(true); 
@@ -46,12 +44,19 @@ DlgAudio::DlgAudio(KConfigDialog *parent)
 	tableWidget_codecs->setSelectionBehavior(QAbstractItemView::SelectRows);
 	
 	updateAlsaSettings();
-	connect(box_alsaPlugin,        SIGNAL(currentIndexChanged(int)),        parent, SLOT(updateButtons()));
-	connect(tableWidget_codecs,    SIGNAL(itemChanged(QTableWidgetItem *)), this,   SLOT(codecTableChanged()));
-	connect(toolButton_codecUp,    SIGNAL(clicked()),                       this,   SLOT(codecTableChanged()));
-	connect(toolButton_codecDown,  SIGNAL(clicked()),                       this,   SLOT(codecTableChanged()));
+	connect(box_alsaPlugin,        SIGNAL(currentIndexChanged(int)),   
+	        parent,                SLOT(updateButtons()));
+	connect(tableWidget_codecs,    SIGNAL(itemChanged(QTableWidgetItem *)),
+	        this,                  SLOT(codecTableChanged()));
+	connect(tableWidget_codecs,    SIGNAL(currentCellChanged(int, int, int, int)),
+	        this,                  SLOT(updateCodecListCommands()));
+	connect(toolButton_codecUp,    SIGNAL(clicked()),
+	        this,                  SLOT(codecTableChanged()));
+	connect(toolButton_codecDown,  SIGNAL(clicked()),
+	        this,                  SLOT(codecTableChanged()));
 	
-	connect(this,                  SIGNAL(updateButtons()),                 parent, SLOT(updateButtons()));
+	connect(this,                  SIGNAL(updateButtons()),
+	        parent,                SLOT(updateButtons()));
 }
 
 
@@ -76,7 +81,7 @@ void DlgAudio::updateWidgets()
 	#else
    	for (int i = 0 ; i < activeCodecList.size() ; i++)
 		{
-			if(activeCodecList.lastIndexOf(activeCodecList[i]) != i)
+			if(activeCodecList.lastIndexOf(activeCodecList[i]) != i || ! codecList.contains(activeCodecList[i]))
 			{
 				activeCodecList.removeAt(i);
 				i--;
@@ -84,14 +89,6 @@ void DlgAudio::updateWidgets()
 		}
 	#endif
 
-	for (int i=0 ; i<activeCodecList.size() ; i++)
-	{
-		if(! codecList.contains(activeCodecList[i]))
-		{
-			activeCodecList.removeAt(i);
-			i--;
-		}
-	}
 	QStringList codecListToDisplay = activeCodecList;
 	for (int i=0 ; i<codecList.size() ; i++)
 	{
@@ -210,34 +207,28 @@ void DlgAudio::updateAlsaSettings()
 
 void DlgAudio::updateCodecListCommands()
 {
+	qDebug() << "updateCodecListCommands";
 	bool buttonsEnabled[2] = {true,true};
 	if(! tableWidget_codecs->currentItem())
 	{
 		buttonsEnabled[0] = false;
 		buttonsEnabled[1] = false;
 	}
-	else if(tableWidget_codecs->currentRow() == 0)
-	{
-		buttonsEnabled[0] = false;
-	}
-	else if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1)
+	else
 	{
-		buttonsEnabled[1] = false;
+		if(tableWidget_codecs->currentRow() == 0)
+		{
+			buttonsEnabled[0] = false;
+		}
+		if(tableWidget_codecs->currentRow() == tableWidget_codecs->rowCount() - 1)
+		{
+			buttonsEnabled[1] = false;
+		}
 	}
 	toolButton_codecUp->setEnabled(buttonsEnabled[0]);
 	toolButton_codecDown->setEnabled(buttonsEnabled[1]);
 }
 
-void DlgAudio::on_tableWidget_codecs_currentCellChanged(int currentRow)
-{
-	qDebug() << "on_tableWidget_codecs_currentCellChanged";
-	int nbCol = tableWidget_codecs->columnCount();
-	for(int i = 0 ; i < nbCol ; i++)
-	{
-		tableWidget_codecs->setRangeSelected(QTableWidgetSelectionRange(currentRow, 0, currentRow, nbCol - 1), true);
-	}
-	updateCodecListCommands();
-}
 
 void DlgAudio::on_toolButton_codecUp_clicked()
 {
diff --git a/sflphone-client-kde/src/conf/dlgaudio.h b/sflphone-client-kde/src/conf/dlgaudio.h
index 15c1f8f70b26d0d6dbaf22772282e9ccd9d651b8..cad1b9ee65a39f0e20183a3616e353115d6c04a1 100644
--- a/sflphone-client-kde/src/conf/dlgaudio.h
+++ b/sflphone-client-kde/src/conf/dlgaudio.h
@@ -49,7 +49,6 @@ public slots:
 	
 private slots:
 	void updateCodecListCommands();
-	void on_tableWidget_codecs_currentCellChanged(int currentRow);
 	void on_toolButton_codecUp_clicked();
 	void on_toolButton_codecDown_clicked();
 	void codecTableChanged();
diff --git a/sflphone-client-kde/src/conf/dlgaudiobase.ui b/sflphone-client-kde/src/conf/dlgaudiobase.ui
index 08c842887c2194360655e7bf54787777bd6f6ed9..3679d8c79da33d1f7d00ba9924d287776ea97c8d 100644
--- a/sflphone-client-kde/src/conf/dlgaudiobase.ui
+++ b/sflphone-client-kde/src/conf/dlgaudiobase.ui
@@ -202,32 +202,15 @@
           <string>ALSA settings</string>
          </property>
          <layout class="QFormLayout" name="formLayout_4">
+          <property name="fieldGrowthPolicy">
+           <enum>QFormLayout::ExpandingFieldsGrow</enum>
+          </property>
           <property name="verticalSpacing">
            <number>5</number>
           </property>
           <property name="leftMargin">
            <number>9</number>
           </property>
-          <item row="3" column="0">
-           <widget class="QLabel" name="label2_in">
-            <property name="text">
-             <string>In</string>
-            </property>
-            <property name="buddy">
-             <cstring>kcfg_alsaInputDevice</cstring>
-            </property>
-           </widget>
-          </item>
-          <item row="5" column="0">
-           <widget class="QLabel" name="label3_out">
-            <property name="text">
-             <string>Out</string>
-            </property>
-            <property name="buddy">
-             <cstring>kcfg_alsaOutputDevice</cstring>
-            </property>
-           </widget>
-          </item>
           <item row="0" column="0">
            <widget class="QLabel" name="label1_alsaPugin">
             <property name="text">
@@ -245,14 +228,34 @@
             </property>
            </widget>
           </item>
-          <item row="3" column="1">
+          <item row="2" column="0">
+           <widget class="QLabel" name="label2_in">
+            <property name="text">
+             <string>In</string>
+            </property>
+            <property name="buddy">
+             <cstring>kcfg_alsaInputDevice</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="2" column="1">
            <widget class="KComboBox" name="kcfg_alsaInputDevice">
             <property name="sizeAdjustPolicy">
              <enum>QComboBox::AdjustToContents</enum>
             </property>
            </widget>
           </item>
-          <item row="5" column="1">
+          <item row="4" column="0">
+           <widget class="QLabel" name="label3_out">
+            <property name="text">
+             <string>Out</string>
+            </property>
+            <property name="buddy">
+             <cstring>kcfg_alsaOutputDevice</cstring>
+            </property>
+           </widget>
+          </item>
+          <item row="4" column="1">
            <widget class="KComboBox" name="kcfg_alsaOutputDevice">
             <property name="sizeAdjustPolicy">
              <enum>QComboBox::AdjustToContents</enum>
diff --git a/sflphone-client-kde/src/sflphone_kdeview.cpp b/sflphone-client-kde/src/sflphone_kdeview.cpp
index 3049235f1a1c6ee6c872963a1614be2b2bedd420..b40fde0d20be6596ed34ec38ea203530a8666dee 100644
--- a/sflphone-client-kde/src/sflphone_kdeview.cpp
+++ b/sflphone-client-kde/src/sflphone_kdeview.cpp
@@ -107,6 +107,8 @@ sflphone_kdeView::sflphone_kdeView(QWidget *parent)
 	        
 	connect(accountList, SIGNAL(accountListUpdated()),
 	        this,     SLOT(updateStatusMessage()));
+	connect(accountList, SIGNAL(accountListUpdated()),
+	        this,     SLOT(updateWindowCallState()));
 	        
 	accountList->updateAccounts();
 	        
@@ -163,6 +165,19 @@ Account * sflphone_kdeView::firstRegisteredAccount()
 	}
 }
 
+QString sflphone_kdeView::firstRegisteredAccountId()
+{
+	Account * firstRegistered = firstRegisteredAccount();
+	if(firstRegistered == NULL)
+	{
+		return QString();
+	}
+	else
+	{
+		return firstRegistered->getAccountId();
+	}
+}
+
 AccountList * sflphone_kdeView::getAccountList()
 {
 	return accountList;
@@ -463,7 +478,7 @@ void sflphone_kdeView::updateWindowCallState()
 		item = listWidget_callList->currentItem();
 		if (!item)
 		{
-			qDebug() << "No item selected. Updating window.";
+			qDebug() << "No item selected.";
 			enabledActions[1] = false;
 			enabledActions[2] = false;
 			enabledActions[3] = false;
@@ -479,57 +494,57 @@ void sflphone_kdeView::updateWindowCallState()
 			switch (state)
 			{
 				case CALL_STATE_INCOMING:
-					qDebug() << "Reached CALL_STATE_INCOMING with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_INCOMING with call " << (*callList)[item]->getCallId();
 					buttonIconFiles[0] = ICON_ACCEPT;
 					buttonIconFiles[1] = ICON_REFUSE;
 					actionTexts[0] = ACTION_LABEL_ACCEPT;
 					actionTexts[0] = ACTION_LABEL_REFUSE;
 					break;
 				case CALL_STATE_RINGING:
-					qDebug() << "Reached CALL_STATE_RINGING with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_RINGING with call " << (*callList)[item]->getCallId();
 					enabledActions[2] = false;
 					enabledActions[3] = false;
 					break;
 				case CALL_STATE_CURRENT:
 					qDebug() << "details = " << CallManagerInterfaceSingleton::getInstance().getCallDetails(call->getCallId()).value();
-					qDebug() << "Reached CALL_STATE_CURRENT with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_CURRENT with call " << (*callList)[item]->getCallId();
 					recordEnabled = true;
 					break;
 				case CALL_STATE_DIALING:
-					qDebug() << "Reached CALL_STATE_DIALING with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_DIALING with call " << (*callList)[item]->getCallId();
 					enabledActions[2] = false;
 					enabledActions[3] = false;
 					enabledActions[4] = false;
 					buttonIconFiles[0] = ICON_ACCEPT;
 					break;
 				case CALL_STATE_HOLD:
-					qDebug() << "Reached CALL_STATE_HOLD with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_HOLD with call " << (*callList)[item]->getCallId();
 					buttonIconFiles[2] = ICON_UNHOLD;
 					actionTexts[2] = ACTION_LABEL_UNHOLD;
 					break;		
 				case CALL_STATE_FAILURE:
-					qDebug() << "Reached CALL_STATE_FAILURE with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_FAILURE with call " << (*callList)[item]->getCallId();
 					enabledActions[0] = false;
 					enabledActions[2] = false;
 					enabledActions[3] = false;
 					enabledActions[4] = false;
 					break;
 				case CALL_STATE_BUSY:
-					qDebug() << "Reached CALL_STATE_BUSY with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_BUSY with call " << (*callList)[item]->getCallId();
 					enabledActions[0] = false;
 					enabledActions[2] = false;
 					enabledActions[3] = false;
 					enabledActions[4] = false;
 				break;
 				case CALL_STATE_TRANSFER:
-					qDebug() << "Reached CALL_STATE_TRANSFER with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_TRANSFER with call " << (*callList)[item]->getCallId();
 					buttonIconFiles[0] = ICON_EXEC_TRANSF;
 					actionTexts[3] = ACTION_LABEL_GIVE_UP_TRANSF;
 					transfer = true;
 					recordEnabled = true;
 					break;
 				case CALL_STATE_TRANSF_HOLD:
-					qDebug() << "Reached CALL_STATE_TRANSF_HOLD with call " << (*callList)[item]->getCallId() << ". Updating window.";
+					qDebug() << "Reached CALL_STATE_TRANSF_HOLD with call " << (*callList)[item]->getCallId();
 					buttonIconFiles[0] = ICON_EXEC_TRANSF;
 					buttonIconFiles[2] = ICON_UNHOLD;
 					actionTexts[3] = ACTION_LABEL_GIVE_UP_TRANSF;
@@ -553,10 +568,10 @@ void sflphone_kdeView::updateWindowCallState()
 		item = listWidget_callHistory->currentItem();
 		buttonIconFiles[0] = ICON_ACCEPT;
 		actionTexts[0] = ACTION_LABEL_CALL_BACK;
-		actionTexts[1] = ACTION_LABEL_GIVE_UP_SEARCH;
+// 		actionTexts[1] = ACTION_LABEL_GIVE_UP_SEARCH;
 		if (!item)
 		{
-			qDebug() << "No item selected. Updating window.";
+			qDebug() << "No item selected.";
 			enabledActions[0] = false;
 			enabledActions[1] = false;
 			enabledActions[2] = false;
@@ -570,19 +585,19 @@ void sflphone_kdeView::updateWindowCallState()
 			enabledActions[3] = false;
 			enabledActions[4] = false;
 		}
-		if(!lineEdit_searchHistory->text().isEmpty())
-		{
-			enabledActions[1] = true;
-		}
+// 		if(!lineEdit_searchHistory->text().isEmpty())
+// 		{
+// 			enabledActions[1] = true;
+// 		}
 	}
 	if(stackedWidget_screen->currentWidget() == page_addressBook)
 	{
 		item = listWidget_addressBook->currentItem();
 		buttonIconFiles[0] = ICON_ACCEPT;
-		actionTexts[1] = ACTION_LABEL_GIVE_UP_SEARCH;
+// 		actionTexts[1] = ACTION_LABEL_GIVE_UP_SEARCH;
 		if (!item)
 		{
-			qDebug() << "No item selected. Updating window.";
+			qDebug() << "No item selected.";
 			enabledActions[0] = false;
 			enabledActions[1] = false;
 			enabledActions[2] = false;
@@ -596,12 +611,14 @@ void sflphone_kdeView::updateWindowCallState()
 			enabledActions[3] = false;
 			enabledActions[4] = false;
 		}
-		if(!lineEdit_addressBook->text().isEmpty())
-		{
-			enabledActions[1] = true;
-		}
+// 		if(!lineEdit_addressBook->text().isEmpty())
+// 		{
+// 			enabledActions[1] = true;
+// 		}
 	}
 	
+	qDebug() << "Updating Window.";
+	
 	action_accept->setEnabled(enabledActions[0]);
 	action_refuse->setEnabled(enabledActions[1]);
 	action_hold->setEnabled(enabledActions[2]);
@@ -622,6 +639,8 @@ void sflphone_kdeView::updateWindowCallState()
 	
 	action_transfer->setChecked(transfer);
 	action_record->setChecked(recordActivated);
+
+	qDebug() << "Window updated.";
 }
 
 void sflphone_kdeView::updateSearchHistory()
@@ -1337,7 +1356,6 @@ void sflphone_kdeView::on_action_addressBook_triggered(bool checked)
 
 void sflphone_kdeView::on_action_mailBox_triggered()
 {
-	ConfigurationManagerInterface & configurationManager = ConfigurationManagerInterfaceSingleton::getInstance();
 	Account * account = firstRegisteredAccount();
 	QString mailBoxNumber = account->getAccountDetail(ACCOUNT_MAILBOX);
 	Call * call = callList->addDialingCall();
diff --git a/sflphone-client-kde/src/sflphone_kdeview.h b/sflphone-client-kde/src/sflphone_kdeview.h
index 41bdde02f89c710300c73f5ce30f2117da0db658..ddcc22354e92b93caa56d47de0e49692d7575240 100644
--- a/sflphone-client-kde/src/sflphone_kdeview.h
+++ b/sflphone-client-kde/src/sflphone_kdeview.h
@@ -97,6 +97,15 @@ public:
 	 * @return the account to use if an outgoing call is placed.
 	 */
 	static Account * firstRegisteredAccount();
+	/**
+	 *   Seeks the ID of the account to use.
+	 *   If priorAccountId is defined and the corresponding
+	 *   account exists and is registered, uses this one, else,
+	 *   asks the first registered of accountList.
+	 *   If there is no account registered, returns an empty string.
+	 * @return the ID of the account to use if an outgoing call is placed.
+	 */
+	static QString firstRegisteredAccountId();
 	
 	static AccountList * getAccountList();
 	QErrorMessage * getErrorWindow();