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

List:       kde-commits
Subject:    kdenetwork/kopete/kopete
From:       Olivier Goffart <ogoffart () kde ! org>
Date:       2005-02-02 13:21:49
Message-ID: 20050202132149.AD9D71BAC8 () office ! kde ! org
[Download RAW message or body]

CVS commit by ogoffart: 

Enable the "add contact" entry in groups, and change the caption to make it more easy \
to understand.

BUG: 64577


  M +2 -1      kopeteui.rc   1.43
  M +23 -6     contactlist/kopetecontactlistview.cpp   1.132


--- kdenetwork/kopete/kopete/kopeteui.rc  #1.42:1.43
@@ -1,4 +1,4 @@
 <!DOCTYPE kpartgui>
-<kpartgui name="kopete" version="20">
+<kpartgui name="kopete" version="21">
         <MenuBar>
                 <Menu name="file" noMerge="1">
@@ -92,4 +92,5 @@
                 <Action name="contactRename" />
                 <Action name="contactSendMessage" />
+                <Action name="contactAddContact" />
                 <Separator lineSeparator="true" />
                 <Action name="contactProperties" />

--- kdenetwork/kopete/kopete/contactlist/kopetecontactlistview.cpp  #1.131:1.132
@@ -553,5 +553,4 @@ void KopeteContactListView::slotMetaCont
         actionMove->setEnabled( sel ); // TODO: make available for several contacts
         actionCopy->setEnabled( sel ); // TODO: make available for several contacts
-        actionAddContact->setEnabled( sel );
 }
 
@@ -1363,4 +1362,6 @@ void KopeteContactListView::updateAction
                 actionRename->setEnabled(true);
                 actionRemove->setEnabled(true);
+                actionAddContact->setText(i18n("&Add Subcontact"));
+                actionAddContact->setEnabled(!contacts.first()->isTemporary());
         }
         else if( groups.count() == 1 && contacts.isEmpty() )
@@ -1372,4 +1373,6 @@ void KopeteContactListView::updateAction
                 actionRemove->setEnabled(true);
                 actionSendMessage->setEnabled(true);
+                actionAddContact->setText(i18n("&Add Contact to Group"));
+                actionAddContact->setEnabled(groups.first()->type()==Kopete::Group::Normal);
  }
         else
@@ -1379,4 +1382,5 @@ void KopeteContactListView::updateAction
                 actionRename->setEnabled(false);
                 actionRemove->setEnabled(contacts.count()+groups.count());
+                actionAddContact->setEnabled(false);
         }
 
@@ -1655,11 +1659,15 @@ void KopeteContactListView::slotAddConta
         Kopete::MetaContact *metacontact =
                 Kopete::ContactList::self()->selectedMetaContacts().first();
+        Kopete::Group *group =
+                        Kopete::ContactList::self()->selectedGroups().first();
         Kopete::Account *account = dynamic_cast<Kopete::Account*>( \
sender()->parent() );  
-        if( account && metacontact )
-        {
-                if ( metacontact->isTemporary() )
+        if ( ( metacontact && metacontact->isTemporary() ) ||
+                          (group && group->type()!=Kopete::Group::Normal ) )
                         return;
 
+
+        if( account && ( metacontact || group) )
+        {
                 KDialogBase *addDialog = new KDialogBase( this, "addDialog", true,
                         i18n( "Add Contact" ), KDialogBase::Ok|KDialogBase::Cancel,
@@ -1680,7 +1688,16 @@ void KopeteContactListView::slotAddConta
                         {
                                 if( addContactPage->validateData() )
+                                {
+                                        if(!metacontact)
+                                        {
+                                                metacontact = new \
Kopete::MetaContact(); +                                                \
metacontact->addToGroup( group ); +                                                \
Kopete::ContactList::self()->addMetaContact( metacontact ); +                         \
} +
                                         addContactPage->apply( account, metacontact \
);  }
                 }
+                }
                 addDialog->deleteLater();
         }


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

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