[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdenetwork/kopete/libkopete
From:       Duncan Mac-Vicar Prett <duncan () kde ! org>
Date:       2005-04-06 14:50:04
Message-ID: 20050406145004.EAE89492 () office ! kde ! org
[Download RAW message or body]

CVS commit by dmacvicar: 



Use the new meta contact selector.


  M +4 -4      Makefile.am   1.119
  M +8 -31     kopetecontact.cpp   1.232


--- kdenetwork/kopete/libkopete/Makefile.am  #1.118:1.119
@@ -32,8 +32,8 @@
 
 #AM_CXXFLAGS = -DQT_PLUGIN 
-kde_widget_LTLIBRARIES = kopetewidgets.la
-kopetewidgets_la_LDFLAGS = $(KDE_PLUGIN) -module $(all_libraries)
-kopetewidgets_la_LIBADD = $(LIB_KIO) libkopete.la ui/libkopeteui.la
-kopetewidgets_la_SOURCES = ui/kopetewidgets.cpp 
+kde_widget_LTLIBRARIES = libkopetewidgets.la
+widget.includeFile = QString::fromLatin1("kopete/ui/kopetelistview.h");_LDFLAGS = \
$(KDE_PLUGIN) -module $(all_libraries) +libkopetewidgets_la_LIBADD = $(LIB_KIO) \
libkopete.la ui/libkopeteui.la +libkopetewidgets_la_SOURCES = ui/kopetewidgets.cpp 
 
 #kopetewidgets.cpp: $(srcdir)/kopete.widgets

--- kdenetwork/kopete/libkopete/kopetecontact.cpp  #1.231:1.232
@@ -32,4 +32,5 @@
 #include <kpopupmenu.h>
 #include <kmessagebox.h>
+#include <klistviewsearchline.h>
 
 #include "kopetecontactlist.h"
@@ -43,4 +44,5 @@
 #include "kopetemetacontact.h"
 #include "kopeteprefs.h"
+#include "metacontactselectorwidget.h"
 
 //For the moving to another metacontact dialog
@@ -266,42 +268,17 @@ void Contact::changeMetaContact()
 
         QVBox *w = new QVBox( moveDialog );
-        w->setSpacing( 8 );
-        new QLabel( i18n( "Select the meta contact to which you want to move this \
                contact:" ), w );
-        KListView *selectMetaContactListBox = new KListView ( w, \
                "selectMetaContactListBox" );
-        selectMetaContactListBox->addColumn( i18n( "Display Name" ) );
-        selectMetaContactListBox->addColumn( i18n( "Contact IDs" ) );
-
-        QMap<QListViewItem*,MetaContact*> map;
-        QPtrList<MetaContact> metaContacts = ContactList::self()->metaContacts();
-        for( MetaContact *mc = metaContacts.first(); mc ; mc = metaContacts.next() )
-        {
-                if( !mc->isTemporary() && mc != metaContact() )
-                {
-                        QString t;
-                        bool f=true;
-                        QPtrList<Contact> contacts = mc->contacts();
-                        for( Contact *c = contacts.first(); c ; c = contacts.next() \
                )
-                        {
-                                if( !f )
-                                        t += QString::fromLatin1( " ; " );
-                                t += c->contactId();
-                                f = false;
-                        }
-
-                        map.insert(  new QListViewItem(selectMetaContactListBox, \
                mc->displayName(),t) , mc  ) ;
-                }
-        }
-
-        selectMetaContactListBox->sort();
+        w->setSpacing( KDialog::spacingHint() );
+        MetaContactSelectorWidget *selector = new MetaContactSelectorWidget(w);
+        selector->setLabelMessage(i18n( "Select the meta contact to which you want \
to move this contact:" ));     
         QCheckBox *chkCreateNew = new QCheckBox( i18n( "Create a new metacontact for \
                this contact" ), w );
         QWhatsThis::add( chkCreateNew , i18n( "If you select this option, a new \
                metacontact will be created in the top-level group "
                 "with the name of this contact and the contact will be moved to it." \
                ) );
-        QObject::connect( chkCreateNew , SIGNAL( toggled(bool) ) ,  \
selectMetaContactListBox , SLOT ( setDisabled(bool) ) ) ; +        QObject::connect( \
chkCreateNew , SIGNAL( toggled(bool) ) ,  selector , SLOT ( setDisabled(bool) ) ) ;  
-        moveDialog->setMainWidget( w );
+        moveDialog->setMainWidget(w);
         if( moveDialog->exec() == QDialog::Accepted )
         {
-                Kopete::MetaContact *mc = \
map[selectMetaContactListBox->currentItem()]; +                Kopete::MetaContact \
*mc = selector->metaContact();  if(chkCreateNew->isChecked())
                 {


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic