2 testbedaddcontactpage.cpp - Kopete Testbed Protocol
4 Copyright (c) 2003 by Will Stephenson <will@stevello.free-online.co.uk>
5 Kopete (c) 2002-2003 by the Kopete developers <kopete-devel@kde.org>
7 *************************************************************************
9 * This library is free software; you can redistribute it and/or *
10 * modify it under the terms of the GNU General Public *
11 * License as published by the Free Software Foundation; either *
12 * version 2 of the License, or (at your option) any later version. *
14 *************************************************************************
17 #include "testbedaddcontactpage.h"
20 #include <qradiobutton.h>
22 #include <QVBoxLayout>
23 #include <qlineedit.h>
26 #include "kopeteaccount.h"
27 #include "kopetecontactlist.h"
28 #include "kopetemetacontact.h"
30 #include "testbedcontact.h"
32 TestbedAddContactPage::TestbedAddContactPage( QWidget
* parent
)
33 : AddContactPage(parent
)
36 QVBoxLayout
* l
= new QVBoxLayout( this );
37 QWidget
* w
= new QWidget();
38 m_testbedAddUI
.setupUi( w
);
42 TestbedAddContactPage::~TestbedAddContactPage()
46 bool TestbedAddContactPage::apply( Kopete::Account
* a
, Kopete::MetaContact
* m
)
50 QString name
= m_testbedAddUI
.m_uniqueName
->text();
52 if ( a
->addContact(name
, m
, Kopete::Account::ChangeKABC
) )
54 TestbedContact
* newContact
= qobject_cast
<TestbedContact
*>( Kopete::ContactList::self()->findContact( a
->protocol()->pluginId(), a
->accountId(), name
) );
57 newContact
->setType( m_testbedAddUI
.m_rbEcho
->isChecked() ? TestbedContact::Echo
: TestbedContact::Group
);
67 bool TestbedAddContactPage::validateData()
73 #include "testbedaddcontactpage.moc"