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/plugins/contactnotes/contactnotesplugin.cpp | 83 ++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 kopete/plugins/contactnotes/contactnotesplugin.cpp (limited to 'kopete/plugins/contactnotes/contactnotesplugin.cpp') diff --git a/kopete/plugins/contactnotes/contactnotesplugin.cpp b/kopete/plugins/contactnotes/contactnotesplugin.cpp new file mode 100644 index 00000000..5982200f --- /dev/null +++ b/kopete/plugins/contactnotes/contactnotesplugin.cpp @@ -0,0 +1,83 @@ +/*************************************************************************** + contactnotes.cpp - description + ------------------- + begin : lun sep 16 2002 + copyright : (C) 2002 by Olivier Goffart + email : 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. * + * * + ***************************************************************************/ + +#include +#include +#include + +#include "kopetemetacontact.h" +#include "kopetecontactlist.h" + +#include "contactnotesedit.h" + +#include "contactnotesplugin.h" + +typedef KGenericFactory ContactNotesPluginFactory; +K_EXPORT_COMPONENT_FACTORY( kopete_contactnotes, ContactNotesPluginFactory( "kopete_contactnotes" ) ) + +ContactNotesPlugin::ContactNotesPlugin( QObject *parent, const char *name, const QStringList & /* args */ ) +: Kopete::Plugin( ContactNotesPluginFactory::instance(), parent, name ) +{ + if ( pluginStatic_ ) + kdDebug(14302)<<"ContactNotesPlugin::ContactNotesPlugin : plugin already initialized"<setEnabled(Kopete::ContactList::self()->selectedMetaContacts().count()==1 ); + + setXMLFile("contactnotesui.rc"); +} + +ContactNotesPlugin::~ContactNotesPlugin() +{ + pluginStatic_ = 0L; +} + +ContactNotesPlugin* ContactNotesPlugin::plugin() +{ + return pluginStatic_ ; +} + +ContactNotesPlugin* ContactNotesPlugin::pluginStatic_ = 0L; + + +void ContactNotesPlugin::slotEditInfo() +{ + Kopete::MetaContact *m=Kopete::ContactList::self()->selectedMetaContacts().first(); + if(!m) + return; + ContactNotesEdit *e=new ContactNotesEdit(m,this); + connect( e, SIGNAL( notesChanged( const QString, Kopete::MetaContact*) ),this, + SLOT( setNotes( const QString, Kopete::MetaContact * ) ) ); + e->show(); +} + + +QString ContactNotesPlugin::notes(Kopete::MetaContact *m) +{ + return m->pluginData( this, "notes" ); +} + +void ContactNotesPlugin::setNotes( const QString n, Kopete::MetaContact *m ) +{ + m->setPluginData( this, "notes", n ); +} + +#include "contactnotesplugin.moc" + -- cgit v1.2.3