summaryrefslogtreecommitdiffstats
path: root/kopete/kopete/config
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbcb704366cb5e333a626c18c308c7e0448a8e69f (patch)
treef0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/kopete/config
downloadtdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.tar.gz
tdenetwork-bcb704366cb5e333a626c18c308c7e0448a8e69f.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/kopete/config')
-rw-r--r--kopete/kopete/config/Makefile.am3
-rw-r--r--kopete/kopete/config/accounts/Makefile.am18
-rw-r--r--kopete/kopete/config/accounts/kopete_accountconfig.desktop131
-rw-r--r--kopete/kopete/config/accounts/kopeteaccountconfig.cpp285
-rw-r--r--kopete/kopete/config/accounts/kopeteaccountconfig.h61
-rw-r--r--kopete/kopete/config/accounts/kopeteaccountconfigbase.ui268
-rw-r--r--kopete/kopete/config/appearance/Makefile.am20
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig.cpp870
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig.h70
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig_chatwindow.ui195
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig_colors.ui397
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig_contactlist.ui349
-rw-r--r--kopete/kopete/config/appearance/appearanceconfig_emoticons.ui214
-rw-r--r--kopete/kopete/config/appearance/kopete_appearanceconfig.desktop130
-rw-r--r--kopete/kopete/config/appearance/tooltipeditdialog.cpp226
-rw-r--r--kopete/kopete/config/appearance/tooltipeditdialog.h49
-rw-r--r--kopete/kopete/config/appearance/tooltipeditwidget.ui215
-rw-r--r--kopete/kopete/config/avdevice/Makefile.am24
-rw-r--r--kopete/kopete/config/avdevice/avdeviceconfig.cpp229
-rw-r--r--kopete/kopete/config/avdevice/avdeviceconfig.h79
-rw-r--r--kopete/kopete/config/avdevice/avdeviceconfig_videoconfig.ui624
-rw-r--r--kopete/kopete/config/avdevice/cr128-app-kopete_avdevice.pngbin0 -> 11490 bytes
-rw-r--r--kopete/kopete/config/avdevice/cr22-app-kopete_avdevice.pngbin0 -> 1167 bytes
-rw-r--r--kopete/kopete/config/avdevice/cr32-app-kopete_avdevice.pngbin0 -> 1948 bytes
-rw-r--r--kopete/kopete/config/avdevice/cr64-app-kopete_avdevice.pngbin0 -> 4793 bytes
-rw-r--r--kopete/kopete/config/avdevice/kopete_avdeviceconfig.desktop118
-rw-r--r--kopete/kopete/config/behavior/Makefile.am18
-rw-r--r--kopete/kopete/config/behavior/behaviorconfig.cpp305
-rw-r--r--kopete/kopete/config/behavior/behaviorconfig.h61
-rw-r--r--kopete/kopete/config/behavior/behaviorconfig_chat.ui308
-rw-r--r--kopete/kopete/config/behavior/behaviorconfig_events.ui388
-rw-r--r--kopete/kopete/config/behavior/behaviorconfig_general.ui211
-rw-r--r--kopete/kopete/config/behavior/kopete_behaviorconfig.desktop135
-rw-r--r--kopete/kopete/config/behavior/kopeteawayconfigbase.ui356
-rw-r--r--kopete/kopete/config/identity/Makefile.am15
-rw-r--r--kopete/kopete/config/identity/globalidentitiesmanager.cpp260
-rw-r--r--kopete/kopete/config/identity/globalidentitiesmanager.h143
-rw-r--r--kopete/kopete/config/identity/kopete_identityconfig.desktop112
-rw-r--r--kopete/kopete/config/identity/kopeteidentityconfig.cpp636
-rw-r--r--kopete/kopete/config/identity/kopeteidentityconfig.h80
-rw-r--r--kopete/kopete/config/identity/kopeteidentityconfigbase.ui541
-rw-r--r--kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfg15
-rw-r--r--kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc8
-rw-r--r--kopete/kopete/config/plugins/Makefile.am11
-rw-r--r--kopete/kopete/config/plugins/kopetepluginconfig.cpp120
-rw-r--r--kopete/kopete/config/plugins/kopetepluginconfig.h56
46 files changed, 8354 insertions, 0 deletions
diff --git a/kopete/kopete/config/Makefile.am b/kopete/kopete/config/Makefile.am
new file mode 100644
index 00000000..2e866531
--- /dev/null
+++ b/kopete/kopete/config/Makefile.am
@@ -0,0 +1,3 @@
+SUBDIRS = plugins accounts behavior appearance identity avdevice
+
+
diff --git a/kopete/kopete/config/accounts/Makefile.am b/kopete/kopete/config/accounts/Makefile.am
new file mode 100644
index 00000000..9f32e5af
--- /dev/null
+++ b/kopete/kopete/config/accounts/Makefile.am
@@ -0,0 +1,18 @@
+kopete_srcdir=$(top_srcdir)/kopete
+kopete_builddir=$(top_builddir)/kopete
+
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) $(KOPETE_COMPAT_INCLUDES) $(all_includes) -I$(kopete_srcdir)/kopete/addaccountwizard
+
+
+kde_module_LTLIBRARIES = kcm_kopete_accountconfig.la
+
+kcm_kopete_accountconfig_la_SOURCES = kopeteaccountconfigbase.ui kopeteaccountconfig.cpp
+kcm_kopete_accountconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries)
+kcm_kopete_accountconfig_la_LIBADD = ../../../libkopete/libkopete.la ../../addaccountwizard/libkopeteaddaccountwizard.la $(LIB_KOPETECOMPAT) $(LIB_KUTILS)
+
+service_DATA = kopete_accountconfig.desktop
+servicedir = $(kde_servicesdir)
+
+# vim: set noet:
+
diff --git a/kopete/kopete/config/accounts/kopete_accountconfig.desktop b/kopete/kopete/config/accounts/kopete_accountconfig.desktop
new file mode 100644
index 00000000..78ce4efe
--- /dev/null
+++ b/kopete/kopete/config/accounts/kopete_accountconfig.desktop
@@ -0,0 +1,131 @@
+[Desktop Entry]
+Icon=personal
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_accountconfig
+X-KDE-FactoryName=KopeteAccountConfigFactory
+X-KDE-ParentApp=kopete
+X-KDE-ParentComponents=kopete
+
+Name=Accounts
+Name[ar]=حسابات
+Name[be]=Рахункі
+Name[bg]=Сметки
+Name[bn]=অ্যাকাউন্ট
+Name[br]=Kontoù
+Name[bs]=Računi
+Name[ca]=Comptes
+Name[cs]=Účty
+Name[cy]=Cyfrifon
+Name[da]=Konti
+Name[de]=Zugänge
+Name[el]=Λογαριασμοί
+Name[eo]=Kontoj
+Name[es]=Cuentas
+Name[et]=Kontod
+Name[eu]=Kontuak
+Name[fa]=حسابها
+Name[fi]=Tilit
+Name[fr]=Comptes
+Name[ga]=Cuntais
+Name[gl]=Contas
+Name[he]=חשבונות
+Name[hi]=अकाउन्ट्स
+Name[hr]=Korisnički računi
+Name[hu]=Azonosítók
+Name[is]=Notandanöfn
+Name[it]=Account
+Name[ja]=アカウント
+Name[ka]=ანგარიშები
+Name[kk]=Тіркелгілер
+Name[km]=គណនី
+Name[lt]=Paskyros
+Name[mk]=Сметки
+Name[nb]=Kontoer
+Name[nds]=Kontos
+Name[ne]=खाता
+Name[nn]=Kontoar
+Name[pa]=ਖਾਤੇ
+Name[pl]=Konta
+Name[pt]=Contas
+Name[pt_BR]=Contas
+Name[ro]=Conturi
+Name[ru]=Учётные записи
+Name[se]=Kontut
+Name[sk]=Účty
+Name[sl]=Računi
+Name[sr]=Налози
+Name[sr@Latn]=Nalozi
+Name[sv]=Konton
+Name[ta]=கணக்குகள்
+Name[tg]=Ҳисоботҳо
+Name[tr]=Hesaplar
+Name[uk]=Рахунки
+Name[uz]=Hisoblar
+Name[uz@cyrillic]=Ҳисоблар
+Name[wa]=Contes
+Name[zh_CN]=账户
+Name[zh_HK]=帳號
+Name[zh_TW]=帳號
+Comment=Here You Can Manage All Your Accounts
+Comment[ar]=من هنا تستطيع إدارة جميع حساباتك
+Comment[be]=Кіраванне вашымі рахункамі
+Comment[bg]=Настройване на сметките
+Comment[bn]=আপনি এখানে আপনার অ্যাকাউন্ট পরিচালনা করতে পারেন
+Comment[bs]=Ovdje možete upravljati svim svojim računima
+Comment[ca]=Aquí podreu gestionar tots els vostres comptes
+Comment[cs]=Zde můžete spravovat veškeré své účty
+Comment[cy]=Yma Gallwch Reoli Eich Cyfrifon i Gyd
+Comment[da]=Her kan du håndtere alle dine konti
+Comment[de]=Hier können Sie Ihre Zugänge verwalten
+Comment[el]=Εδώ μπορείτε να ρυθμίσετε όλους τους λογαριασμούς σας
+Comment[es]=Gestiona todas sus cuentas
+Comment[et]=Kõigi oma kohtode haldamine
+Comment[eu]=Hemen zure kontu guztiak kudeatu ditzakezu
+Comment[fa]=اینجا می‌توانید همۀ حسابهای خود را مدیریت کنید
+Comment[fi]=Täältä voit hallita kaikkia tilejäsi
+Comment[fr]=Vous pouvez gérer vos comptes ici
+Comment[ga]=Tig leat do chuntais uile a láimhseáil anseo
+Comment[gl]=Aquí podes xestionar todas as túas contas
+Comment[he]=כאן באפשרותך לנהל את כל חשבונותיך
+Comment[hi]=यहाँ आप अपने सभी अकाउन्ट्स का प्रबंधन कर सकते हैं
+Comment[hr]=Ovde možete upravljati svim vašim korisničkim računima
+Comment[hu]=Itt lehet kezelni az azonosítókat
+Comment[is]=Hér geturðu haldið utan um öll þín notandanöfn
+Comment[it]=Qui puoi gestire tutti i tuoi account
+Comment[ja]=ここですべてのアカウントを管理します
+Comment[ka]=აქ თქვენ შეგიძლიათ ყველა ანგარიშის მართვა
+Comment[kk]=Мұнда барлық тіркелгілеріңізді басқара аласыз
+Comment[km]=ទីនេះ អ្នក​អាច​គ្រប់គ្រង​គណនី​ទាំងអស់​របស់​អ្នក
+Comment[lt]=Čia galite tvarkyti visas savo paskyras
+Comment[mk]=Тука можете да управувате со сите ваши сметки
+Comment[nb]=Rediger kontoene du har satt opp
+Comment[nds]=Hier kannst Du all Dien Kontos plegen
+Comment[ne]=यहाँ तपाईँ तपाईँको सबै खाता प्रबन्ध गर्न सक्नुहुन्छ
+Comment[nl]=Hier kunt u al uw accounts beheren
+Comment[nn]=Rediger kontoane du har sett opp
+Comment[pl]=Tutaj można zarządzać wszystkimi Twoimi kontami
+Comment[pt]=Aqui Você Pode Gerir Todas as Suas Contas
+Comment[pt_BR]=Aqui você pode gerenciar todas as suas contas
+Comment[ro]=Aici vă puteţi administra toate conturile
+Comment[ru]=Настройка учётных записей
+Comment[se]=Dáppe sáhtát gieđahallat buot iežat kontuid
+Comment[sk]=Tu môžete spravovať všetky svoje účty
+Comment[sl]=Tukaj lahko upravljate z vsemi svojimi računi
+Comment[sr]=Овде можете управљати свим вашим налозима
+Comment[sr@Latn]=Ovde možete upravljati svim vašim nalozima
+Comment[sv]=Här kan du hantera alla dina konton
+Comment[ta]=இங்கு நீங்கள் அனைத்து கணக்குகளையும் உள்ளமைக்க முடியும்
+Comment[tg]=Дар ин ҷо Шумо Ҳамаи Ҳисоботҳои худро Идора карда метавонед
+Comment[tr]=Bütün Hesaplarınız Buradan Yönetilebilir
+Comment[uk]=Тут можна керувати вашими рахунками
+Comment[uz]=Bu yerda hamma hisoblarni moslash mumkin
+Comment[uz@cyrillic]=Бу ерда ҳамма ҳисобларни мослаш мумкин
+Comment[zh_CN]=您可在此管理您全部的账户
+Comment[zh_HK]=在此您可管理您的帳號
+Comment[zh_TW]=您可以在此管理您的所有帳號
+DocPath=kopete/configure-dialog.html#configuring-accounts
+
+
diff --git a/kopete/kopete/config/accounts/kopeteaccountconfig.cpp b/kopete/kopete/config/accounts/kopeteaccountconfig.cpp
new file mode 100644
index 00000000..3d86fb8d
--- /dev/null
+++ b/kopete/kopete/config/accounts/kopeteaccountconfig.cpp
@@ -0,0 +1,285 @@
+/*
+ accountconfig.cpp - Kopete account config page
+
+ Copyright (c) 2003-2004 by Olivier Goffart <ogoffart @ kde.org>
+ Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ Kopete (c) 2003-2004 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopeteaccountconfig.h"
+
+#include <qcheckbox.h>
+#include <qlayout.h>
+#include <qguardedptr.h>
+
+#include <kcolorbutton.h>
+#include <kpushbutton.h>
+#include <kdebug.h>
+#include <kdialogbase.h>
+#include <kgenericfactory.h>
+#include <kiconloader.h>
+#include <klistview.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include "addaccountwizard.h"
+#include "editaccountwidget.h"
+#include "kopeteaccountconfigbase.h"
+#include "kopeteaccountmanager.h"
+#include "kopeteprotocol.h"
+#include "kopeteaccount.h"
+
+class KopeteAccountLVI : public KListViewItem
+{
+ public:
+ KopeteAccountLVI( Kopete::Account *a, KListView *p ) : KListViewItem( p ){ m_account = a; }
+ Kopete::Account *account() { return m_account; }
+
+ private:
+ //need to be guarded because some accounts may be linked (that's the case of jabber transports)
+ QGuardedPtr<Kopete::Account> m_account;
+};
+
+typedef KGenericFactory<KopeteAccountConfig, QWidget> KopeteAccountConfigFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_accountconfig, KopeteAccountConfigFactory( "kcm_kopete_accountconfig" ) )
+
+KopeteAccountConfig::KopeteAccountConfig( QWidget *parent, const char * /* name */, const QStringList &args )
+: KCModule( KopeteAccountConfigFactory::instance(), parent, args )
+{
+
+ ( new QVBoxLayout( this ) )->setAutoAdd( true );
+ m_view = new KopeteAccountConfigBase( this, "KopeteAccountConfig::m_view" );
+
+ m_view->mButtonUp->setIconSet( SmallIconSet( "up" ) );
+ m_view->mButtonDown->setIconSet( SmallIconSet( "down" ) );
+
+ connect( m_view->mButtonNew, SIGNAL( clicked() ), this, SLOT( slotAddAccount() ) );
+ connect( m_view->mButtonEdit, SIGNAL( clicked() ), this, SLOT( slotEditAccount() ) );
+ connect( m_view->mButtonRemove, SIGNAL( clicked() ), this, SLOT( slotRemoveAccount() ) );
+ connect( m_view->mButtonUp, SIGNAL( clicked() ), this, SLOT( slotAccountUp() ) );
+ connect( m_view->mButtonDown, SIGNAL( clicked() ), this, SLOT( slotAccountDown() ) );
+ connect( m_view->mAccountList, SIGNAL( selectionChanged() ), this, SLOT( slotItemSelected() ) );
+ connect( m_view->mAccountList, SIGNAL( doubleClicked( QListViewItem * ) ), this, SLOT( slotEditAccount() ) );
+ connect( m_view->mUseColor, SIGNAL( toggled( bool ) ), this, SLOT( slotColorChanged() ) );
+ connect( m_view->mColorButton, SIGNAL( changed( const QColor & ) ), this, SLOT( slotColorChanged() ) );
+
+ m_view->mAccountList->setSorting(-1);
+
+ setButtons( Help );
+ load();
+}
+
+void KopeteAccountConfig::save()
+{
+ uint priority = m_view->mAccountList->childCount();
+
+ KopeteAccountLVI *i = static_cast<KopeteAccountLVI*>( m_view->mAccountList->firstChild() );
+ while( i )
+ {
+ if(!i->account())
+ continue;
+ i->account()->setPriority( priority-- );
+ i = static_cast<KopeteAccountLVI*>( i->nextSibling() );
+ }
+
+ QMap<Kopete::Account *, QColor>::Iterator it;
+ for(it=m_newColors.begin() ; it != m_newColors.end() ; ++it)
+ it.key()->setColor(it.data());
+ m_newColors.clear();
+
+ Kopete::AccountManager::self()->save();
+
+ load(); //refresh the colred accounts (in case of apply)
+}
+
+void KopeteAccountConfig::load()
+{
+ KopeteAccountLVI *lvi = 0L;
+
+ m_view->mAccountList->clear();
+
+ QPtrList<Kopete::Account> accounts = Kopete::AccountManager::self()->accounts();
+ for ( Kopete::Account *i = accounts.first() ; i; i = accounts.next() )
+ {
+ // Insert the item after the previous one
+ lvi = new KopeteAccountLVI( i, m_view->mAccountList );
+ lvi->setText( 0, i->protocol()->displayName() );
+ lvi->setPixmap( 0, i->accountIcon() );
+ lvi->setText( 1, i->accountLabel() );
+ }
+
+ m_newColors.clear();
+ slotItemSelected();
+}
+
+void KopeteAccountConfig::slotItemSelected()
+{
+ m_protected=true;
+ KopeteAccountLVI *itemSelected = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+
+ m_view->mButtonEdit->setEnabled( itemSelected );
+ m_view->mButtonRemove->setEnabled( itemSelected );
+
+ if ( itemSelected && itemSelected->account() )
+ {
+ m_view->mButtonUp->setEnabled( itemSelected->itemAbove() );
+ m_view->mButtonDown->setEnabled( itemSelected->itemBelow() );
+
+ Kopete::Account *account = itemSelected->account();
+ QColor color= m_newColors.contains(account) ? m_newColors[account] : account->color();
+ m_view->mUseColor->setEnabled( true );
+ m_view->mUseColor->setChecked( color.isValid() );
+ m_view->mColorButton->setColor( color );
+ m_view->mColorButton->setEnabled( m_view->mUseColor->isChecked() );
+
+ }
+ else
+ {
+ m_view->mButtonUp->setEnabled( false );
+ m_view->mButtonDown->setEnabled( false);
+ m_view->mUseColor->setEnabled( false );
+ m_view->mColorButton->setEnabled( false );
+ }
+ m_protected=false;
+}
+
+void KopeteAccountConfig::slotAccountUp()
+{
+ KopeteAccountLVI *itemSelected = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+ if ( !itemSelected )
+ return;
+
+ if ( itemSelected->itemAbove() )
+ itemSelected->itemAbove()->moveItem( itemSelected );
+
+ slotItemSelected();
+ emit changed( true );
+}
+
+void KopeteAccountConfig::slotAccountDown()
+{
+ KopeteAccountLVI *itemSelected = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+ if ( !itemSelected )
+ return;
+
+ itemSelected->moveItem( itemSelected->itemBelow() );
+
+ slotItemSelected();
+ emit changed( true );
+}
+
+void KopeteAccountConfig::slotAddAccount()
+{
+ AddAccountWizard *m_addwizard = new AddAccountWizard( this, "addAccountWizard", true );
+ connect( m_addwizard, SIGNAL( destroyed( QObject * ) ), this, SLOT( slotAddWizardDone() ) );
+ m_addwizard->show();
+}
+
+void KopeteAccountConfig::slotEditAccount()
+{
+ KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+ if ( !lvi || !lvi->account() )
+ return;
+
+ Kopete::Account *ident = lvi->account();
+ Kopete::Protocol *proto = ident->protocol();
+
+ KDialogBase *editDialog = new KDialogBase( this, "KopeteAccountConfig::editDialog", true,
+ i18n( "Edit Account" ), KDialogBase::Ok | KDialogBase::Cancel, KDialogBase::Ok, true );
+
+ KopeteEditAccountWidget *m_accountWidget = proto->createEditAccountWidget( ident, editDialog );
+ if ( !m_accountWidget )
+ return;
+
+ // FIXME: Why the #### is EditAccountWidget not a QWidget?!? This sideways casting
+ // is braindead and error-prone. Looking at MSN the only reason I can see is
+ // because it allows direct subclassing of designer widgets. But what is
+ // wrong with embedding the designer widget in an empty QWidget instead?
+ // Also, if this REALLY has to be a pure class and not a widget, then the
+ // class should at least be renamed to EditAccountIface instead - Martijn
+ QWidget *w = dynamic_cast<QWidget *>( m_accountWidget );
+ if ( !w )
+ return;
+
+ editDialog->setMainWidget( w );
+ if ( editDialog->exec() == QDialog::Accepted )
+ {
+ if( m_accountWidget->validateData() )
+ m_accountWidget->apply();
+ }
+
+ // FIXME: Why deleteLater? It shouldn't be in use anymore at this point - Martijn
+ editDialog->deleteLater();
+ load();
+ Kopete::AccountManager::self()->save();
+}
+
+void KopeteAccountConfig::slotRemoveAccount()
+{
+ KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+ if ( !lvi || !lvi->account() )
+ return;
+
+ Kopete::Account *i = lvi->account();
+ if ( KMessageBox::warningContinueCancel( this, i18n( "Are you sure you want to remove the account \"%1\"?" ).arg( i->accountLabel() ),
+ i18n( "Remove Account" ), KGuiItem(i18n( "Remove Account" ), "editdelete"),
+ "askRemoveAccount", KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::Continue )
+ {
+ Kopete::AccountManager::self()->removeAccount( i );
+ delete lvi;
+ }
+}
+
+void KopeteAccountConfig::slotAddWizardDone()
+{
+ save();
+ load();
+}
+
+void KopeteAccountConfig::slotColorChanged()
+{
+ if(m_protected) //this slot is called because we changed the button
+ return; // color because another account has been selected
+
+ KopeteAccountLVI *lvi = static_cast<KopeteAccountLVI*>( m_view->mAccountList->selectedItem() );
+ if ( !lvi || !lvi->account() )
+ return;
+ Kopete::Account *account = lvi->account();
+
+ if(!account->color().isValid() && !m_view->mUseColor->isChecked() )
+ { //we don't use color for that account and nothing changed.
+ m_newColors.remove(account);
+ return;
+ }
+ else if(!m_view->mUseColor->isChecked())
+ { //the user disabled account coloring, but it was activated before
+ m_newColors[account]=QColor();
+ emit changed(true);
+ return;
+ }
+ else if(account->color() == m_view->mColorButton->color() )
+ { //The color has not changed.
+ m_newColors.remove(account);
+ return;
+ }
+ else
+ {
+ m_newColors[account]=m_view->mColorButton->color();
+ emit changed(true);
+ }
+}
+
+#include "kopeteaccountconfig.moc"
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/kopete/config/accounts/kopeteaccountconfig.h b/kopete/kopete/config/accounts/kopeteaccountconfig.h
new file mode 100644
index 00000000..9aec2a60
--- /dev/null
+++ b/kopete/kopete/config/accounts/kopeteaccountconfig.h
@@ -0,0 +1,61 @@
+/*
+ accountconfig.h - Kopete account config page
+
+ Copyright (c) 2003-2004 by Olivier Goffart <ogoffart @ kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef __ACCOUNTCONFIG_H
+#define __ACCOUNTCONFIG_H
+
+#include <kcmodule.h>
+#include <qmap.h>
+#include <qcolor.h>
+
+namespace Kopete
+{
+class Account;
+}
+
+class KopeteAccountConfigBase;
+
+/**
+ * @author Olivier Goffart <ogoffart @ kde.org>
+ */
+class KopeteAccountConfig : public KCModule
+{
+ Q_OBJECT
+
+public:
+ KopeteAccountConfig(QWidget *parent, const char *name, const QStringList &args );
+
+public slots:
+ virtual void save();
+ virtual void load();
+
+private:
+ KopeteAccountConfigBase *m_view;
+ QMap<Kopete::Account* , QColor> m_newColors;
+ bool m_protected;
+
+private slots:
+ void slotRemoveAccount();
+ void slotEditAccount();
+ void slotAddAccount();
+ void slotAddWizardDone();
+ void slotItemSelected();
+ void slotAccountUp();
+ void slotAccountDown();
+ void slotColorChanged();
+};
+#endif
+
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/accounts/kopeteaccountconfigbase.ui b/kopete/kopete/config/accounts/kopeteaccountconfigbase.ui
new file mode 100644
index 00000000..eea90c35
--- /dev/null
+++ b/kopete/kopete/config/accounts/kopeteaccountconfigbase.ui
@@ -0,0 +1,268 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KopeteAccountConfigBase</class>
+<author>Olivier Goffart</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KopeteAccountConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>477</width>
+ <height>316</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Manage Accounts</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <widget class="QPushButton" row="0" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>mButtonNew</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;New...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Add new account</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="1" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>mButtonEdit</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Modify...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Modify selected account</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Let you edit the account's properties.</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="2" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>mButtonRemove</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Remove selected account</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Remove selected account</string>
+ </property>
+ </widget>
+ <widget class="KListView" row="0" column="0" rowspan="8" colspan="1">
+ <column>
+ <property name="text">
+ <string>Protocol</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Account</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>mAccountList</cstring>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="4" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>mUseColor</cstring>
+ </property>
+ <property name="text">
+ <string>Use &amp;custom color</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use custom color for account</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Allows you to set a custom color for this account</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="5" column="2">
+ <property name="name">
+ <cstring>mColorButton</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Account custom color selector</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Allows you to set a custom color for this account.
+The icon of every contact of this account will be coloured with this color. Useful if you have several accounts of the same protocol</string>
+ </property>
+ </widget>
+ <spacer row="5" column="1">
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Minimum</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget" row="7" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout27</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton" row="0" column="0">
+ <property name="name">
+ <cstring>mButtonUp</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>10</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Increase the priority</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Uses these buttons to increase or decrease the priority.
+The priority is used to determine which contact to use when you click on a metacontact: Kopete will use the contact of the account with the greatest priority (if all contacts have the same online status.)</string>
+ </property>
+ </widget>
+ <spacer row="0" column="1" rowspan="2" colspan="1">
+ <property name="name">
+ <cstring>spacer41</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KPushButton" row="1" column="0">
+ <property name="name">
+ <cstring>mButtonDown</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>60</width>
+ <height>10</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Decrease the priority</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Uses these buttons to increase or decrease the priority.
+The priority is used to determine which contact to use when you click on a metacontact: Kopete will use the contact of the account with the greatest priority (if all contacts have the same online status.)</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer row="6" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>70</width>
+ <height>50</height>
+ </size>
+ </property>
+ </spacer>
+ <spacer row="3" column="1" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>70</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>mUseColor</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mColorButton</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>mAccountList</tabstop>
+ <tabstop>mButtonNew</tabstop>
+ <tabstop>mButtonEdit</tabstop>
+ <tabstop>mButtonRemove</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/appearance/Makefile.am b/kopete/kopete/config/appearance/Makefile.am
new file mode 100644
index 00000000..7e7fc8ca
--- /dev/null
+++ b/kopete/kopete/config/appearance/Makefile.am
@@ -0,0 +1,20 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private \
+ -I$(top_srcdir)/kopete/kopete/chatwindow $(KOPETE_COMPAT_INCLUDES) $(all_includes)
+
+kde_module_LTLIBRARIES = kcm_kopete_appearanceconfig.la
+
+kcm_kopete_appearanceconfig_la_SOURCES = appearanceconfig_emoticons.ui \
+ appearanceconfig_colors.ui appearanceconfig_chatwindow.ui appearanceconfig_contactlist.ui \
+ appearanceconfig.cpp tooltipeditwidget.ui tooltipeditdialog.cpp
+
+kcm_kopete_appearanceconfig_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) \
+ $(all_libraries)
+kcm_kopete_appearanceconfig_la_LIBADD = ../../../libkopete/libkopete.la \
+ ../../../kopete/chatwindow/libkopetechatwindow.la \
+ -lktexteditor $(LIB_KOPETECOMPAT) $(LIB_KUTILS) $(LIB_KNEWSTUFF)
+
+service_DATA = kopete_appearanceconfig.desktop
+servicedir = $(kde_servicesdir)
+
+# vim: set noet:
diff --git a/kopete/kopete/config/appearance/appearanceconfig.cpp b/kopete/kopete/config/appearance/appearanceconfig.cpp
new file mode 100644
index 00000000..e3867d41
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig.cpp
@@ -0,0 +1,870 @@
+/*
+ appearanceconfig.cpp - Kopete Look Feel Config
+
+ Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
+ Copyright (c) 2005-2006 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2002-2006 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "appearanceconfig.h"
+#include "appearanceconfig_emoticons.h"
+#include "appearanceconfig_chatwindow.h"
+#include "appearanceconfig_colors.h"
+#include "appearanceconfig_contactlist.h"
+
+#include "tooltipeditdialog.h"
+
+#include <qcheckbox.h>
+#include <qdir.h>
+#include <qlayout.h>
+#include <qhbuttongroup.h>
+#include <qspinbox.h>
+#include <qslider.h>
+#include <qlabel.h>
+
+#include <kdeversion.h>
+#include <kinputdialog.h>
+
+#include <kapplication.h>
+#include <kcolorcombo.h>
+#include <kcolorbutton.h>
+#include <kconfig.h> // for KNewStuff emoticon fetching
+#include <kdebug.h>
+#include <kfontrequester.h>
+#include <kgenericfactory.h>
+#include <kio/netaccess.h>
+#include <khtmlview.h>
+#include <klineedit.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kpushbutton.h>
+#include <kstandarddirs.h>
+#include <ktextedit.h>
+#include <kurl.h> // KNewStuff
+#include <kurlrequesterdlg.h>
+#include <krun.h>
+#include <kfiledialog.h>
+
+#include <knewstuff/downloaddialog.h> // knewstuff emoticon and chatwindow fetching
+#include <knewstuff/engine.h> // "
+#include <knewstuff/entry.h> // "
+#include <knewstuff/knewstuff.h> // "
+#include <knewstuff/provider.h> // "
+
+// For Kopete Chat Window Style configuration and preview.
+#include <kopetechatwindowstylemanager.h>
+#include <kopetechatwindowstyle.h>
+#include <chatmessagepart.h>
+
+// Things we fake to get the message preview to work
+#include <kopeteprotocol.h>
+#include <kopetemetacontact.h>
+#include <kopeteaccount.h>
+#include <kopetecontact.h>
+#include <kopetemessage.h>
+#include <kopetechatsession.h>
+#include <kopetechatsessionmanager.h>
+
+#include "kopeteprefs.h"
+#include "kopeteemoticons.h"
+#include "kopeteglobal.h"
+
+#include <qtabwidget.h>
+
+typedef KGenericFactory<AppearanceConfig, QWidget> KopeteAppearanceConfigFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_appearanceconfig, KopeteAppearanceConfigFactory( "kcm_kopete_appearanceconfig" ) )
+
+class FakeProtocol;
+class FakeAccount;
+class FakeContact;
+
+class AppearanceConfig::Private
+{
+public:
+ Private()
+ : mAppearanceTabCtl(0L), preview(0L), mPrfsEmoticons(0L),mPrfsChatWindow(0L),
+ mPrfsColors(0L), mPrfsContactList(0L), currentStyle(0L), loading(false),
+ styleChanged(false)
+ {}
+
+ QTabWidget *mAppearanceTabCtl;
+
+ ChatMessagePart *preview;
+ AppearanceConfig_Emoticons *mPrfsEmoticons;
+ AppearanceConfig_ChatWindow *mPrfsChatWindow;
+ AppearanceConfig_Colors *mPrfsColors;
+ AppearanceConfig_ContactList *mPrfsContactList;
+
+ // value is the style path
+ QMap<QListBoxItem*,QString> styleItemMap;
+ ChatWindowStyle::StyleVariants currentVariantMap;
+ ChatWindowStyle *currentStyle;
+ bool loading;
+ bool styleChanged;
+
+ // For style preview
+ FakeProtocol *previewProtocol;
+ FakeAccount *previewAccount;
+ Kopete::MetaContact *myselfMetaContact;
+ Kopete::MetaContact *jackMetaContact;
+ FakeContact *myself;
+ FakeContact *jack;
+ Kopete::ChatSession *previewChatSession;
+};
+
+class KopeteStyleNewStuff : public KNewStuff
+{
+public:
+ KopeteStyleNewStuff(const QString &type, QWidget *parentWidget = 0)
+ : KNewStuff( type, parentWidget)
+ {}
+
+ bool createUploadFile(const QString &)
+ {
+ return false;
+ }
+
+ bool install(const QString &styleFilename)
+ {
+ int styleInstallReturn = 0;
+ styleInstallReturn = ChatWindowStyleManager::self()->installStyle( styleFilename );
+
+ switch(styleInstallReturn)
+ {
+ case ChatWindowStyleManager::StyleInstallOk:
+ {
+ KMessageBox::queuedMessageBox( this->parentWidget(), KMessageBox::Information, i18n("The Chat Window style was successfully installed."), i18n("Install successful") );
+ return true;
+ }
+ case ChatWindowStyleManager::StyleCannotOpen:
+ {
+ KMessageBox::queuedMessageBox( this->parentWidget(), KMessageBox::Error, i18n("The specified archive cannot be opened.\nMake sure that the archive is valid ZIP or TAR archive."), i18n("Cannot open archive") );
+ break;
+ }
+ case ChatWindowStyleManager::StyleNoDirectoryValid:
+ {
+ KMessageBox::queuedMessageBox( this->parentWidget(), KMessageBox::Error, i18n("Could not find a suitable place to install the Chat Window style in user directory."), i18n("Cannot find styles directory") );
+ break;
+ }
+ case ChatWindowStyleManager::StyleNotValid:
+ {
+ KMessageBox::queuedMessageBox( this->parentWidget(), KMessageBox::Error, i18n("The specified archive does not contain a valid Chat Window style."), i18n("Invalid Style") );
+ break;
+ }
+
+ case ChatWindowStyleManager::StyleUnknow:
+ default:
+ {
+ KMessageBox::queuedMessageBox( this->parentWidget(), KMessageBox::Error, i18n("An unknow error occurred while trying to install the Chat Window style."), i18n("Unknow error") );
+ break;
+ }
+ }
+ return false;
+ }
+};
+
+// TODO: Someday, this configuration dialog must(not should) use KConfigXT
+AppearanceConfig::AppearanceConfig(QWidget *parent, const char* /*name*/, const QStringList &args )
+: KCModule( KopeteAppearanceConfigFactory::instance(), parent, args )
+{
+ d = new Private;
+
+ (new QVBoxLayout(this))->setAutoAdd(true);
+ d->mAppearanceTabCtl = new QTabWidget(this, "mAppearanceTabCtl");
+
+ KConfig *config = KGlobal::config();
+ config->setGroup( "ChatWindowSettings" );
+
+ // "Emoticons" TAB ==========================================================
+ d->mPrfsEmoticons = new AppearanceConfig_Emoticons(d->mAppearanceTabCtl);
+ connect(d->mPrfsEmoticons->chkUseEmoticons, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsEmoticons->chkRequireSpaces, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsEmoticons->icon_theme_list, SIGNAL(selectionChanged()),
+ this, SLOT(slotSelectedEmoticonsThemeChanged()));
+ connect(d->mPrfsEmoticons->btnInstallTheme, SIGNAL(clicked()),
+ this, SLOT(installEmoticonTheme()));
+
+ connect(d->mPrfsEmoticons->btnGetThemes, SIGNAL(clicked()),
+ this, SLOT(slotGetEmoticonThemes()));
+ connect(d->mPrfsEmoticons->btnRemoveTheme, SIGNAL(clicked()),
+ this, SLOT(removeSelectedEmoticonTheme()));
+
+ d->mAppearanceTabCtl->addTab(d->mPrfsEmoticons, i18n("&Emoticons"));
+
+ // "Chat Window" TAB ========================================================
+ d->mPrfsChatWindow = new AppearanceConfig_ChatWindow(d->mAppearanceTabCtl);
+
+ connect(d->mPrfsChatWindow->styleList, SIGNAL(selectionChanged(QListBoxItem *)),
+ this, SLOT(slotChatStyleSelected()));
+ connect(d->mPrfsChatWindow->variantList, SIGNAL(activated(const QString&)),
+ this, SLOT(slotChatStyleVariantSelected(const QString &)));
+ connect(d->mPrfsChatWindow->deleteButton, SIGNAL(clicked()),
+ this, SLOT(slotDeleteChatStyle()));
+ connect(d->mPrfsChatWindow->installButton, SIGNAL(clicked()),
+ this, SLOT(slotInstallChatStyle()));
+ connect(d->mPrfsChatWindow->btnGetStyles, SIGNAL(clicked()),
+ this, SLOT(slotGetChatStyles()));
+ connect(d->mPrfsChatWindow->groupConsecutiveMessages, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ // Show the available styles when the Manager has finish to load the styles.
+ connect(ChatWindowStyleManager::self(), SIGNAL(loadStylesFinished()), this, SLOT(slotLoadChatStyles()));
+
+ d->mPrfsChatWindow->htmlFrame->setFrameStyle(QFrame::WinPanel | QFrame::Sunken);
+ // Create the fake Chat Session
+ createPreviewChatSession();
+ QVBoxLayout *l = new QVBoxLayout(d->mPrfsChatWindow->htmlFrame);
+ d->preview = new ChatMessagePart(d->previewChatSession, d->mPrfsChatWindow->htmlFrame, "preview");
+ d->preview->setJScriptEnabled(false);
+ d->preview->setJavaEnabled(false);
+ d->preview->setPluginsEnabled(false);
+ d->preview->setMetaRefreshEnabled(false);
+ KHTMLView *htmlWidget = d->preview->view();
+ htmlWidget->setMarginWidth(4);
+ htmlWidget->setMarginHeight(4);
+ htmlWidget->setFocusPolicy(NoFocus);
+ htmlWidget->setSizePolicy(
+ QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding));
+ l->addWidget(htmlWidget);
+ // Add the preview message to the ChatMessagePart
+ createPreviewMessages();
+
+ d->mAppearanceTabCtl->addTab( d->mPrfsChatWindow, i18n("Chat Window") );
+
+ // "Contact List" TAB =======================================================
+ d->mPrfsContactList = new AppearanceConfig_ContactList(d->mAppearanceTabCtl);
+ connect(d->mPrfsContactList->mTreeContactList, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mSortByGroup, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mEditTooltips, SIGNAL(clicked()),
+ this, SLOT(slotEditTooltips()));
+ connect(d->mPrfsContactList->mIndentContacts, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mDisplayMode, SIGNAL(clicked(int)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mIconMode, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mAnimateChanges, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mFadeVisibility, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mFoldVisibility, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mAutoHide, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsContactList->mAutoHideTimeout, SIGNAL(valueChanged(int)),
+ this, SLOT(emitChanged()));
+
+ // don't enable the checkbox if XRender is not available
+ #ifdef HAVE_XRENDER
+ d->mPrfsContactList->mFadeVisibility->setEnabled(true);
+ #else
+ d->mPrfsContactList->mFadeVisibility->setEnabled(false);
+ #endif
+
+ d->mAppearanceTabCtl->addTab(d->mPrfsContactList, i18n("Contact List"));
+
+ // "Colors and Fonts" TAB ===================================================
+ d->mPrfsColors = new AppearanceConfig_Colors(d->mAppearanceTabCtl);
+ connect(d->mPrfsColors->foregroundColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(slotHighlightChanged()));
+ connect(d->mPrfsColors->backgroundColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(slotHighlightChanged()));
+ connect(d->mPrfsColors->fontFace, SIGNAL(fontSelected(const QFont &)),
+ this, SLOT(slotChangeFont()));
+ connect(d->mPrfsColors->textColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(slotUpdateChatPreview()));
+ connect(d->mPrfsColors->bgColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(slotUpdateChatPreview()));
+ connect(d->mPrfsColors->linkColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(slotUpdateChatPreview()));
+ connect(d->mPrfsColors->mGreyIdleMetaContacts, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->idleContactColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mUseCustomFonts, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mSmallFont, SIGNAL(fontSelected(const QFont &)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mNormalFont, SIGNAL(fontSelected(const QFont &)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mGroupNameColor, SIGNAL(changed(const QColor &)),
+ this, SLOT(emitChanged()));
+
+ connect(d->mPrfsColors->mBgOverride, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mFgOverride, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+ connect(d->mPrfsColors->mRtfOverride, SIGNAL(toggled(bool)),
+ this, SLOT(emitChanged()));
+
+ d->mAppearanceTabCtl->addTab(d->mPrfsColors, i18n("Colors && Fonts"));
+
+ // ==========================================================================
+
+ load();
+}
+
+AppearanceConfig::~AppearanceConfig()
+{
+ delete d;
+}
+
+void AppearanceConfig::updateEmoticonsButton(bool _b)
+{
+ QString themeName = d->mPrfsEmoticons->icon_theme_list->currentText();
+ QFileInfo fileInf(KGlobal::dirs()->findResource("emoticons", themeName+"/"));
+ d->mPrfsEmoticons->btnRemoveTheme->setEnabled( _b && fileInf.isWritable());
+ d->mPrfsEmoticons->btnGetThemes->setEnabled( false );
+}
+
+void AppearanceConfig::save()
+{
+// kdDebug(14000) << k_funcinfo << "called." << endl;
+ KopetePrefs *p = KopetePrefs::prefs();
+
+ // "Emoticons" TAB ==========================================================
+ p->setIconTheme( d->mPrfsEmoticons->icon_theme_list->currentText() );
+ p->setUseEmoticons ( d->mPrfsEmoticons->chkUseEmoticons->isChecked() );
+ p->setEmoticonsRequireSpaces( d->mPrfsEmoticons->chkRequireSpaces->isChecked() );
+
+ // "Chat Window" TAB ========================================================
+ p->setGroupConsecutiveMessages( d->mPrfsChatWindow->groupConsecutiveMessages->isChecked() );
+
+ // Get the stylePath
+ if(d->currentStyle)
+ {
+ kdDebug(14000) << k_funcinfo << d->currentStyle->getStylePath() << endl;
+ p->setStylePath(d->currentStyle->getStylePath());
+ }
+ // Get and save the styleVariant
+ if( !d->currentVariantMap.empty() )
+ {
+ kdDebug(14000) << k_funcinfo << d->currentVariantMap[ d->mPrfsChatWindow->variantList->currentText()] << endl;
+ p->setStyleVariant(d->currentVariantMap[ d->mPrfsChatWindow->variantList->currentText()]);
+ }
+
+ // "Contact List" TAB =======================================================
+ p->setTreeView(d->mPrfsContactList->mTreeContactList->isChecked());
+ p->setSortByGroup(d->mPrfsContactList->mSortByGroup->isChecked());
+ p->setContactListIndentContacts(d->mPrfsContactList->mIndentContacts->isChecked());
+ p->setContactListDisplayMode(KopetePrefs::ContactDisplayMode(d->mPrfsContactList->mDisplayMode->selectedId()));
+ p->setContactListIconMode(KopetePrefs::IconDisplayMode((d->mPrfsContactList->mIconMode->isChecked()) ? KopetePrefs::PhotoPic : KopetePrefs::IconPic));
+ p->setContactListAnimation(d->mPrfsContactList->mAnimateChanges->isChecked());
+ p->setContactListFading(d->mPrfsContactList->mFadeVisibility->isChecked());
+ p->setContactListFolding(d->mPrfsContactList->mFoldVisibility->isChecked());
+
+ // "Colors & Fonts" TAB =====================================================
+ p->setHighlightBackground(d->mPrfsColors->backgroundColor->color());
+ p->setHighlightForeground(d->mPrfsColors->foregroundColor->color());
+ p->setBgColor(d->mPrfsColors->bgColor->color());
+ p->setTextColor(d->mPrfsColors->textColor->color());
+ p->setLinkColor(d->mPrfsColors->linkColor->color());
+ p->setFontFace(d->mPrfsColors->fontFace->font());
+ p->setIdleContactColor(d->mPrfsColors->idleContactColor->color());
+ p->setGreyIdleMetaContacts(d->mPrfsColors->mGreyIdleMetaContacts->isChecked());
+ p->setContactListUseCustomFonts(d->mPrfsColors->mUseCustomFonts->isChecked());
+ p->setContactListCustomSmallFont(d->mPrfsColors->mSmallFont->font());
+ p->setContactListCustomNormalFont(d->mPrfsColors->mNormalFont->font());
+ p->setContactListGroupNameColor(d->mPrfsColors->mGroupNameColor->color());
+ p->setContactListAutoHide(d->mPrfsContactList->mAutoHide->isChecked());
+ p->setContactListAutoHideTimeout(d->mPrfsContactList->mAutoHideTimeout->value());
+
+ p->setBgOverride( d->mPrfsColors->mBgOverride->isChecked() );
+ p->setFgOverride( d->mPrfsColors->mFgOverride->isChecked() );
+ p->setRtfOverride( d->mPrfsColors->mRtfOverride->isChecked() );
+
+ p->save();
+ d->styleChanged = false;
+}
+
+void AppearanceConfig::load()
+{
+ //we will change the state of somme controls, which will call some signals.
+ //so to don't refresh everything several times, we memorize we are loading.
+ d->loading=true;
+
+// kdDebug(14000) << k_funcinfo << "called" << endl;
+ KopetePrefs *p = KopetePrefs::prefs();
+
+ // "Emoticons" TAB ==========================================================
+ updateEmoticonlist();
+ d->mPrfsEmoticons->chkUseEmoticons->setChecked( p->useEmoticons() );
+ d->mPrfsEmoticons->chkRequireSpaces->setChecked( p->emoticonsRequireSpaces() );
+
+ // "Chat Window" TAB ========================================================
+ d->mPrfsChatWindow->groupConsecutiveMessages->setChecked( p->groupConsecutiveMessages() );
+ // Look for avaiable chat window styles.
+ slotLoadChatStyles();
+
+ // "Contact List" TAB =======================================================
+ d->mPrfsContactList->mTreeContactList->setChecked( p->treeView() );
+ d->mPrfsContactList->mSortByGroup->setChecked( p->sortByGroup() );
+ d->mPrfsContactList->mIndentContacts->setChecked( p->contactListIndentContacts() );
+
+ // convert old single value display mode to dual display/icon modes
+ if (p->contactListDisplayMode() == KopetePrefs::Yagami) {
+ p->setContactListDisplayMode( KopetePrefs::Detailed);
+ p->setContactListIconMode( KopetePrefs::PhotoPic );
+ }
+
+ d->mPrfsContactList->mDisplayMode->setButton( p->contactListDisplayMode() );
+ d->mPrfsContactList->mIconMode->setChecked( p->contactListIconMode() == KopetePrefs::PhotoPic);
+
+
+ d->mPrfsContactList->mAnimateChanges->setChecked( p->contactListAnimation() );
+#ifdef HAVE_XRENDER
+ d->mPrfsContactList->mFadeVisibility->setChecked( p->contactListFading() );
+#else
+ d->mPrfsContactList->mFadeVisibility->setChecked( false );
+#endif
+ d->mPrfsContactList->mFoldVisibility->setChecked( p->contactListFolding() );
+ d->mPrfsContactList->mAutoHide->setChecked( p->contactListAutoHide() );
+ d->mPrfsContactList->mAutoHideTimeout->setValue( p->contactListAutoHideTimeout() );
+
+ // "Colors & Fonts" TAB =====================================================
+ d->mPrfsColors->foregroundColor->setColor(p->highlightForeground());
+ d->mPrfsColors->backgroundColor->setColor(p->highlightBackground());
+ d->mPrfsColors->textColor->setColor(p->textColor());
+ d->mPrfsColors->linkColor->setColor(p->linkColor());
+ d->mPrfsColors->bgColor->setColor(p->bgColor());
+ d->mPrfsColors->fontFace->setFont(p->fontFace());
+ d->mPrfsColors->mGreyIdleMetaContacts->setChecked(p->greyIdleMetaContacts());
+ d->mPrfsColors->idleContactColor->setColor(p->idleContactColor());
+ d->mPrfsColors->mUseCustomFonts->setChecked(p->contactListUseCustomFonts());
+ d->mPrfsColors->mSmallFont->setFont(p->contactListCustomSmallFont());
+ d->mPrfsColors->mNormalFont->setFont(p->contactListCustomNormalFont());
+ d->mPrfsColors->mGroupNameColor->setColor(p->contactListGroupNameColor());
+
+ d->mPrfsColors->mBgOverride->setChecked( p->bgOverride() );
+ d->mPrfsColors->mFgOverride->setChecked( p->fgOverride() );
+ d->mPrfsColors->mRtfOverride->setChecked( p->rtfOverride() );
+
+ d->loading=false;
+ slotUpdateChatPreview();
+}
+
+void AppearanceConfig::slotLoadChatStyles()
+{
+ d->mPrfsChatWindow->styleList->clear();
+ d->styleItemMap.clear();
+
+ ChatWindowStyleManager::StyleList availableStyles;
+ availableStyles = ChatWindowStyleManager::self()->getAvailableStyles();
+ if( availableStyles.empty() )
+ kdDebug(14000) << k_funcinfo << "Warning, available styles is empty !" << endl;
+
+ ChatWindowStyleManager::StyleList::ConstIterator it, itEnd = availableStyles.constEnd();
+ for(it = availableStyles.constBegin(); it != itEnd; ++it)
+ {
+ // Insert style name into the listbox
+ d->mPrfsChatWindow->styleList->insertItem( it.key(), 0 );
+ // Insert the style class into the internal map for futher acces.
+ d->styleItemMap.insert( d->mPrfsChatWindow->styleList->firstItem(), it.data() );
+
+ if( it.data() == KopetePrefs::prefs()->stylePath() )
+ {
+ kdDebug(14000) << k_funcinfo << "Restoring saved style: " << it.key() << endl;
+
+ d->mPrfsChatWindow->styleList->setSelected( d->mPrfsChatWindow->styleList->firstItem(), true );
+ }
+ }
+
+ d->mPrfsChatWindow->styleList->sort();
+}
+
+void AppearanceConfig::updateEmoticonlist()
+{
+ KopetePrefs *p = KopetePrefs::prefs();
+ KStandardDirs dir;
+
+ d->mPrfsEmoticons->icon_theme_list->clear(); // Wipe out old list
+ // Get a list of directories in our icon theme dir
+ QStringList themeDirs = KGlobal::dirs()->findDirs("emoticons", "");
+ // loop adding themes from all dirs into theme-list
+ for(unsigned int x = 0;x < themeDirs.count();x++)
+ {
+ QDir themeQDir(themeDirs[x]);
+ themeQDir.setFilter( QDir::Dirs ); // only scan for subdirs
+ themeQDir.setSorting( QDir::Name ); // I guess name is as good as any
+ for(unsigned int y = 0; y < themeQDir.count(); y++)
+ {
+ QStringList themes = themeQDir.entryList(QDir::Dirs, QDir::Name);
+ // We don't care for '.' and '..'
+ if ( themeQDir[y] != "." && themeQDir[y] != ".." )
+ {
+ // Add ourselves to the list, using our directory name FIXME: use the first emoticon of the theme.
+ QPixmap previewPixmap = QPixmap(locate("emoticons", themeQDir[y]+"/smile.png"));
+ d->mPrfsEmoticons->icon_theme_list->insertItem(previewPixmap,themeQDir[y]);
+ }
+ }
+ }
+
+ // Where is that theme in our big-list-o-themes?
+ QListBoxItem *item = d->mPrfsEmoticons->icon_theme_list->findItem( p->iconTheme() );
+
+ if (item) // found it... make it the currently selected theme
+ d->mPrfsEmoticons->icon_theme_list->setCurrentItem( item );
+ else // Er, it's not there... select the current item
+ d->mPrfsEmoticons->icon_theme_list->setCurrentItem( 0 );
+}
+
+void AppearanceConfig::slotSelectedEmoticonsThemeChanged()
+{
+ QString themeName = d->mPrfsEmoticons->icon_theme_list->currentText();
+ QFileInfo fileInf(KGlobal::dirs()->findResource("emoticons", themeName+"/"));
+ d->mPrfsEmoticons->btnRemoveTheme->setEnabled( fileInf.isWritable() );
+
+ Kopete::Emoticons emoticons( themeName );
+ QStringList smileys = emoticons.emoticonAndPicList().keys();
+ QString newContentText = "<qt>";
+
+ for(QStringList::Iterator it = smileys.begin(); it != smileys.end(); ++it )
+ newContentText += QString::fromLatin1("<img src=\"%1\"> ").arg(*it);
+
+ newContentText += QString::fromLatin1("</qt>");
+ d->mPrfsEmoticons->icon_theme_preview->setText(newContentText);
+ emitChanged();
+}
+
+void AppearanceConfig::slotHighlightChanged()
+{
+// bool value = mPrfsChatWindow->highlightEnabled->isChecked();
+// mPrfsChatWindow->foregroundColor->setEnabled ( value );
+// mPrfsChatWindow->backgroundColor->setEnabled ( value );
+ slotUpdateChatPreview();
+}
+
+void AppearanceConfig::slotChangeFont()
+{
+ slotUpdateChatPreview();
+ emitChanged();
+}
+
+void AppearanceConfig::slotChatStyleSelected()
+{
+ // Retrieve variant list.
+ QString stylePath = d->styleItemMap[d->mPrfsChatWindow->styleList->selectedItem()];
+ d->currentStyle = ChatWindowStyleManager::self()->getStyleFromPool( stylePath );
+
+ if(d->currentStyle)
+ {
+ d->currentVariantMap = d->currentStyle->getVariants();
+ kdDebug(14000) << k_funcinfo << "Loading style: " << d->currentStyle->getStylePath() << endl;
+
+ // Update the variant list based on current style.
+ d->mPrfsChatWindow->variantList->clear();
+
+ // Add the no variant item to the list
+ // TODO: Use default name variant from Info.plist
+ // TODO: Select default variant from Info.plist
+ d->mPrfsChatWindow->variantList->insertItem( i18n("(No Variant)") );
+
+ ChatWindowStyle::StyleVariants::ConstIterator it, itEnd = d->currentVariantMap.constEnd();
+ int currentIndex = 0;
+ for(it = d->currentVariantMap.constBegin(); it != itEnd; ++it)
+ {
+ // Insert variant name into the combobox.
+ d->mPrfsChatWindow->variantList->insertItem( it.key() );
+
+ if( it.data() == KopetePrefs::prefs()->styleVariant() )
+ d->mPrfsChatWindow->variantList->setCurrentItem(currentIndex+1);
+
+ currentIndex++;
+ }
+
+ // Update the preview
+ slotUpdateChatPreview();
+ // Get the first variant to preview
+ // Check if the current style has variants.
+ if( !d->currentVariantMap.empty() )
+ d->preview->setStyleVariant(d->currentVariantMap[0]);
+
+ emitChanged();
+ }
+}
+
+void AppearanceConfig::slotChatStyleVariantSelected(const QString &variantName)
+{
+// kdDebug(14000) << k_funcinfo << variantName << endl;
+// kdDebug(14000) << k_funcinfo << d->currentVariantMap[variantName] << endl;
+
+ // Update the preview
+ d->preview->setStyleVariant(d->currentVariantMap[variantName]);
+ emitChanged();
+}
+
+void AppearanceConfig::slotInstallChatStyle()
+{
+ KURL styleToInstall = KFileDialog::getOpenURL( QString::null, QString::fromUtf8("application/x-zip application/x-tgz application/x-tbz"), this, i18n("Choose Chat Window style to install.") );
+
+ if( !styleToInstall.isEmpty() )
+ {
+ QString stylePath;
+ if( KIO::NetAccess::download( styleToInstall, stylePath, this ) )
+ {
+ int styleInstallReturn = 0;
+ styleInstallReturn = ChatWindowStyleManager::self()->installStyle( stylePath );
+ switch(styleInstallReturn)
+ {
+ case ChatWindowStyleManager::StyleCannotOpen:
+ {
+ KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("The specified archive cannot be opened.\nMake sure that the archive is valid ZIP or TAR archive."), i18n("Can't open archive") );
+ break;
+ }
+ case ChatWindowStyleManager::StyleNoDirectoryValid:
+ {
+ KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("Could not find a suitable place to install the Chat Window style in user directory."), i18n("Can't find styles directory") );
+ break;
+ }
+ case ChatWindowStyleManager::StyleNotValid:
+ KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("The specified archive does not contain a valid Chat Window style."), i18n("Invalid Style") );
+ break;
+ case ChatWindowStyleManager::StyleInstallOk:
+ {
+ KMessageBox::queuedMessageBox( this, KMessageBox::Information, i18n("The Chat Window style was successfully installed."), i18n("Install successful") );
+ break;
+ }
+ case ChatWindowStyleManager::StyleUnknow:
+ default:
+ {
+ KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("An unknow error occurred while trying to install the Chat Window style."), i18n("Unknow error") );
+ break;
+ }
+ }
+
+ // removeTempFile check if the file is a temp file, so it's ok for local files.
+ KIO::NetAccess::removeTempFile( stylePath );
+ }
+ }
+}
+
+void AppearanceConfig::slotDeleteChatStyle()
+{
+ QString styleName = d->mPrfsChatWindow->styleList->selectedItem()->text();
+ QString stylePathToDelete = d->styleItemMap[d->mPrfsChatWindow->styleList->selectedItem()];
+ if( ChatWindowStyleManager::self()->removeStyle(stylePathToDelete) )
+ {
+ KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18n("It's the deleted style name", "The style %1 was successfully deleted.").arg(styleName));
+
+ // Get the first item in the stye List.
+ QString stylePath = (*d->styleItemMap.begin());
+ d->currentStyle = ChatWindowStyleManager::self()->getStyleFromPool(stylePath);
+ emitChanged();
+ }
+ else
+ {
+ KMessageBox::queuedMessageBox(this, KMessageBox::Information, i18n("It's the deleted style name", "An error occured while trying to delete %1 style.").arg(styleName));
+ }
+}
+
+void AppearanceConfig::slotGetChatStyles()
+{
+ // we need this because KNewStuffGeneric's install function isn't clever enough
+ KopeteStyleNewStuff *kopeteNewStuff = new KopeteStyleNewStuff( "kopete/chatstyle", this );
+ KNS::Engine *engine = new KNS::Engine( kopeteNewStuff, "kopete/chatstyle", this );
+ KNS::DownloadDialog *downloadDialog = new KNS::DownloadDialog( engine, this );
+ downloadDialog->setType( "kopete/chatstyle" );
+ // you have to do this by hand when providing your own Engine
+ KNS::ProviderLoader *provider = new KNS::ProviderLoader( this );
+ QObject::connect( provider, SIGNAL( providersLoaded(Provider::List*) ), downloadDialog, SLOT( slotProviders (Provider::List *) ) );
+ provider->load( "kopete/chatstyle", "http://download.kde.org/khotnewstuff/kopetestyles12-providers.xml" );
+ downloadDialog->exec();
+}
+
+// Reimplement Kopete::Contact and its abstract method
+// This is for style preview.
+class FakeContact : public Kopete::Contact
+{
+public:
+ FakeContact (Kopete::Account *account, const QString &id, Kopete::MetaContact *mc ) : Kopete::Contact( account, id, mc ) {}
+ virtual Kopete::ChatSession *manager(Kopete::Contact::CanCreateFlags /*c*/) { return 0L; }
+ virtual void slotUserInfo() {};
+};
+
+// This is for style preview.
+class FakeProtocol : public Kopete::Protocol
+{
+public:
+FakeProtocol( KInstance *instance, QObject *parent, const char *name ) : Kopete::Protocol(instance, parent, name){}
+Kopete::Account* createNewAccount( const QString &/*accountId*/ ){return 0L;}
+AddContactPage* createAddContactWidget( QWidget */*parent*/, Kopete::Account */*account*/){return 0L;}
+KopeteEditAccountWidget* createEditAccountWidget( Kopete::Account */*account*/, QWidget */*parent */){return 0L;}
+};
+
+// This is for style preview.
+class FakeAccount : public Kopete::Account
+{
+public:
+FakeAccount(Kopete::Protocol *parent, const QString &accountID, const char *name) : Kopete::Account(parent, accountID, name){}
+~FakeAccount()
+{}
+bool createContact( const QString &/*contactId*/, Kopete::MetaContact */*parentContact*/ ){return true;}
+void connect( const Kopete::OnlineStatus& /*initialStatus*/){}
+void disconnect(){}
+void setOnlineStatus( const Kopete::OnlineStatus& /*status*/ , const QString &/*reason*/){}
+};
+
+void AppearanceConfig::createPreviewChatSession()
+{
+ d->previewProtocol = new FakeProtocol( new KInstance(QCString("kopete-preview-chatwindowstyle")), 0L, "kopete-preview-chatwindowstyle");
+ d->previewAccount = new FakeAccount(d->previewProtocol, QString("previewaccount"), 0);
+
+ // Create fake meta/contacts
+ d->myselfMetaContact = new Kopete::MetaContact();
+ d->myself = new FakeContact(d->previewAccount, i18n("This is the myself preview contact id", "myself@preview"), d->myselfMetaContact);
+ d->myself->setNickName(i18n("This is the myself preview contact nickname", "Myself"));
+ d->jackMetaContact = new Kopete::MetaContact();
+ d->jack = new FakeContact(d->previewAccount, i18n("This is the other preview contact id", "jack@preview"), d->jackMetaContact);
+ d->jack->setNickName(i18n("This is the other preview contact nickname", "Jack"));
+ d->myselfMetaContact->setDisplayName(i18n("Myself"));
+ d->myselfMetaContact->setDisplayNameSource(Kopete::MetaContact::SourceCustom);
+ d->jackMetaContact->setDisplayName(i18n("Jack"));
+ d->jackMetaContact->setDisplayNameSource(Kopete::MetaContact::SourceCustom);
+
+ Kopete::ContactPtrList contactList;
+ contactList.append(d->jack);
+ // Create fakeChatSession
+ d->previewChatSession = Kopete::ChatSessionManager::self()->create(d->myself, contactList, 0);
+ d->previewChatSession->setDisplayName("Preview Session");
+}
+
+void AppearanceConfig::createPreviewMessages()
+{
+ Kopete::Message msgIn( d->jack,d->myself, i18n( "Hello, this is an incoming message :-)" ), Kopete::Message::Inbound );
+ Kopete::Message msgIn2( d->jack, d->myself, i18n( "Hello, this is an incoming consecutive message." ), Kopete::Message::Inbound );
+
+ Kopete::Message msgOut( d->myself, d->jack, i18n( "Ok, this is an outgoing message" ), Kopete::Message::Outbound );
+ Kopete::Message msgOut2( d->myself, d->jack, i18n( "Ok, a outgoing consecutive message." ), Kopete::Message::Outbound );
+
+ Kopete::Message msgCol( d->jack, d->myself, i18n( "Here is an incoming colored message" ), Kopete::Message::Inbound );
+ msgCol.setFg( QColor( "DodgerBlue" ) );
+ msgCol.setBg( QColor( "LightSteelBlue" ) );
+ Kopete::Message msgInt( d->jack, d->myself, i18n( "This is an internal message" ), Kopete::Message::Internal );
+ Kopete::Message msgAct( d->jack, d->myself, i18n( "performed an action" ), Kopete::Message::Inbound,
+ Kopete::Message::PlainText, QString::null, Kopete::Message::TypeAction );
+ Kopete::Message msgHigh( d->jack, d->myself, i18n( "This is a highlighted message" ), Kopete::Message::Inbound );
+ msgHigh.setImportance( Kopete::Message::Highlight );
+ // This is a UTF-8 string btw.
+ Kopete::Message msgRightToLeft(d->myself, d->jack, i18n("This special UTF-8 string is to test if the style support Right-to-Left language display.", "הודעות טקסט"), Kopete::Message::Outbound);
+ Kopete::Message msgExplanation( d->myself, d->jack, i18n( "That message was in a Right-to-Left language, which Kopete also supports." ), Kopete::Message::Outbound );
+ Kopete::Message msgBye ( d->myself, d->jack, i18n( "Bye" ), Kopete::Message::Outbound );
+
+ // Add the messages to ChatMessagePart
+ d->preview->appendMessage(msgIn);
+ d->preview->appendMessage(msgIn2);
+ d->preview->appendMessage(msgOut);
+ d->preview->appendMessage(msgOut2);
+ d->preview->appendMessage(msgCol);
+ d->preview->appendMessage(msgInt);
+ d->preview->appendMessage(msgAct);
+ d->preview->appendMessage(msgHigh);
+ d->preview->appendMessage(msgRightToLeft);
+ d->preview->appendMessage(msgExplanation);
+ d->preview->appendMessage(msgBye);
+}
+
+void AppearanceConfig::slotUpdateChatPreview()
+{
+ if(d->loading || !d->currentStyle)
+ return;
+
+ // Update the preview
+ d->preview->setStyle(d->currentStyle);
+
+ emitChanged();
+}
+
+void AppearanceConfig::emitChanged()
+{
+ emit changed( true );
+}
+
+void AppearanceConfig::installEmoticonTheme()
+{
+ KURL themeURL = KURLRequesterDlg::getURL(QString::null, this,
+ i18n("Drag or Type Emoticon Theme URL"));
+ if ( themeURL.isEmpty() )
+ return;
+
+ //TODO: support remote theme files!
+ if ( !themeURL.isLocalFile() )
+ {
+ KMessageBox::queuedMessageBox( this, KMessageBox::Error, i18n("Sorry, emoticon themes must be installed from local files."),
+ i18n("Could Not Install Emoticon Theme") );
+ return;
+ }
+
+ Kopete::Global::installEmoticonTheme( themeURL.path() );
+ updateEmoticonlist();
+}
+
+void AppearanceConfig::removeSelectedEmoticonTheme()
+{
+ QListBoxItem *selected = d->mPrfsEmoticons->icon_theme_list->selectedItem();
+ if(selected==0)
+ return;
+
+ QString themeName = selected->text();
+
+ QString question=i18n("<qt>Are you sure you want to remove the "
+ "<strong>%1</strong> emoticon theme?<br>"
+ "<br>"
+ "This will delete the files installed by this theme.</qt>").
+ arg(themeName);
+
+ int res = KMessageBox::warningContinueCancel(this, question, i18n("Confirmation"),KStdGuiItem::del());
+ if (res!=KMessageBox::Continue)
+ return;
+
+ KURL themeUrl(KGlobal::dirs()->findResource("emoticons", themeName+"/"));
+ KIO::NetAccess::del(themeUrl, this);
+
+ updateEmoticonlist();
+}
+
+void AppearanceConfig::slotGetEmoticonThemes()
+{
+ KConfig* config = KGlobal::config();
+ config->setGroup( "KNewStuff" );
+ config->writeEntry( "ProvidersUrl",
+ "http://download.kde.org/khotnewstuff/emoticons-providers.xml" );
+ config->writeEntry( "StandardResource", "emoticons" );
+ config->writeEntry( "Uncompress", "application/x-gzip" );
+ config->sync();
+
+#if ( KDE_IS_VERSION(3,3,90) )
+ KNS::DownloadDialog::open( "emoticons", i18n( "Get New Emoticons") );
+#else
+ KNS::DownloadDialog::open( i18n( "Get New Emoticons" ) );
+#endif
+
+ updateEmoticonlist();
+}
+
+void AppearanceConfig::slotEditTooltips()
+{
+ TooltipEditDialog *dlg = new TooltipEditDialog(this);
+ connect(dlg, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
+ dlg->exec();
+ delete dlg;
+}
+
+#include "appearanceconfig.moc"
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/appearance/appearanceconfig.h b/kopete/kopete/config/appearance/appearanceconfig.h
new file mode 100644
index 00000000..22a23024
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig.h
@@ -0,0 +1,70 @@
+/*
+ appearanceconfig.h - Kopete Look Feel Config
+
+ Copyright (c) 2001-2002 by Duncan Mac-Vicar Prett <duncan@kde.org>
+ Copyright (c) 2005 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef __APPEARANCE_H
+#define __APPEARANCE_H
+
+#include "kcmodule.h"
+#include <qptrlist.h>
+#include <qmap.h>
+
+/**
+ * @author Duncan Mac-Vicar P. <duncan@kde.org>
+ * @author Michaël Larouche <michael.larouche@kdemail.net>
+ */
+class AppearanceConfig : public KCModule
+{
+ Q_OBJECT
+
+friend class KopeteStyleNewStuff;
+
+public:
+ AppearanceConfig( QWidget *parent, const char *name, const QStringList &args );
+ ~AppearanceConfig();
+
+ virtual void save();
+ virtual void load();
+
+private slots:
+ void slotSelectedEmoticonsThemeChanged();
+ void slotUpdateChatPreview();
+ void slotHighlightChanged();
+ void slotChangeFont();
+ void slotInstallChatStyle();
+ void slotDeleteChatStyle();
+ void slotChatStyleSelected();
+ void slotChatStyleVariantSelected(const QString &variantName);
+ void slotEditTooltips();
+ void emitChanged();
+ void installEmoticonTheme();
+ void removeSelectedEmoticonTheme();
+ void slotGetEmoticonThemes();
+ void slotGetChatStyles();
+ void slotLoadChatStyles();
+ void updateEmoticonsButton(bool);
+private:
+ void updateEmoticonlist();
+ void createPreviewChatSession();
+ void createPreviewMessages();
+
+private:
+ class Private;
+ Private *d;
+};
+#endif
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/appearance/appearanceconfig_chatwindow.ui b/kopete/kopete/config/appearance/appearanceconfig_chatwindow.ui
new file mode 100644
index 00000000..129abdd5
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig_chatwindow.ui
@@ -0,0 +1,195 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AppearanceConfig_ChatWindow</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AppearanceConfig_ChatWindow</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>462</width>
+ <height>454</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Chat Window Appearance</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>stylesGroupBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Styles</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSplitter" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>splitter1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>styleList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>1</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QFrame">
+ <property name="name">
+ <cstring>htmlFrame</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>4</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="frameShape">
+ <enum>StyledPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Raised</enum>
+ </property>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>btnGetStyles</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Get New...</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Get new Chat Window styles over the Internet</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>installButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Install...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>deleteButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Delete</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Style Variant:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <property name="name">
+ <cstring>variantList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>Display</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>groupConsecutiveMessages</cstring>
+ </property>
+ <property name="text">
+ <string>Group consecuti&amp;ve messages</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+</widget>
+<tabstops>
+ <tabstop>styleList</tabstop>
+ <tabstop>installButton</tabstop>
+ <tabstop>deleteButton</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistbox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/appearance/appearanceconfig_colors.ui b/kopete/kopete/config/appearance/appearanceconfig_colors.ui
new file mode 100644
index 00000000..6300b844
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig_colors.ui
@@ -0,0 +1,397 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>AppearanceConfig_Colors</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AppearanceConfig_Colors</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>595</width>
+ <height>606</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Colors</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Chat Window</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>Base font:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="3" column="1">
+ <property name="name">
+ <cstring>foregroundColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>Highlight foreground:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="2" column="1">
+ <property name="name">
+ <cstring>linkColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="color">
+ <color>
+ <red>0</red>
+ <green>85</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="3" column="3">
+ <property name="name">
+ <cstring>backgroundColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Base font color:</string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>textColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="1" column="3">
+ <property name="name">
+ <cstring>bgColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="color">
+ <color>
+ <red>255</red>
+ <green>255</green>
+ <blue>255</blue>
+ </color>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="2">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Highlight background:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>Link color:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="2">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Background color:</string>
+ </property>
+ </widget>
+ <widget class="KFontRequester" row="0" column="1" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>fontFace</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox4</cstring>
+ </property>
+ <property name="title">
+ <string>Formatting Overrides</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mBgOverride</cstring>
+ </property>
+ <property name="text">
+ <string>Do not show user specified &amp;background color</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mFgOverride</cstring>
+ </property>
+ <property name="text">
+ <string>Do not show user specified &amp;foreground color</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mRtfOverride</cstring>
+ </property>
+ <property name="text">
+ <string>Do not show user specified &amp;rich text</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3_2</cstring>
+ </property>
+ <property name="title">
+ <string>Contact List</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mUseCustomFonts</cstring>
+ </property>
+ <property name="text">
+ <string>Use custom fonts for contact list items</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer13</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>0</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>mSmallFontLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Small font:</string>
+ </property>
+ </widget>
+ <widget class="KFontRequester" row="0" column="1">
+ <property name="name">
+ <cstring>mNormalFont</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>mNormalFontLabel</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Normal font:</string>
+ </property>
+ </widget>
+ <widget class="KFontRequester" row="1" column="1">
+ <property name="name">
+ <cstring>mSmallFont</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KColorButton" row="1" column="1">
+ <property name="name">
+ <cstring>mGroupNameColor</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="KColorButton" row="0" column="1">
+ <property name="name">
+ <cstring>idleContactColor</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="0" column="0">
+ <property name="name">
+ <cstring>mGreyIdleMetaContacts</cstring>
+ </property>
+ <property name="text">
+ <string>Recolor contacts marked as idle:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>Group name color:</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>80</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>mUseCustomFonts</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mNormalFontLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseCustomFonts</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mNormalFont</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseCustomFonts</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mSmallFontLabel</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseCustomFonts</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mSmallFont</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mGreyIdleMetaContacts</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>idleContactColor</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>bgColor</tabstop>
+ <tabstop>textColor</tabstop>
+ <tabstop>linkColor</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kfontrequester.h</includehint>
+ <includehint>kfontrequester.h</includehint>
+ <includehint>kfontrequester.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+ <includehint>kcolorbutton.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/appearance/appearanceconfig_contactlist.ui b/kopete/kopete/config/appearance/appearanceconfig_contactlist.ui
new file mode 100644
index 00000000..4c9c7934
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig_contactlist.ui
@@ -0,0 +1,349 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AppearanceConfig_ContactList</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>AppearanceConfig_ContactList</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>707</width>
+ <height>445</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Contact List Appearance</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Layout</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mSortByGroup</cstring>
+ </property>
+ <property name="text">
+ <string>Arrange metacontacts by &amp;group</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mTreeContactList</cstring>
+ </property>
+ <property name="text">
+ <string>Show tree &amp;branch lines</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mIndentContacts</cstring>
+ </property>
+ <property name="text">
+ <string>In&amp;dent contacts</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="0" column="1">
+ <property name="name">
+ <cstring>groupBox10</cstring>
+ </property>
+ <property name="title">
+ <string>Contact Display Mode</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>mDisplayMode</cstring>
+ </property>
+ <property name="title">
+ <string>List Style</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton8</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Classic, left-aligned status icons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton9</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Right-aligned status icons</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioButton10</cstring>
+ </property>
+ <property name="text">
+ <string>Detailed &amp;view</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mIconMode</cstring>
+ </property>
+ <property name="text">
+ <string>Use contact photos when available</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Contact List Auto-Hide</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When enabled, the contact list will automatically be hidden a fixed amount of time after the mouse cursor leaves the window. You can set the amount of time in the 'Time until autohide' box below.</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mAutoHide</cstring>
+ </property>
+ <property name="text">
+ <string>A&amp;uto-hide contact list</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>mAutoHideTimeout</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="suffix">
+ <string> Sec</string>
+ </property>
+ <property name="maxValue">
+ <number>300</number>
+ </property>
+ <property name="minValue">
+ <number>3</number>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The timeout value for both contact list and scrollbar auto-hiding.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="enabled">
+ <bool>true</bool>
+ </property>
+ <property name="text">
+ <string>after the cursor left the window</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox" row="1" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Contact List Animations</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mAnimateChanges</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Animate changes to contact list items</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mFadeVisibility</cstring>
+ </property>
+ <property name="text">
+ <string>Fade in / out contacts as the&amp;y appear / disappear</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mFoldVisibility</cstring>
+ </property>
+ <property name="text">
+ <string>Fo&amp;ld in / out contacts as they appear / disappear</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>mEditTooltips</cstring>
+ </property>
+ <property name="text">
+ <string>Change &amp;Tooltip Contents...</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>spacer15</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>mTreeContactList</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mIndentContacts</receiver>
+ <slot>setDisabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui b/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui
new file mode 100644
index 00000000..8649e4c2
--- /dev/null
+++ b/kopete/kopete/config/appearance/appearanceconfig_emoticons.ui
@@ -0,0 +1,214 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AppearanceConfig_Emoticons</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AppearanceConfig_Emoticons</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>541</width>
+ <height>395</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>chkUseEmoticons</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use emoticons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked, the text representation of emoticons in messages will be replaced by an image</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>chkRequireSpaces</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Require separators (spaces) around emoticons</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If this is checked, only emoticons that are separated from the text by spaces will be shown as images.</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="focusPolicy">
+ <enum>NoFocus</enum>
+ </property>
+ <property name="text">
+ <string>Select emoticon theme:</string>
+ </property>
+ </widget>
+ <widget class="KListBox">
+ <property name="name">
+ <cstring>icon_theme_list</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>lblPreview</cstring>
+ </property>
+ <property name="text">
+ <string>Preview:</string>
+ </property>
+ </widget>
+ <widget class="KTextEdit">
+ <property name="name">
+ <cstring>icon_theme_preview</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>64</height>
+ </size>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>btnGetThemes</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Get New Themes...</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Download emoticon theme from the Internet</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>btnInstallTheme</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Install Theme File...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>btnRemoveTheme</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Remove Theme</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>31</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+</customwidgets>
+<connections>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>chkRequireSpaces</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lblPreview</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>icon_theme_list</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>lblPreview</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>textLabel1</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>btnGetThemes</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>btnInstallTheme</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>chkUseEmoticons</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>btnRemoveTheme</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistbox.h</includehint>
+ <includehint>ktextedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/appearance/kopete_appearanceconfig.desktop b/kopete/kopete/config/appearance/kopete_appearanceconfig.desktop
new file mode 100644
index 00000000..e9b941b7
--- /dev/null
+++ b/kopete/kopete/config/appearance/kopete_appearanceconfig.desktop
@@ -0,0 +1,130 @@
+[Desktop Entry]
+Icon=looknfeel
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_appearanceconfig
+X-KDE-FactoryName=KopeteAppearanceConfigFactory
+X-KDE-ParentApp=kopete
+X-KDE-ParentComponents=kopete
+
+Name=Appearance
+Name[ar]=المظهر
+Name[be]=Вонкавы выгляд
+Name[bg]=Външен вид
+Name[bn]=চেহারা
+Name[br]=Neuziadur
+Name[bs]=Izgled
+Name[ca]=Aparença
+Name[cs]=Vzhled
+Name[cy]=Golwg
+Name[da]=Udseende
+Name[de]=Erscheinungsbild
+Name[el]=Εμφάνιση
+Name[eo]=Apero
+Name[es]=Apariencia
+Name[et]=Välimus
+Name[eu]=Itxura
+Name[fa]=ظاهر
+Name[fi]=Ulkonäkö
+Name[fr]=Apparence
+Name[ga]=Cuma
+Name[gl]=Apariencia
+Name[he]=מראה
+Name[hi]=शक्ल-सूरत
+Name[hr]=Izgled
+Name[hu]=Megjelenés
+Name[is]=Útlit
+Name[it]=Aspetto
+Name[ja]=外観
+Name[ka]=იერსახე
+Name[kk]=Сыртқы көрінісі
+Name[km]=រូបរាង
+Name[lt]=Išvaizda
+Name[mk]=Изглед
+Name[nb]=Utseende
+Name[nds]=Utsehn
+Name[ne]=दृश्य
+Name[nl]=Uiterlijk
+Name[nn]=Utsjånad
+Name[pa]=ਦਿੱਖ
+Name[pl]=Wygląd
+Name[pt]=Aparência
+Name[pt_BR]=Aparência
+Name[ro]=Aspect
+Name[ru]=Внешний вид
+Name[rw]=Imigaragarire
+Name[se]=Fárda
+Name[sk]=Vzhľad
+Name[sl]=Videz
+Name[sr]=Изглед
+Name[sr@Latn]=Izgled
+Name[sv]=Utseende
+Name[tg]=Намуди зоҳирӣ
+Name[tr]=Görünüm
+Name[uk]=Вигляд
+Name[uz]=Koʻrinishi
+Name[uz@cyrillic]=Кўриниши
+Name[wa]=Rivnance
+Name[zh_CN]=外观
+Name[zh_HK]=外觀
+Name[zh_TW]=外觀
+Comment=Here You Can Alter Kopete's Look And Feel
+Comment[ar]=يمكنك تغيير مظهر Kopete
+Comment[be]=Вонкавы выгляд Kopete
+Comment[bg]=Настройване външния вид на програмата
+Comment[bn]=আপনি এখানে কপেটের চেহারা ও কার্যকারিতা পরিবর্তন করতে পারেন
+Comment[bs]=Ovdje možete izmijeniti izgled Kopete-a
+Comment[ca]=Aquí podreu modificar l'aparença i comportament de Kopete
+Comment[cs]=Zde je možné přizpůsobit si vzhled a chování Kopete
+Comment[cy]=Yma Gallwch Addasu Golwg a Theimlad Kopete
+Comment[da]=Her kan du ændre Kopete's udseende
+Comment[de]=Hier können Sie Kopetes Erscheinungsbild verändern
+Comment[el]=Εδώ μπορείτε να τροποποιήσετε την όψη και αίσθηση του Kopete
+Comment[es]=Aquí­ puede modificar el aspecto de Kopete
+Comment[et]=Siin saab muuta Kopete väljanägemist
+Comment[eu]=Hemen Kopete-ren itxura eta izaera alda dezakezu
+Comment[fa]=اینجا می‌توانید ویژگیهای ظاهری Kopete را تغییر دهید
+Comment[fi]=Täältä voit muuttaa Kopeten ulkonäköä ja tuntumaa
+Comment[fr]=Vous pouvez modifier l'apparence et l'ergonomie de Kopete ici
+Comment[gl]=Aquí podes modificar o aspecto de Kopete
+Comment[he]=כאן תוכל לשנות את המראה של Kopete
+Comment[hi]=यहाँ आप के-ऑप्टी के रूप और विन्यास को बदल सकते हैं
+Comment[hr]=Ovde možete promijeniti Kopeteov izgled i način rada
+Comment[hu]=Itt lehet megváltoztatni a Kopete grafikai megjelenését
+Comment[is]=Hér er hægt að breyta útliti og viðmóti Kopete
+Comment[it]=Qui puoi modificare l'aspetto di Kopete
+Comment[ja]=ここで Kopete の外観をカスタマイズします
+Comment[ka]=აქ თქვენ შეგიძლიათ Kopeteს იერსახის კონფიგურაცია
+Comment[kk]=Мұнда Kopete-тің сырқы көрінісін өзгерте аласыз
+Comment[km]=ទី​នេះ អ្នក​អាច​ប្ដូរ​រូបរាង និង​មុខងារ​របស់ Kopete​
+Comment[lt]=Čia galite keisti Kopete išvaizdą ir pojūtį
+Comment[mk]=Тука можете да го менувате изгледот на Kopete
+Comment[nb]=Endre utseendet på Kopete
+Comment[nds]=Hier kannst Du dat Utsehn vun Kopete ännern
+Comment[ne]=यहाँ तपाईँ कोपेटको हेराइ र महसुस अल्टर गर्न सक्नुहुन्छ
+Comment[nl]=Hier kunt u uw het uiterlijk van Kopete aanpassen
+Comment[nn]=Endra utsjånaden til Kopete
+Comment[pl]=Tutaj można zmienić wygląd i zachowanie Kopete
+Comment[pt]=Aqui Você Pode Alterar a Aparência e Comportamento do Kopete
+Comment[pt_BR]=Aqui você pode alterar a aparência do Kopete
+Comment[ro]=Aici puteţi modifica aspectul Kopete
+Comment[ru]=Настройка внешнего вида Kopete
+Comment[se]=Dáppe sáhtát rievdadit Kopete:a fárdda
+Comment[sk]=Tu môžete upraviť vzhľad Kopete
+Comment[sl]=Tukaj lahko spreminjate izgled in občutek za Kopete
+Comment[sr]=Овде можете променити Kopete-ов изглед и осећај
+Comment[sr@Latn]=Ovde možete promeniti Kopete-ov izgled i osećaj
+Comment[sv]=Här kan du ändra Kopetes utseende och känsla
+Comment[tg]=Дар Ин Ҷо Шумо Намуди Зоҳирии Kopete-и Худро Тағир Дода Метавонед
+Comment[tr]=Kopete'nin Görünüm ve Dokusunu Buradan Değiştirebilirsiniz
+Comment[uk]=Тут можна наладнати зовнішній вигляд Kopete
+Comment[uz]=Bu yerda Kopete koʻrinishini moslash mumkin
+Comment[uz@cyrillic]=Бу ерда Kopete кўринишини мослаш мумкин
+Comment[zh_CN]=您可在此更改 Kopete 的观感
+Comment[zh_HK]=在此您可改動 Kopete 的外觀
+Comment[zh_TW]=您可以在此改變 Kopete 的外觀與感覺
+DocPath=kopete/configure-dialog.html#configuring-appearance
+
+
diff --git a/kopete/kopete/config/appearance/tooltipeditdialog.cpp b/kopete/kopete/config/appearance/tooltipeditdialog.cpp
new file mode 100644
index 00000000..c8ed8a5d
--- /dev/null
+++ b/kopete/kopete/config/appearance/tooltipeditdialog.cpp
@@ -0,0 +1,226 @@
+/*
+ tooltipeditdialog.cpp - Kopete Tooltip Editor
+
+ Copyright (c) 2004 by Stefan Gehn <metz AT gehn.net>
+ Kopete (c) 2004 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "tooltipeditdialog.h"
+#include "tooltipeditwidget.h"
+
+#include "kopetecontactproperty.h"
+#include "kopeteglobal.h"
+#include "kopeteprefs.h"
+
+#include <qapplication.h>
+#include <qtoolbutton.h>
+#include <qheader.h>
+#include <qstringlist.h>
+
+#include <kiconloader.h>
+#include <klistview.h>
+#include <klocale.h>
+
+class TooltipItem : public KListViewItem
+{
+ public:
+ TooltipItem(KListView *parent, const QString& label, const QString& propertyName)
+ : KListViewItem(parent, label),
+ mPropName(propertyName)
+ {
+ }
+
+ TooltipItem(KListView *parent, QListViewItem *item, const QString& label, const QString& propertyName)
+ : KListViewItem(parent, item, label),
+ mPropName(propertyName)
+ {
+ }
+
+ QString propertyName() const { return mPropName; }
+ private:
+ QString mPropName;
+};
+
+
+
+TooltipEditDialog::TooltipEditDialog(QWidget *parent, const char* name)
+ : KDialogBase(parent, name, true, i18n("Tooltip Editor"), Ok|Cancel, Ok, true)
+{
+ mMainWidget = new TooltipEditWidget(this, "TooltipEditDialog::mMainWidget");
+ setMainWidget(mMainWidget);
+ mMainWidget->lstUsedItems->header()->hide();
+ mMainWidget->lstUnusedItems->header()->hide();
+ mMainWidget->lstUsedItems->setSorting( -1 );
+ mMainWidget->lstUnusedItems->setSorting( 0 );
+
+ const Kopete::ContactPropertyTmpl::Map propmap(
+ Kopete::Global::Properties::self()->templateMap());
+ QStringList usedKeys = KopetePrefs::prefs()->toolTipContents();
+
+ connect(mMainWidget->lstUnusedItems, SIGNAL(doubleClicked ( QListViewItem *, const QPoint &, int )), this, SLOT(slotAddButton()));
+ connect(mMainWidget->lstUsedItems, SIGNAL(doubleClicked ( QListViewItem *, const QPoint &, int )), this, SLOT(slotRemoveButton()));
+
+ // first fill the "used" list
+ QStringList::Iterator usedIt=usedKeys.end();
+ do
+ {
+ usedIt--;
+ // only add if that property key is really known
+ if(propmap.contains(*usedIt) && !propmap[*usedIt].isPrivate())
+ {
+ new TooltipItem(mMainWidget->lstUsedItems,
+ propmap[*usedIt].label(), *usedIt);
+ }
+ } while(usedIt != usedKeys.begin());
+
+ // then iterate over all known properties and insert the remaining ones
+ // into the "unused" list
+ Kopete::ContactPropertyTmpl::Map::ConstIterator it;
+ for(it = propmap.begin(); it != propmap.end(); ++it)
+ {
+ if((usedKeys.contains(it.key())==0) && (!it.data().isPrivate()))
+ new TooltipItem(mMainWidget->lstUnusedItems, it.data().label(), it.key());
+ }
+
+ connect(mMainWidget->lstUnusedItems, SIGNAL(selectionChanged(QListViewItem *)),
+ this, SLOT(slotUnusedSelected(QListViewItem *)));
+ connect(mMainWidget->lstUsedItems, SIGNAL(selectionChanged(QListViewItem *)),
+ this, SLOT(slotUsedSelected(QListViewItem *)));
+
+ QIconSet iconSet;
+ iconSet = SmallIconSet("up");
+ mMainWidget->tbUp->setIconSet(iconSet);
+ mMainWidget->tbUp->setEnabled(false);
+ mMainWidget->tbUp->setAutoRepeat(true);
+ connect(mMainWidget->tbUp, SIGNAL(clicked()), SLOT(slotUpButton()));
+
+ iconSet = SmallIconSet("down");
+ mMainWidget->tbDown->setIconSet(iconSet);
+ mMainWidget->tbDown->setEnabled(false);
+ mMainWidget->tbDown->setAutoRepeat(true);
+ connect(mMainWidget->tbDown, SIGNAL(clicked()), SLOT(slotDownButton()));
+
+ iconSet = QApplication::reverseLayout() ? SmallIconSet("back") : SmallIconSet("forward");
+ mMainWidget->tbAdd->setIconSet(iconSet);
+ mMainWidget->tbAdd->setEnabled(false);
+ connect(mMainWidget->tbAdd, SIGNAL(clicked()), SLOT(slotAddButton()));
+
+ iconSet = QApplication::reverseLayout() ? SmallIconSet("forward") : SmallIconSet("back");
+ mMainWidget->tbRemove->setIconSet(iconSet);
+ mMainWidget->tbRemove->setEnabled(false);
+ connect(mMainWidget->tbRemove, SIGNAL(clicked()), SLOT(slotRemoveButton()));
+
+ connect(this, SIGNAL(okClicked()), this, SLOT(slotOkClicked()));
+
+ resize(QSize(450, 450));
+}
+
+void TooltipEditDialog::slotOkClicked()
+{
+ QStringList oldList = KopetePrefs::prefs()->toolTipContents();
+ QStringList newList;
+ QListViewItemIterator it(mMainWidget->lstUsedItems);
+ QString keyname;
+
+ while(it.current())
+ {
+ keyname = static_cast<TooltipItem *>(it.current())->propertyName();
+ newList += keyname;
+ kdDebug(14000) << k_funcinfo <<
+ "Adding key '" << keyname << "' to tooltip list" << endl;
+ ++it;
+ }
+
+ if(oldList != newList)
+ {
+ KopetePrefs::prefs()->setToolTipContents(newList);
+ emit changed(true);
+ kdDebug(14000) << k_funcinfo << "tooltip fields changed, emitting changed()" << endl;
+ }
+}
+
+
+void TooltipEditDialog::slotUnusedSelected(QListViewItem *item)
+{
+ //mMainWidget->tbRemove->setEnabled(false);
+ mMainWidget->tbAdd->setEnabled(item!=0);
+}
+
+void TooltipEditDialog::slotUsedSelected(QListViewItem *item)
+{
+ mMainWidget->tbRemove->setEnabled(item!=0);
+ //mMainWidget->tbAdd->setEnabled(false);
+ if (item)
+ {
+ mMainWidget->tbUp->setEnabled(item->itemAbove() != 0);
+ mMainWidget->tbDown->setEnabled(item->itemBelow() != 0);
+ }
+ else
+ {
+ mMainWidget->tbUp->setEnabled(false);
+ mMainWidget->tbDown->setEnabled(false);
+ }
+}
+
+void TooltipEditDialog::slotUpButton()
+{
+ QListViewItem *item = mMainWidget->lstUsedItems->currentItem();
+ QListViewItem *prev = item->itemAbove();
+ if(prev == 0) // we are first item already
+ return;
+
+ prev->moveItem(item);
+ slotUsedSelected(item);
+}
+
+void TooltipEditDialog::slotDownButton()
+{
+ QListViewItem *item = mMainWidget->lstUsedItems->currentItem();
+ QListViewItem *next = item->itemBelow();
+ if(next == 0) // we are last item already
+ return;
+
+ item->moveItem(next);
+ slotUsedSelected(item);
+}
+
+void TooltipEditDialog::slotAddButton()
+{
+ TooltipItem *item = static_cast<TooltipItem *>(mMainWidget->lstUnusedItems->currentItem());
+ if(!item)
+ return;
+ //kdDebug(14000) << k_funcinfo << endl;
+
+ // build a new one in the "used" list
+ new TooltipItem(mMainWidget->lstUsedItems, item->text(0), item->propertyName());
+
+ // remove the old one from "unused" list
+ mMainWidget->lstUnusedItems->takeItem(item);
+ delete item;
+}
+
+void TooltipEditDialog::slotRemoveButton()
+{
+ TooltipItem *item = static_cast<TooltipItem *>(mMainWidget->lstUsedItems->currentItem());
+ if(!item)
+ return;
+ //kdDebug(14000) << k_funcinfo << endl;
+
+ // build a new one in the "unused" list
+ new TooltipItem(mMainWidget->lstUnusedItems, item->text(0), item->propertyName());
+
+ // remove the old one from "used" list
+ mMainWidget->lstUsedItems->takeItem(item);
+ delete item;
+}
+
+#include "tooltipeditdialog.moc"
diff --git a/kopete/kopete/config/appearance/tooltipeditdialog.h b/kopete/kopete/config/appearance/tooltipeditdialog.h
new file mode 100644
index 00000000..92d75aa9
--- /dev/null
+++ b/kopete/kopete/config/appearance/tooltipeditdialog.h
@@ -0,0 +1,49 @@
+/*
+ tooltipeditdialog.cpp - Kopete Tooltip Editor
+
+ Copyright (c) 2004 by Stefan Gehn <metz AT gehn.net>
+ Kopete (c) 2004 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef TOOLTIPEDITDIALOG_H
+#define TOOLTIPEDITDIALOG_H
+
+#include <kdebug.h>
+#include <qhbox.h>
+#include <kdialogbase.h>
+class TooltipEditWidget;
+
+class TooltipEditDialog : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ TooltipEditDialog(QWidget *parent=0, const char* name="ToolTipEditDialog");
+
+ private slots:
+ void slotUnusedSelected(QListViewItem *);
+ void slotUsedSelected(QListViewItem *);
+ void slotUpButton();
+ void slotDownButton();
+ void slotAddButton();
+ void slotRemoveButton();
+ void slotOkClicked();
+
+ signals:
+ void changed(bool);
+
+ private:
+ TooltipEditWidget *mMainWidget;
+};
+
+#endif
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/appearance/tooltipeditwidget.ui b/kopete/kopete/config/appearance/tooltipeditwidget.ui
new file mode 100644
index 00000000..f00b8f26
--- /dev/null
+++ b/kopete/kopete/config/appearance/tooltipeditwidget.ui
@@ -0,0 +1,215 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>TooltipEditWidget</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>TooltipEditWidget</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>489</width>
+ <height>418</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="Line" row="1" column="0">
+ <property name="name">
+ <cstring>line1</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>HLine</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Using the arrow buttons, put on the right the items you want to see in the contact tooltips. You can then sort them.</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignVCenter</set>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Here you can customize the contact tooltips&lt;/b&gt;</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="3" column="0">
+ <property name="name">
+ <cstring>layout5</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>lstUnusedItems</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This list contains elements which are currently &lt;b&gt;not present&lt;/b&gt; in the contact tooltip.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>60</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout1</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QToolButton" row="2" column="1">
+ <property name="name">
+ <cstring>tbDown</cstring>
+ </property>
+ <property name="text">
+ <string>v</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use this arrow to reorder the items in the list.</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="0" column="1">
+ <property name="name">
+ <cstring>tbUp</cstring>
+ </property>
+ <property name="text">
+ <string>^</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="1" column="0">
+ <property name="name">
+ <cstring>tbRemove</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;</string>
+ </property>
+ </widget>
+ <widget class="QToolButton" row="1" column="2">
+ <property name="name">
+ <cstring>tbAdd</cstring>
+ </property>
+ <property name="text">
+ <string>&gt;</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Use this arrows to add or remove items to your contact tooltips.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="clickable">
+ <bool>false</bool>
+ </property>
+ <property name="resizable">
+ <bool>false</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>lstUsedItems</cstring>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This list contains elements which are currently &lt;b&gt;present&lt;/b&gt; in the contact tooltips.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<customwidgets>
+</customwidgets>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/avdevice/Makefile.am b/kopete/kopete/config/avdevice/Makefile.am
new file mode 100644
index 00000000..f1c9303a
--- /dev/null
+++ b/kopete/kopete/config/avdevice/Makefile.am
@@ -0,0 +1,24 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) \
+ -I$(top_srcdir)/kopete/libkopete/avdevice \
+ -I$(top_srcdir)/kopete/libkopete/private $(KOPETE_COMPAT_INCLUDES) $(all_includes)
+
+kde_module_LTLIBRARIES = kcm_kopete_avdeviceconfig.la
+
+kcm_kopete_avdeviceconfig_la_SOURCES = avdeviceconfig.cpp \
+ avdeviceconfig_videoconfig.ui
+
+kcm_kopete_avdeviceconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries)
+
+kcm_kopete_avdeviceconfig_la_LIBADD = ../../../libkopete/libkopete.la \
+ ../../../libkopete/avdevice/libkopete_videodevice.la \
+ $(LIB_KOPETECOMPAT) $(LIB_KUTILS)
+
+service_DATA = kopete_avdeviceconfig.desktop
+servicedir = $(kde_servicesdir)
+
+kopeteicondir = $(kde_datadir)/kopete/icons
+kopeteicon_ICON = AUTO
+
+# vim: set noet:
+noinst_HEADERS = avdeviceconfig_videoconfig.h
diff --git a/kopete/kopete/config/avdevice/avdeviceconfig.cpp b/kopete/kopete/config/avdevice/avdeviceconfig.cpp
new file mode 100644
index 00000000..a2c474e0
--- /dev/null
+++ b/kopete/kopete/config/avdevice/avdeviceconfig.cpp
@@ -0,0 +1,229 @@
+/*
+ avdeviceconfig.cpp - Kopete Video Device Configuration Panel
+
+ Copyright (c) 2005-2006 by Cláudio da Silveira Pinheiro <taupter@gmail.com>
+
+ Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "avdeviceconfig.h"
+#include "avdeviceconfig_videoconfig.h"
+#include "videodevice.h"
+
+#include <qcheckbox.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qhbuttongroup.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qslider.h>
+
+#include <kplugininfo.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kgenericfactory.h>
+#include <ktrader.h>
+#include <kconfig.h>
+#include <kcombobox.h>
+#include <qimage.h>
+#include <qpixmap.h>
+
+#include <qtabwidget.h>
+
+//#include "videodevice.h"
+typedef KGenericFactory<AVDeviceConfig, QWidget> KopeteAVDeviceConfigFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_avdeviceconfig, KopeteAVDeviceConfigFactory( "kcm_kopete_avdeviceconfig" ) )
+
+AVDeviceConfig::AVDeviceConfig(QWidget *parent, const char * name , const QStringList &args)
+ : KCModule( KopeteAVDeviceConfigFactory::instance(), parent, args )
+{
+ kdDebug() << "kopete:config (avdevice): KopeteAVDeviceConfigFactory::instance() called. " << endl;
+ (new QVBoxLayout(this))->setAutoAdd(true);
+ mAVDeviceTabCtl = new QTabWidget(this, "mAVDeviceTabCtl");
+
+// "Video" TAB ============================================================
+ mPrfsVideoDevice = new AVDeviceConfig_VideoDevice(mAVDeviceTabCtl);
+ connect(mPrfsVideoDevice->mDeviceKComboBox, SIGNAL(activated(int)), this, SLOT(slotDeviceKComboBoxChanged(int)));
+ connect(mPrfsVideoDevice->mInputKComboBox, SIGNAL(activated(int)), this, SLOT(slotInputKComboBoxChanged(int)));
+ connect(mPrfsVideoDevice->mStandardKComboBox, SIGNAL(activated(int)), this, SLOT(slotStandardKComboBoxChanged(int)));
+ connect(mPrfsVideoDevice->mBrightnessSlider, SIGNAL(valueChanged(int)), this, SLOT(slotBrightnessSliderChanged(int)));
+ connect(mPrfsVideoDevice->mContrastSlider, SIGNAL(valueChanged(int)), this, SLOT(slotContrastSliderChanged(int)));
+ connect(mPrfsVideoDevice->mSaturationSlider, SIGNAL(valueChanged(int)), this, SLOT(slotSaturationSliderChanged(int)));
+ connect(mPrfsVideoDevice->mWhitenessSlider, SIGNAL(valueChanged(int)), this, SLOT(slotWhitenessSliderChanged(int)));
+ connect(mPrfsVideoDevice->mHueSlider, SIGNAL(valueChanged(int)), this, SLOT(slotHueSliderChanged(int)));
+ connect(mPrfsVideoDevice->mImageAutoBrightnessContrast, SIGNAL(toggled(bool)), this, SLOT(slotImageAutoBrightnessContrastChanged(bool)));
+ connect(mPrfsVideoDevice->mImageAutoColorCorrection, SIGNAL(toggled(bool)), this, SLOT(slotImageAutoColorCorrectionChanged(bool)));
+ connect(mPrfsVideoDevice->mImageAsMirror, SIGNAL(toggled(bool)), this, SLOT(slotImageAsMirrorChanged(bool)));
+
+ // why is this here?
+ // mPrfsVideoDevice->mVideoImageLabel->setPixmap(qpixmap);
+ mAVDeviceTabCtl->addTab(mPrfsVideoDevice, i18n("&Video"));
+ mVideoDevicePool = Kopete::AV::VideoDevicePool::self();
+ mVideoDevicePool->open();
+ mVideoDevicePool->setSize(320, 240);
+
+ mVideoDevicePool->fillDeviceKComboBox(mPrfsVideoDevice->mDeviceKComboBox);
+ mVideoDevicePool->fillInputKComboBox(mPrfsVideoDevice->mInputKComboBox);
+ mVideoDevicePool->fillStandardKComboBox(mPrfsVideoDevice->mStandardKComboBox);
+ setVideoInputParameters();
+
+ mVideoDevicePool->startCapturing();
+ mVideoDevicePool->getFrame();
+ mVideoDevicePool->getImage(&qimage);
+ if (qpixmap.convertFromImage(qimage,0) == true)
+ mPrfsVideoDevice->mVideoImageLabel->setPixmap(qpixmap);
+ connect(&qtimer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) );
+ qtimer.start(0,FALSE);
+}
+
+
+AVDeviceConfig::~AVDeviceConfig()
+{
+ mVideoDevicePool->close();
+}
+
+
+
+
+/*!
+ \fn VideoDeviceConfig::save()
+ */
+void AVDeviceConfig::save()
+{
+ /// @todo implement me
+ kdDebug() << "kopete:config (avdevice): save() called. " << endl;
+ mVideoDevicePool->saveConfig();
+}
+
+
+/*!
+ \fn VideoDeviceConfig::load()
+ */
+void AVDeviceConfig::load()
+{
+ /// @todo implement me
+}
+
+void AVDeviceConfig::slotSettingsChanged(bool){
+ emit changed(true);
+}
+
+void AVDeviceConfig::slotValueChanged(int){
+ emit changed( true );
+}
+
+void AVDeviceConfig::setVideoInputParameters()
+{
+ if(mVideoDevicePool->size())
+ {
+ mPrfsVideoDevice->mBrightnessSlider->setValue((int)(mVideoDevicePool->getBrightness()*65535));
+ mPrfsVideoDevice->mContrastSlider->setValue((int)(mVideoDevicePool->getContrast()*65535));
+ mPrfsVideoDevice->mSaturationSlider->setValue((int)(mVideoDevicePool->getSaturation()*65535));
+ mPrfsVideoDevice->mWhitenessSlider->setValue((int)(mVideoDevicePool->getWhiteness()*65535));
+ mPrfsVideoDevice->mHueSlider->setValue((int)(mVideoDevicePool->getHue()*65535));
+ mPrfsVideoDevice->mImageAutoBrightnessContrast->setChecked(mVideoDevicePool->getAutoBrightnessContrast());
+ mPrfsVideoDevice->mImageAutoColorCorrection->setChecked(mVideoDevicePool->getAutoColorCorrection());
+ mPrfsVideoDevice->mImageAsMirror->setChecked(mVideoDevicePool->getImageAsMirror());
+ }
+}
+
+void AVDeviceConfig::slotDeviceKComboBoxChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotDeviceKComboBoxChanged(int) called. " << endl;
+ unsigned int newdevice = mPrfsVideoDevice->mDeviceKComboBox->currentItem();
+ kdDebug() << "kopete:config (avdevice): slotDeviceKComboBoxChanged(int) Current device: " << mVideoDevicePool->currentDevice() << "New device: " << newdevice << endl;
+ if ((newdevice < mVideoDevicePool->m_videodevice.size())&&(newdevice!=mVideoDevicePool->currentDevice()))
+ {
+ kdDebug() << "kopete:config (avdevice): slotDeviceKComboBoxChanged(int) should change device. " << endl;
+ mVideoDevicePool->open(newdevice);
+ mVideoDevicePool->setSize(320, 240);
+ mVideoDevicePool->fillInputKComboBox(mPrfsVideoDevice->mInputKComboBox);
+ mVideoDevicePool->startCapturing();
+ setVideoInputParameters();
+ kdDebug() << "kopete:config (avdevice): slotDeviceKComboBoxChanged(int) called. " << endl;
+ emit changed( true );
+ }
+
+}
+
+void AVDeviceConfig::slotInputKComboBoxChanged(int){
+ unsigned int newinput = mPrfsVideoDevice->mInputKComboBox->currentItem();
+ if((newinput < mVideoDevicePool->inputs()) && ( newinput !=mVideoDevicePool->currentInput()))
+ {
+ mVideoDevicePool->selectInput(mPrfsVideoDevice->mInputKComboBox->currentItem());
+ mVideoDevicePool->fillStandardKComboBox(mPrfsVideoDevice->mStandardKComboBox);
+ setVideoInputParameters();
+ emit changed( true );
+ }
+}
+
+// ATTENTION: The 65535.0 value must be used instead of 65535 because the trailing ".0" converts the resulting value to floating point number.
+// Otherwise the resulting division operation would return 0 or 1 exclusively.
+
+void AVDeviceConfig::slotStandardKComboBoxChanged(int){
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotBrightnessSliderChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotBrightnessSliderChanged(int) called. " << mPrfsVideoDevice->mBrightnessSlider->value() / 65535.0 << endl;
+ mVideoDevicePool->setBrightness( mPrfsVideoDevice->mBrightnessSlider->value() / 65535.0 );
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotContrastSliderChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotContrastSliderChanged(int) called. " << mPrfsVideoDevice->mContrastSlider->value() / 65535.0 << endl;
+ mVideoDevicePool->setContrast( mPrfsVideoDevice->mContrastSlider->value() / 65535.0 );
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotSaturationSliderChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotSaturationSliderChanged(int) called. " << mPrfsVideoDevice->mSaturationSlider->value() / 65535.0 << endl;
+ mVideoDevicePool->setSaturation( mPrfsVideoDevice->mSaturationSlider->value() / 65535.0);
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotWhitenessSliderChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotWhitenessSliderChanged(int) called. " << mPrfsVideoDevice->mWhitenessSlider->value() / 65535.0 << endl;
+ mVideoDevicePool->setWhiteness( mPrfsVideoDevice->mWhitenessSlider->value() / 65535.0);
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotHueSliderChanged(int){
+ kdDebug() << "kopete:config (avdevice): slotHueSliderChanged(int) called. " << mPrfsVideoDevice->mHueSlider->value() / 65535.0 << endl;
+ mVideoDevicePool->setHue( mPrfsVideoDevice->mHueSlider->value() / 65535.0 );
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotImageAutoBrightnessContrastChanged(bool){
+ kdDebug() << "kopete:config (avdevice): slotImageAutoBrightnessContrastChanged(" << mPrfsVideoDevice->mImageAutoBrightnessContrast->isChecked() << ") called. " << endl;
+ mVideoDevicePool->setAutoBrightnessContrast(mPrfsVideoDevice->mImageAutoBrightnessContrast->isChecked());
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotImageAutoColorCorrectionChanged(bool){
+ kdDebug() << "kopete:config (avdevice): slotImageAutoColorCorrectionChanged(" << mPrfsVideoDevice->mImageAutoColorCorrection->isChecked() << ") called. " << endl;
+ mVideoDevicePool->setAutoColorCorrection(mPrfsVideoDevice->mImageAutoColorCorrection->isChecked());
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotImageAsMirrorChanged(bool){
+ kdDebug() << "kopete:config (avdevice): slotImageAsMirrorChanged(" << mPrfsVideoDevice->mImageAsMirror->isChecked() << ") called. " << endl;
+ mVideoDevicePool->setImageAsMirror(mPrfsVideoDevice->mImageAsMirror->isChecked());
+ emit changed( true );
+}
+
+void AVDeviceConfig::slotUpdateImage()
+{
+ mVideoDevicePool->getFrame();
+ mVideoDevicePool->getImage(&qimage);
+ bitBlt(mPrfsVideoDevice->mVideoImageLabel, 0, 0, &qimage, 0, Qt::CopyROP);
+// kdDebug() << "kopete (avdeviceconfig_videoconfig): Image updated." << endl;
+}
diff --git a/kopete/kopete/config/avdevice/avdeviceconfig.h b/kopete/kopete/config/avdevice/avdeviceconfig.h
new file mode 100644
index 00000000..d732b1a7
--- /dev/null
+++ b/kopete/kopete/config/avdevice/avdeviceconfig.h
@@ -0,0 +1,79 @@
+/*
+ avdeviceconfig.h - Kopete Video Device Configuration Panel
+
+ Copyright (c) 2005-2006 by Cláudio da Silveira Pinheiro <taupter@gmail.com>
+
+ Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef AVDEVICECONFIG_H
+#define AVDEVICECONFIG_H
+
+#include "kcmodule.h"
+#include "videodevicepool.h"
+#include <qimage.h>
+#include <qpixmap.h>
+#include <qtimer.h>
+
+#ifdef HAVE_GL
+# include <qgl.h>
+#endif
+
+class QFrame;
+class QTabWidget;
+
+class AVDeviceConfig_VideoDevice;
+class AVDeviceConfig_AudioDevice;
+
+/**
+@author Cl�dio da Silveira Pinheiro
+*/
+class AVDeviceConfig : public KCModule
+{
+Q_OBJECT
+public:
+ AVDeviceConfig(QWidget *parent, const char * name , const QStringList &args);
+
+ ~AVDeviceConfig();
+ virtual void save();
+ virtual void load();
+
+private slots:
+ void slotSettingsChanged(bool);
+ void slotValueChanged(int);
+ void slotDeviceKComboBoxChanged(int);
+ void slotInputKComboBoxChanged(int);
+ void slotStandardKComboBoxChanged(int);
+ void slotBrightnessSliderChanged(int);
+ void slotContrastSliderChanged(int);
+ void slotSaturationSliderChanged(int);
+ void slotWhitenessSliderChanged(int);
+ void slotHueSliderChanged(int);
+ void slotImageAutoBrightnessContrastChanged(bool);
+ void slotImageAutoColorCorrectionChanged(bool);
+ void slotImageAsMirrorChanged(bool);
+ void slotUpdateImage();
+private:
+ QTabWidget* mAVDeviceTabCtl;
+ AVDeviceConfig_VideoDevice *mPrfsVideoDevice;
+ AVDeviceConfig_AudioDevice *mPrfsAudioDevice;
+ Kopete::AV::VideoDevicePool *mVideoDevicePool ;
+ QImage qimage;
+ QPixmap qpixmap;
+ QTimer qtimer;
+ void setVideoInputParameters();
+#ifdef HAVE_GL
+ QGLWidget m_video_gl;
+#endif
+};
+
+#endif
diff --git a/kopete/kopete/config/avdevice/avdeviceconfig_videoconfig.ui b/kopete/kopete/config/avdevice/avdeviceconfig_videoconfig.ui
new file mode 100644
index 00000000..90464a8b
--- /dev/null
+++ b/kopete/kopete/config/avdevice/avdeviceconfig_videoconfig.ui
@@ -0,0 +1,624 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>AVDeviceConfig_VideoDevice</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>AVDeviceConfig_VideoDevice</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>358</width>
+ <height>510</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="caption">
+ <string>Video</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget" row="1" column="0">
+ <property name="name">
+ <cstring>VideoTabWidget</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Device</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup7</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Video Device Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>videodevice_selection_layout</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>videodevice_selection_labels</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>deviceLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Device:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>inputLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Input:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>standardLabel</cstring>
+ </property>
+ <property name="text">
+ <string>Standard:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>videodevice_selection_combos</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>mDeviceKComboBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>mInputKComboBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>mStandardKComboBox</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>Con&amp;trols</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="0" column="0">
+ <property name="name">
+ <cstring>buttonGroup12</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>&amp;Image Adjustment</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout9</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>brightnessLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Brightness:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>contrastLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Contrast:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>saturationLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Saturation:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>whitenessLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Whiteness:</string>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>hueLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Hue:</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout10</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>mBrightnessSlider</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="lineStep">
+ <number>256</number>
+ </property>
+ <property name="pageStep">
+ <number>4096</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>mContrastSlider</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="lineStep">
+ <number>256</number>
+ </property>
+ <property name="pageStep">
+ <number>4096</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>mSaturationSlider</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="lineStep">
+ <number>256</number>
+ </property>
+ <property name="pageStep">
+ <number>4096</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>mWhitenessSlider</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="lineStep">
+ <number>256</number>
+ </property>
+ <property name="pageStep">
+ <number>4096</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ <widget class="QSlider">
+ <property name="name">
+ <cstring>mHueSlider</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maxValue">
+ <number>65535</number>
+ </property>
+ <property name="lineStep">
+ <number>256</number>
+ </property>
+ <property name="pageStep">
+ <number>4096</number>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Optio&amp;ns</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout8</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>ImageOptions</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>5</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Image options</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mImageAutoBrightnessContrast</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Au&amp;tomatic brightness/contrast adjustment</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mImageAutoColorCorrection</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>Automatic color correction</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mImageAsMirror</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>See preview mirrored</string>
+ </property>
+ <property name="accel">
+ <string></string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>imageLeftSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>mVideoImageLabel</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>320</width>
+ <height>240</height>
+ </size>
+ </property>
+ <property name="pixmap">
+ <pixmap>image0</pixmap>
+ </property>
+ <property name="scaledContents">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>imageRightSpacer</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4833">789c8597596f23470e80dfe75718c3b7c182e9eabb11ec834fc9873cbeaf601fc86ec9966df994cfc5fef794483633934d10c836fcb9582cde55fee5dbd2d9de68e9db2f5f9ee7349fb64bed153d2d7deb5e66b38fdffef3efff7ef99aa64b8baf2c5b4abffeebcb57dc5c6a9720499290640b8613e110ff22eb941b07657e7256f90be742e4a7c6a9ed076791c7a1732efbd784d3f817615a71167db0e55c0a17ce95c88f8ced3c7e74d6f306cea29fd159f583b3e8a75367d18f5bce8df0b63389be67e3ccfcd97716fd78e22cfaf1d459edefedcbedbc63e75af4cf85b33edeb8616cfef1b5b39eb7e72cf6c28b7166fb53678df7b5b3fadf388b3d503a8b3d40c6b9eaa35767d9cf37c6a5e53f73d6f3769d55bedf5f2789ac6bfcf2de1fda33ce4cdfbb716eeb6fce1acf1de3c2f2bbe7acf573605cdafe2b67f5efd359f20bb97165febe38b3c453fd2bfa7cd0a67165fea97c9db416ff1de3b1e9d77a6d12567bf8c159ed9d1ab7969fc2b8d378e2ba304579c93769bd719457fd524f2184cae221f51bd250a8fd3c35ae4cfec1b8b6fa06e3c6eaffc859d651f215b2d0c7efdab8327b969d459e9e8d7bfd57c68df587c43be4c1e20b685c1b9f0b17c1e283cfce927f96f911ca40d63fcbce7afebd31eb3a91b3fa37376ead9e64dea5759606a94f546eb23499883d9bc69932bef4acf22cf594725c1f8bfca9b3c8d3aa711e82c82bb73de3817111a4fe2171d67e1a1b97ba8e87ce5a8f12bfb48b2cfae8ceb85206894f9666135bff2e5c45d6fae894a3393a3f5be13aaeb7729eca4ff2d6ce3f5b701ef2b1c95f0aa7715dfb4de657519675d0fc8d8c9ba0f527f12faab234fd8fc695f1ab716dfa3f84ebb2089dec5f779678d381711d74beae398b7f540b3751bfd6e39ab1c9033b6bbd07e326687dcb3c2da8ecf47cfa301e9bbe37e389c94b3c0a2edba0f5f361dc194b3c8b36eed77acf9c453fab7f6d95587e6e8d83c957c25dc9668fdc5fc538b2c6e3a6e754e7adcc836252b6a9d69bccffb2ad535d67e98fb2ab538befaab3e8439947e5b84e82f6ffa17165f1bd7096fcc1ccb8b67a981b375a0f20f92d2775b078493dd54c75aaef0de9dfba75167fea2eb2f683dc5771388d753fbe396b7fca7c6b52ea2c5e57ce621fcbfdd26464f1812767ed8f63e3ced665de34c464fe9e1bb3d5b3f45bc3dca67a7fc9fba7697b46a9bf66cc13cb8fcc8b66c2960f3832b6f3988dad1e2828b799c53371d6f9766b9c5b7f4afe286983f5c3aeb3be177ace6c1ecc9cb51f6a678def8a7169f351fca710f5a93d9db3d64febacf9981aa76a2f5e3b6b7d5d1af7f6df3aebfb67e4acf93f72d6f972675cd83c7d77d67cac3bebfdfce9acf7eb87b3c66b665cdabc5feed9f44bfd51caade59395dbc4fc3f33cecc9f9b9e35bf786fdccfffc459e7ffc059eb7fe2acefcfd459df13dbceda5f4367bddffed8affdf0665c243a6f769c351f6367f51f7ad6fcefcf9dd57e72567fd959e3dd3a6bbc3b677daf34ce6affadb3dadbdb57263a5f46ce7adf8e9dd5dededfbe5e2f9cb5de5b678df7bb71a5fa59f767dccf77cd57d6f7136c185b7e79d359f3159cf53df7e8acf19e19f7f57ee5acef9b0d67f5b733b6fa844b63f38f07ceea9fcc3fca5b9bef58199b3dbce5acefa53567bd6fee8c73d54f95b3fa3b34b6fcc3b3b3f6dba1b3f6afe6a788fb6bad9f1f3f08f19b90b18ddff0f3dafefc2fe4bb284948f1b7f1e2e73fca4ff012af708ad77883b77f2f8f33bc8b9aeff1011ff1099f718e2ff88a6ff88e1ff8196da33fc92fe30aaee21aaee3060e70889bb885dbb88323dc8d7a407df941be8dd2dfa3ec5e94dac7033cc4233cc6133cc5333cc78bffb327c18029669863812556d1ef1a9ba8168080a1850ec608daaf30814bb882296ec035dc486426700b33b8837b78c0213cc2133ce367af3f7a93c01c5e700b5ee10d6fe11d093ee01396610556f104d6601d36a2d77abf0da2f41036610bb6b1841d18c12e7c873dd887033884233886133885b318297d3fc558e114cee1021208d1e01432c8a180122aa8e3c5190f2322c63bb507995aea62bc37698c9f34a14bba822d9ad235ddd02dcde80e87744f0f7fc823d1233de1363d634d737aa1577aa3ebf8047ba70ffaa4655aa1555aa375b37f0c298e6923ca0fb0a1212cd3266dd136edd08876e93bedd13e1dd0211d997e88f6031dd3099d624e67744e17f15f8b40296594cb273ef61632aa5ff34515d5d43032707c19449fd6e993db283b8217ee62fc0630fa31bf1cdf037c493bb1724ef98a162d30e56bcae185467cc3b731dfa0f935f919dff13daef1033ff2133fc77d039e73d41da55ff90d268b8afba17ea27d30a18edff9833f7999577895d7a88421aff31b6fc0e04ff5c6314acc031ef2266cc4c7ce036ff12ca66a10ff75d95eacfd2ccf3b0bfd38e651ac93f7d83b77f84e47d1e6f1222e0bf9c5ef3ff7a3f690766f4ffd0490aa85affffbf5cbef985d44a8</data>
+ </image>
+</images>
+<slots>
+ <slot>mHueSlider_valueChanged(int)</slot>
+ <slot>mHueSlider_sliderPressed()</slot>
+ <slot>mHueSlider_destroyed(QObject*)</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kcombobox.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/avdevice/cr128-app-kopete_avdevice.png b/kopete/kopete/config/avdevice/cr128-app-kopete_avdevice.png
new file mode 100644
index 00000000..a4e4fa58
--- /dev/null
+++ b/kopete/kopete/config/avdevice/cr128-app-kopete_avdevice.png
Binary files differ
diff --git a/kopete/kopete/config/avdevice/cr22-app-kopete_avdevice.png b/kopete/kopete/config/avdevice/cr22-app-kopete_avdevice.png
new file mode 100644
index 00000000..4b0eaa77
--- /dev/null
+++ b/kopete/kopete/config/avdevice/cr22-app-kopete_avdevice.png
Binary files differ
diff --git a/kopete/kopete/config/avdevice/cr32-app-kopete_avdevice.png b/kopete/kopete/config/avdevice/cr32-app-kopete_avdevice.png
new file mode 100644
index 00000000..df6476e9
--- /dev/null
+++ b/kopete/kopete/config/avdevice/cr32-app-kopete_avdevice.png
Binary files differ
diff --git a/kopete/kopete/config/avdevice/cr64-app-kopete_avdevice.png b/kopete/kopete/config/avdevice/cr64-app-kopete_avdevice.png
new file mode 100644
index 00000000..3d382289
--- /dev/null
+++ b/kopete/kopete/config/avdevice/cr64-app-kopete_avdevice.png
Binary files differ
diff --git a/kopete/kopete/config/avdevice/kopete_avdeviceconfig.desktop b/kopete/kopete/config/avdevice/kopete_avdeviceconfig.desktop
new file mode 100644
index 00000000..49fa3e94
--- /dev/null
+++ b/kopete/kopete/config/avdevice/kopete_avdeviceconfig.desktop
@@ -0,0 +1,118 @@
+[Desktop Entry]
+Icon=kopete_avdevice
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_avdeviceconfig
+X-KDE-FactoryName=KopeteAVDeviceConfigFactory
+X-KDE-ParentApp=kopete
+X-KDE-ParentComponents=kopete
+
+Name=Devices
+Name[be]=Прылады
+Name[bg]=Устройства
+Name[bn]=ডিভাইস
+Name[br]=Trobarzhelloù
+Name[bs]=Uređaji
+Name[ca]=Dispositius
+Name[cs]=Zařízení
+Name[cy]=Dyfeisiau
+Name[da]=Enheder
+Name[de]=Geräte
+Name[el]=Συσκευές
+Name[eo]=Aparatoj
+Name[es]=Dispositivos
+Name[et]=Seadmed
+Name[eu]=Dispositiboak
+Name[fa]=دستگاهها
+Name[fi]=Laitteet
+Name[fr]=Périphériques
+Name[ga]=Gléasanna
+Name[gl]=Dispositivos
+Name[he]=התקנים
+Name[hu]=Eszközök
+Name[id]=Divais
+Name[is]=Tæki
+Name[it]=Periferiche
+Name[ja]=デバイス
+Name[ka]=მოწყობილობები
+Name[kk]=Құрылығылар
+Name[km]=ឧបករណ៍
+Name[lt]=Įrenginiai
+Name[lv]=Iekārtas
+Name[nb]=Enheter
+Name[nds]=Reedschappen
+Name[ne]=यन्त्र
+Name[nl]=Apparaten
+Name[nn]=Einingar
+Name[pa]=ਜੰਤਰ
+Name[pl]=Urządzenia
+Name[pt]=Dispositivos
+Name[pt_BR]=Dispositivos
+Name[ru]=Устройства
+Name[rw]=Apareye
+Name[sk]=Zariadenia
+Name[sl]=Naprave
+Name[sr]=Уређаји
+Name[sr@Latn]=Uređaji
+Name[sv]=Enheter
+Name[th]=อุปกรณ์
+Name[tr]=Aygıtlar
+Name[uk]=Пристрої
+Name[uz]=Uskunalar
+Name[uz@cyrillic]=Ускуналар
+Name[ven]=Maano
+Name[wa]=Éndjins
+Name[xh]=Amacebo
+Name[zh_CN]=设备
+Name[zh_HK]=裝置
+Name[zh_TW]=裝置
+Name[zu]=Amacebo
+Comment=Here You Can Alter Kopete's Video And Audio Devices' Settings
+Comment[be]=Настаўленні відэа- і аўдыёпрыладаў для працы з Kopete
+Comment[bg]=Настройване на видео и аудио устройствата на програмата
+Comment[bn]=আপনি এখানে কপেটের ভিডিও এবং অডিও ডিভাইসের মানসমূহ পরিবর্তন করতে পারেন
+Comment[bs]=Ovdje možete izmijeniti postavke Kopete-a za video i audio uređaje
+Comment[ca]=Aquí podreu modificar els paràmetres dels dispositius d'àudio i vídeo del Kopete
+Comment[cs]=Zde je možné přizpůsobit si nastavení audio a video zařízení
+Comment[da]=Her kan du ændre Kopete's video- og lydenheds opsætning
+Comment[de]=Hier können Sie Kopetes Einstellungen zu Audio- und Videogeräten verändern
+Comment[el]=Εδώ μπορείτε να τροποποιήσετε τις ρυθμίσεις των συσκευών βίντεο και ήχου
+Comment[es]=Aquí­ puede configurar los dispositivos de sonido y audio de Kopete
+Comment[et]=Siin saab muuta Kopete video- ja heliseadmete seadistusi
+Comment[eu]=Hemen Kopete-ren bideo eta audio ezarpenak ezar ditzakezu
+Comment[fa]=اینجا می‌توانید تنظیمات دستگاههای ویدیویی و صوتیKopete را تغییر دهید
+Comment[fi]=Täältä voit muuttaa Kopeten video- ja äänilaitteiden asetuksia
+Comment[fr]=Vous pouvez modifier ici la configuration des périphériques audio et vidéo de Kopete
+Comment[gl]=Aquí podes modificar as opcións dos dispositivos de video e audio de Kopete
+Comment[hu]=Itt lehet módosítani a Kopete video- és hangbeállításait
+Comment[is]=Hér getur þú breytt vídeó- og hljóðtæki stillingum Kopete
+Comment[it]=Qui puoi modificare le impostazioni audio e video di Kopete
+Comment[ja]=ここで Kopete の A/V デバイス設定を変更します
+Comment[ka]=აქ თქვენ შეგიძლიათ Kopeteს ვიდეო და აუდიო მოწყობილობების პარამეტრების გამართვა
+Comment[kk]=Мұнда Kopete-тің бейне мен дыбыс құрылығылардың параметрлерін өзгерте аласыз
+Comment[km]=ទីនេះ អ្នក​អាច​ប្ដូរ​ការ​កំណត់​នៃ​ឧបករណ៍​អូឌីយ៉ូ និង​វីដេអូ​របស់ Kopete
+Comment[lt]=Čia galite keisti Kopete video ir audio įrenginių nustatymus
+Comment[nb]=Her kan du endre innstillinger for lyd og bilde i Kopete
+Comment[nds]=Hier kannst Du de Instellen för de Video- un Audio-Reedschappen vun Kopete ännern
+Comment[ne]=यहाँ तपाईँ कोपेटको भिडियो र अडियो यन्त्र सेटिङ अल्टर गर्न सक्नुहुन्छ
+Comment[nl]=Hier kunt u de video- en audioapparaten voor Kopete instellen
+Comment[nn]=Her kan du endra på innstillingane for lyd og bilete i Kopete
+Comment[pl]=Tutaj można zmienić ustawienia urządzeń audio i wideo Kopete
+Comment[pt]=Aqui Você Pode Alterar a Configuração do Áudio e Vídeo do Kopete
+Comment[pt_BR]=Aqui você pode alterar as configurações dos dispositivos de audio e vídeo do Kopete
+Comment[ru]=Параметры видео- и аудиоустройств для Kopete
+Comment[sk]=Tu môžete upraviť nastavenia video a audio zariadení pre Kopete
+Comment[sl]=Tukaj lahko spreminjate nastavitve video in zvočnih naprav za Kopete
+Comment[sr]=Овде можете променити поставке Kopete-ових аудио и видео уређаја
+Comment[sr@Latn]=Ovde možete promeniti postavke Kopete-ovih audio i video uređaja
+Comment[sv]=Här kan du ändra Kopetes video- och ljudenhetsinställningar
+Comment[tr]=Kopete'nin Video ve Ses Ayarlarını Buradan Değiştirebilirsiniz
+Comment[uk]=Тут можна змінити відео і аудіо параметри Kopete
+Comment[uz]=Bu yerda video va audio uskunalarini moslash mumkin
+Comment[uz@cyrillic]=Бу ерда видео ва аудио ускуналарини мослаш мумкин
+Comment[zh_CN]=您可在此更改 Kopete 的影音设备设置
+Comment[zh_HK]=在此您可改動 Kopete 視像和音訊裝置的設定
+Comment[zh_TW]=您可以在此改變 Kopete 的影像與聲音裝置設定
+DocPath=kopete/configure-dialog.html#configuring-avdevice
diff --git a/kopete/kopete/config/behavior/Makefile.am b/kopete/kopete/config/behavior/Makefile.am
new file mode 100644
index 00000000..cc7a6196
--- /dev/null
+++ b/kopete/kopete/config/behavior/Makefile.am
@@ -0,0 +1,18 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) -I$(top_srcdir)/kopete/libkopete/private $(KOPETE_COMPAT_INCLUDES) $(all_includes)
+
+kde_module_LTLIBRARIES = kcm_kopete_behaviorconfig.la
+
+kcm_kopete_behaviorconfig_la_SOURCES = \
+ kopeteawayconfigbase.ui \
+ behaviorconfig_chat.ui behaviorconfig_general.ui behaviorconfig_events.ui behaviorconfig.cpp
+
+kcm_kopete_behaviorconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries)
+
+kcm_kopete_behaviorconfig_la_LIBADD = ../../../libkopete/libkopete.la \
+ $(LIB_KOPETECOMPAT) $(LIB_KUTILS)
+
+service_DATA = kopete_behaviorconfig.desktop
+servicedir = $(kde_servicesdir)
+
+# vim: set noet:
diff --git a/kopete/kopete/config/behavior/behaviorconfig.cpp b/kopete/kopete/config/behavior/behaviorconfig.cpp
new file mode 100644
index 00000000..379e762a
--- /dev/null
+++ b/kopete/kopete/config/behavior/behaviorconfig.cpp
@@ -0,0 +1,305 @@
+/*
+ behaviorconfig.cpp - Kopete Look Feel Config
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "behaviorconfig.h"
+#include "behaviorconfig_general.h"
+#include "behaviorconfig_events.h"
+#include "behaviorconfig_chat.h"
+
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qlayout.h>
+#include <qlabel.h>
+#include <qhbuttongroup.h>
+#include <qspinbox.h>
+#include <qcombobox.h>
+#include <qradiobutton.h>
+
+#include <kdebug.h>
+#include <kplugininfo.h>
+#include <klocale.h>
+#include <kpushbutton.h>
+#include <kgenericfactory.h>
+#include <ktrader.h>
+#include <kconfig.h>
+#include <klineedit.h>
+
+#include "kopeteprefs.h"
+#include "kopeteaway.h"
+#include "kopeteawayconfigbase.h"
+#include "kopetepluginmanager.h"
+#include "kopeteaway.h"
+
+#include <qtabwidget.h>
+
+typedef KGenericFactory<BehaviorConfig, QWidget> KopeteBehaviorConfigFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_behaviorconfig, KopeteBehaviorConfigFactory( "kcm_kopete_behaviorconfig" ) )
+
+
+BehaviorConfig::BehaviorConfig(QWidget *parent, const char * /* name */, const QStringList &args) :
+ KCModule( KopeteBehaviorConfigFactory::instance(), parent, args )
+{
+ (new QVBoxLayout(this))->setAutoAdd(true);
+ mBehaviorTabCtl = new QTabWidget(this, "mBehaviorTabCtl");
+
+ // "General" TAB ============================================================
+ mPrfsGeneral = new BehaviorConfig_General(mBehaviorTabCtl);
+ mBehaviorTabCtl->addTab(mPrfsGeneral, i18n("&General"));
+
+ // "Events" TAB ============================================================
+ mPrfsEvents = new BehaviorConfig_Events(mBehaviorTabCtl);
+ mBehaviorTabCtl->addTab(mPrfsEvents, i18n("&Events"));
+
+ // "Away" TAB ===============================================================
+ mAwayConfigUI = new KopeteAwayConfigBaseUI(mBehaviorTabCtl);
+ mBehaviorTabCtl->addTab(mAwayConfigUI, i18n("A&way Settings"));
+
+ // "Chat" TAB ===============================================================
+ mPrfsChat = new BehaviorConfig_Chat(mBehaviorTabCtl);
+ mBehaviorTabCtl->addTab(mPrfsChat, i18n("Cha&t"));
+
+ Kopete::PluginManager *pluginManager = Kopete::PluginManager::self();
+ viewPlugins = pluginManager->availablePlugins("Views");
+
+ load();
+
+
+ // "General" TAB ============================================================
+ connect(mPrfsGeneral->mShowTrayChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsGeneral->mStartDockedChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsGeneral->mUseQueueChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsGeneral->mUseStackChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsGeneral->mQueueUnreadMessagesChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsGeneral->mAutoConnect, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+
+ // "Events" TAB ============================================================
+ connect(mPrfsEvents->mQueueOnlyHighlightedMessagesInGroupChatsChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mQueueOnlyMessagesOnAnotherDesktopChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mBalloonNotifyChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mBalloonNotifyIgnoreClosesChatViewChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mCloseBalloonChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mBalloonCloseDelay, SIGNAL(valueChanged(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect(mPrfsEvents->mTrayflashNotifyChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mTrayflashNotifyLeftClickOpensMessageChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mTrayflashNotifySetCurrentDesktopToChatViewChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mSoundIfAwayChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mEventIfActive, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect(mPrfsEvents->mRaiseMsgWindowChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+
+
+ // "Chat" TAB ===============================================================
+ connect( mPrfsChat->cb_ShowEventsChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mPrfsChat->highlightEnabled, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mPrfsChat->cb_SpellCheckChk, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mPrfsChat->cmbChatGroupingPolicy, SIGNAL(activated(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mPrfsChat->mChatViewBufferSize, SIGNAL(valueChanged(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mPrfsChat->truncateContactNameEnabled, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mPrfsChat->mMaxContactNameLength, SIGNAL(valueChanged(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mPrfsChat->viewPlugin, SIGNAL(activated(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mPrfsChat->viewPlugin, SIGNAL(activated(int)),
+ this, SLOT(slotUpdatePluginLabel(int)));
+
+ // "Away" TAB ===============================================================
+ connect( mAwayConfigUI->rememberedMessages, SIGNAL(valueChanged(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mAwayConfigUI->mAutoAwayTimeout, SIGNAL(valueChanged(int)),
+ this, SLOT(slotValueChanged(int)));
+ connect( mAwayConfigUI->mGoAvailable, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mAwayConfigUI->mUseAutoAway, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mAwayConfigUI->mDisplayLastAwayMessage, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mAwayConfigUI->mDisplayCustomAwayMessage, SIGNAL(toggled(bool)),
+ this, SLOT(slotSettingsChanged(bool)));
+ connect( mAwayConfigUI->mAutoAwayMessageEdit, SIGNAL(textChanged(const QString&)),
+ this, SLOT(slotTextChanged(const QString&)));
+}
+
+void BehaviorConfig::save()
+{
+// kdDebug(14000) << k_funcinfo << "called." << endl;
+
+ KopetePrefs *p = KopetePrefs::prefs();
+ KConfig *config = KGlobal::config();
+
+ // "General" TAB ============================================================
+ p->setShowTray(mPrfsGeneral->mShowTrayChk->isChecked());
+ p->setStartDocked(mPrfsGeneral->mStartDockedChk->isChecked());
+ p->setUseQueue(mPrfsGeneral->mUseQueueChk->isChecked());
+ p->setUseStack(mPrfsGeneral->mUseStackChk->isChecked());
+ p->setQueueUnreadMessages(mPrfsGeneral->mQueueUnreadMessagesChk->isChecked());
+ p->setAutoConnect(mPrfsGeneral->mAutoConnect->isChecked());
+
+ // "Events" TAB ============================================================
+ p->setQueueOnlyHighlightedMessagesInGroupChats(mPrfsEvents->mQueueOnlyHighlightedMessagesInGroupChatsChk->isChecked());
+ p->setQueueOnlyMessagesOnAnotherDesktop(mPrfsEvents->mQueueOnlyMessagesOnAnotherDesktopChk->isChecked());
+ p->setBalloonNotify(mPrfsEvents->mBalloonNotifyChk->isChecked());
+ p->setBalloonNotifyIgnoreClosesChatView(mPrfsEvents->mBalloonNotifyIgnoreClosesChatViewChk->isChecked());
+ p->setBalloonClose(mPrfsEvents->mCloseBalloonChk->isChecked());
+ p->setBalloonDelay(mPrfsEvents->mBalloonCloseDelay->value());
+ p->setTrayflashNotify(mPrfsEvents->mTrayflashNotifyChk->isChecked());
+ p->setTrayflashNotifyLeftClickOpensMessage(mPrfsEvents->mTrayflashNotifyLeftClickOpensMessageChk->isChecked());
+ p->setTrayflashNotifySetCurrentDesktopToChatView(mPrfsEvents->mTrayflashNotifySetCurrentDesktopToChatViewChk->isChecked());
+ p->setSoundIfAway(mPrfsEvents->mSoundIfAwayChk->isChecked());
+ p->setRaiseMsgWindow(mPrfsEvents->mRaiseMsgWindowChk->isChecked());
+ config->setGroup("General");
+ config->writeEntry("EventIfActive", mPrfsEvents->mEventIfActive->isChecked());
+
+ // "Away" TAB ===============================================================
+ p->setRememberedMessages( mAwayConfigUI->rememberedMessages->value() );
+
+ config->setGroup("AutoAway");
+ config->writeEntry("Timeout", mAwayConfigUI->mAutoAwayTimeout->value() * 60);
+ config->writeEntry("GoAvailable", mAwayConfigUI->mGoAvailable->isChecked());
+ config->writeEntry("UseAutoAway", mAwayConfigUI->mUseAutoAway->isChecked() );
+ config->writeEntry("UseAutoAwayMessage", mAwayConfigUI->mDisplayCustomAwayMessage->isChecked() );
+ config->sync();
+
+ // Save the auto away message, if defined
+ if( mAwayConfigUI->mDisplayCustomAwayMessage->isChecked() )
+ {
+ awayInstance->setAutoAwayMessage( mAwayConfigUI->mAutoAwayMessageEdit->text() );
+ }
+
+ // "Chat" TAB ===============================================================
+ p->setShowEvents(mPrfsChat->cb_ShowEventsChk->isChecked());
+ p->setHighlightEnabled(mPrfsChat->highlightEnabled->isChecked());
+ p->setSpellCheck(mPrfsChat->cb_SpellCheckChk->isChecked());
+ p->setInterfacePreference( viewPlugins[mPrfsChat->viewPlugin->currentItem()]->pluginName() );
+ p->setChatWindowPolicy(mPrfsChat->cmbChatGroupingPolicy->currentItem());
+
+ p->setChatViewBufferSize(mPrfsChat->mChatViewBufferSize->value());
+ p->setTruncateContactNames(mPrfsChat->truncateContactNameEnabled->isChecked());
+ p->setMaxContactNameLength(mPrfsChat->mMaxContactNameLength->value());
+
+ p->save();
+ emit changed(false);
+}
+
+void BehaviorConfig::load()
+{
+// kdDebug(14000) << k_funcinfo << "called" << endl;
+ KopetePrefs *p = KopetePrefs::prefs();
+ KConfig *config = KGlobal::config();
+ awayInstance = Kopete::Away::getInstance();
+
+ // "General" TAB ============================================================
+ mPrfsGeneral->mShowTrayChk->setChecked( p->showTray() );
+ mPrfsGeneral->mStartDockedChk->setChecked( p->startDocked() );
+ mPrfsGeneral->mInstantMessageOpeningChk->setChecked( !p->useQueue() && !p->useStack());
+ mPrfsGeneral->mUseQueueChk->setChecked( p->useQueue() );
+ mPrfsGeneral->mUseStackChk->setChecked( p->useStack() );
+ mPrfsGeneral->mQueueUnreadMessagesChk->setChecked ( p->queueUnreadMessages() );
+ mPrfsGeneral->mAutoConnect->setChecked( p->autoConnect() );
+
+ // "Events" TAB ============================================================
+ mPrfsEvents->mQueueOnlyHighlightedMessagesInGroupChatsChk->setChecked ( p->queueOnlyHighlightedMessagesInGroupChats() );
+ mPrfsEvents->mQueueOnlyMessagesOnAnotherDesktopChk->setChecked ( p->queueOnlyMessagesOnAnotherDesktop() );
+ mPrfsEvents->mBalloonNotifyChk->setChecked ( p->balloonNotify() );
+ mPrfsEvents->mBalloonNotifyIgnoreClosesChatViewChk->setChecked ( p->balloonNotifyIgnoreClosesChatView() );
+ mPrfsEvents->mCloseBalloonChk->setChecked( p->balloonClose() );
+ mPrfsEvents->mBalloonCloseDelay->setValue( p->balloonCloseDelay() );
+ mPrfsEvents->mTrayflashNotifyChk->setChecked ( p->trayflashNotify() );
+ mPrfsEvents->mTrayflashNotifyLeftClickOpensMessageChk->setChecked ( p->trayflashNotifyLeftClickOpensMessage() );
+ mPrfsEvents->mTrayflashNotifySetCurrentDesktopToChatViewChk->setChecked ( p->trayflashNotifySetCurrentDesktopToChatView() );
+ mPrfsEvents->mSoundIfAwayChk->setChecked( p->soundIfAway() );
+ mPrfsEvents->mRaiseMsgWindowChk->setChecked(p->raiseMsgWindow());
+ config->setGroup("General");
+ mPrfsEvents->mEventIfActive->setChecked(config->readBoolEntry("EventIfActive", true));
+
+ // "Away" TAB ===============================================================
+ config->setGroup("AutoAway");
+ mAwayConfigUI->mAutoAwayTimeout->setValue(config->readNumEntry("Timeout", 600)/60);
+ mAwayConfigUI->mGoAvailable->setChecked(config->readBoolEntry("GoAvailable", true));
+ mAwayConfigUI->mUseAutoAway->setChecked(config->readBoolEntry("UseAutoAway", true));
+ mAwayConfigUI->rememberedMessages->setValue( p->rememberedMessages() );
+ mAwayConfigUI->mAutoAwayMessageEdit->setText( awayInstance->autoAwayMessage() );
+
+ // Always display the last away message by default
+ mAwayConfigUI->mDisplayCustomAwayMessage->setChecked(config->readBoolEntry("UseAutoAwayMessage", false));
+
+ // "Chat" TAB ===============================================================
+ mPrfsChat->cb_ShowEventsChk->setChecked(p->showEvents());
+ mPrfsChat->highlightEnabled->setChecked(p->highlightEnabled());
+ mPrfsChat->cb_SpellCheckChk->setChecked(p->spellCheck());
+ mPrfsChat->cmbChatGroupingPolicy->setCurrentItem(p->chatWindowPolicy());
+
+ mPrfsChat->mChatViewBufferSize->setValue(p->chatViewBufferSize());
+ mPrfsChat->truncateContactNameEnabled->setChecked(p->truncateContactNames());
+ mPrfsChat->mMaxContactNameLength->setValue(p->maxConactNameLength());
+
+
+ mPrfsChat->viewPlugin->clear();
+ int selectedIdx = 0, i = 0;
+ for( QValueList<KPluginInfo*>::iterator it = viewPlugins.begin(); it != viewPlugins.end(); ++it )
+ {
+ if( (*it)->pluginName() == p->interfacePreference() )
+ selectedIdx = i;
+ mPrfsChat->viewPlugin->insertItem( (*it)->name(), i++ );
+ }
+
+ mPrfsChat->viewPlugin->setCurrentItem(selectedIdx);
+ slotUpdatePluginLabel(selectedIdx);
+}
+
+void BehaviorConfig::slotUpdatePluginLabel(int)
+{
+ mPrfsChat->viewPluginLabel->setText( viewPlugins[ mPrfsChat->viewPlugin->currentItem() ]->comment() );
+}
+
+void BehaviorConfig::slotSettingsChanged(bool)
+{
+ emit changed(true);
+}
+
+void BehaviorConfig::slotValueChanged(int)
+{
+ emit changed( true );
+}
+
+void BehaviorConfig::slotTextChanged(const QString&)
+{
+ emit changed( true );
+}
+
+#include "behaviorconfig.moc"
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/behavior/behaviorconfig.h b/kopete/kopete/config/behavior/behaviorconfig.h
new file mode 100644
index 00000000..5a981784
--- /dev/null
+++ b/kopete/kopete/config/behavior/behaviorconfig.h
@@ -0,0 +1,61 @@
+/*
+ behaviorconfig.h - Kopete Look Feel Config
+
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef __BEHAVIOR_H
+#define __BEHAVIOR_H
+
+#include "kcmodule.h"
+
+namespace Kopete
+{
+class Away;
+}
+
+class QFrame;
+class QTabWidget;
+
+class BehaviorConfig_General;
+class BehaviorConfig_Events;
+class BehaviorConfig_Chat;
+class KopeteAwayConfigBaseUI;
+class KPluginInfo;
+
+class BehaviorConfig : public KCModule
+{
+ Q_OBJECT
+
+ public:
+ BehaviorConfig(QWidget *parent, const char * name , const QStringList &args) ;
+
+ virtual void save();
+ virtual void load();
+
+ private slots:
+ void slotSettingsChanged(bool);
+ void slotValueChanged(int);
+ void slotUpdatePluginLabel(int);
+ void slotTextChanged(const QString&);
+
+ private:
+ QTabWidget* mBehaviorTabCtl;
+ BehaviorConfig_General *mPrfsGeneral;
+ BehaviorConfig_Events *mPrfsEvents;
+ BehaviorConfig_Chat *mPrfsChat;
+ KopeteAwayConfigBaseUI *mAwayConfigUI;
+ QValueList<KPluginInfo*> viewPlugins;
+ Kopete::Away* awayInstance;
+};
+#endif
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/behavior/behaviorconfig_chat.ui b/kopete/kopete/config/behavior/behaviorconfig_chat.ui
new file mode 100644
index 00000000..26bfae46
--- /dev/null
+++ b/kopete/kopete/config/behavior/behaviorconfig_chat.ui
@@ -0,0 +1,308 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>BehaviorConfig_Chat</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BehaviorConfig_Chat</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>564</width>
+ <height>537</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Chat</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup" row="4" column="0">
+ <property name="name">
+ <cstring>interfaceGroup</cstring>
+ </property>
+ <property name="title">
+ <string>&amp;Interface Preference</string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>viewPlugin</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>viewPluginLabel</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>viewPlugin</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <spacer row="8" column="0">
+ <property name="name">
+ <cstring>spacer2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>240</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QButtonGroup" row="5" column="0">
+ <property name="name">
+ <cstring>chatWindowGroup</cstring>
+ </property>
+ <property name="title">
+ <string>Chat Window Grouping &amp;Policy</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox" row="7" column="0">
+ <item>
+ <property name="text">
+ <string>Open All Messages in New Chat Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Group Messages From Same Account in Same Chat Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Group All Messages in Same Chat Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Group Messages From Contacts in Same Group in Same Chat Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Group Messages From Same Metacontact in Same Chat Window</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>cmbChatGroupingPolicy</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;dl&gt;
+ &lt;dt&gt;&lt;tt&gt;Open all messages in a new chat window&lt;/tt&gt;
+ &lt;dd&gt;Every chat will have its own window.
+ &lt;dt&gt;&lt;tt&gt;Group messages from the same account in the same chat window&lt;/tt&gt;
+ &lt;dd&gt;All chats for one account get grouped in to one window by using tabs.
+ &lt;dt&gt;&lt;tt&gt;Group all messages in the same chat window&lt;/tt&gt;
+ &lt;dd&gt;All chats get grouped in to one window by using tabs.
+ &lt;dt&gt;&lt;tt&gt;Group messages from contacts in the same group in the same chat window&lt;/tt&gt;
+ &lt;dd&gt;All chats from one group get grouped in to one window by using tabs.
+ &lt;dt&gt;&lt;tt&gt;Group messages from the same metacontact in the same chat window&lt;/tt&gt;
+ &lt;dd&gt;All chats from one metacontact get grouped in to one window by using tabs.
+ &lt;/dl&gt;
+ </string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QCheckBox" row="2" column="0">
+ <property name="name">
+ <cstring>highlightEnabled</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>High&amp;light messages containing your nickname</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="3" column="0">
+ <property name="name">
+ <cstring>cb_SpellCheckChk</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>E&amp;nable automatic spell checking</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>cb_ShowEventsChk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Show events in chat window</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="6" column="0">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>truncateContactNameEnabled</cstring>
+ </property>
+ <property name="text">
+ <string>T&amp;runcate contact name with more characters than:</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer3</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>120</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>mMaxContactNameLength</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="minValue">
+ <number>5</number>
+ </property>
+ <property name="value">
+ <number>20</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="7" column="0">
+ <property name="name">
+ <cstring>layout4</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>txtChatViewBufferSize</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Maximum number of chat window lines:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mChatViewBufferSize</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Limit the maximum number of lines visible in a chat window to improve speed for complex layouts.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>212</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>mChatViewBufferSize</cstring>
+ </property>
+ <property name="maxValue">
+ <number>9000</number>
+ </property>
+ <property name="minValue">
+ <number>2</number>
+ </property>
+ <property name="value">
+ <number>250</number>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>truncateContactNameEnabled</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mMaxContactNameLength</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>cb_ShowEventsChk</tabstop>
+ <tabstop>highlightEnabled</tabstop>
+ <tabstop>cb_SpellCheckChk</tabstop>
+ <tabstop>viewPlugin</tabstop>
+ <tabstop>cmbChatGroupingPolicy</tabstop>
+ <tabstop>truncateContactNameEnabled</tabstop>
+ <tabstop>mMaxContactNameLength</tabstop>
+ <tabstop>mChatViewBufferSize</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/kopete/config/behavior/behaviorconfig_events.ui b/kopete/kopete/config/behavior/behaviorconfig_events.ui
new file mode 100644
index 00000000..ea2d1ea3
--- /dev/null
+++ b/kopete/kopete/config/behavior/behaviorconfig_events.ui
@@ -0,0 +1,388 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>BehaviorConfig_Events</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BehaviorConfig_Events</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>427</width>
+ <height>386</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Events</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>notifyGroupBox</cstring>
+ </property>
+ <property name="title">
+ <string>Tray Flash &amp;&amp; Bubble</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mTrayflashNotifyChk</cstring>
+ </property>
+ <property name="text">
+ <string>Flash s&amp;ystem tray</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Flash the system tray icon on an incoming message</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Flash the system tray icon whenever a message comes in.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11_2</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mTrayflashNotifyLeftClickOpensMessageChk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>&amp;Left mouse click opens message</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Left mouse click on flashing system tray opens message instead of restoring/minimizing contact list</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>A left mouse click on the flashing system tray icon opens the incoming message instead of restoring/minimizing the contact list (e.g. to check who is sending messages). A middle click always opens this message.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mBalloonNotifyChk</cstring>
+ </property>
+ <property name="text">
+ <string>Sho&amp;w bubble</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Show a bubble on an incoming message</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Show a bubble whenever a message comes in.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer10</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mBalloonNotifyIgnoreClosesChatViewChk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Button "&amp;Ignore" closes chat</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The "Ignore" button of the bubble closes the chat window for the sender</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If there is already a chat window opened for the sender of the message displayed in the bubble the "Ignore" button will close this chat window.</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mCloseBalloonChk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Close &amp;bubble automatically after</string>
+ </property>
+ <property name="checked">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Automatically close bubble after fixed amount of time</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Bubbles will automatically be closed after a fixed amount of time. A closed one will be replaced by a new one if another message is waiting.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>mBalloonCloseDelay</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="suffix">
+ <string> Sec</string>
+ </property>
+ <property name="maxValue">
+ <number>120</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>30</number>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>70</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mQueueOnlyHighlightedMessagesInGroupChatsChk</cstring>
+ </property>
+ <property name="text">
+ <string>Exclude non-highlighted messages in grou&amp;p chats</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Notify only highlighted messages in group chats</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>In very active group chats important messages can be singled out by excluding non-highlighted messages from notification.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mQueueOnlyMessagesOnAnotherDesktopChk</cstring>
+ </property>
+ <property name="text">
+ <string>Exclude messages in chats on current des&amp;ktop</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Do not display notification for messages in chat windows on current desktop</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This option allows you to turn off the notification of events for chat windows that are on the current desktop. If this option is turned on, then only chat windows on different desktops than the current one will notify you that an event has occured. Otherwise, all chat windows will notify you that an event has occured.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="title">
+ <string>Miscellaneous</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mSoundIfAwayChk</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;nable events while away</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enable events if your account status is "Away"</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enable notification events even if your account status is "Away" or less available, e.g. "Not Available" or "Do not Disturb". Note: This does not affect the flashing of the system tray icon.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mEventIfActive</cstring>
+ </property>
+ <property name="text">
+ <string>Enable events for acti&amp;ve chat windows</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Enable events for incoming messages if the chat window is active</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Enable notification events for incoming messages even if the receiving chat window is active. Note: Neither the system tray icon flashes nor the bubble is shown.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mTrayflashNotifySetCurrentDesktopToChatViewChk</cstring>
+ </property>
+ <property name="text">
+ <string>Switch &amp;to desktop containing chat on opening message</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Switch to the desktop which contains the chat window for the sender when opening his/her message</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If there is already a chat window open for the sender of the message, opening his/her message will cause a switch to the desktop which contains this chat window.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mRaiseMsgWindowChk</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Raise window on incoming message</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Raise the chat window/tab on an incoming message</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If there is already a chat window opened for the sender of an incoming message this window will be put on the current desktop and in front of all other windows.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>mTrayflashNotifyChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mTrayflashNotifyLeftClickOpensMessageChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mBalloonNotifyChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mBalloonNotifyIgnoreClosesChatViewChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mBalloonNotifyChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mCloseBalloonChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mBalloonNotifyChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mBalloonCloseDelay</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>mTrayflashNotifyChk</tabstop>
+ <tabstop>mBalloonNotifyChk</tabstop>
+ <tabstop>mQueueOnlyHighlightedMessagesInGroupChatsChk</tabstop>
+ <tabstop>mQueueOnlyMessagesOnAnotherDesktopChk</tabstop>
+ <tabstop>mSoundIfAwayChk</tabstop>
+ <tabstop>mEventIfActive</tabstop>
+ <tabstop>mTrayflashNotifySetCurrentDesktopToChatViewChk</tabstop>
+ <tabstop>mRaiseMsgWindowChk</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/kopete/config/behavior/behaviorconfig_general.ui b/kopete/kopete/config/behavior/behaviorconfig_general.ui
new file mode 100644
index 00000000..d15815ad
--- /dev/null
+++ b/kopete/kopete/config/behavior/behaviorconfig_general.ui
@@ -0,0 +1,211 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>BehaviorConfig_General</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>BehaviorConfig_General</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>348</width>
+ <height>302</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>General</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup2</cstring>
+ </property>
+ <property name="title">
+ <string>System Tray</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mShowTrayChk</cstring>
+ </property>
+ <property name="text">
+ <string>Show system tray &amp;icon</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Show the icon in the system tray</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>By default, the system tray icon indicates new incoming messages by flashing and showing a bubble. A left or middle mouse click on the icon will open the message in a new chat window. Pressing the "View" button in the bubble has the same effect.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mStartDockedChk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Start with hidden &amp;main window</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Start with the main window minimized to the system tray</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Start with the main window hidden. The only visible item is the system tray icon.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>buttonGroup1</cstring>
+ </property>
+ <property name="title">
+ <string>Message Handling</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mInstantMessageOpeningChk</cstring>
+ </property>
+ <property name="text">
+ <string>Open messages instantl&amp;y</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Instantly open incoming messages</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If there is no existing chat window a new window will be opened when a new message comes in. If there is already a chat window opened for the sender of the message it will be displayed there instantly.</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mUseQueueChk</cstring>
+ </property>
+ <property name="text">
+ <string>Use message &amp;queue</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a message queue to store incoming messages</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Store new incoming messages in a message queue. New messages are messages that cannot be displayed in an already open chat window. Only queued or stacked messages trigger notification via bubble, a flashing tray icon, or both..</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mUseStackChk</cstring>
+ </property>
+ <property name="text">
+ <string>Use message stac&amp;k</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Use a message stack to store incoming messages</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Store new incoming messages in a message stack. New messages are messages that cannot be displayed in an already open chat window. Only queued or stacked messages trigger notification via bubble and flashing tray.</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mQueueUnreadMessagesChk</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Queue/stack &amp;unread messages</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Also add unread messages to queue/stack</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Unread messages are messages that will be displayed in an already opened but inactive chat window. Only incoming queued messages trigger notification via the bubble, the flashing tray icon, or both. With this option disabled only new incoming messages are queued, i.e. messages that cannot be displayed in an already open chat window.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="title">
+ <string>Miscellaneous</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mAutoConnect</cstring>
+ </property>
+ <property name="text">
+ <string>Connect automatically at &amp;startup</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Connect all your accounts automatically when starting Kopete</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When starting Kopete all your accounts will be connected automatically. Note: You can exclude accounts individually in their properties.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer1</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>mShowTrayChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mStartDockedChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseQueueChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mQueueUnreadMessagesChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseStackChk</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mQueueUnreadMessagesChk</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>mShowTrayChk</tabstop>
+ <tabstop>mStartDockedChk</tabstop>
+ <tabstop>mUseQueueChk</tabstop>
+ <tabstop>mAutoConnect</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/kopete/config/behavior/kopete_behaviorconfig.desktop b/kopete/kopete/config/behavior/kopete_behaviorconfig.desktop
new file mode 100644
index 00000000..a9531a60
--- /dev/null
+++ b/kopete/kopete/config/behavior/kopete_behaviorconfig.desktop
@@ -0,0 +1,135 @@
+[Desktop Entry]
+Icon=configure
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_behaviorconfig
+X-KDE-FactoryName=KopeteBehaviorConfigFactory
+X-KDE-ParentApp=kopete
+X-KDE-ParentComponents=kopete
+
+Name=Behavior
+Name[ar]=السلوك
+Name[be]=Паводзіны
+Name[bg]=Поведение
+Name[bn]=আচরণ
+Name[br]=Emzalc'h
+Name[bs]=Ponašanje
+Name[ca]=Comportament
+Name[cs]=Chování
+Name[cy]=Ymddygiad
+Name[da]=Opførsel
+Name[de]=Verhalten
+Name[el]=Συμπεριφορά
+Name[en_GB]=Behaviour
+Name[eo]=Fenestrokonduto
+Name[es]=Comportamiento
+Name[et]=Käitumine
+Name[eu]=Portaera
+Name[fa]=رفتار
+Name[fi]=Käytös
+Name[fr]=Comportement
+Name[ga]=Oibriú
+Name[gl]=Comportamento
+Name[he]=אופן פעולה
+Name[hi]=बर्ताव
+Name[hr]=Ponašanje
+Name[hu]=Működés
+Name[is]=Hegðun
+Name[it]=Comportamento
+Name[ja]=挙動
+Name[ka]=ქცევა
+Name[kk]=Қасиеттер
+Name[km]=ឥរិយាបថ
+Name[lt]=Elgsena
+Name[mk]=Однесување
+Name[nb]=Oppførsel
+Name[nds]=Bedregen
+Name[ne]=व्यवहार
+Name[nl]=Gedrag
+Name[nn]=Åtferd
+Name[pa]=ਰਵੱਈਆ
+Name[pl]=Zachowanie
+Name[pt]=Comportamento
+Name[pt_BR]=Comportamento
+Name[ro]=Comportament
+Name[ru]=Поведение
+Name[rw]=Imyitwarire
+Name[se]=Láhtten
+Name[sk]=Chovanie
+Name[sl]=Obnašanje
+Name[sr]=Понашање
+Name[sr@Latn]=Ponašanje
+Name[sv]=Beteende
+Name[tg]=Рафтор
+Name[tr]=Davranış
+Name[uk]=Поведінка
+Name[uz]=Xususiyatlar
+Name[uz@cyrillic]=Хусусиятлар
+Name[wa]=Dujhance
+Name[zh_CN]=行为
+Name[zh_HK]=行為
+Name[zh_TW]=行為
+Comment=Here You Can Personalize Kopete
+Comment[ar]=هنا يمكنك تخصيص Kopete
+Comment[be]=Персаналізацыя Kopete
+Comment[bg]=Настройване поведението на програмата
+Comment[bn]=আপনি এখানে কপেট ব্যক্তিগতকরণ করতে পারেন
+Comment[bs]=Ovdje možete prilagoditi sebi Kopete
+Comment[ca]=Aquí podreu personalitzar el Kopete
+Comment[cs]=Zde je možné přizpůsobit si Kopete
+Comment[cy]=Yma Gallwch Bersonoleiddio Kopete
+Comment[da]=Her kan du personliggøre Kopete
+Comment[de]=Hier können Sie Kopete an Ihre persönlichen Vorstellungen anpassen
+Comment[el]=Εδώ μπορείτε να προσαρμόσετε το Kopete
+Comment[en_GB]=Here You Can Personalise Kopete
+Comment[es]=Aquí­ puede personalizar Kopete
+Comment[et]=Siin saab muuta Kopete just selliseks, nagu sulle meeldib
+Comment[eu]=Hemen Kopete pertsonalizatu dezakezu
+Comment[fa]=اینجا می‌توانید Kopete را شخصی کنید
+Comment[fi]=Täällä voit yksilöllistää Kopetea
+Comment[fr]=Vous pouvez personnaliser Kopete ici
+Comment[ga]=Tig Leat Kopete a Oiriúnú Duit Féin Anseo
+Comment[gl]=Aquí podes personaliza-lo comportamento de Kopete
+Comment[he]=כאן ניתן להתאים אישית את Kopete
+Comment[hi]=यहाँ आप के-ऑप्टी को पर्सनलाइज कर सकते हैं
+Comment[hr]=Ovde možete prilagoditi Kopete
+Comment[hu]=Itt lehet megváltoztatni a Kopete működési jellemzőit
+Comment[is]=Hér geturðu breytt Kopete
+Comment[it]=Qui puoi personalizzare Kopete
+Comment[ja]=ここで Kopete の挙動をカスタマイズします
+Comment[ka]=თქვენ აქ შეგიძლიათ Kopete-ს მორგება
+Comment[kk]=Мұнда Kopete-ті ыңғайлап алуға болады
+Comment[km]=ទីនេះ អ្នក​អាច​តម្រូវ Kopete តាម​បុគ្គល
+Comment[lt]=Čia galite Kopete pritaikyti sau
+Comment[mk]=Тука можете да го прилагодите Kopete на вашите желби
+Comment[nb]=Sett dine egne innstillinger i Kopete
+Comment[nds]=Hier kannst Du Kopete Dien Wennsten topassen
+Comment[ne]=तपाईँ यहाँ कोपेट निजीकरण गर्न सक्नुहुन्छ
+Comment[nl]=Hier kunt u Kopete naar wens instellen
+Comment[nn]=Vel dine eigne innstillingar i Kopete
+Comment[pl]=Tutaj możesz dostosować Kopete do osobistych preferencji
+Comment[pt]=Aqui você pode personalizar o Kopete
+Comment[pt_BR]=Agora você pode personalizar o Kopete
+Comment[ro]=Aici puteţi personaliza Kopete
+Comment[ru]=Персональная настройка Kopete
+Comment[se]=Dáppe sáhtát heivehit Kopete:a iežat hápmái
+Comment[sk]=Tu môžete Kopete prispôsobiť
+Comment[sl]=Tukaj lahko nastavite Kopete
+Comment[sr]=Овде можете прилагодити Kopete себи
+Comment[sr@Latn]=Ovde možete prilagoditi Kopete sebi
+Comment[sv]=Här kan du göra personlig anpassning av Kopete
+Comment[tg]=Дар Ин Ҷо Шумо Kopete-и Худро Шахсӣ Карда Метавонед
+Comment[tr]=Burada Kopete'yi Kişiselleştirebilirsiniz
+Comment[uk]=Тут можна наладнати Kopete під себе
+Comment[uz]=Bu yerda turli xususiyatlarni moslash mumkin
+Comment[uz@cyrillic]=Бу ерда турли хусусиятларни мослаш мумкин
+Comment[wa]=Chal vos ploz apontyî Kopete a vosse mode
+Comment[zh_CN]=您可在此个性化 Kopete
+Comment[zh_HK]=在此您可設定 Kopete 的個人化資料
+Comment[zh_TW]=您已經在此將 Kopete 個人化
+DocPath=kopete/configure-dialog.html#configuring-behavior
+
+
+
diff --git a/kopete/kopete/config/behavior/kopeteawayconfigbase.ui b/kopete/kopete/config/behavior/kopeteawayconfigbase.ui
new file mode 100644
index 00000000..8d0b8441
--- /dev/null
+++ b/kopete/kopete/config/behavior/kopeteawayconfigbase.ui
@@ -0,0 +1,356 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KopeteAwayConfigBaseUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KopeteAwayConfigBaseUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>471</width>
+ <height>266</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Away Configuration</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>General</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Number of away messages to remember:</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed.</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="1" column="1">
+ <property name="name">
+ <cstring>rememberedMessages</cstring>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>5</number>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Kopete will remember this many away messages for use at a later date; if this limit is exceeded, the least-used message will be removed.</string>
+ </property>
+ </widget>
+ <spacer row="1" column="2">
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>61</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox3</cstring>
+ </property>
+ <property name="title">
+ <string>Auto Away</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>&lt;p&gt;If you check the &lt;i&gt;Use auto away&lt;/i&gt; checkbox, Kopete will automaticaly set you globaly away when the KDE screen saver start, or after the selected minutes of user inactivity (i.e no mouse move, or key pressed)&lt;/p&gt;
+&lt;p&gt;Kopete will set you available again when you come back if you checked &lt;i&gt;Become available when detecting activity again&lt;/i&gt;&lt;/p&gt;</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mUseAutoAway</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Use auto away</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel2</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Become away after</string>
+ </property>
+ </widget>
+ <widget class="QSpinBox">
+ <property name="name">
+ <cstring>mAutoAwayTimeout</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="maxValue">
+ <number>999</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel3</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>minutes of user inactivity</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>81</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>mGoAvailable</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Become available when detecting activity again</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>autoAwayMessageGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="title">
+ <string>Auto Away Message</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mDisplayLastAwayMessage</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Display the last away message used</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>mDisplayCustomAwayMessage</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Display the following away message:</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout3</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5_2_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Fixed</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>16</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>mAutoAwayMessageEdit</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>300</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>30</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel2</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mAutoAwayTimeout</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>TextLabel3</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mGoAvailable</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mDisplayLastAwayMessage</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mDisplayCustomAwayMessage</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mDisplayCustomAwayMessage</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>mAutoAwayMessageEdit</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>mUseAutoAway</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>autoAwayMessageGroup</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>mUseAutoAway</tabstop>
+ <tabstop>mAutoAwayTimeout</tabstop>
+ <tabstop>mGoAvailable</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/identity/Makefile.am b/kopete/kopete/config/identity/Makefile.am
new file mode 100644
index 00000000..3f0fa409
--- /dev/null
+++ b/kopete/kopete/config/identity/Makefile.am
@@ -0,0 +1,15 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) $(KOPETE_COMPAT_INCLUDES) $(all_includes)
+
+kde_module_LTLIBRARIES = kcm_kopete_identityconfig.la
+
+kcm_kopete_identityconfig_la_SOURCES = kopeteidentityconfigbase.ui \
+ kopeteidentityconfig.cpp globalidentitiesmanager.cpp kopeteidentityconfigpreferences.kcfgc
+kcm_kopete_identityconfig_la_LDFLAGS = -no-undefined -module $(KDE_PLUGIN) $(all_libraries)
+kcm_kopete_identityconfig_la_LIBADD = -lkabc ../../../libkopete/libkopete.la $(LIB_KOPETECOMPAT) $(LIB_KUTILS)
+
+service_DATA = kopete_identityconfig.desktop
+servicedir = $(kde_servicesdir)
+
+# vim: set noet:
+kde_kcfg_DATA = kopeteidentityconfigpreferences.kcfg
diff --git a/kopete/kopete/config/identity/globalidentitiesmanager.cpp b/kopete/kopete/config/identity/globalidentitiesmanager.cpp
new file mode 100644
index 00000000..192849e4
--- /dev/null
+++ b/kopete/kopete/config/identity/globalidentitiesmanager.cpp
@@ -0,0 +1,260 @@
+/*
+ globalidentitiesmanager.h - Kopete Global identities manager.
+
+ Copyright (c) 2005 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2003-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+#include "globalidentitiesmanager.h"
+
+// Qt includes
+#include <qdom.h>
+#include <qfile.h>
+#include <qtextstream.h>
+
+// KDE includes
+#include <kdebug.h>
+#include <ksavefile.h>
+#include <klocale.h>
+#include <kurl.h>
+#include <kstandarddirs.h>
+
+// Kopete includes
+#include "kopetecontact.h"
+#include "kopetemetacontact.h"
+#include "kopetecontactlist.h"
+#include "kopetepluginmanager.h"
+
+class GlobalIdentitiesManager::Private
+{
+public:
+ QMap<QString, Kopete::MetaContact*> identitiesList;
+};
+
+GlobalIdentitiesManager *GlobalIdentitiesManager::s_self = 0L;
+GlobalIdentitiesManager *GlobalIdentitiesManager::self()
+{
+ if ( !s_self )
+ s_self = new GlobalIdentitiesManager;
+
+ return s_self;
+}
+
+GlobalIdentitiesManager::GlobalIdentitiesManager(QObject *parent, const char *name)
+ : QObject(parent, name)
+{
+ d = new Private;
+}
+
+GlobalIdentitiesManager::~GlobalIdentitiesManager()
+{
+ s_self = 0L;
+
+ delete d;
+}
+
+void GlobalIdentitiesManager::createNewIdentity(const QString &identityName)
+{
+ // Create new identity metacontact based on myself to get the sub-contacts.
+ Kopete::MetaContact *newIdentity = createNewMetaContact();
+
+ // Add to internal list.
+ d->identitiesList.insert(identityName, newIdentity);
+}
+
+void GlobalIdentitiesManager::copyIdentity(const QString &copyIdentityName, const QString &sourceIdentity)
+{
+ Kopete::MetaContact *copyIdentity = createCopyMetaContact(d->identitiesList[sourceIdentity]);
+
+ d->identitiesList.insert(copyIdentityName, copyIdentity);
+}
+
+void GlobalIdentitiesManager::renameIdentity(const QString &oldName, const QString &newName)
+{
+ Kopete::MetaContact *renamedIdentity = d->identitiesList[oldName];
+ d->identitiesList.remove(oldName);
+ d->identitiesList.insert(newName, renamedIdentity);
+}
+
+void GlobalIdentitiesManager::removeIdentity(const QString &removedIdentity)
+{
+ // Clear from memory the identity metacontact.
+ delete d->identitiesList[removedIdentity];
+ // Remove from the list.
+ d->identitiesList.remove(removedIdentity);
+}
+
+void GlobalIdentitiesManager::updateIdentity(const QString &updatedIdentity, Kopete::MetaContact *sourceMetaContact)
+{
+ copyMetaContact(d->identitiesList[updatedIdentity], sourceMetaContact);
+}
+
+bool GlobalIdentitiesManager::isIdentityPresent(const QString &identityName)
+{
+ QMapIterator<QString, Kopete::MetaContact*> it;
+ QMapIterator<QString, Kopete::MetaContact*> end = d->identitiesList.end();
+
+ for(it = d->identitiesList.begin(); it != end; ++it)
+ {
+ if(it.key() == identityName)
+ {
+ // A entry with the same name was found.
+ return true;
+ }
+ }
+ return false;
+}
+
+Kopete::MetaContact *GlobalIdentitiesManager::getIdentity(const QString &identityName)
+{
+ // Check if the identity is present.
+ return isIdentityPresent(identityName) ? d->identitiesList[identityName] : 0;
+}
+
+void GlobalIdentitiesManager::loadXML()
+{
+ kdDebug() << k_funcinfo << "Loading global identities list from XML." << endl;
+
+ QString filename = locateLocal( "appdata", QString::fromUtf8("global-identities.xml") );
+ if( filename.isEmpty() )
+ {
+ return;
+ }
+
+ QDomDocument globalIdentitiesList( QString::fromUtf8( "kopete-global-identities-list" ) );
+
+ QFile globalIdentitiesListFile( filename );
+ globalIdentitiesListFile.open( IO_ReadOnly );
+ globalIdentitiesList.setContent( &globalIdentitiesListFile );
+
+ QDomElement list = globalIdentitiesList.documentElement();
+ QDomElement element = list.firstChild().toElement();
+ while( !element.isNull() )
+ {
+ if( element.tagName() == QString::fromUtf8("identity") )
+ {
+ Kopete::MetaContact *metaContact = createNewMetaContact();
+ QString identityName = element.attribute(QString::fromUtf8("name"));
+
+ if(!metaContact->fromXML(element))
+ {
+ delete metaContact;
+ metaContact = 0L;
+ }
+ else
+ {
+ d->identitiesList.insert(identityName, metaContact);
+ }
+ }
+ element = element.nextSibling().toElement();
+ }
+
+ // If no identity are loaded, create a default identity MetaContact.
+ if(d->identitiesList.empty())
+ {
+ createNewIdentity(i18n("Default Identity"));
+ }
+}
+
+void GlobalIdentitiesManager::saveXML()
+{
+ kdDebug() << k_funcinfo << "Saving global identities list to XML." << endl;
+
+ QString globalIdentitiesListFileName = locateLocal( "appdata", QString::fromUtf8("global-identities.xml") );
+ KSaveFile globalIdentitiesListFile(globalIdentitiesListFileName);
+ if( globalIdentitiesListFile.status() == 0 )
+ {
+ QTextStream *stream = globalIdentitiesListFile.textStream();
+ stream->setEncoding( QTextStream::UnicodeUTF8 );
+ toXML().save( *stream, 4 );
+
+ if ( globalIdentitiesListFile.close() )
+ {
+ return;
+ }
+ else
+ {
+ kdDebug(14000) << k_funcinfo << "Failed to write global identities list, error code is: " << globalIdentitiesListFile.status() << endl;
+ }
+ }
+ else
+ {
+ kdWarning(14000) << k_funcinfo << "Couldn't open global identities list file " << globalIdentitiesListFileName
+ << ". Global Identities list not saved." << endl;
+ }
+}
+
+const QDomDocument GlobalIdentitiesManager::toXML()
+{
+ QDomDocument doc;
+
+ doc.appendChild(doc.createElement(QString::fromUtf8("kopete-global-identities-list")));
+
+ QMapIterator<QString, Kopete::MetaContact*> it;
+ QMapIterator<QString, Kopete::MetaContact*> end = d->identitiesList.end();
+ for(it = d->identitiesList.begin(); it != end; ++it)
+ {
+ kdDebug(14000) << k_funcinfo << "Saving " << it.key() << endl;
+ QDomElement identityMetaContactElement = it.data()->toXML(true); // Save minimal information.
+ identityMetaContactElement.setTagName(QString::fromUtf8("identity"));
+ identityMetaContactElement.setAttribute(QString::fromUtf8("name"), it.key());
+ doc.documentElement().appendChild(doc.importNode(identityMetaContactElement, true));
+ }
+
+ return doc;
+}
+
+Kopete::MetaContact *GlobalIdentitiesManager::createNewMetaContact()
+{
+ Kopete::MetaContact *newMetaContact = new Kopete::MetaContact();
+ QPtrList<Kopete::Contact> contactList = Kopete::ContactList::self()->myself()->contacts();
+
+ // Copy the contacts list to the new metacontact, so Kopete::Contact for SourceContact
+ // will not be null.
+ QPtrListIterator<Kopete::Contact> it( contactList);
+ for ( ; it.current(); ++it )
+ {
+ newMetaContact->addContact(it.current());
+ }
+
+ newMetaContact->setDisplayNameSource(Kopete::MetaContact::SourceCustom);
+ newMetaContact->setPhotoSource(Kopete::MetaContact::SourceCustom);
+
+ return newMetaContact;
+}
+
+Kopete::MetaContact *GlobalIdentitiesManager::createCopyMetaContact(Kopete::MetaContact *source)
+{
+ Kopete::MetaContact *copyMetaContactObject = createNewMetaContact();
+
+ copyMetaContact(copyMetaContactObject, source);
+
+ return copyMetaContactObject;
+}
+
+void GlobalIdentitiesManager::copyMetaContact(Kopete::MetaContact *destination, Kopete::MetaContact *source)
+{
+ destination->setDisplayName(source->customDisplayName());
+ destination->setDisplayNameSource(source->displayNameSource());
+ destination->setDisplayNameSourceContact(source->displayNameSourceContact());
+
+ destination->setPhoto(source->customPhoto());
+ destination->setPhotoSource(source->photoSource());
+ destination->setPhotoSourceContact(source->photoSourceContact());
+}
+
+QMap<QString, Kopete::MetaContact*> GlobalIdentitiesManager::getGlobalIdentitiesList()
+{
+ return d->identitiesList;
+}
+
+#include "globalidentitiesmanager.moc"
diff --git a/kopete/kopete/config/identity/globalidentitiesmanager.h b/kopete/kopete/config/identity/globalidentitiesmanager.h
new file mode 100644
index 00000000..c188d497
--- /dev/null
+++ b/kopete/kopete/config/identity/globalidentitiesmanager.h
@@ -0,0 +1,143 @@
+/*
+ globalidentitiesmanager.h - Kopete Global identities manager.
+
+ Copyright (c) 2005 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2003-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef GLOBALIDENTITIESMANAGER_H
+#define GLOBALIDENTITIESMANAGER_H
+
+#include <qobject.h>
+#include <qmap.h>
+
+namespace Kopete
+{
+ class MetaContact;
+}
+class QDomDocument;
+
+/**
+ * This singleton class handle the loading, saving and manipulating of all the global identities from a XML file.
+ * It also hold the pointer list of metacontacts.
+ * Use this class with GlobalIdentitiesManager::self()
+ *
+ * @author Michaël Larouche <michael.larouche@kdemail.net>
+*/
+class GlobalIdentitiesManager : public QObject
+{
+ Q_OBJECT
+public:
+ /**
+ * @brief Return the single instance of GlobalIdentitiesManager class
+ *
+ * The global identities manager is a singleton class of which only
+ * a single instance will exist. If no manager exists yet, this method
+ * create one for you.
+ *
+ * @return The single instance of GlobalIdentitiesManager class.
+ * FIXME: Should I remove the singleton pattern ?
+ */
+ static GlobalIdentitiesManager* self();
+ ~GlobalIdentitiesManager();
+
+ /**
+ * @brief Create a new identity and add it to the internal list.
+ */
+ void createNewIdentity(const QString &identityName);
+
+ /**
+ * @brief Copy a identity
+ *
+ * @param copyIdentityName Name for the copy identity.
+ * @param sourceIdentity Name of the source identity.
+ */
+ void copyIdentity(const QString &copyIdentityName, const QString &sourceIdentity);
+
+ /**
+ * @brief Rename a identity
+ *
+ * @param oldName Identity to rename.
+ * @param newName New identity name.
+ */
+ void renameIdentity(const QString &oldName, const QString &newName);
+
+ /**
+ * @brief Delete identity
+ *
+ * @param removedIdentity Identity name to remove.
+ */
+ void removeIdentity(const QString &removedIdentity);
+
+ /**
+ * @brief Update the specified identity using the source MetaContact
+ *
+ * @param updatedIdentity Identity to update.
+ * @param sourceMetaContact Source of data.
+ */
+ void updateIdentity(const QString &updatedIdentity, Kopete::MetaContact *sourceMetaContact);
+
+ /**
+ * @brief Check if the specified identityName exists.
+ *
+ * This is a helper method to avoid duplicated entries.
+ * @return if the identityName is in the internal list.
+ */
+ bool isIdentityPresent(const QString &identityName);
+
+ /**
+ * @brief Return the specified identity.
+ *
+ * @param identityName Identity to retrive.
+ * @return Identity data as Kopete::MetaContact.
+ */
+ Kopete::MetaContact *getIdentity(const QString &identityName);
+
+ /**
+ * @brief Load the XML file where global identities metacontacts are stored.
+ */
+ void loadXML();
+
+ /**
+ * @brief Save the global identities metacontacts to XML file.
+ */
+ void saveXML();
+
+ /**
+ * @brief Return the list of global identities metacontact.
+ * @return The pointer list of metacontact as QValueList
+ */
+ QMap<QString, Kopete::MetaContact*> getGlobalIdentitiesList();
+
+private:
+ GlobalIdentitiesManager(QObject *parent = 0, const char *name = 0);
+
+ /**
+ * @brief Return a XML representation of the global identities list.
+ *
+ * @return the XML represention as QDomDocument.
+ */
+ const QDomDocument toXML();
+
+ Kopete::MetaContact *createNewMetaContact();
+ Kopete::MetaContact *createCopyMetaContact(Kopete::MetaContact *source);
+ void copyMetaContact(Kopete::MetaContact *destination, Kopete::MetaContact *source);
+
+private:
+ static GlobalIdentitiesManager *s_self;
+ class Private;
+ Private *d;
+
+};
+
+#endif
diff --git a/kopete/kopete/config/identity/kopete_identityconfig.desktop b/kopete/kopete/config/identity/kopete_identityconfig.desktop
new file mode 100644
index 00000000..6b655550
--- /dev/null
+++ b/kopete/kopete/config/identity/kopete_identityconfig.desktop
@@ -0,0 +1,112 @@
+[Desktop Entry]
+Icon=identity
+Type=Service
+ServiceTypes=KCModule
+
+X-KDE-ModuleType=Library
+X-KDE-Library=kopete_identityconfig
+X-KDE-FactoryName=KopeteIdentityConfigFactory
+X-KDE-ParentApp=kopete
+X-KDE-ParentComponents=kopete
+
+Name=Identity
+Name[be]=Прыватныя звесткі
+Name[bg]=Идентификация
+Name[bn]=পরিচয়
+Name[br]=Anvelezh
+Name[bs]=Identitet
+Name[ca]=Identitat
+Name[cs]=Identita
+Name[cy]=Dynodiad
+Name[da]=Identitet
+Name[de]=Identität
+Name[el]=Ταυτότητα
+Name[eo]=Idento
+Name[es]=Identidad
+Name[et]=Identiteet
+Name[eu]=Identitatea
+Name[fa]=هویت
+Name[fi]=Identiteetti
+Name[fr]=Identité
+Name[ga]=Aitheantas
+Name[gl]=Indentidade
+Name[he]=חשבון
+Name[hu]=Azonosító
+Name[is]=Auðkenni
+Name[it]=Identità
+Name[ja]=分身
+Name[ka]=პროფილი
+Name[kk]=Профилі
+Name[km]=អត្តសញ្ញាណ
+Name[lt]=Tapatybė
+Name[nb]=Identitet
+Name[nds]=Identiteet
+Name[ne]=परिचय
+Name[nl]=Identiteit
+Name[nn]=Identitet
+Name[pl]=Tożsamość
+Name[pt]=Identidade
+Name[pt_BR]=Identidade
+Name[ru]=Профиль
+Name[sk]=Identita
+Name[sl]=Identiteta
+Name[sr]=Идентитет
+Name[sr@Latn]=Identitet
+Name[sv]=Identitet
+Name[tr]=Kimlik
+Name[uk]=Профіль
+Name[uz]=Shaxsiyat
+Name[uz@cyrillic]=Шахсият
+Name[zh_CN]=身份
+Name[zh_HK]=識別名稱
+Name[zh_TW]=身份
+Comment=Here You Can Manage Your Global Identity
+Comment[be]=Глабальныя прыватныя звесткі
+Comment[bg]=Настройване на идентификацията
+Comment[bn]=আপনি এখানে আপনার বিশ্ব পরিচয় পরিচালনা করতে পারেন
+Comment[bs]=Ovdje možete upravljati svojim globalnim identiteom
+Comment[ca]=Aquí podreu gestionar globalment la vostra identitat
+Comment[cs]=Zde můžete spravovat svou globální identitu
+Comment[da]=Her kan du håndtere din globale identitet
+Comment[de]=Hier können Sie Ihre globale Identität verwalten
+Comment[el]=Εδώ μπορείτε να χειριστείτε την καθολική σας ταυτότητα
+Comment[es]=Aquí puede gestionar su identidad global
+Comment[et]=Siin saad hallata oma globaalset identiteeti
+Comment[eu]=Hemen zure identitate globala kudea dezakezu
+Comment[fa]=اینجا می‌توانید هویت سراسری خود را مدیریت کنید
+Comment[fi]=Täältä voit hallita globaalia identiteettiäsi
+Comment[fr]=Vous pouvez gérer ici votre identité principale
+Comment[ga]=Tig Leat d'Aitheantas a Láimhseáil Anseo
+Comment[gl]=Aquí podes xestionar a súa identidade global
+Comment[he]=כאן באפשרותך לנהל את כל חשבונותיך
+Comment[hu]=Itt lehet kezelni a globális azonosítókat
+Comment[is]=Hér geturðu haldið utan um víðværa auðkennið þitt
+Comment[it]=Qui puoi gestire la tua identità globale
+Comment[ja]=ここでアカウント共通のあなたの分身を設定します
+Comment[ka]=აქ თქვენ თქვენი ზოგადი იდენტიფიკაციის გამართვა
+Comment[kk]=Мұнда жалпы профилін басқара аласыз
+Comment[km]=ទីនេះ អ្នក​អាច​គ្រប់គ្រង​អត្តសញ្ញាណ​សកល​របស់​អ្នក
+Comment[lt]=Čia galite tvarkyti globaliąją paskyrą
+Comment[nb]=Her kan du behandle din globale identitet
+Comment[nds]=Hier kannst Du Dien globale Identiteet plegen
+Comment[ne]=यहाँ तपाईँ तपाईँको विश्वव्यापी परिचय प्रबन्ध गर्न सक्नुहुन्छ
+Comment[nl]=Hier kunt u uw globale identiteit beheren
+Comment[nn]=Her kan du handtera den globale identiteten din
+Comment[pl]=Tutaj można zarządzać Twoją tożsamością
+Comment[pt]=Aqui Você Pode Gerir a Sua Identidade Global
+Comment[pt_BR]=Aqui Você Pode Gerenciar Sua Identidade Global
+Comment[ru]=Настройка глобального профиля пользователя
+Comment[sk]=Tu môžete spravovať Vašu globálnu identifikáciu
+Comment[sl]=Tukaj lahko upravljate s svojo globalno identiteto
+Comment[sr]=Овде можете управљати вашим општим идентитетом
+Comment[sr@Latn]=Ovde možete upravljati vašim opštim identitetom
+Comment[sv]=Här kan du hantera din generella identitet
+Comment[tr]=Bütün Genel Kimliklerinizi Buradan Yönetebilirsiniz
+Comment[uk]=Тут можна керувати вашим глобальним профілем
+Comment[uz]=Bu yerda umumiy shaxsiyatni moslash mumkin
+Comment[uz@cyrillic]=Бу ерда умумий шахсиятни мослаш мумкин
+Comment[zh_CN]=您可在此管理您的全局身份
+Comment[zh_HK]=在此您可管理 Kopete 的全域識別名稱
+Comment[zh_TW]=您可以在此管理您的全域身份
+
+DocPath=kopete/configure-dialog.html#configuring-identity
diff --git a/kopete/kopete/config/identity/kopeteidentityconfig.cpp b/kopete/kopete/config/identity/kopeteidentityconfig.cpp
new file mode 100644
index 00000000..26613b87
--- /dev/null
+++ b/kopete/kopete/config/identity/kopeteidentityconfig.cpp
@@ -0,0 +1,636 @@
+/*
+ kopeteidentityconfig.cpp - Kopete Identity config page
+
+ Copyright (c) 2005 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2003-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopeteidentityconfig.h"
+
+// Qt includes
+#include <qlayout.h>
+#include <qimage.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qcheckbox.h>
+#include <qradiobutton.h>
+#include <qcombobox.h>
+#include <qapplication.h>
+#include <qbuffer.h>
+
+// KDE includes
+#include <kcombobox.h>
+#include <kfiledialog.h>
+#include <kpushbutton.h>
+#include <kdebug.h>
+#include <kgenericfactory.h>
+#include <kiconloader.h>
+#include <klocale.h>
+#include <kmessagebox.h>
+#include <kstandarddirs.h>
+#include <kglobal.h>
+#include <kurlrequester.h>
+#include <kinputdialog.h>
+#include <kpixmapregionselectordialog.h>
+#include <kmdcodec.h>
+
+// KDE KIO includes
+#include <kio/netaccess.h>
+
+// KDE KABC(AddressBook) includes
+#include <kabc/addresseedialog.h>
+#include <kabc/stdaddressbook.h>
+#include <kabc/addressee.h>
+
+// Kopete include
+#include "kabcpersistence.h"
+#include "kopeteglobal.h"
+#include "kopeteaccountmanager.h"
+#include "kopeteprotocol.h"
+#include "kopeteaccount.h"
+#include "kopetecontact.h"
+#include "kopetecontactlist.h"
+#include "addressbookselectordialog.h"
+#include "kopeteconfig.h"
+
+// Local includes
+#include "kopeteidentityconfigbase.h"
+#include "globalidentitiesmanager.h"
+#include "kopeteidentityconfigpreferences.h"
+
+class KopeteIdentityConfig::Private
+{
+public:
+ Private() : m_view(0L), myself(0L), currentIdentity(0L), selectedIdentity("")
+ {}
+
+ KopeteIdentityConfigBase *m_view;
+ Kopete::MetaContact *myself;
+ Kopete::MetaContact *currentIdentity;
+
+ QMap<int, Kopete::Contact*> contactPhotoSourceList;
+ QString selectedIdentity;
+};
+
+typedef KGenericFactory<KopeteIdentityConfig, QWidget> KopeteIdentityConfigFactory;
+K_EXPORT_COMPONENT_FACTORY( kcm_kopete_identityconfig, KopeteIdentityConfigFactory( "kcm_kopete_identityconfig" ) )
+
+KopeteIdentityConfig::KopeteIdentityConfig(QWidget *parent, const char */*name*/, const QStringList &args) : KCModule( KopeteIdentityConfigFactory::instance(), parent, args)
+{
+ d = new Private;
+ ( new QVBoxLayout( this ) )->setAutoAdd( true );
+ d->m_view = new KopeteIdentityConfigBase( this, "KopeteIdentityConfig::m_view" );
+
+ // Setup KConfigXT link with GUI.
+ addConfig( Kopete::Config::self(), d->m_view );
+
+ // Load config
+ KopeteIdentityConfigPreferences::self()->readConfig();
+
+ // Load from XML the identities.
+ GlobalIdentitiesManager::self()->loadXML();
+
+ d->myself = Kopete::ContactList::self()->myself();
+
+ // Set the latest selected Identity.
+ d->selectedIdentity = KopeteIdentityConfigPreferences::self()->selectedIdentity();
+ kdDebug() << k_funcinfo << "Latest loaded identity: " << d->selectedIdentity << endl;
+
+ // If the latest selected Identity is not present anymore, use a fallback identity.
+ if( !GlobalIdentitiesManager::self()->isIdentityPresent(d->selectedIdentity) )
+ {
+ QMapIterator<QString, Kopete::MetaContact*> it = GlobalIdentitiesManager::self()->getGlobalIdentitiesList().begin();
+ d->selectedIdentity = it.key();
+ }
+ else
+ {
+ // Update the latest identity with myself Metacontact.
+ GlobalIdentitiesManager::self()->updateIdentity(d->selectedIdentity, d->myself);
+ }
+ d->currentIdentity = GlobalIdentitiesManager::self()->getIdentity(d->selectedIdentity);
+
+ // Set icon for KPushButton
+ d->m_view->buttonNewIdentity->setIconSet(SmallIconSet("new"));
+ d->m_view->buttonCopyIdentity->setIconSet(SmallIconSet("editcopy"));
+ d->m_view->buttonRenameIdentity->setIconSet(SmallIconSet("edit"));
+ d->m_view->buttonRemoveIdentity->setIconSet(SmallIconSet("delete_user"));
+ d->m_view->buttonClearPhoto->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "locationbar_erase" : "clear_left" ) );
+
+ load(); // Load Configuration
+
+ // Action signal/slots
+ connect(d->m_view->buttonChangeAddressee, SIGNAL(clicked()), this, SLOT(slotChangeAddressee()));
+ connect(d->m_view->comboSelectIdentity, SIGNAL(activated(const QString &)), this, SLOT(slotUpdateCurrentIdentity(const QString& )));
+ connect(d->m_view->buttonNewIdentity, SIGNAL(clicked()), this, SLOT(slotNewIdentity()));
+ connect(d->m_view->buttonCopyIdentity, SIGNAL(clicked()), this, SLOT(slotCopyIdentity()));
+ connect(d->m_view->buttonRenameIdentity, SIGNAL(clicked()), this, SLOT(slotRenameIdentity()));
+ connect(d->m_view->buttonRemoveIdentity, SIGNAL(clicked()), this, SLOT(slotRemoveIdentity()));
+ connect(d->m_view->comboPhotoURL, SIGNAL(urlSelected(const QString& )), this, SLOT(slotChangePhoto(const QString& )));
+ connect(d->m_view->buttonClearPhoto, SIGNAL(clicked()), this, SLOT(slotClearPhoto()));
+
+ // Settings signal/slots
+ connect(d->m_view->radioNicknameContact, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+ connect(d->m_view->radioNicknameCustom, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+ connect(d->m_view->radioNicknameKABC, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+
+ connect(d->m_view->radioPhotoContact, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+ connect(d->m_view->radioPhotoCustom, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+ connect(d->m_view->radioPhotoKABC, SIGNAL(toggled(bool )), this, SLOT(slotEnableAndDisableWidgets()));
+
+ connect(d->m_view->checkSyncPhotoKABC, SIGNAL(toggled(bool )), this, SLOT(slotSettingsChanged()));
+ connect(d->m_view->lineNickname, SIGNAL(textChanged(const QString& )), this, SLOT(slotSettingsChanged()));
+ connect(d->m_view->comboNameContact, SIGNAL(activated(int )), this, SLOT(slotSettingsChanged()));
+ connect(d->m_view->comboPhotoContact, SIGNAL(activated(int )), this, SLOT(slotEnableAndDisableWidgets()));
+}
+
+KopeteIdentityConfig::~KopeteIdentityConfig()
+{
+ delete d;
+}
+
+void KopeteIdentityConfig::load()
+{
+ KCModule::load();
+
+ // Populate the select Identity combo box.
+ loadIdentities();
+ // Populate the name contact ComboBox
+ slotLoadNameSources();
+ // Populate the photo contact ComboBOx
+ slotLoadPhotoSources();
+
+ KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
+ // Load the address book link
+ if (!a.isEmpty())
+ {
+ d->m_view->lineAddressee->setText(a.realName());
+ }
+
+ slotEnableAndDisableWidgets();
+}
+
+void KopeteIdentityConfig::save()
+{
+ KCModule::save();
+
+ saveCurrentIdentity();
+
+ // Don't save the new global identity if it's not activated.
+ if(d->m_view->kcfg_EnableGlobalIdentity->isChecked())
+ {
+ // Save the myself metacontact settings.
+ // Nickname settings.
+ if(d->m_view->lineNickname->text() != d->myself->customDisplayName())
+ d->myself->setDisplayName(d->m_view->lineNickname->text());
+
+ d->myself->setDisplayNameSource(selectedNameSource());
+ d->myself->setDisplayNameSourceContact(selectedNameSourceContact());
+
+ // Photo settings
+ d->myself->setPhotoSource(selectedPhotoSource());
+ d->myself->setPhotoSourceContact(selectedPhotoSourceContact());
+ if(!d->m_view->comboPhotoURL->url().isEmpty())
+ d->myself->setPhoto(d->m_view->comboPhotoURL->url());
+ else
+ d->myself->setPhoto( KURL() );
+ d->myself->setPhotoSyncedWithKABC(d->m_view->checkSyncPhotoKABC->isChecked());
+ }
+
+ // Save global identities list.
+ KopeteIdentityConfigPreferences::self()->setSelectedIdentity(d->selectedIdentity);
+ GlobalIdentitiesManager::self()->saveXML();
+
+ // (Re)made slot connections to apply Global Identity in protocols
+ Kopete::ContactList::self()->loadGlobalIdentity();
+
+ load();
+}
+
+void KopeteIdentityConfig::loadIdentities()
+{
+ d->m_view->comboSelectIdentity->clear();
+
+ QMap<QString, Kopete::MetaContact*> identitiesList = GlobalIdentitiesManager::self()->getGlobalIdentitiesList();
+ QMapIterator<QString, Kopete::MetaContact*> it;
+ QMapIterator<QString, Kopete::MetaContact*> end = identitiesList.end();
+
+ int count=0, selectedIndex=0;
+ for(it = identitiesList.begin(); it != end; ++it)
+ {
+ d->m_view->comboSelectIdentity->insertItem(it.key());
+ if(it.key() == d->selectedIdentity)
+ {
+ selectedIndex = count;
+ }
+ count++;
+ }
+
+ d->m_view->comboSelectIdentity->setCurrentItem(selectedIndex);
+ d->m_view->buttonRemoveIdentity->setEnabled(count == 1 ? false : true);
+}
+
+void KopeteIdentityConfig::saveCurrentIdentity()
+{
+ kdDebug() << k_funcinfo << "Saving data of current identity." << endl;
+ // Ignore saving when removing a identity
+ if(!d->currentIdentity)
+ return;
+
+ if(d->m_view->lineNickname->text() != d->currentIdentity->customDisplayName())
+ d->currentIdentity->setDisplayName(d->m_view->lineNickname->text());
+
+ d->currentIdentity->setDisplayNameSource(selectedNameSource());
+ d->currentIdentity->setDisplayNameSourceContact(selectedNameSourceContact());
+
+ // Photo settings
+ d->currentIdentity->setPhotoSource(selectedPhotoSource());
+ d->currentIdentity->setPhotoSourceContact(selectedPhotoSourceContact());
+ if(!d->m_view->comboPhotoURL->url().isEmpty())
+ d->currentIdentity->setPhoto(d->m_view->comboPhotoURL->url());
+ else
+ d->currentIdentity->setPhoto( KURL() );
+ d->currentIdentity->setPhotoSyncedWithKABC(d->m_view->checkSyncPhotoKABC->isChecked());
+}
+
+void KopeteIdentityConfig::slotLoadNameSources()
+{
+ Kopete::Contact *nameSourceContact = d->currentIdentity->displayNameSourceContact();
+
+ QPtrList<Kopete::Contact> contactList = d->myself->contacts(); // Use myself contact PtrList. Safer.
+ QPtrListIterator<Kopete::Contact> it(contactList);
+
+ d->m_view->comboNameContact->clear();
+
+ for(; it.current(); ++it)
+ {
+ QString account = it.current()->property(Kopete::Global::Properties::self()->nickName()).value().toString() + " <" + it.current()->contactId() + ">";
+ QPixmap accountIcon = it.current()->account()->accountIcon();
+ d->m_view->comboNameContact->insertItem(accountIcon, account);
+
+ // Select this item if it's the one we're tracking.
+ if(it.current() == nameSourceContact)
+ {
+ d->m_view->comboNameContact->setCurrentItem(d->m_view->comboNameContact->count() - 1);
+ }
+ }
+
+ d->m_view->lineNickname->setText(d->currentIdentity->customDisplayName());
+
+ Kopete::MetaContact::PropertySource nameSource = d->currentIdentity->displayNameSource();
+
+ d->m_view->radioNicknameCustom->setChecked(nameSource == Kopete::MetaContact::SourceCustom);
+ d->m_view->radioNicknameKABC->setChecked(nameSource == Kopete::MetaContact::SourceKABC);
+ d->m_view->radioNicknameContact->setChecked(nameSource == Kopete::MetaContact::SourceContact);
+}
+
+void KopeteIdentityConfig::slotLoadPhotoSources()
+{
+ Kopete::Contact *photoSourceContact = d->currentIdentity->photoSourceContact();
+
+ QPtrList<Kopete::Contact> contactList = d->myself->contacts(); // Use myself contact PtrList. Safer.
+ QPtrListIterator<Kopete::Contact> it(contactList);
+
+ d->m_view->comboPhotoContact->clear();
+ d->m_view->comboPhotoURL->clear();
+ d->contactPhotoSourceList.clear();
+
+ for(; it.current(); ++it)
+ {
+ Kopete::Contact *currentContact = it.current();
+ if(currentContact->hasProperty(Kopete::Global::Properties::self()->photo().key()))
+ {
+ QString account = currentContact->property(Kopete::Global::Properties::self()->nickName()).value().toString() + " <" + currentContact->contactId() + ">";
+ QPixmap accountIcon = currentContact->account()->accountIcon();
+
+ d->m_view->comboPhotoContact->insertItem(accountIcon, account);
+ d->contactPhotoSourceList.insert(d->m_view->comboPhotoContact->count() - 1, currentContact);
+
+ // Select this item if it's the one we're tracking.
+ if(currentContact == photoSourceContact)
+ {
+ d->m_view->comboPhotoContact->setCurrentItem(d->m_view->comboPhotoContact->count() - 1);
+ }
+ }
+ }
+
+ d->m_view->comboPhotoURL->setURL(d->currentIdentity->customPhoto().pathOrURL());
+ Kopete::MetaContact::PropertySource photoSource = d->currentIdentity->photoSource();
+
+ d->m_view->radioPhotoCustom->setChecked(photoSource == Kopete::MetaContact::SourceCustom);
+ d->m_view->radioPhotoContact->setChecked(photoSource == Kopete::MetaContact::SourceContact);
+ d->m_view->radioPhotoKABC->setChecked(photoSource == Kopete::MetaContact::SourceKABC);
+
+ d->m_view->checkSyncPhotoKABC->setChecked(d->currentIdentity->isPhotoSyncedWithKABC());
+}
+
+void KopeteIdentityConfig::slotEnableAndDisableWidgets()
+{
+ KABC::Addressee a = KABC::StdAddressBook::self()->whoAmI();
+ bool hasKABCLink = !a.isEmpty();
+
+ d->m_view->radioNicknameKABC->setEnabled(hasKABCLink);
+ d->m_view->radioPhotoKABC->setEnabled(hasKABCLink);
+
+ // Don't sync global photo with KABC if KABC is the source
+ // or if they are no KABC link. (would create a break in timeline)
+ if( selectedPhotoSource() == Kopete::MetaContact::SourceKABC || !hasKABCLink )
+ {
+ d->m_view->checkSyncPhotoKABC->setEnabled(false);
+ }
+ else
+ {
+ d->m_view->checkSyncPhotoKABC->setEnabled(true);
+ }
+
+ d->m_view->radioNicknameContact->setEnabled(d->currentIdentity->contacts().count());
+ d->m_view->radioPhotoContact->setEnabled(!d->contactPhotoSourceList.isEmpty());
+
+ d->m_view->comboNameContact->setEnabled(selectedNameSource() == Kopete::MetaContact::SourceContact);
+ d->m_view->lineNickname->setEnabled(selectedNameSource() == Kopete::MetaContact::SourceCustom);
+
+ d->m_view->comboPhotoContact->setEnabled(selectedPhotoSource() == Kopete::MetaContact::SourceContact);
+ d->m_view->comboPhotoURL->setEnabled(selectedPhotoSource() == Kopete::MetaContact::SourceCustom);
+
+ if(d->contactPhotoSourceList.isEmpty() )
+ {
+ d->m_view->comboPhotoContact->clear();
+ d->m_view->comboPhotoContact->insertItem(i18n("No Contacts with Photo Support"));
+ d->m_view->comboPhotoContact->setEnabled(false);
+ }
+
+ QImage photo;
+ switch ( selectedPhotoSource() )
+ {
+ case Kopete::MetaContact::SourceKABC:
+ photo = Kopete::photoFromKABC(a.uid());
+ break;
+ case Kopete::MetaContact::SourceContact:
+ photo = Kopete::photoFromContact(selectedNameSourceContact());
+ break;
+ case Kopete::MetaContact::SourceCustom:
+ photo = QImage(d->m_view->comboPhotoURL->url());
+ break;
+ }
+
+ if(!photo.isNull())
+ d->m_view->labelPhoto->setPixmap(QPixmap(photo.smoothScale(64, 92, QImage::ScaleMin)));
+ else
+ d->m_view->labelPhoto->setPixmap(QPixmap());
+
+ emit changed(true);
+}
+
+void KopeteIdentityConfig::slotUpdateCurrentIdentity(const QString &selectedIdentity)
+{
+ kdDebug() << k_funcinfo << "Updating current identity." << endl;
+
+ // Save the current identity detail, so we don't loose information.
+ saveCurrentIdentity();
+
+ // Change the current identity reflecting the combo box.
+ d->selectedIdentity = selectedIdentity;
+ d->currentIdentity = GlobalIdentitiesManager::self()->getIdentity(d->selectedIdentity);
+ KopeteIdentityConfigPreferences::self()->setSelectedIdentity(d->selectedIdentity);
+ KopeteIdentityConfigPreferences::self()->writeConfig();
+ // Save global identities list.
+ GlobalIdentitiesManager::self()->saveXML();
+
+ // Reload the details.
+ slotLoadNameSources();
+ slotLoadPhotoSources();
+}
+
+void KopeteIdentityConfig::slotNewIdentity()
+{
+ bool ok;
+ QString newIdentityName = KInputDialog::getText(i18n("New Identity"), i18n("Identity name:") , QString::null , &ok);
+
+ if(newIdentityName.isEmpty() || !ok)
+ return;
+
+
+ GlobalIdentitiesManager::self()->createNewIdentity(newIdentityName);
+
+ slotUpdateCurrentIdentity(newIdentityName);
+ loadIdentities();
+}
+
+void KopeteIdentityConfig::slotCopyIdentity()
+{
+ bool ok;
+ QString copyName = KInputDialog::getText(i18n("Copy Identity"), i18n("Identity name:") , QString::null, &ok);
+
+ if(copyName.isEmpty() || !ok)
+ return;
+
+
+ if(!GlobalIdentitiesManager::self()->isIdentityPresent(copyName))
+ {
+ GlobalIdentitiesManager::self()->copyIdentity(copyName, d->selectedIdentity);
+
+ slotUpdateCurrentIdentity(copyName);
+ loadIdentities();
+ }
+ else
+ {
+ KMessageBox::error(this, i18n("An identity with the same name was found."), i18n("Identity Configuration"));
+ }
+}
+
+void KopeteIdentityConfig::slotRenameIdentity()
+{
+ if(d->selectedIdentity.isNull())
+ return;
+
+ bool ok;
+ QString renamedName = KInputDialog::getText(i18n("Rename Identity"), i18n("Identity name:") , d->selectedIdentity, &ok);
+
+ if(renamedName.isEmpty() || !ok)
+ return;
+
+
+ if(renamedName.isEmpty())
+ return;
+
+ if(!GlobalIdentitiesManager::self()->isIdentityPresent(renamedName))
+ {
+ GlobalIdentitiesManager::self()->renameIdentity(d->selectedIdentity, renamedName);
+
+ slotUpdateCurrentIdentity(renamedName);
+ loadIdentities();
+ }
+ else
+ {
+ KMessageBox::error(this, i18n("An identity with the same name was found."), i18n("Identity Configuration"));
+ }
+}
+
+void KopeteIdentityConfig::slotRemoveIdentity()
+{
+ kdDebug() << k_funcinfo << "Removing current identity." << endl;
+ GlobalIdentitiesManager::self()->removeIdentity(d->selectedIdentity);
+ // Reset the currentIdentity pointer. The currentIdentity object was deleted in GlobalIdentitiesManager.
+ d->currentIdentity = 0;
+
+ // Select the entry before(or after) the removed identity.
+ int currentItem = d->m_view->comboSelectIdentity->currentItem();
+ // Use the next item if the removed identity is the first in the comboBox.
+ if(currentItem - 1 < 0)
+ {
+ currentItem++;
+ }
+ else
+ {
+ currentItem--;
+ }
+ d->m_view->comboSelectIdentity->setCurrentItem(currentItem);
+
+ slotUpdateCurrentIdentity(d->m_view->comboSelectIdentity->currentText());
+ loadIdentities();
+}
+
+
+
+void KopeteIdentityConfig::slotChangeAddressee()
+{
+ KABC::Addressee a = Kopete::UI::AddressBookSelectorDialog::getAddressee(i18n("Addressbook Association"), i18n("Choose the person who is yourself."), d->myself->metaContactId(), this);
+
+ if ( !a.isEmpty() )
+ {
+ d->m_view->lineAddressee->setText(a.realName());
+ KABC::StdAddressBook::self()->setWhoAmI(a);
+ d->myself->setMetaContactId(a.uid());
+ }
+
+ emit changed(true);
+}
+
+void KopeteIdentityConfig::slotChangePhoto(const QString &photoUrl)
+{
+ QString saveLocation;
+
+ QImage photo(photoUrl);
+ // use KABC photo size 100x140
+ photo = KPixmapRegionSelectorDialog::getSelectedImage( QPixmap(photo), 96, 96, this );
+
+ if(!photo.isNull())
+ {
+ if(photo.width() > 96 || photo.height() > 96)
+ {
+ // Scale and crop the picture.
+ photo = photo.smoothScale( 96, 96, QImage::ScaleMin );
+ // crop image if not square
+ if(photo.width() < photo.height())
+ photo = photo.copy((photo.width()-photo.height())/2, 0, 96, 96);
+ else if (photo.width() > photo.height())
+ photo = photo.copy(0, (photo.height()-photo.width())/2, 96, 96);
+
+ }
+ else if (photo.width() < 32 || photo.height() < 32)
+ {
+ // Scale and crop the picture.
+ photo = photo.smoothScale( 32, 32, QImage::ScaleMin );
+ // crop image if not square
+ if(photo.width() < photo.height())
+ photo = photo.copy((photo.width()-photo.height())/2, 0, 32, 32);
+ else if (photo.width() > photo.height())
+ photo = photo.copy(0, (photo.height()-photo.width())/2, 32, 32);
+
+ }
+ else if (photo.width() != photo.height())
+ {
+ if(photo.width() < photo.height())
+ photo = photo.copy((photo.width()-photo.height())/2, 0, photo.height(), photo.height());
+ else if (photo.width() > photo.height())
+ photo = photo.copy(0, (photo.height()-photo.width())/2, photo.height(), photo.height());
+ }
+
+ // Use MD5 hash to save the filename, so no problems will occur with the filename because of non-ASCII characters.
+ // Bug 124175: My personnal picture doesn't appear cause of l10n
+ QByteArray tempArray;
+ QBuffer tempBuffer(tempArray);
+ tempBuffer.open( IO_WriteOnly );
+ photo.save(&tempBuffer, "PNG");
+ KMD5 context(tempArray);
+ // Save the image to a file.
+ saveLocation = context.hexDigest() + ".png";
+ saveLocation = locateLocal( "appdata", QString::fromUtf8("globalidentitiespictures/%1").arg( saveLocation ) );
+
+ if(!photo.save(saveLocation, "PNG"))
+ {
+ KMessageBox::sorry(this,
+ i18n("An error occurred when trying to save the custom photo for %1 identity.").arg(d->selectedIdentity),
+ i18n("Identity Configuration"));
+ }
+ d->m_view->comboPhotoURL->setURL(saveLocation);
+ slotEnableAndDisableWidgets();
+ }
+ else
+ {
+ KMessageBox::sorry(this,
+ i18n("An error occurred when trying to save the custom photo for %1 identity.").arg(d->selectedIdentity),
+ i18n("Identity Configuration"));
+ }
+}
+
+void KopeteIdentityConfig::slotClearPhoto()
+{
+ d->m_view->comboPhotoURL->setURL( QString::null );
+ slotEnableAndDisableWidgets();
+}
+
+void KopeteIdentityConfig::slotSettingsChanged()
+{
+ emit changed(true);
+}
+
+Kopete::MetaContact::PropertySource KopeteIdentityConfig::selectedNameSource() const
+{
+ if (d->m_view->radioNicknameKABC->isChecked())
+ return Kopete::MetaContact::SourceKABC;
+ if (d->m_view->radioNicknameContact->isChecked())
+ return Kopete::MetaContact::SourceContact;
+ if (d->m_view->radioNicknameCustom->isChecked())
+ return Kopete::MetaContact::SourceCustom;
+ else
+ return Kopete::MetaContact::SourceCustom;
+}
+
+Kopete::MetaContact::PropertySource KopeteIdentityConfig::selectedPhotoSource() const
+{
+ if (d->m_view->radioPhotoKABC->isChecked())
+ return Kopete::MetaContact::SourceKABC;
+ if (d->m_view->radioPhotoContact->isChecked())
+ return Kopete::MetaContact::SourceContact;
+ if (d->m_view->radioPhotoCustom->isChecked())
+ return Kopete::MetaContact::SourceCustom;
+ else
+ return Kopete::MetaContact::SourceCustom;
+}
+
+Kopete::Contact* KopeteIdentityConfig::selectedNameSourceContact() const
+{
+ Kopete::Contact *c = d->myself->contacts().at(d->m_view->comboNameContact->currentItem());
+ return c ? c : 0L;
+}
+
+Kopete::Contact* KopeteIdentityConfig::selectedPhotoSourceContact() const
+{
+ if (d->contactPhotoSourceList.isEmpty())
+ return 0L;
+
+ Kopete::Contact *c = d->contactPhotoSourceList[d->m_view->comboPhotoContact->currentItem()];
+ return c ? c : 0L;
+}
+
+#include "kopeteidentityconfig.moc"
diff --git a/kopete/kopete/config/identity/kopeteidentityconfig.h b/kopete/kopete/config/identity/kopeteidentityconfig.h
new file mode 100644
index 00000000..f18c5a8c
--- /dev/null
+++ b/kopete/kopete/config/identity/kopeteidentityconfig.h
@@ -0,0 +1,80 @@
+/*
+ kopeteidentityconfig.h - Kopete identity config page
+
+ Copyright (c) 2005 by Michaël Larouche <michael.larouche@kdemail.net>
+
+ Kopete (c) 2003-2005 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef _IDENTITYCONFIG_H
+#define _IDENTITYCONFIG_H
+
+#include <kcmodule.h>
+#include <kconfigdialog.h>
+
+#include "kopetemetacontact.h"
+
+namespace Kopete
+{
+class Contact;
+}
+
+class KopeteIdentityConfigBase;
+
+/**
+ * @author Michaël Larouche <shock@shockdev.ca.tc>
+ */
+class KopeteIdentityConfig : public KCModule
+{
+ Q_OBJECT
+public:
+ KopeteIdentityConfig(QWidget *parent, const char *name, const QStringList &args );
+ ~KopeteIdentityConfig();
+
+public slots:
+ virtual void save();
+ virtual void load();
+
+private:
+ void loadIdentities();
+ void saveCurrentIdentity();
+
+ Kopete::MetaContact::PropertySource selectedNameSource() const;
+ Kopete::MetaContact::PropertySource selectedPhotoSource() const;
+ Kopete::Contact* selectedNameSourceContact() const;
+ Kopete::Contact* selectedPhotoSourceContact() const;
+
+private slots:
+ void slotLoadNameSources();
+ void slotLoadPhotoSources();
+ void slotEnableAndDisableWidgets();
+
+ void slotUpdateCurrentIdentity(const QString &selectedIdentity);
+ void slotNewIdentity();
+ void slotCopyIdentity();
+ void slotRenameIdentity();
+ void slotRemoveIdentity();
+
+ void slotChangeAddressee();
+ void slotChangePhoto(const QString &photoUrl);
+ void slotClearPhoto();
+
+ void slotSettingsChanged();
+
+private:
+ class Private;
+ Private *d;
+
+};
+#endif
+
+// vim: set noet ts=4 sts=4 sw=4:
diff --git a/kopete/kopete/config/identity/kopeteidentityconfigbase.ui b/kopete/kopete/config/identity/kopeteidentityconfigbase.ui
new file mode 100644
index 00000000..4e31a29f
--- /dev/null
+++ b/kopete/kopete/config/identity/kopeteidentityconfigbase.ui
@@ -0,0 +1,541 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>KopeteIdentityConfigBase</class>
+<author>Michaël Larouche</author>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>KopeteIdentityConfigBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>633</width>
+ <height>447</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>kcfg_EnableGlobalIdentity</cstring>
+ </property>
+ <property name="text">
+ <string>Enable &amp;global identity</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout6</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>Identity:</string>
+ </property>
+ </widget>
+ <widget class="KComboBox">
+ <property name="name">
+ <cstring>comboSelectIdentity</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonNewIdentity</cstring>
+ </property>
+ <property name="text">
+ <string>Ne&amp;w Identity...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonCopyIdentity</cstring>
+ </property>
+ <property name="text">
+ <string>Cop&amp;y Identity...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonRenameIdentity</cstring>
+ </property>
+ <property name="text">
+ <string>Rename I&amp;dentity...</string>
+ </property>
+ </widget>
+ <widget class="KPushButton">
+ <property name="name">
+ <cstring>buttonRemoveIdentity</cstring>
+ </property>
+ <property name="text">
+ <string>Remo&amp;ve Identity</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Nickname</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>nicknameButtonGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="frameShape">
+ <enum>NoFrame</enum>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout12</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioNicknameCustom</cstring>
+ </property>
+ <property name="text">
+ <string>Cu&amp;stom:</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>lineNickname</cstring>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioNicknameKABC</cstring>
+ </property>
+ <property name="text">
+ <string>Use address boo&amp;k name (need address book link)</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton">
+ <property name="name">
+ <cstring>radioNicknameContact</cstring>
+ </property>
+ <property name="text">
+ <string>Use nickname from con&amp;tact for global nickname:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>comboNameContact</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Contact to synchronize the displayname with.</string>
+ </property>
+ </widget>
+ </vbox>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>P&amp;hoto</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QButtonGroup">
+ <property name="name">
+ <cstring>photoButtonGroup</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="lineWidth">
+ <number>0</number>
+ </property>
+ <property name="title">
+ <string></string>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KURLComboRequester" row="1" column="0">
+ <property name="name">
+ <cstring>comboPhotoURL</cstring>
+ </property>
+ </widget>
+ <widget class="KPushButton" row="1" column="1">
+ <property name="name">
+ <cstring>buttonClearPhoto</cstring>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32</width>
+ <height>3232</height>
+ </size>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>checkSyncPhotoKABC</cstring>
+ </property>
+ <property name="text">
+ <string>S&amp;ync address book photo with global photo</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>comboPhotoContact</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioPhotoCustom</cstring>
+ </property>
+ <property name="text">
+ <string>Cus&amp;tom:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="3" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioPhotoContact</cstring>
+ </property>
+ <property name="text">
+ <string>U&amp;se photo from contact for global photo:</string>
+ </property>
+ </widget>
+ <widget class="QRadioButton" row="2" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>radioPhotoKABC</cstring>
+ </property>
+ <property name="text">
+ <string>Use a&amp;ddress book photo (needs address book link)</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout11</cstring>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>36</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>labelPhoto</cstring>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>64</width>
+ <height>92</height>
+ </size>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>64</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="frameShape">
+ <enum>Box</enum>
+ </property>
+ <property name="lineWidth">
+ <number>1</number>
+ </property>
+ <property name="text">
+ <string>&lt;center&gt;Photo&lt;/center&gt;</string>
+ </property>
+ <property name="textFormat">
+ <enum>RichText</enum>
+ </property>
+ <property name="scaledContents">
+ <bool>false</bool>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer7</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </hbox>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer5</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Address &amp;Book Link</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout7</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KLineEdit">
+ <property name="name">
+ <cstring>lineAddressee</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>buttonChangeAddressee</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>C&amp;hange...</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;b&gt;Note:&lt;/b&gt; The address book link uses KAddressBook's
+current user contact.</string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer4_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>100</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ </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>20</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+</widget>
+<connections>
+ <connection>
+ <sender>kcfg_EnableGlobalIdentity</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>nicknameButtonGroup</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>kcfg_EnableGlobalIdentity</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>photoButtonGroup</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>kcfg_EnableGlobalIdentity</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboSelectIdentity</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+ <connection>
+ <sender>kcfg_EnableGlobalIdentity</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>buttonChangeAddressee</receiver>
+ <slot>setEnabled(bool)</slot>
+ </connection>
+</connections>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kurlrequester.h</includehint>
+ <includehint>kcombobox.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>kpushbutton.h</includehint>
+ <includehint>klineedit.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfg b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfg
new file mode 100644
index 00000000..3d004495
--- /dev/null
+++ b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfg
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Author: Michaël Larouche-->
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name="kopeterc"/>
+
+ <group name="Kopete Identity Config">
+ <entry name="SelectedIdentity" type="String">
+ <label>Latest selected global identity.</label>
+ <default code="true">i18n("Default Identity")</default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc
new file mode 100644
index 00000000..6f93d40f
--- /dev/null
+++ b/kopete/kopete/config/identity/kopeteidentityconfigpreferences.kcfgc
@@ -0,0 +1,8 @@
+# Code generation options for kconfig_compiler
+File=kopeteidentityconfigpreferences.kcfg
+ClassName=KopeteIdentityConfigPreferences
+Singleton=true
+Mutators=true
+MemberVariables=private
+GlobalEnums=true
+IncludeFiles=klocale.h
diff --git a/kopete/kopete/config/plugins/Makefile.am b/kopete/kopete/config/plugins/Makefile.am
new file mode 100644
index 00000000..3ed239a1
--- /dev/null
+++ b/kopete/kopete/config/plugins/Makefile.am
@@ -0,0 +1,11 @@
+METASOURCES = AUTO
+AM_CPPFLAGS = $(KOPETE_INCLUDES) $(all_includes)
+
+noinst_LTLIBRARIES = libkopetepluginconfig.la
+
+libkopetepluginconfig_la_SOURCES = kopetepluginconfig.cpp
+libkopetepluginconfig_la_LDFLAGS = $(all_libraries)
+libkopetepluginconfig_la_LIBADD = $(LIB_KUTILS)
+
+# vim: set noet:
+
diff --git a/kopete/kopete/config/plugins/kopetepluginconfig.cpp b/kopete/kopete/config/plugins/kopetepluginconfig.cpp
new file mode 100644
index 00000000..9949f70e
--- /dev/null
+++ b/kopete/kopete/config/plugins/kopetepluginconfig.cpp
@@ -0,0 +1,120 @@
+/*
+ kopetepluginconfig.cpp - Configure the Kopete plugins
+
+ Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ Kopete (c) 2001-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#include "kopetepluginconfig.h"
+
+#include <qlayout.h>
+#include <qtimer.h>
+
+#include <kdebug.h>
+#include <klocale.h>
+#include <kpluginselector.h>
+#include <ksettings/dispatcher.h>
+
+#include "kopetepluginmanager.h"
+
+class KopetePluginConfigPrivate
+{
+public:
+ KPluginSelector *pluginSelector;
+ bool isChanged;
+};
+
+KopetePluginConfig::~KopetePluginConfig()
+{
+ delete d;
+}
+
+KopetePluginConfig::KopetePluginConfig( QWidget *parent, const char *name )
+: KDialogBase( Plain, i18n( "Configure Plugins" ), /*Help |*/ Cancel | Apply | Ok | User1,
+ Ok, parent, name, false, true, KGuiItem( i18n( "&Reset" ), "undo" ) )
+{
+ d = new KopetePluginConfigPrivate;
+ showButton( User1, false );
+ setChanged( false );
+
+ // FIXME: Implement this - Martijn
+ enableButton( KDialogBase::Help, false );
+
+ setInitialSize( QSize( 640, 480 ) );
+
+ ( new QVBoxLayout( plainPage(), 0, 0 ) )->setAutoAdd( true );
+ d->pluginSelector = new KPluginSelector( plainPage() );
+ setMainWidget( d->pluginSelector );
+ connect( d->pluginSelector, SIGNAL( changed( bool ) ), this, SLOT( setChanged( bool ) ) );
+ connect( d->pluginSelector, SIGNAL( configCommitted( const QCString & ) ),
+ KSettings::Dispatcher::self(), SLOT( reparseConfiguration( const QCString & ) ) );
+
+ d->pluginSelector->addPlugins( Kopete::PluginManager::self()->availablePlugins( "Plugins" ), i18n( "General Plugins" ), "Plugins" );
+}
+
+void KopetePluginConfig::setChanged( bool c )
+{
+ d->isChanged = c;
+ enableButton( Apply, c );
+}
+
+void KopetePluginConfig::slotDefault()
+{
+ d->pluginSelector->defaults();
+ setChanged( false );
+}
+
+void KopetePluginConfig::slotUser1()
+{
+ d->pluginSelector->load();
+ setChanged( false );
+}
+
+void KopetePluginConfig::apply()
+{
+ if( d->isChanged )
+ {
+ d->pluginSelector->save();
+ Kopete::PluginManager::self()->loadAllPlugins();
+ setChanged( false );
+ }
+}
+
+void KopetePluginConfig::slotApply()
+{
+ apply();
+}
+
+void KopetePluginConfig::slotOk()
+{
+ emit okClicked();
+ apply();
+ accept();
+}
+
+void KopetePluginConfig::slotHelp()
+{
+ kdWarning() << k_funcinfo << "FIXME: Implement!" << endl;
+}
+
+void KopetePluginConfig::show()
+{
+ d->pluginSelector->load();
+
+ KDialogBase::show();
+}
+
+#include "kopetepluginconfig.moc"
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/kopete/config/plugins/kopetepluginconfig.h b/kopete/kopete/config/plugins/kopetepluginconfig.h
new file mode 100644
index 00000000..e8853a1c
--- /dev/null
+++ b/kopete/kopete/config/plugins/kopetepluginconfig.h
@@ -0,0 +1,56 @@
+/*
+ kopetepluginconfig.h - Configure the Kopete plugins
+
+ Copyright (c) 2003 by Martijn Klingens <klingens@kde.org>
+
+ Kopete (c) 2001-2003 by the Kopete developers <kopete-devel@kde.org>
+
+ *************************************************************************
+ * *
+ * 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 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ *************************************************************************
+*/
+
+#ifndef KOPETEPLUGINCONFIG_H
+#define KOPETEPLUGINCONFIG_H
+
+#include <kdialogbase.h>
+
+class KopetePluginConfigPrivate;
+
+/**
+ * Plugin selector. See KPluginSelector in kdelibs for documentation.
+ *
+ * @author Martijn Klingens <klingens@kde.org>
+ */
+class KopetePluginConfig : public KDialogBase
+{
+ Q_OBJECT
+
+public:
+ KopetePluginConfig( QWidget *parent, const char *name = 0L );
+ ~KopetePluginConfig();
+ void apply();
+
+public slots:
+ void setChanged( bool c );
+
+ virtual void slotDefault();
+ virtual void slotUser1();
+ virtual void slotApply();
+ virtual void slotOk();
+ virtual void slotHelp();
+ virtual void show();
+
+private:
+ KopetePluginConfigPrivate *d;
+};
+
+#endif // KOPETEPLUGINCONFIG_H
+
+// vim: set noet ts=4 sts=4 sw=4:
+