diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | bcb704366cb5e333a626c18c308c7e0448a8e69f (patch) | |
tree | f0d6ab7d78ecdd9207cf46536376b44b91a1ca71 /kopete/plugins/contactnotes | |
download | tdenetwork-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/plugins/contactnotes')
-rw-r--r-- | kopete/plugins/contactnotes/Makefile.am | 15 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/contactnotesedit.cpp | 55 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/contactnotesedit.h | 53 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/contactnotesplugin.cpp | 83 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/contactnotesplugin.h | 66 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/contactnotesui.rc | 12 | ||||
-rw-r--r-- | kopete/plugins/contactnotes/kopete_contactnotes.desktop | 124 |
7 files changed, 408 insertions, 0 deletions
diff --git a/kopete/plugins/contactnotes/Makefile.am b/kopete/plugins/contactnotes/Makefile.am new file mode 100644 index 00000000..94ff86ce --- /dev/null +++ b/kopete/plugins/contactnotes/Makefile.am @@ -0,0 +1,15 @@ +METASOURCES = AUTO + +AM_CPPFLAGS = $(KOPETE_INCLUDES) $(all_includes) + +kde_module_LTLIBRARIES = kopete_contactnotes.la + +kopete_contactnotes_la_SOURCES = contactnotesplugin.cpp contactnotesedit.cpp +kopete_contactnotes_la_LDFLAGS = -module -no-undefined $(KDE_PLUGIN) $(all_libraries) +kopete_contactnotes_la_LIBADD = ../../libkopete/libkopete.la -lkio + +service_DATA = kopete_contactnotes.desktop +servicedir = $(kde_servicesdir) + +mydatadir = $(kde_datadir)/kopete_contactnotes +mydata_DATA = contactnotesui.rc diff --git a/kopete/plugins/contactnotes/contactnotesedit.cpp b/kopete/plugins/contactnotes/contactnotesedit.cpp new file mode 100644 index 00000000..f7333c7b --- /dev/null +++ b/kopete/plugins/contactnotes/contactnotesedit.cpp @@ -0,0 +1,55 @@ +/*************************************************************************** + contactnotesedit.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 <qlabel.h> +#include <qtextedit.h> +#include <qvbox.h> + +#include <klocale.h> + +#include "kopetemetacontact.h" + +#include "contactnotesplugin.h" +#include "contactnotesedit.h" + +ContactNotesEdit::ContactNotesEdit(Kopete::MetaContact *m,ContactNotesPlugin *p,const char *name) : KDialogBase(0L, name , false, i18n("Contact Notes") , KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok) +{ + m_plugin=p; + m_metaContact=m; + + QVBox *w=new QVBox(this); + w->setSpacing(KDialog::spacingHint()); + m_label = new QLabel(i18n("Notes about %1:").arg(m->displayName()) , w , "m_label"); + m_linesEdit= new QTextEdit ( w , "m_linesEdit"); + + m_linesEdit->setText(p->notes(m)); + + enableButtonSeparator(true); + setMainWidget(w); +} + +ContactNotesEdit::~ContactNotesEdit() +{ +} + +void ContactNotesEdit::slotOk() +{ + emit notesChanged(m_linesEdit->text(),m_metaContact) ; + KDialogBase::slotOk(); +} + +#include "contactnotesedit.moc" diff --git a/kopete/plugins/contactnotes/contactnotesedit.h b/kopete/plugins/contactnotes/contactnotesedit.h new file mode 100644 index 00000000..20fe7d10 --- /dev/null +++ b/kopete/plugins/contactnotes/contactnotesedit.h @@ -0,0 +1,53 @@ +/*************************************************************************** + contactnotesedit.h - 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. * + * * + ***************************************************************************/ + +#ifndef CONTACTNOTESEDIT_H +#define CONTACTNOTESEDIT_H + +#include <qwidget.h> +#include <qstring.h> +#include <kdialogbase.h> + +class QLabel; +class QTextEdit; +namespace Kopete { class MetaContact; } +class ContactNotesPlugin; + +/** + *@author Olivier Goffart + */ + +class ContactNotesEdit : public KDialogBase { + Q_OBJECT +public: + ContactNotesEdit(Kopete::MetaContact *m,ContactNotesPlugin *p=0 ,const char *name=0); + ~ContactNotesEdit(); + +private: + ContactNotesPlugin *m_plugin; + Kopete::MetaContact *m_metaContact; + + QLabel *m_label; + QTextEdit *m_linesEdit; + +protected slots: // Protected slots + virtual void slotOk(); +signals: // Signals + void notesChanged(const QString, Kopete::MetaContact*); +}; + +#endif 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 <kaction.h> +#include <kdebug.h> +#include <kgenericfactory.h> + +#include "kopetemetacontact.h" +#include "kopetecontactlist.h" + +#include "contactnotesedit.h" + +#include "contactnotesplugin.h" + +typedef KGenericFactory<ContactNotesPlugin> 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"<<endl; + else + pluginStatic_ = this; + + KAction *m_actionEdit=new KAction( i18n("&Notes"), "identity", 0, this, SLOT (slotEditInfo()), actionCollection() , "editContactNotes"); + connect ( Kopete::ContactList::self() , SIGNAL( metaContactSelected(bool)) , m_actionEdit , SLOT(setEnabled(bool))); + m_actionEdit->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" + diff --git a/kopete/plugins/contactnotes/contactnotesplugin.h b/kopete/plugins/contactnotes/contactnotesplugin.h new file mode 100644 index 00000000..c4fb8224 --- /dev/null +++ b/kopete/plugins/contactnotes/contactnotesplugin.h @@ -0,0 +1,66 @@ +/*************************************************************************** + contactnotesplugin.h - 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. * + * * + ***************************************************************************/ + +#ifndef BABELFISHPLUGIN_H +#define BABELFISHPLUGIN_H + +#include <qobject.h> +#include <qmap.h> +#include <qstring.h> + +#include "kopeteplugin.h" + +class QString; +class KAction; +class KActionCollection; + +namespace Kopete { class MetaContact; } + +/** + * @author Olivier Goffart <ogoffart @ kde.org> + * + * Kopete Contact Notes Plugin + * + */ + +class ContactNotesPlugin : public Kopete::Plugin +{ + Q_OBJECT + +public: + static ContactNotesPlugin *plugin(); + + ContactNotesPlugin( QObject *parent, const char *name, const QStringList &args ); + ~ContactNotesPlugin(); + + QString notes(Kopete::MetaContact *m); + + +public slots: + void setNotes(const QString n, Kopete::MetaContact *m); + +private: + static ContactNotesPlugin* pluginStatic_; + +private slots: // Private slots + /** No descriptions */ + void slotEditInfo(); +}; + +#endif + + diff --git a/kopete/plugins/contactnotes/contactnotesui.rc b/kopete/plugins/contactnotes/contactnotesui.rc new file mode 100644 index 00000000..9e7a5748 --- /dev/null +++ b/kopete/plugins/contactnotes/contactnotesui.rc @@ -0,0 +1,12 @@ +<!DOCTYPE kpartgui> +<kpartgui name="kopete_contactnotes" version="1"> + <MenuBar> + <Menu name="edit"> + <text>&Edit</text> + <Action name="editContactNotes" /> + </Menu> + </MenuBar> + <Menu name="contact_popup"> + <Action name="editContactNotes" /> + </Menu> +</kpartgui> diff --git a/kopete/plugins/contactnotes/kopete_contactnotes.desktop b/kopete/plugins/contactnotes/kopete_contactnotes.desktop new file mode 100644 index 00000000..455f299d --- /dev/null +++ b/kopete/plugins/contactnotes/kopete_contactnotes.desktop @@ -0,0 +1,124 @@ +[Desktop Entry] +Type=Service +X-Kopete-Version=1000900 +Icon=identity +ServiceTypes=Kopete/Plugin +X-KDE-Library=kopete_contactnotes +X-KDE-PluginInfo-Author=Olivier Goffart +X-KDE-PluginInfo-Name=kopete_contactnotes +X-KDE-PluginInfo-Version=0.8.0 +X-KDE-PluginInfo-Website=http://kopete.kde.org +X-KDE-PluginInfo-Category=Plugins +X-KDE-PluginInfo-Depends= +X-KDE-PluginInfo-License=GPL +X-KDE-PluginInfo-EnabledByDefault=false +Name=Contact Notes +Name[ar]=ملاحظات الاتصال +Name[be]=Нататкі +Name[bg]=Бележки за контактите +Name[bn]=যোগাযোগ নোট +Name[br]=Notennoù an darempred +Name[bs]=Kontakt informacije +Name[ca]=Notes del contacte +Name[cs]=Poznámky ke kontaktu +Name[cy]=Nodiadau Cysylltiad +Name[da]=Kontaktnoter +Name[de]=Kontakt-Notizen +Name[el]=Σημειώσεις επαφής +Name[eo]=Kontaktinformoj +Name[es]=Notas de contacto +Name[et]=Kontakti märkmed +Name[eu]=Kontaktuaren oharrak +Name[fa]=یادداشتهای تماس +Name[fi]=Yhteystiedot +Name[fr]=Notes sur les contacts +Name[gl]=Notas de contacto +Name[he]=הערות על איש-קשר +Name[hi]=सम्पर्क नोट्स +Name[hr]=Zabilješke kontakata +Name[hu]=Megjegyzés a partnerekhez +Name[is]=Skráð um notanda +Name[it]=Note contatto +Name[ja]=コンタクトメモ +Name[ka]=მეგობრის შენიშვნები +Name[kk]=Контакт ескертпелері +Name[km]=ចំណាំក្នុងទំនាក់ទំនង +Name[lt]=Kontaktų pastabos +Name[mk]=Забелешки за контакт +Name[nb]=Notater om kontakter +Name[nds]=Kontakt-Notizen +Name[ne]=सम्पर्क द्रष्टब्य +Name[nl]=Notities bij contacten +Name[nn]=Notat om kontaktar +Name[pa]=ਸੰਪਰਕ ਨੋਟਿਸ +Name[pl]=Notatki kontaktu +Name[pt]=Notas do Contacto +Name[pt_BR]=Notas do Contato +Name[ru]=Примечания к контакту +Name[sk]=Poznámky kontaktu +Name[sl]=Zapiski za stike +Name[sr]=Белешке о контакту +Name[sr@Latn]=Beleške o kontaktu +Name[sv]=Kontaktanteckningar +Name[ta]=தொடர்பு குறிப்பு +Name[tg]=Эзоҳи Пайвастшавӣ +Name[tr]=Bağlantı Notları +Name[uk]=Примітки до контакту +Name[zh_CN]=联系人备忘 +Name[zh_HK]=聯絡人備註 +Name[zh_TW]=聯絡人備忘錄 +Comment=Add personal notes on your contacts +Comment[ar]=أضف ملاحظاتك الشخصية إلى بيانات اﻹتصال +Comment[be]=Дадаць прыватныя нататкі для людзей у спісе +Comment[bg]=Добавяне и редактиране на бележки и коментари към контактите +Comment[bn]=আপনার যোগাযোগে ব্যক্তিগত নোট যোগ করুন +Comment[bs]=Dodajte lične bilješke vašim kontaktima +Comment[ca]=Afegeix notes personals als vostres contactes +Comment[cs]=Osobní poznámky ke kontaktům +Comment[cy]=Ychwanegu nodiadau personol ynglyn â'ch cysylltiadau +Comment[da]=Tilføj personlige noter om dine kontakter +Comment[de]=Ermöglicht das Hinzufügen persönlicher Notizen zu Kontakten +Comment[el]=Προσθέστε προσωπικές σημειώσεις στις επαφές σας +Comment[eo]=Aldoni personajn notojn al viaj kontaktoj +Comment[es]=Añade notas personales a tus contactos +Comment[et]=Isiklike märkmete lisamine kontaktide kohta +Comment[eu]=Gehitu ohar pertsonalak zure kontaktuei +Comment[fa]=افزودن پیامهای شخصی به تماسهای شما +Comment[fi]=Lisää omia muistiinpanoja yhteystietoihin +Comment[fr]=Ajoutez des notes personnelles à vos contacts +Comment[gl]=Engadir notas persoáis ós teus contactos +Comment[he]=הוספת הערות אישיות לגבי אנשי-הקשר שלך +Comment[hi]=आपके सम्पर्कों पर निजी टीप जोड़े +Comment[hr]=Dodaje osobne zabilješke o vašim kontaktima +Comment[hu]=Személyes megjegyzések fűzése a partnerek adataihoz +Comment[is]=Bæta við upplýsingum um notanda +Comment[it]=Aggiungi note personali ai tuoi contatti +Comment[ja]=コンタクトに個人的なメモを加えます +Comment[ka]=მეგობრებისთვის პერსონალური შენიშვნების დამატება +Comment[kk]=Контакттарға жеке ескертпелерді қосу +Comment[km]=បន្ថែមចំណាំផ្ទាល់ខ្លួនលើទំនាក់ទំនងរបស់អ្នក +Comment[lt]=Papildykite kontaktus asmeniniais užrašais +Comment[mk]=Додадете лични забелешки на вашите контакти +Comment[nb]=Legg til egne notater i kontaktlista +Comment[nds]=Dien Kontaken persöönliche Notizen tofögen +Comment[ne]=तपाईँको सम्पर्कमा व्यक्तिगत द्रष्टब्य थप्नुहोस् +Comment[nl]=Voeg persoonlijke notities toe aan contacten +Comment[nn]=Legg til eigne notat i kontaktlista +Comment[pl]=Dodaje osobiste notatki do kontaktu +Comment[pt]=Adiciona notas pessoais aos seus contactos +Comment[pt_BR]=Adiciona notas pessoais em seus contatos +Comment[ru]=Добавить личные примечания к вашим контактам +Comment[sk]=Pridá osobné poznámky ku kontaktom +Comment[sl]=Dodajte osebne zapiske k vašim stikom +Comment[sr]=Додаје личне забелешке о вашим контактима +Comment[sr@Latn]=Dodaje lične zabeleške o vašim kontaktima +Comment[sv]=Lägg till personliga anteckningar om kontakter +Comment[ta]=உங்கள் உரையில் சிறப்பு விளைவுகளை சேர்க்கும் +Comment[tg]=Ба пайвастагии худ эзоҳҳои шахсиро илова кунед +Comment[tr]=Bağlantıların üzerine kişisel notlar ekle +Comment[uk]=Додати особисті примітки до власних контактів +Comment[wa]=Radjouter des notes da vosse å calpin d' adresses +Comment[zh_CN]=在您的联系人上添加私人备忘 +Comment[zh_HK]=為您的聯絡人新增個人備註 +Comment[zh_TW]=新增聯絡人的備忘錄 |