[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: Re: [kopete-devel] Updated: meta-contact changes...
From: "Michael D. Stemle, Jr." <manchicken () notsosoft ! net>
Date: 2006-07-28 12:11:37
Message-ID: 200607280711.38142.manchicken () notsosoft ! net
[Download RAW message or body]
Ack... everybody, please disregard the previous patch. I forgot to exclude my
work on the SMS protocol porting. If you use that old patch I sent out
kopete probably won't compile ;)
Please see the attached patch. The patch is from SVN r567030.
--
~ Michael D. Stemle, Jr. <><
(A)bort, (R)etry, (I)nfluence with large hammer
["20060728-metacontact.svn-diff" (text/x-diff)]
Index: kopete/contactlist/kopetecontactlistview.h
===================================================================
--- kopete/contactlist/kopetecontactlistview.h (revision 567121)
+++ kopete/contactlist/kopetecontactlistview.h (working copy)
@@ -180,6 +180,8 @@
void slotTimeout();
+ void slotMakeMetaContact();
+
private:
bool mShowAsTree;
@@ -206,6 +208,7 @@
KAction *actionProperties;
KAction *actionUndo;
KAction *actionRedo;
+ KAction *actionMakeMetaContact;
KopeteContactListViewPrivate *d;
Index: kopete/contactlist/kopetecontactlistview.cpp
===================================================================
--- kopete/contactlist/kopetecontactlistview.cpp (revision 567121)
+++ kopete/contactlist/kopetecontactlistview.cpp (working copy)
@@ -495,6 +495,9 @@
actionCopy = new KopeteGroupListAction( i18n( "&Copy To" ), QLatin1String( \
"editcopy" ), 0, this, SLOT( slotCopyToGroup() ), ac, "contactCopy" );
+ actionMakeMetaContact = new KAction(KIcon("move"), i18n("Make Meta Contact"), ac, \
"makeMetaContact"); + connect (actionMakeMetaContact, SIGNAL(triggered(bool)), \
this, SLOT(slotMakeMetaContact())); +
actionRemove = KopeteStdAction::deleteContact( this, SLOT( slotRemove() ),
ac, "contactRemove" );
actionSendEmail = new KAction( KIcon("mail_generic"), i18n( "Send Email..." ), ac, \
"contactSendEmail" ); @@ -1449,6 +1452,9 @@
actionRename->setEnabled(false);
actionRemove->setEnabled(contacts.count()+groups.count());
actionAddContact->setEnabled(false);
+
+ actionMakeMetaContact->setText(i18n("Make Meta Contact"));
+ actionMakeMetaContact->setEnabled(contacts.count()); // Specifically for multiple \
contacts, not groups. }
actionMove->setCurrentItem( -1 );
@@ -1878,7 +1884,6 @@
undoTimer.start(10*60*1000);
}
-
void KopeteContactListView::slotUndo()
{
bool step = false;
@@ -2187,6 +2192,33 @@
actionRedo->setEnabled(false);
}
+void KopeteContactListView::slotMakeMetaContact()
+{
+ QList<Kopete::MetaContact*> contacts = \
Kopete::ContactList::self()->selectedMetaContacts(); + \
QList<Kopete::MetaContact*>::iterator cit, citEnd = contacts.end(); + \
Kopete::MetaContact * first = (Kopete::MetaContact *) NULL; +
+ // Iterate through the selected contacts.
+ for( cit = contacts.begin(); cit != citEnd; ++cit ) {
+ Kopete::MetaContact* mc = static_cast<Kopete::MetaContact*>(*cit);
+
+ if (!first) {
+ // Grab the first one.
+ first = mc;
+ } else {
+ QList<Kopete::Contact*> foreignList = mc->contacts();
+ QList<Kopete::Contact *>::iterator theContact, stopit = \
foreignList.end(); + // Have the first of all in the selected contacts \
steal the contacts from all the others. + for (theContact = \
foreignList.begin(); theContact != stopit; ++theContact) { + \
Kopete::Contact *one = static_cast<Kopete::Contact*>(*theContact); + \
one->setMetaContact(first); + }
+ }
+ }
+
+ return;
+}
+
#include "kopetecontactlistview.moc"
// vim: set noet ts=4 sts=4 sw=4:
Index: kopete/kopeteui.rc
===================================================================
--- kopete/kopeteui.rc (revision 567121)
+++ kopete/kopeteui.rc (working copy)
@@ -94,6 +94,8 @@
<Action name="contactProperties" />
</Menu>
<Menu name="contactlistitems_popup">
+ <Action name="makeMetaContact" />
+ <Separator lineSeparator="false"/>
<Action name="contactRemove" />
</Menu>
<Menu name="contactlist_popup">
Index: libkopete/ui/addcontactpage.h
===================================================================
--- libkopete/ui/addcontactpage.h (revision 567121)
+++ libkopete/ui/addcontactpage.h (working copy)
@@ -37,6 +37,7 @@
public:
AddContactPage(QWidget *parent=0);
+ AddContactPage(QWidget *parent, const char *name);
virtual ~AddContactPage();
//Kopete::Protocol *protocol;
Index: libkopete/ui/addcontactpage.cpp
===================================================================
--- libkopete/ui/addcontactpage.cpp (revision 567121)
+++ libkopete/ui/addcontactpage.cpp (working copy)
@@ -21,6 +21,10 @@
{
}
+AddContactPage::AddContactPage(QWidget *parent, const char *name) : QWidget(parent, \
name) +{
+}
+
AddContactPage::~AddContactPage()
{
}
_______________________________________________
kopete-devel mailing list
kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic