From bcb704366cb5e333a626c18c308c7e0448a8e69f Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- kopete/protocols/yahoo/yahooaddcontact.cpp | 72 ++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 kopete/protocols/yahoo/yahooaddcontact.cpp (limited to 'kopete/protocols/yahoo/yahooaddcontact.cpp') diff --git a/kopete/protocols/yahoo/yahooaddcontact.cpp b/kopete/protocols/yahoo/yahooaddcontact.cpp new file mode 100644 index 00000000..909c4379 --- /dev/null +++ b/kopete/protocols/yahoo/yahooaddcontact.cpp @@ -0,0 +1,72 @@ +/* + yahooaddcontact.cpp - UI Page for Adding a Yahoo Contact + + Copyright (c) 2003 by Gav Wood + Copyright (c) 2003 by Matt Rogers + Based on code by Duncan Mac-Vicar Prett + Kopete (c) 2003 by the Kopete developers + + ************************************************************************* + * * + * 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. * + * * + ************************************************************************* +*/ + +// QT Includes +#include + +// KDE Includes +#include +#include + +// Kopete Includes +#include +#include + +// Local Includes +#include "yahooadd.h" +#include "yahooaddcontact.h" +#include "yahooaccount.h" + +// Yahoo Add Contact page +YahooAddContact::YahooAddContact(YahooProtocol *owner, QWidget *parent, const char *name): AddContactPage(parent, name) +{ + kdDebug(YAHOO_GEN_DEBUG) << "YahooAddContact::YahooAddContact(, , " << name << ")" << endl; + + (new QVBoxLayout(this))->setAutoAdd(true); + theDialog = new YahooAddContactBase(this); + theDialog->show(); + theProtocol = owner; +} + +// Destructor +YahooAddContact::~YahooAddContact() +{ + kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; +} + +bool YahooAddContact::validateData() +{ + kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; + + return !theDialog->contactID->text().isEmpty(); +} + +bool YahooAddContact::apply(Kopete::Account *theAccount, Kopete::MetaContact *theMetaContact) +{ + kdDebug(YAHOO_GEN_DEBUG) << k_funcinfo << endl; + + QString displayName = theDialog->contactID->text(); + YahooAccount* myAccount = static_cast(theAccount); + myAccount->addContact(theDialog->contactID->text().lower(), theMetaContact, Kopete::Account::ChangeKABC ); + return true; +} + +#include "yahooaddcontact.moc" + +// vim: set noet ts=4 sts=4 sw=4: + -- cgit v1.2.1