summaryrefslogtreecommitdiffstats
path: root/kopete/protocols/irc/ui
diff options
context:
space:
mode:
Diffstat (limited to 'kopete/protocols/irc/ui')
-rw-r--r--kopete/protocols/irc/ui/Makefile.am12
-rw-r--r--kopete/protocols/irc/ui/channellist.cpp346
-rw-r--r--kopete/protocols/irc/ui/channellist.h80
-rw-r--r--kopete/protocols/irc/ui/channellistdialog.cpp61
-rw-r--r--kopete/protocols/irc/ui/channellistdialog.h45
-rw-r--r--kopete/protocols/irc/ui/empty.cpp1
-rw-r--r--kopete/protocols/irc/ui/ircadd.ui163
-rw-r--r--kopete/protocols/irc/ui/irceditaccount.ui1022
-rw-r--r--kopete/protocols/irc/ui/irceditaccountwidget.cpp282
-rw-r--r--kopete/protocols/irc/ui/irceditaccountwidget.h60
-rw-r--r--kopete/protocols/irc/ui/networkconfig.ui382
-rw-r--r--kopete/protocols/irc/ui/networkconfig.ui.h26
12 files changed, 2480 insertions, 0 deletions
diff --git a/kopete/protocols/irc/ui/Makefile.am b/kopete/protocols/irc/ui/Makefile.am
new file mode 100644
index 00000000..854a7398
--- /dev/null
+++ b/kopete/protocols/irc/ui/Makefile.am
@@ -0,0 +1,12 @@
+METASOURCES = AUTO
+
+noinst_LTLIBRARIES = libkopeteircui.la
+AM_CPPFLAGS = $(KOPETE_INCLUDES) \
+ -I$(srcdir)/..\
+ -I$(srcdir)/../libkirc \
+ $(all_includes)
+
+
+libkopeteircui_la_SOURCES = ircadd.ui empty.cpp irceditaccountwidget.cpp \
+ irceditaccount.ui channellist.cpp channellistdialog.cpp networkconfig.ui
+EXTRA_DIST = ircadd.ui ircprefs.ui empty.cpp
diff --git a/kopete/protocols/irc/ui/channellist.cpp b/kopete/protocols/irc/ui/channellist.cpp
new file mode 100644
index 00000000..5c66ede0
--- /dev/null
+++ b/kopete/protocols/irc/ui/channellist.cpp
@@ -0,0 +1,346 @@
+/*
+ channellist.cpp - IRC Channel Search Widget
+
+ Copyright (c) 2004 by Jason Keirstead <jason@keirstead.org>
+
+ Kopete (c) 2002-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 "channellist.h"
+
+#include "kircengine.h"
+
+#include <klocale.h>
+#include <kmessagebox.h>
+
+#include <qvariant.h>
+#include <qlabel.h>
+#include <qpainter.h>
+#include <qapplication.h>
+#include <qsimplerichtext.h>
+#include <qstyle.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qheader.h>
+#include <klistview.h>
+#include <qlayout.h>
+#include <qtooltip.h>
+#include <qtimer.h>
+#include <qspinbox.h>
+#include <qwhatsthis.h>
+
+class ChannelListItem : public KListViewItem
+{
+ public:
+ ChannelListItem( KListView *parent, QString arg1, QString arg2, QString arg3 );
+ virtual int compare( QListViewItem *i, int col, bool ascending ) const;
+ virtual void paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align );
+
+ private:
+ KListView *parentList;
+};
+
+ChannelListItem::ChannelListItem( KListView *parent, QString arg1, QString arg2, QString arg3 ) :
+ KListViewItem( parent, parent->lastItem() ), parentList( parent )
+{
+ setText(0, arg1);
+ setText(1, arg2);
+ setText(2, arg3);
+}
+
+int ChannelListItem::compare( QListViewItem *i, int col, bool ascending ) const
+{
+ if( col == 1 )
+ {
+ if( text(1).toUInt() < i->text(1).toUInt() )
+ return -1;
+ else if ( text(1).toUInt() == i->text(1).toUInt() )
+ return 0;
+ else
+ return 1;
+ }
+ else
+ return QListViewItem::compare( i, col, ascending );
+}
+
+void ChannelListItem::paintCell( QPainter *p, const QColorGroup &cg, int column, int width, int align )
+{
+ QPixmap back( width, height() );
+ QPainter paint( &back );
+ //KListViewItem::paintCell( &paint, cg, column, width, align );
+ // PASTED FROM KLISTVIEWITEM:
+ // set the alternate cell background colour if necessary
+ QColorGroup _cg = cg;
+ if (isAlternate())
+ if (listView()->viewport()->backgroundMode()==Qt::FixedColor)
+ _cg.setColor(QColorGroup::Background, static_cast< KListView* >(listView())->alternateBackground());
+ else
+ _cg.setColor(QColorGroup::Base, static_cast< KListView* >(listView())->alternateBackground());
+ // PASTED FROM QLISTVIEWITEM
+ {
+ QPainter *p = &paint;
+
+ QListView *lv = listView();
+ if ( !lv )
+ return;
+ QFontMetrics fm( p->fontMetrics() );
+
+ // any text we render is done by the Components, not by this class, so make sure we've nothing to write
+ QString t;
+
+ // removed text truncating code from Qt - we do that differently, further on
+
+ int marg = lv->itemMargin();
+ int r = marg;
+ // const QPixmap * icon = pixmap( column );
+
+ const BackgroundMode bgmode = lv->viewport()->backgroundMode();
+ const QColorGroup::ColorRole crole = QPalette::backgroundRoleFromMode( bgmode );
+
+ if ( _cg.brush( crole ) != lv->colorGroup().brush( crole ) )
+ p->fillRect( 0, 0, width, height(), _cg.brush( crole ) );
+ else
+ {
+ // all copied from QListView::paintEmptyArea
+
+ //lv->paintEmptyArea( p, QRect( 0, 0, width, height() ) );
+ QStyleOption opt( lv->sortColumn(), 0 ); // ### hack; in 3.1, add a property in QListView and QHeader
+ QStyle::SFlags how = QStyle::Style_Default;
+ if ( lv->isEnabled() )
+ how |= QStyle::Style_Enabled;
+
+ lv->style().drawComplexControl( QStyle::CC_ListView,
+ p, lv, QRect( 0, 0, width, height() ), lv->colorGroup(),
+ how, QStyle::SC_ListView, QStyle::SC_None,
+ opt );
+ }
+
+
+
+ if ( isSelected() &&
+ (column == 0 || lv->allColumnsShowFocus()) ) {
+ p->fillRect( r - marg, 0, width - r + marg, height(),
+ _cg.brush( QColorGroup::Highlight ) );
+ // removed text pen setting code from Qt
+ }
+
+ // removed icon drawing code from Qt
+
+ // draw the tree gubbins
+ if ( multiLinesEnabled() && column == 0 && isOpen() && childCount() ) {
+ int textheight = fm.size( align, t ).height() + 2 * lv->itemMargin();
+ textheight = QMAX( textheight, QApplication::globalStrut().height() );
+ if ( textheight % 2 > 0 )
+ textheight++;
+ if ( textheight < height() ) {
+ int w = lv->treeStepSize() / 2;
+ lv->style().drawComplexControl( QStyle::CC_ListView, p, lv,
+ QRect( 0, textheight, w + 1, height() - textheight + 1 ), _cg,
+ lv->isEnabled() ? QStyle::Style_Enabled : QStyle::Style_Default,
+ QStyle::SC_ListViewExpand,
+ (uint)QStyle::SC_All, QStyleOption( this ) );
+ }
+ }
+ }
+ // END OF PASTE
+
+
+ //do you see a better way to tell the TextComponent we are selected ? - Olivier 2004-09-02
+ if ( isSelected() )
+ _cg.setColor(QColorGroup::Text , _cg.highlightedText() );
+
+ QSimpleRichText myrichtext( text(column), paint.font() );
+ myrichtext.draw( &paint, 0, 0, paint.window(), _cg );
+
+ paint.end();
+ p->drawPixmap( 0, 0, back );
+}
+
+ChannelList::ChannelList( QWidget* parent, KIRC::Engine *engine )
+ : QWidget( parent ), m_engine( engine )
+{
+ ChannelListLayout = new QVBoxLayout( this, 11, 6, "ChannelListLayout");
+
+ layout72_2 = new QHBoxLayout( 0, 0, 6, "layout72_2");
+
+ textLabel1_2 = new QLabel( this, "textLabel1_2" );
+ layout72_2->addWidget( textLabel1_2 );
+
+ channelSearch = new QLineEdit( this, "channelSearch" );
+ layout72_2->addWidget( channelSearch );
+
+ numUsers = new QSpinBox( 0, 32767, 1, this, "num_users" );
+ numUsers->setSuffix( i18n(" members") );
+ layout72_2->addWidget( numUsers );
+
+ mSearchButton = new QPushButton( this, "mSearchButton" );
+ layout72_2->addWidget( mSearchButton );
+ ChannelListLayout->addLayout( layout72_2 );
+
+ mChannelList = new KListView( this, "mChannelList" );
+ mChannelList->addColumn( i18n( "Channel" ) );
+ mChannelList->addColumn( i18n( "Users" ) );
+ mChannelList->header()->setResizeEnabled( FALSE, mChannelList->header()->count() - 1 );
+ mChannelList->addColumn( i18n( "Topic" ) );
+ mChannelList->setAllColumnsShowFocus( TRUE );
+ mChannelList->setShowSortIndicator( TRUE );
+ ChannelListLayout->addWidget( mChannelList );
+
+ clearWState( WState_Polished );
+
+ textLabel1_2->setText( i18n( "Search for:" ) );
+ QToolTip::add( textLabel1_2, i18n( "You may search for channels on the IRC server for a text string entered here." ) );
+ QToolTip::add( numUsers, i18n( "Channels returned must have at least this many members." ) );
+ QWhatsThis::add( numUsers, i18n( "Channels returned must have at least this many members." ) );
+ QWhatsThis::add( textLabel1_2, i18n( "You may search for channels on the IRC server for a text string entered here. For instance, you may type 'linux' to find channels that have something to do with linux." ) );
+ QToolTip::add( channelSearch, i18n( "You may search for channels on the IRC server for a text string entered here." ) );
+ QWhatsThis::add( channelSearch, i18n( "You may search for channels on the IRC server for a text string entered here. For instance, you may type 'linux' to find channels that have something to do with linux." ) );
+ mSearchButton->setText( i18n( "S&earch" ) );
+ QToolTip::add( mSearchButton, i18n( "Perform a channel search." ) );
+ QWhatsThis::add( mSearchButton, i18n( "Perform a channel search. Please be patient, as this can be slow depending on the number of channels on the server." ) );
+ QToolTip::add( mChannelList, i18n( "Double click on a channel to select it." ) );
+ mChannelList->header()->setLabel( 0, i18n( "Channel" ) );
+ mChannelList->header()->setLabel( 1, i18n( "Users" ) );
+ mChannelList->header()->setLabel( 2, i18n( "Topic" ) );
+
+ // signals and slots connections
+ connect( mChannelList, SIGNAL( doubleClicked(QListViewItem*) ),
+ this, SLOT( slotItemDoubleClicked(QListViewItem*) ) );
+
+ connect( mSearchButton, SIGNAL( clicked() ), this, SLOT( search() ) );
+
+ connect( mChannelList, SIGNAL( selectionChanged( QListViewItem*) ), this,
+ SLOT( slotItemSelected( QListViewItem *) ) );
+
+ connect( m_engine, SIGNAL( incomingListedChan( const QString &, uint, const QString & ) ),
+ this, SLOT( slotChannelListed( const QString &, uint, const QString & ) ) );
+
+ connect( m_engine, SIGNAL( incomingEndOfList() ), this, SLOT( slotListEnd() ) );
+
+ connect( m_engine, SIGNAL( statusChanged(KIRC::Engine::Status) ),
+ this, SLOT( slotStatusChanged(KIRC::Engine::Status) ) );
+
+ show();
+}
+
+void ChannelList::slotItemDoubleClicked( QListViewItem *i )
+{
+ emit channelDoubleClicked( i->text(0) );
+}
+
+void ChannelList::slotItemSelected( QListViewItem *i )
+{
+ emit channelSelected( i->text(0) );
+}
+
+void ChannelList::slotStatusChanged(KIRC::Engine::Status newStatus)
+{
+ switch(newStatus) {
+ case KIRC::Engine::Connected:
+ this->reset();
+ break;
+ case KIRC::Engine::Disconnected:
+ if (mSearching) {
+ KMessageBox::queuedMessageBox(
+ this, KMessageBox::Error,
+ i18n("You have been disconnected from the IRC server."),
+ i18n("Disconnected"), 0
+ );
+ }
+
+ slotListEnd();
+ break;
+ default:
+ break;
+ }
+}
+
+void ChannelList::reset()
+{
+ channelCache.clear();
+ clear();
+}
+
+void ChannelList::clear()
+{
+ mChannelList->clear();
+ channelSearch->clear();
+ channelSearch->setFocus();
+}
+
+void ChannelList::search()
+{
+ if( m_engine->isConnected() || !channelCache.isEmpty() )
+ {
+ mChannelList->clear();
+ mChannelList->setSorting( -1 );
+ mSearchButton->setEnabled(false);
+ mSearch = channelSearch->text();
+ mSearching = true;
+ mUsers = numUsers->value();
+
+ if( channelCache.isEmpty() )
+ m_engine->list();
+ else
+ {
+ cacheIterator = channelCache.begin();
+ slotSearchCache();
+ }
+ }
+ else
+ {
+ KMessageBox::queuedMessageBox(
+ this, KMessageBox::Error,
+ i18n("You must be connected to the IRC server to perform a channel listing."),
+ i18n("Not Connected"), 0
+ );
+ }
+}
+
+void ChannelList::slotChannelListed( const QString &channel, uint users, const QString &topic )
+{
+ checkSearchResult( channel, users, topic );
+ channelCache.insert( channel, QPair< uint, QString >( users, topic ) );
+}
+
+void ChannelList::checkSearchResult( const QString &channel, uint users, const QString &topic )
+{
+ if( ( mUsers == 0 || mUsers <= users ) &&
+ ( mSearch.isEmpty() || channel.contains( mSearch, false ) || topic.contains( mSearch, false ) )
+ )
+ {
+ new ChannelListItem( mChannelList, channel, QString::number(users), topic );
+ }
+}
+
+void ChannelList::slotSearchCache()
+{
+ if( cacheIterator != channelCache.end() )
+ {
+ checkSearchResult( cacheIterator.key(), cacheIterator.data().first, cacheIterator.data().second );
+ ++cacheIterator;
+ QTimer::singleShot( 0, this, SLOT( slotSearchCache() ) );
+ }
+ else
+ {
+ slotListEnd();
+ }
+}
+
+void ChannelList::slotListEnd()
+{
+ mChannelList->setSorting(0, true);
+ mSearchButton->setEnabled(true);
+ mSearching = false;
+}
+
+#include "channellist.moc"
diff --git a/kopete/protocols/irc/ui/channellist.h b/kopete/protocols/irc/ui/channellist.h
new file mode 100644
index 00000000..c6f435a0
--- /dev/null
+++ b/kopete/protocols/irc/ui/channellist.h
@@ -0,0 +1,80 @@
+ /*
+ channellist.h - IRC Channel Search Widget
+
+ Copyright (c) 2004 by Jason Keirstead <jason@keirstead.org>
+
+ 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 CHANNELLIST_H
+#define CHANNELLIST_H
+
+#include <qwidget.h>
+#include <qmap.h>
+#include <qpair.h>
+
+#include "kircengine.h"
+
+class QVBoxLayout;
+class QHBoxLayout;
+class QGridLayout;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class KListView;
+class QSpinBox;
+class QListViewItem;
+
+class ChannelList
+ : public QWidget
+{
+ Q_OBJECT
+
+ public:
+ ChannelList( QWidget *parent, KIRC::Engine *engine );
+
+ public slots:
+ void search();
+ void reset();
+ void clear();
+
+ signals:
+ void channelDoubleClicked( const QString &channel );
+ void channelSelected( const QString &channel );
+
+ private slots:
+ void slotItemDoubleClicked( QListViewItem * i );
+ void slotItemSelected( QListViewItem * i );
+ void slotChannelListed( const QString & channel, uint users, const QString & topic );
+ void slotListEnd();
+ void slotSearchCache();
+ void slotStatusChanged( KIRC::Engine::Status );
+
+ private:
+ void checkSearchResult( const QString & channel, uint users, const QString & topic );
+
+ QLabel* textLabel1_2;
+ QLineEdit* channelSearch;
+ QSpinBox* numUsers;
+ QPushButton* mSearchButton;
+ KListView* mChannelList;
+ QVBoxLayout* ChannelListLayout;
+ QHBoxLayout* layout72_2;
+ KIRC::Engine *m_engine;
+ bool mSearching;
+ QString mSearch;
+ uint mUsers;
+ QMap< QString, QPair< uint, QString > > channelCache;
+ QMap< QString, QPair< uint, QString > >::const_iterator cacheIterator;
+};
+
+#endif
diff --git a/kopete/protocols/irc/ui/channellistdialog.cpp b/kopete/protocols/irc/ui/channellistdialog.cpp
new file mode 100644
index 00000000..46128730
--- /dev/null
+++ b/kopete/protocols/irc/ui/channellistdialog.cpp
@@ -0,0 +1,61 @@
+/*
+ channellistdialog.cpp - IRC Channel Search Dialog
+
+ Copyright (c) 2004 by Jason Keirstead <jason@keirstead.org>
+ Copyright (c) 2005 by Michel Hermier <michel.hermier@wanadoo.fr>
+
+ 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 "channellistdialog.h"
+
+#include "kircengine.h"
+
+#include "kopeteuiglobal.h"
+
+#include "qlayout.h"
+
+ChannelListDialog::ChannelListDialog(KIRC::Engine *engine, const QString &caption, QObject *target, const char* slotJoinChan)
+ : KDialogBase(Kopete::UI::Global::mainWidget(), "channel_list_widget", false, caption, Close)
+{
+ m_engine = engine;
+ m_list = new ChannelList( this, engine );
+
+ connect( m_list, SIGNAL( channelDoubleClicked( const QString & ) ),
+ target, slotJoinChan );
+
+ connect( m_list, SIGNAL( channelDoubleClicked( const QString & ) ),
+ this, SLOT( slotChannelDoubleClicked( const QString & ) ) );
+
+ new QHBoxLayout( m_list, 0, spacingHint() );
+
+ setInitialSize( QSize( 500, 400 ) );
+ setMainWidget( m_list );
+ show();
+}
+
+void ChannelListDialog::clear()
+{
+ m_list->clear();
+}
+
+void ChannelListDialog::search()
+{
+ m_list->search();
+}
+
+void ChannelListDialog::slotChannelDoubleClicked( const QString & )
+{
+ close();
+}
+
+#include "channellistdialog.moc"
diff --git a/kopete/protocols/irc/ui/channellistdialog.h b/kopete/protocols/irc/ui/channellistdialog.h
new file mode 100644
index 00000000..2bb85f5b
--- /dev/null
+++ b/kopete/protocols/irc/ui/channellistdialog.h
@@ -0,0 +1,45 @@
+ /*
+ channellist.h - IRC Channel Search Widget
+
+ Copyright (c) 2004 by Jason Keirstead <jason@keirstead.org>
+
+ 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 CHANNELLISTDIALOG_H
+#define CHANNELLISTDIALOG_H
+
+#include "channellist.h"
+
+#include "kdialogbase.h"
+
+class ChannelListDialog
+ : public KDialogBase
+{
+ Q_OBJECT
+
+ public:
+ ChannelListDialog(KIRC::Engine *engine, const QString &caption, QObject *target, const char* slotJoinChan);
+
+ void clear();
+
+ void search();
+
+ private slots:
+ void slotChannelDoubleClicked( const QString & );
+
+ private:
+ KIRC::Engine *m_engine;
+ ChannelList *m_list;
+};
+
+#endif
diff --git a/kopete/protocols/irc/ui/empty.cpp b/kopete/protocols/irc/ui/empty.cpp
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/kopete/protocols/irc/ui/empty.cpp
@@ -0,0 +1 @@
+
diff --git a/kopete/protocols/irc/ui/ircadd.ui b/kopete/protocols/irc/ui/ircadd.ui
new file mode 100644
index 00000000..f1025112
--- /dev/null
+++ b/kopete/protocols/irc/ui/ircadd.ui
@@ -0,0 +1,163 @@
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
+<class>ircAddUI</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>ircAddUI</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>389</width>
+ <height>350</height>
+ </rect>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>0</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget3</cstring>
+ </property>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Add Contact</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <property name="margin">
+ <number>6</number>
+ </property>
+ <property name="spacing">
+ <number>6</number>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout70</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>TextLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ickname/channel to add:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>addID</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The name of the IRC contact or channel you would like to add.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The name of the IRC contact or channel you would like to add. You may type simply the text of a person's nickname, or you may type a channel name, preceded by a pound sign ('#').</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>addID</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The name of the IRC contact or channel you would like to add.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The name of the IRC contact or channel you would like to add. You may type simply the text of a person's nickname, or you may type a channel name, preceded by a pound sign ('#')</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="text">
+ <string>&lt;i&gt;(for example: joe_bob or #somechannel)&lt;/i&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>AlignVCenter|AlignRight</set>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer25</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>110</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>&amp;Search Channels</string>
+ </attribute>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QHBox">
+ <property name="name">
+ <cstring>hbox</cstring>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </widget>
+ </vbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>QHBox</class>
+ <header>qhbox.h</header>
+ <sizehint>
+ <width>-1</width>
+ <height>-1</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>5</hordata>
+ <verdata>5</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="XPM.GZ" length="4462">789c9d97c76e24490e86effd1442f3d65870d2451a0ce6206f5adeb4cc620f8c34f2553225b5a4c1befb46927fe6a1d4c0ccac4287fa8a0c26834193f5dbb785b3fd9d856fbf7d799ec9ecba5ea8afe469e15bf3727ffffeeffffcf1e797af49b2d0ffc7d142f2f55f5fbe1ecc16ea85dde9a4ed81290045faa77ca49cf4ab67ba1e3953969173651ab9d4fdf1c8a27c3872ad7c3c72d3b32c2a67c3f3444636fbef23eb7e590267e68fcc4656395d8dacf6d938ef97eaef289781cddebdb2846fccff44b989ba58e3411f3dc75158e6df1d3889539517ca49bf54fe43398d1dec4f46567f685fd9c539f43fc025f80c1c3ce8d93f28e77185f8bf0c6cfae4c0b5f9c3c6e5c0542a4b5876fe13708df39d2bd7716372aa8c93c4e4723bb2f977aadc26ceec4bdb7310e6b0bfab9c2445ecd49f1370694cebca65d260ffa6711a41aef14d24e94cee6be3348e0ae5e9c8765f07ca3e8db17f0f9c825794eb3489351fe9bb7217e4969f29388bd51ee9fda5715a19730696b852fea95c6471647ca95cf64bcf43e0cef4657b647bfe6acf213d6bb32f9a9f5992b5a64f9a8f990b6cf9ecc15d6cf9acf6b2da55a8a75cb973dee4b2d1b38b5c05de02434e87e01aacfb351df5bebddea74b5c67f9c795711ea15e357e2ecde358fb87efc0a867df8cac728a074e62e527706afb59f3cf6583be5c28bb3c35f693812d1fbdc6dbe57966fec932d899ffa4f7e38adca17e34beaeca4b9c271a18f1d5fc739257b0d70d9c68be7bed7fcee7827ab91cd8e4740cf6b19d4ffb87ab07b9bf516e72d4a3ac821b9cef6e60d84f47367ded2fae1d9f7704f6163f79000ffde27660f387ed3c5dbf54dfeebb0bf6acbe6b706bfa5ef32f8f8b18f5bf0f463f20edb77956a4e68fbc80b3c4facd163847be6bfde72ec86dbeac82715fbc0286be683cf3bc081d44f7df80d344fb0b6b7de64581fb916765297263d6fccd9b7ee97e566e8b06cfdb1f59cf2bda2f8bbc2c11df0c5c41aefdb328ca22b1feb0012eedbce24736f91b18fb796d64eb87cb60817dcdafb07d906bfd14d22f659d8785ef97b2f6d7b2df6ef1d6fb2babaac6f92e8c25b27ecc1f239b7f3a5fca5a8678ea7c2d9bc0e6ef1238b3fca2c7814d5f4cbf9334b5f833384bed3c7a5f5514f4adbe2ec07962e7590457f06f6f649b977afe2a16f42f5e070bfc591e18f7a5f1a812a9e0df39d827da4fbd8c6ccfd7785569bf945f953371a9d5a3de67950bfa2d75c63eb2fb15bdcfaaf011e6c7263846bf8f4636f91618f3c7d3c0f047fb69550efab2074e12bd6fd27957553ec33c5b043bcc7f9d0795f818fdb501a3df8ae673e507ff69021eea37063bc45ffb73550736ff36c0a84f3e0317a86f8b5f139e6ffe1f821de6d9127898ff3be00a7c3ab2cd03e3d697560ff40016e47b3bb2e96bbd559d8f32bbff4b7065f193042c98873acf240af6adbf3c83c5f2954bb0c7bcd77c107d81d2fdebc63e33ff640aaecc9e1c8151df5c803dfaadc64b52dfa03ed64636ffb4ff4b2867f453ede7227586fcd3f9264ded91fffafe236d5da37fe83c91ceb7b9e5b7f6731ff92ed7f747d6fbf7e185cf58347e3e6932e47b3430fa893edf87d795c2fc3f003b67f5f902cec17abfde0dfa3c053b3c5ffb832fc2eb8fddcf233887fc195c801f46b6f3cdc02558fba72f7d2d1a7f7e321ee58fe0cad86bbff24dd3e2fe74fef836b0c6eb60d62fa6bf5e07b3419f853dd7dc70fb8bd5f1255fd90ed30f9f3c5ff30ddff21ddff384a7fcc08ffcc4cf61cdf8855ff9e79c7e1db4dff89d3f7891977899577895d7789d377893b7f83b6fcfe937bc13b477798ff7f9800ff928ac633ee11f7cca6761d7f99c7e1b3cb908da11c7413be1943376e153cc39175c72f549ff9e17c31744429e6a6aa8a58e2ee98aaee9866e7f617fc24b7417a4f734a1293dd0233dd133cd8285177aa5f9f3b63ca5377aa78f607b919668995682e62aadd17ab0b1419b9ff41f682b48bed336edd02eed05ed7d5ea3033a0cdf1ed1f127fd273ae123fa41a774a6b685cee982228a837e42e927fd47caf8985c38651eb40b2ac38e4a5842658a97fab33fd248cb87d2c9a55cc9b5dcc82d1fc99ddccb44a6f230af2f8ff224cf417f262ff22a3fe54ddee543166549966545567f617f4dd66523dc6b2c9bb225df655b7682f692ecca9eeccfe97772c09b722847722c27c1f3eb70f66bf9116c9fca999ccbc59cfe25bf4a143a5ef8992561324a78bd92522acf9ebc78efe7cf7b153276db37bef59dbff457fedadff85b7f27abfede4ffcd4cf9ff76faeff4fffefeff8c7f5fedfdfbffc0fa355c495</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>addID</tabstop>
+ <tabstop>tabWidget3</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/protocols/irc/ui/irceditaccount.ui b/kopete/protocols/irc/ui/irceditaccount.ui
new file mode 100644
index 00000000..682e9be9
--- /dev/null
+++ b/kopete/protocols/irc/ui/irceditaccount.ui
@@ -0,0 +1,1022 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>IRCEditAccountBase</class>
+<widget class="QWidget">
+ <property name="name">
+ <cstring>IRCEditAccountBase</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>689</width>
+ <height>528</height>
+ </rect>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="baseSize">
+ <size>
+ <width>440</width>
+ <height>575</height>
+ </size>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QTabWidget">
+ <property name="name">
+ <cstring>tabWidget2</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>B&amp;asic Setup</string>
+ </attribute>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <spacer row="2" column="0">
+ <property name="name">
+ <cstring>spacer8</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>1</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="maximumSize">
+ <size>
+ <width>32767</width>
+ <height>32767</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&lt;p&gt;&lt;b&gt;Note:&lt;/b&gt; Most IRC servers do not require a password, and only a nickname is required to connect&lt;/p&gt;</string>
+ </property>
+ <property name="alignment">
+ <set>WordBreak|AlignTop</set>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="0" column="0">
+ <property name="name">
+ <cstring>groupBox59</cstring>
+ </property>
+ <property name="frameShape">
+ <enum>GroupBoxPanel</enum>
+ </property>
+ <property name="frameShadow">
+ <enum>Sunken</enum>
+ </property>
+ <property name="title">
+ <string>Account Information</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>N&amp;ickname:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mNickName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>This is the name that everyone will see everytime you say something</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel1_2</cstring>
+ </property>
+ <property name="text">
+ <string>Alternate ni&amp;ckname:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mAltNickname</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When the nickname is already in use when connecting, this name will be used instead</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>mNickName</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>This is the name that everyone will see everytime you say something</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The alias you would like to use on IRC. You may change this once online with the /nick command.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>mAltNickname</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>When the nickname is already in use when connecting, this name will be used instead</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>When the nickname is already in use when connecting, this name will be used instead</string>
+ </property>
+ </widget>
+ <widget class="Kopete::UI::PasswordWidget" row="4" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>mPasswordWidget</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>m_realNameLabel</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Real name:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>m_realNameLineEdit</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="2" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Username:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>mUserName</cstring>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The username you would prefer to use on IRC, if your system does not have identd support. Leave blank to use your system account name.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="2" column="1">
+ <property name="name">
+ <cstring>mUserName</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="echoMode">
+ <enum>Normal</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The username you would prefer to use on IRC, if your system does not have identd support. Leave blank to use your system account name.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The username you would prefer to use on IRC, if your system does not have identd support. Leave blank to use your system account name.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>m_realNameLineEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="echoMode">
+ <enum>Normal</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The username you would prefer to use on IRC, if your system does not have identd support.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The username you would prefer to use on IRC, if your system does not have identd support. Leave blank to use your system account name.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>TabPage</cstring>
+ </property>
+ <attribute name="title">
+ <string>Connection</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout21</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="1">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>description</cstring>
+ </property>
+ <property name="text">
+ <string></string>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer11</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>161</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout20</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>network</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>editButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Edit...</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>392</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_3</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Network:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>network</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox1</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Connection Preferences</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>preferSSL</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Prefer SSL-based connections</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox">
+ <property name="name">
+ <cstring>autoConnect</cstring>
+ </property>
+ <property name="text">
+ <string>E&amp;xclude from connect all</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>If you check that case, the account will not be connected when you press the "Connect All" button, or at startup even if you selected to automatically connect at startup</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout25</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1_2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Default &amp;charset:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>charset</cstring>
+ </property>
+ </widget>
+ <widget class="QComboBox">
+ <property name="name">
+ <cstring>charset</cstring>
+ </property>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer6_2</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>141</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox5</cstring>
+ </property>
+ <property name="title">
+ <string>Default Messages</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Part message:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>partMessage</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Quit message:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>quitMessage</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="0" column="1">
+ <property name="name">
+ <cstring>partMessage</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The message you want people to see when you part a channel without giving a reason. Leave this field blank to use the Kopete default message.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The message you want people to see when you part a channel without giving a reason. Leave this field blank to use the Kopete default message.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="1" column="1">
+ <property name="name">
+ <cstring>quitMessage</cstring>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The message you want people to see when you disconnect from IRC without giving a reason. Leave this field blank to use the Kopete default message.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The message you want people to see when you disconnect from IRC without giving a reason. Leave this field blank to use the Kopete default message.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <spacer>
+ <property name="name">
+ <cstring>spacer72</cstring>
+ </property>
+ <property name="orientation">
+ <enum>Vertical</enum>
+ </property>
+ <property name="sizeType">
+ <enum>Expanding</enum>
+ </property>
+ <property name="sizeHint">
+ <size>
+ <width>20</width>
+ <height>150</height>
+ </size>
+ </property>
+ </spacer>
+ </vbox>
+ </widget>
+ <widget class="QWidget">
+ <property name="name">
+ <cstring>tab</cstring>
+ </property>
+ <attribute name="title">
+ <string>A&amp;dvanced Configuration</string>
+ </attribute>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox7</cstring>
+ </property>
+ <property name="title">
+ <string>Message Destinations</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QCheckBox" row="1" column="1">
+ <property name="name">
+ <cstring>autoShowAnonWindows</cstring>
+ </property>
+ <property name="text">
+ <string>Auto-show anonymous windows</string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="1" column="0">
+ <property name="name">
+ <cstring>autoShowServerWindow</cstring>
+ </property>
+ <property name="text">
+ <string>Auto-show the server window</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="0">
+ <property name="name">
+ <cstring>layout19</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel1_4</cstring>
+ </property>
+ <property name="text">
+ <string>Server messages:</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel4_3</cstring>
+ </property>
+ <property name="text">
+ <string>Server notices:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Active Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Server Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Anonymous Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>KNotify</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ignore</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>serverNotices</cstring>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Active Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Server Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Anonymous Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>KNotify</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ignore</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>serverMessages</cstring>
+ </property>
+ <property name="currentItem">
+ <number>1</number>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QLayoutWidget" row="0" column="1">
+ <property name="name">
+ <cstring>layout23</cstring>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel" row="1" column="0">
+ <property name="name">
+ <cstring>textLabel3_3</cstring>
+ </property>
+ <property name="text">
+ <string>Error messages:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="0" column="1">
+ <item>
+ <property name="text">
+ <string>Active Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Server Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Anonymous Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>KNotify</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ignore</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>informationReplies</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="0" column="0">
+ <property name="name">
+ <cstring>textLabel2_2</cstring>
+ </property>
+ <property name="text">
+ <string>Information replies:</string>
+ </property>
+ </widget>
+ <widget class="QComboBox" row="1" column="1">
+ <item>
+ <property name="text">
+ <string>Active Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Server Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Anonymous Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>KNotify</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Ignore</string>
+ </property>
+ </item>
+ <property name="name">
+ <cstring>errorMessages</cstring>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox6</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>130</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Custom CTCP Replies</string>
+ </property>
+ <vbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="KListView">
+ <column>
+ <property name="text">
+ <string>CTCP</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <column>
+ <property name="text">
+ <string>Reply</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>ctcpList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>false</bool>
+ </property>
+ <property name="defaultRenameAction">
+ <enum>Accept</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="itemsRenameable">
+ <bool>true</bool>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>You can use this dialog to add custom replies for when people send CTCP requests to you. You can also use this dialog to override the built-in replies for VERSION, USERINFO, and CLIENTINFO.</string>
+ </property>
+ </widget>
+ <widget class="QLayoutWidget">
+ <property name="name">
+ <cstring>layout153</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel3_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;CTCP:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>newCTCP</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>newCTCP</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel4_2</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Reply:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>newReply</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>newReply</cstring>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addReply</cstring>
+ </property>
+ <property name="text">
+ <string>Add Repl&amp;y</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ </vbox>
+ </widget>
+ <widget class="QGroupBox">
+ <property name="name">
+ <cstring>groupBox60</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>130</height>
+ </size>
+ </property>
+ <property name="title">
+ <string>Run Following Commands on Connect</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLayoutWidget" row="1" column="0">
+ <property name="name">
+ <cstring>layout29</cstring>
+ </property>
+ <hbox>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit">
+ <property name="name">
+ <cstring>commandEdit</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <widget class="QPushButton">
+ <property name="name">
+ <cstring>addButton</cstring>
+ </property>
+ <property name="text">
+ <string>Add Co&amp;mmand</string>
+ </property>
+ </widget>
+ </hbox>
+ </widget>
+ <widget class="KListView" row="0" column="0">
+ <column>
+ <property name="text">
+ <string>Command</string>
+ </property>
+ <property name="clickable">
+ <bool>true</bool>
+ </property>
+ <property name="resizable">
+ <bool>true</bool>
+ </property>
+ </column>
+ <property name="name">
+ <cstring>commandList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>7</hsizetype>
+ <vsizetype>2</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="allColumnsShowFocus">
+ <bool>true</bool>
+ </property>
+ <property name="defaultRenameAction">
+ <enum>Accept</enum>
+ </property>
+ <property name="fullWidth">
+ <bool>true</bool>
+ </property>
+ <property name="itemsRenameable">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Any commands added here will be run as soon as you are connected to the IRC server.</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Any commands added here will be run as soon as you are connected to the IRC server.</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ </vbox>
+ </widget>
+ </widget>
+ </hbox>
+</widget>
+<customwidgets>
+ <customwidget>
+ <class>Kopete::UI::PasswordWidget</class>
+ <header location="local">kopetepasswordwidget.h</header>
+ <sizehint>
+ <width>50</width>
+ <height>50</height>
+ </sizehint>
+ <container>0</container>
+ <sizepolicy>
+ <hordata>1</hordata>
+ <verdata>0</verdata>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ <pixmap>image0</pixmap>
+ <signal>changed()</signal>
+ </customwidget>
+</customwidgets>
+<images>
+ <image name="image0">
+ <data format="PNG" length="826">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000030149444154388db59531681b5718c77f0e377c070e3c810a3a70e0041eac51852e0a19e45134830a1d9a4c69a04bc8928e990a693a640e1d0c8642b08742321894c1507991b484c890902bb8701a047760c3bd21701fe4201dde49b6a41a32b8df72dcbbeffdbefffbbfefbd5b1b0c07cce266ebe667ae2006c3c1dada0cdc3be87d6e6c35b0d692a409d9c7ec8b20d65ae29398d19b1114e7e3de4ce98b3f5e10dc0053cf0951b4506496e1b964bf7ce6c585d9054c62d01d617ca48be0596553cf496d8f2c8b01c5f795fc93904e85ec4c01a152857a5d9175d0b2805c872080f18595ccc1499a10a225d4e2fbc2877786fe81253ab6c04c8d106e09db5d43ab0d146e5c64d1a23938fb98a185cea1c33eecfd9eba49eb427dcb201e245365f2b7b2fb5b4a3a31dcb927178afe07d86901df870fefa4842aed6f6b74ba42e52b4014d580e1eb9cbd9d94de7e4aad16d2f9be02d805f0b5e532f927a1ffcacea1777f122a8105b164a7c25faf323a5d9f1f1fd600e1e5bec59e2d4b5c7ef5209d0ad17b8b31864e57c0b3e0815ac3ee33253ab664a770ff5185d1a1cb8d2267d3e58aa1dc7d2508cbe597d0e74fdd269aaaf0f52d414c4ea3e9762c996869e42560d7a72e41c4799a2586e74f95e8d8151481fa86efbe7b3398ac58b1a2b8527589f15451ad303ac2293542ad6648a796278f13a27185e4c4754310facb98c53a79e19a3fdc1426ff28c3d7399d1f7cb25343eb96106cf83c790ce9c4f2eb831855c55485663327992eb6dc8a6259874ed700b0b793323cccb9ffa842b30d6133e3e75fea989ac15a8b16ca76b746b0b92278d919774c5b6d48a78697fb29bbcf52468742a32120909c24e899ce67beed5be2db01e22d1e9485bb620e47f9ee9e606a21bd3f5d3744c7e7c54d55e87443867d8b554515ac5db4620e8e4f62263170fd1cdee90aad7640141992891b0f367c9adfe4049bb07d3b7022bd8c687c0978f46684ee084150b65ac1fcca94591b7a90a496e4c095164fb016a2b192a497795cc0f84817aebe25f7bf70ccc54a575c555c03f78ffa5fc0570d1f0c076bff0232285a09643cc7ce0000000049454e44ae426082</data>
+ </image>
+</images>
+<tabstops>
+ <tabstop>tabWidget2</tabstop>
+ <tabstop>mNickName</tabstop>
+ <tabstop>mAltNickname</tabstop>
+ <tabstop>mUserName</tabstop>
+ <tabstop>m_realNameLineEdit</tabstop>
+ <tabstop>network</tabstop>
+ <tabstop>editButton</tabstop>
+ <tabstop>preferSSL</tabstop>
+ <tabstop>autoConnect</tabstop>
+ <tabstop>charset</tabstop>
+ <tabstop>partMessage</tabstop>
+ <tabstop>quitMessage</tabstop>
+ <tabstop>serverMessages</tabstop>
+ <tabstop>serverNotices</tabstop>
+ <tabstop>informationReplies</tabstop>
+ <tabstop>errorMessages</tabstop>
+ <tabstop>autoShowServerWindow</tabstop>
+ <tabstop>autoShowAnonWindows</tabstop>
+ <tabstop>ctcpList</tabstop>
+ <tabstop>newCTCP</tabstop>
+ <tabstop>newReply</tabstop>
+ <tabstop>addReply</tabstop>
+ <tabstop>commandList</tabstop>
+ <tabstop>commandEdit</tabstop>
+ <tabstop>addButton</tabstop>
+</tabstops>
+<layoutdefaults spacing="6" margin="11"/>
+<includehints>
+ <includehint>klistview.h</includehint>
+</includehints>
+</UI>
diff --git a/kopete/protocols/irc/ui/irceditaccountwidget.cpp b/kopete/protocols/irc/ui/irceditaccountwidget.cpp
new file mode 100644
index 00000000..4a1e6ed3
--- /dev/null
+++ b/kopete/protocols/irc/ui/irceditaccountwidget.cpp
@@ -0,0 +1,282 @@
+/*
+ irceditaccountwidget.cpp - IRC Account Widget
+
+ Copyright (c) 2005 by Tommi Rantala <tommi.rantala@cs.helsinki.fi>
+ Copyright (c) 2003 by Olivier Goffart <ogoffart @ kde.org>
+ Copyright (c) 2003 by Jason Keirstead <jason@keirstead.org>
+ 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 "irceditaccountwidget.h"
+
+#include "ircaccount.h"
+#include "ircusercontact.h"
+#include "ircprotocol.h"
+#include "kcodecaction.h"
+
+#include "kircengine.h"
+
+#include "kopetepasswordwidget.h"
+
+#include <kmessagebox.h>
+#include <klocale.h>
+#include <klistview.h>
+#include <kdebug.h>
+#include <kextsock.h>
+#include <kconfig.h>
+#include <kglobal.h>
+#include <kcharsets.h>
+
+#include <qlabel.h>
+#include <qpopupmenu.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qconnection.h>
+#include <qvalidator.h>
+#include <qcombobox.h>
+#include <qlistbox.h>
+#include <qlineedit.h>
+
+IRCEditAccountWidget::IRCEditAccountWidget(IRCProtocol *proto, IRCAccount *ident, QWidget *parent, const char * )
+ : IRCEditAccountBase(parent), KopeteEditAccountWidget(ident)
+{
+ mProtocol = proto;
+
+ // default charset/encoding for new accounts: utf-8, see http://www.iana.org/assignments/character-sets
+ int currentCodec = 106;
+
+ if( account() )
+ {
+ QString nickName = account()->mySelf()->nickName();
+ QString serverInfo = account()->accountId();
+
+ mNickName->setText( nickName );
+ mAltNickname->setText( account()->altNick() );
+ mUserName->setText( account()->userName() );
+ m_realNameLineEdit->setText( account()->realName() );
+
+ partMessage->setText( account()->defaultPart() );
+ quitMessage->setText( account()->defaultQuit() );
+ if( account()->codec() )
+ currentCodec = account()->codec()->mibEnum();
+
+ mPasswordWidget->load ( &account()->password() );
+
+ preferSSL->setChecked(account()->configGroup()->readBoolEntry("PreferSSL"));
+ autoShowServerWindow->setChecked( account()->configGroup()->readBoolEntry("AutoShowServerWindow") );
+ autoConnect->setChecked( static_cast<Kopete::Account*>(account())->excludeConnect() );
+
+ KConfigGroup *config = account()->configGroup();
+
+ serverNotices->setCurrentItem( config->readNumEntry( "ServerNotices", IRCAccount::ServerWindow ) - 1 );
+ serverMessages->setCurrentItem( config->readNumEntry( "ServerMessages", IRCAccount::ServerWindow ) - 1 );
+ informationReplies->setCurrentItem( config->readNumEntry( "InformationReplies", IRCAccount::ActiveWindow ) - 1 );
+ errorMessages->setCurrentItem( config->readNumEntry( "ErrorMessages", IRCAccount::ActiveWindow ) - 1 );
+
+ QStringList cmds = account()->connectCommands();
+ for( QStringList::Iterator i = cmds.begin(); i != cmds.end(); ++i )
+ new QListViewItem( commandList, *i );
+
+ const QMap< QString, QString > replies = account()->customCtcpReplies();
+ for( QMap< QString, QString >::ConstIterator it = replies.begin(); it != replies.end(); ++it )
+ new QListViewItem( ctcpList, it.key(), it.data() );
+ }
+
+ mUserName->setValidator( new QRegExpValidator( QString::fromLatin1("^[^\\s]*$"), mUserName ) );
+ mNickName->setValidator( new QRegExpValidator( QString::fromLatin1("^[^#+&][^\\s]*$"), mNickName ) );
+ mAltNickname->setValidator( new QRegExpValidator( QString::fromLatin1("^[^#+&][^\\s]*$"), mAltNickname ) );
+
+ charset->insertStringList( KCodecAction::supportedEncodings() );
+
+ for (int i = 0; i < charset->count(); ++i) {
+ QString encoding = KGlobal::charsets()->encodingForName(charset->text(i));
+
+ if (KGlobal::charsets()->codecForName(encoding)->mibEnum() == currentCodec) {
+ charset->setCurrentItem( i );
+ break;
+ }
+ }
+
+ connect( commandList, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ),
+ this, SLOT( slotCommandContextMenu( KListView *, QListViewItem *, const QPoint & ) ) );
+
+ connect( ctcpList, SIGNAL( contextMenu( KListView *, QListViewItem *, const QPoint & ) ),
+ this, SLOT( slotCtcpContextMenu( KListView *, QListViewItem *, const QPoint & ) ) );
+
+ connect( addButton, SIGNAL( clicked() ), this, SLOT( slotAddCommand() ) );
+ connect( editButton, SIGNAL( clicked() ), this, SLOT(slotEditNetworks() ) );
+ connect( addReply, SIGNAL( clicked() ), this, SLOT( slotAddCtcp() ) );
+
+ connect( network, SIGNAL( activated( const QString & ) ),
+ this, SLOT( slotUpdateNetworkDescription( const QString &) ) );
+
+ connect( IRCProtocol::protocol(), SIGNAL( networkConfigUpdated( const QString & ) ),
+ this, SLOT( slotUpdateNetworks( const QString & ) ) );
+
+ slotUpdateNetworks( QString::null );
+}
+
+IRCEditAccountWidget::~IRCEditAccountWidget()
+{
+}
+
+IRCAccount *IRCEditAccountWidget::account ()
+{
+ return dynamic_cast<IRCAccount *>(KopeteEditAccountWidget::account () );
+}
+
+void IRCEditAccountWidget::slotUpdateNetworks( const QString & selectedNetwork )
+{
+ network->clear();
+
+ uint i = 0;
+ QStringList keys;
+ for( QDictIterator<IRCNetwork> it( IRCProtocol::protocol()->networks() ); it.current(); ++it )
+ keys.append( it.currentKey() );
+
+ keys.sort();
+
+ QStringList::Iterator end = keys.end();
+ for( QStringList::Iterator it = keys.begin(); it != end; ++it )
+ {
+ IRCNetwork * current = IRCProtocol::protocol()->networks()[*it];
+ network->insertItem( current->name );
+ if ( ( account() && account()->networkName() == current->name ) || current->name == selectedNetwork )
+ {
+ network->setCurrentItem( i );
+ description->setText( current->description );
+ }
+ ++i;
+ }
+}
+
+void IRCEditAccountWidget::slotEditNetworks()
+{
+ IRCProtocol::protocol()->editNetworks( network->currentText() );
+}
+
+void IRCEditAccountWidget::slotUpdateNetworkDescription( const QString &network )
+{
+ description->setText(
+ IRCProtocol::protocol()->networks()[ network ]->description
+ );
+}
+
+void IRCEditAccountWidget::slotCommandContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ QPopupMenu popup;
+ popup.insertItem( i18n("Remove Command"), 1 );
+ if( popup.exec( p ) == 1 )
+ delete item;
+}
+
+void IRCEditAccountWidget::slotCtcpContextMenu( KListView *, QListViewItem *item, const QPoint &p )
+{
+ QPopupMenu popup;
+ popup.insertItem( i18n("Remove CTCP Reply"), 1 );
+ if( popup.exec( p ) == 1 )
+ delete item;
+}
+
+void IRCEditAccountWidget::slotAddCommand()
+{
+ if ( !commandEdit->text().isEmpty() )
+ {
+ new QListViewItem( commandList, commandEdit->text() );
+ commandEdit->clear();
+ }
+}
+
+void IRCEditAccountWidget::slotAddCtcp()
+{
+ if ( !newCTCP->text().isEmpty() && !newReply->text().isEmpty() )
+ {
+ new QListViewItem( ctcpList, newCTCP->text(), newReply->text() );
+ newCTCP->clear();
+ newReply->clear();
+ }
+}
+
+QString IRCEditAccountWidget::generateAccountId( const QString &network )
+{
+ KConfig *config = KGlobal::config();
+ QString nextId = network;
+
+ uint accountNumber = 1;
+ while( config->hasGroup( QString("Account_%1_%2").arg( m_protocol->pluginId() ).arg( nextId ) ) )
+ {
+ nextId = QString::fromLatin1("%1_%2").arg( network ).arg( ++accountNumber );
+ }
+ kdDebug( 14120 ) << k_funcinfo << " ID IS: " << nextId << endl;
+ return nextId;
+}
+
+Kopete::Account *IRCEditAccountWidget::apply()
+{
+ QString nickName = mNickName->text();
+ QString networkName = network->currentText();
+
+ if( !account() )
+ {
+ setAccount( new IRCAccount( mProtocol, generateAccountId(networkName), QString::null, networkName, nickName ) );
+
+ }
+ else
+ {
+ account()->setNickName( nickName );
+ account()->setNetwork( networkName );
+ }
+
+ mPasswordWidget->save( &account()->password() );
+
+ account()->setAltNick( mAltNickname->text() );
+ account()->setUserName( mUserName->text() );
+ account()->setRealName( m_realNameLineEdit->text() );
+ account()->setDefaultPart( partMessage->text() );
+ account()->setDefaultQuit( quitMessage->text() );
+ account()->setAutoShowServerWindow( autoShowServerWindow->isChecked() );
+ account()->setExcludeConnect( autoConnect->isChecked() );
+ account()->setMessageDestinations( serverNotices->currentItem() + 1, serverMessages->currentItem() + 1,
+ informationReplies->currentItem() + 1, errorMessages->currentItem() + 1
+ );
+
+ account()->configGroup()->writeEntry("PreferSSL", preferSSL->isChecked());
+
+ QStringList cmds;
+ for( QListViewItem *i = commandList->firstChild(); i; i = i->nextSibling() )
+ cmds.append( i->text(0) );
+
+ QMap< QString, QString > replies;
+ for( QListViewItem *i = ctcpList->firstChild(); i; i = i->nextSibling() )
+ replies[ i->text(0) ] = i->text(1);
+
+ account()->setCustomCtcpReplies( replies );
+ account()->setConnectCommands( cmds );
+
+ KCharsets *c = KGlobal::charsets();
+ account()->setCodec( c->codecForName( c->encodingForName( charset->currentText() ) ) );
+
+ return account();
+}
+
+
+bool IRCEditAccountWidget::validateData()
+{
+ if( mNickName->text().isEmpty() )
+ KMessageBox::sorry(this, i18n("<qt>You must enter a nickname.</qt>"), i18n("Kopete"));
+ else
+ return true;
+
+ return false;
+}
+
+#include "irceditaccountwidget.moc"
diff --git a/kopete/protocols/irc/ui/irceditaccountwidget.h b/kopete/protocols/irc/ui/irceditaccountwidget.h
new file mode 100644
index 00000000..365acaf3
--- /dev/null
+++ b/kopete/protocols/irc/ui/irceditaccountwidget.h
@@ -0,0 +1,60 @@
+/*
+ irceditaccountwidget.h - IRC Account Widget
+
+ Kopete (c) 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 IRCEDITACCOUNTWIDEGET_H
+#define IRCEDITACCOUNTWIDEGET_H
+
+#include "editaccountwidget.h"
+#include "irceditaccount.h"
+
+class IRCProtocol;
+class IRCAccount;
+class KListView;
+class QListViewItem;
+
+class IRCEditAccountWidget : public IRCEditAccountBase, public KopeteEditAccountWidget
+{
+ Q_OBJECT
+
+ public:
+ IRCEditAccountWidget(IRCProtocol *proto, IRCAccount *, QWidget *parent=0, const char *name=0);
+ ~IRCEditAccountWidget();
+
+ IRCAccount *account();
+ virtual bool validateData();
+ virtual Kopete::Account *apply();
+
+ private slots:
+ void slotCommandContextMenu( KListView*, QListViewItem*, const QPoint & );
+ void slotCtcpContextMenu( KListView*, QListViewItem*, const QPoint & );
+ void slotAddCommand();
+ void slotAddCtcp();
+ void slotEditNetworks();
+ void slotUpdateNetworks( const QString & );
+ void slotUpdateNetworkDescription( const QString & );
+
+ private:
+ void readNetworks();
+ QString generateAccountId( const QString &network );
+
+ IRCProtocol *mProtocol;
+};
+
+#endif
+
+// vim: set noet ts=4 sts=4 sw=4:
+
diff --git a/kopete/protocols/irc/ui/networkconfig.ui b/kopete/protocols/irc/ui/networkconfig.ui
new file mode 100644
index 00000000..d1000e37
--- /dev/null
+++ b/kopete/protocols/irc/ui/networkconfig.ui
@@ -0,0 +1,382 @@
+<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
+<class>NetworkConfig</class>
+<widget class="QDialog">
+ <property name="name">
+ <cstring>NetworkConfig</cstring>
+ </property>
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>670</width>
+ <height>468</height>
+ </rect>
+ </property>
+ <property name="caption">
+ <string>Network Configuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QLineEdit" row="1" column="4" rowspan="1" colspan="3">
+ <property name="name">
+ <cstring>description</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="1" column="3">
+ <property name="name">
+ <cstring>textLabel10</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Description:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>description</cstring>
+ </property>
+ </widget>
+ <widget class="QGroupBox" row="2" column="3" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>groupBox2</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="margin">
+ <number>4</number>
+ </property>
+ <property name="title">
+ <string>Host Con&amp;figuration</string>
+ </property>
+ <grid>
+ <property name="name">
+ <cstring>unnamed</cstring>
+ </property>
+ <widget class="QListBox" row="0" column="0" rowspan="3" colspan="4">
+ <property name="name">
+ <cstring>hostList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>3</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>The IRC servers associated with this network</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>The IRC servers associated with this network. Use the up and down buttons to alter the order in which connections are attempted.</string>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="4" column="1" rowspan="1" colspan="4">
+ <property name="name">
+ <cstring>password</cstring>
+ </property>
+ <property name="echoMode">
+ <enum>Password</enum>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Most IRC servers do not require a password</string>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="2">
+ <property name="name">
+ <cstring>textLabel6</cstring>
+ </property>
+ <property name="text">
+ <string>Por&amp;t:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>port</cstring>
+ </property>
+ </widget>
+ <widget class="QSpinBox" row="3" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>port</cstring>
+ </property>
+ <property name="maxValue">
+ <number>65536</number>
+ </property>
+ <property name="minValue">
+ <number>1</number>
+ </property>
+ <property name="value">
+ <number>6667</number>
+ </property>
+ </widget>
+ <widget class="QLabel" row="4" column="0">
+ <property name="name">
+ <cstring>textLabel4</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Password:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>password</cstring>
+ </property>
+ </widget>
+ <widget class="QLabel" row="3" column="0">
+ <property name="name">
+ <cstring>textLabel5</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Host:</string>
+ </property>
+ <property name="buddy" stdset="0">
+ <cstring>host</cstring>
+ </property>
+ </widget>
+ <widget class="QLineEdit" row="3" column="1">
+ <property name="name">
+ <cstring>host</cstring>
+ </property>
+ <property name="readOnly">
+ <bool>true</bool>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string></string>
+ </property>
+ </widget>
+ <widget class="QCheckBox" row="5" column="0" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>useSSL</cstring>
+ </property>
+ <property name="text">
+ <string>Use SS&amp;L</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Check this to enable SSL for this connection</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="6" column="3" rowspan="1" colspan="2">
+ <property name="name">
+ <cstring>removeHost</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;Remove</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="6" column="2">
+ <property name="name">
+ <cstring>newHost</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>1</hsizetype>
+ <vsizetype>0</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="text">
+ <string>&amp;New...</string>
+ </property>
+ </widget>
+ <spacer row="6" column="0" rowspan="1" colspan="2">
+ <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>210</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="2" column="4">
+ <property name="name">
+ <cstring>downButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Down</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move this server down</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move this server down in connection attempt priority</string>
+ </property>
+ </widget>
+ <spacer row="0" column="4">
+ <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>151</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="1" column="4">
+ <property name="name">
+ <cstring>upButton</cstring>
+ </property>
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="text">
+ <string>Up</string>
+ </property>
+ <property name="toolTip" stdset="0">
+ <string>Move this server up</string>
+ </property>
+ <property name="whatsThis" stdset="0">
+ <string>Move this server up in connection attempt priority</string>
+ </property>
+ </widget>
+ </grid>
+ </widget>
+ <widget class="QPushButton" row="3" column="6">
+ <property name="name">
+ <cstring>cancelButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Cancel</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="5">
+ <property name="name">
+ <cstring>saveButton</cstring>
+ </property>
+ <property name="text">
+ <string>&amp;Save</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="0">
+ <property name="name">
+ <cstring>newNetwork</cstring>
+ </property>
+ <property name="text">
+ <string>Ne&amp;w</string>
+ </property>
+ </widget>
+ <widget class="QListBox" row="0" column="0" rowspan="3" colspan="3">
+ <property name="name">
+ <cstring>networkList</cstring>
+ </property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>3</hsizetype>
+ <vsizetype>7</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ </widget>
+ <spacer row="3" column="3" rowspan="1" colspan="2">
+ <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>260</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ <widget class="QPushButton" row="3" column="1">
+ <property name="name">
+ <cstring>renameNetwork</cstring>
+ </property>
+ <property name="text">
+ <string>Rena&amp;me...</string>
+ </property>
+ </widget>
+ <widget class="QPushButton" row="3" column="2">
+ <property name="name">
+ <cstring>removeNetwork</cstring>
+ </property>
+ <property name="text">
+ <string>Remo&amp;ve</string>
+ </property>
+ </widget>
+ </grid>
+</widget>
+<connections>
+ <connection>
+ <sender>cancelButton</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkConfig</receiver>
+ <slot>reject()</slot>
+ </connection>
+ <connection>
+ <sender>saveButton</sender>
+ <signal>clicked()</signal>
+ <receiver>NetworkConfig</receiver>
+ <slot>accept()</slot>
+ </connection>
+</connections>
+<tabstops>
+ <tabstop>networkList</tabstop>
+ <tabstop>newNetwork</tabstop>
+ <tabstop>renameNetwork</tabstop>
+ <tabstop>removeNetwork</tabstop>
+ <tabstop>description</tabstop>
+ <tabstop>hostList</tabstop>
+ <tabstop>upButton</tabstop>
+ <tabstop>downButton</tabstop>
+ <tabstop>host</tabstop>
+ <tabstop>port</tabstop>
+ <tabstop>password</tabstop>
+ <tabstop>useSSL</tabstop>
+ <tabstop>newHost</tabstop>
+ <tabstop>removeHost</tabstop>
+ <tabstop>saveButton</tabstop>
+ <tabstop>cancelButton</tabstop>
+</tabstops>
+<signals>
+ <signal>accepted()</signal>
+ <signal>rejected()</signal>
+</signals>
+<slots>
+ <slot access="protected">accept()</slot>
+ <slot access="protected">reject()</slot>
+</slots>
+<layoutdefaults spacing="6" margin="11"/>
+</UI>
diff --git a/kopete/protocols/irc/ui/networkconfig.ui.h b/kopete/protocols/irc/ui/networkconfig.ui.h
new file mode 100644
index 00000000..7716e75f
--- /dev/null
+++ b/kopete/protocols/irc/ui/networkconfig.ui.h
@@ -0,0 +1,26 @@
+/****************************************************************************
+** ui.h extension file, included from the uic-generated form implementation.
+**
+** If you wish to add, delete or rename functions or slots use
+** Qt Designer which will update this file, preserving your code. Create an
+** init() function in place of a constructor, and a destroy() function in
+** place of a destructor.
+*****************************************************************************/
+
+
+
+
+
+
+void NetworkConfig::accept()
+{
+ emit accepted();
+ QDialog::accept();
+}
+
+
+void NetworkConfig::reject()
+{
+ emit rejected();
+ QDialog::reject();
+}