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

List:       kmail-devel
Subject:    address book patch
From:       Daniel Naber <dnaber () mini ! gt ! owl ! de>
Date:       2000-04-30 18:56:08
[Download RAW message or body]

Hi,

Don, can you apply this? It makes the address book usable again, until we get 
a new one. You can now select multiple addresses and the window has a common
size when it pops up.

Regards
 Daniel

["addressbook.diff" (text/plain)]

--- kmaddrbookdlg.cpp.org	Sun Apr 30 20:43:39 2000
+++ kmaddrbookdlg.cpp	Sun Apr 30 20:52:20 2000
@@ -38,6 +38,8 @@
   mGrid.setColStretch(0,10);
   mGrid.setColStretch(1,10);
   mGrid.activate();
+  
+  mListBox.setSelectionMode(QListBox::Multi);
 
   connect(&mBtnOk, SIGNAL(clicked()), SLOT(slotOk()));
   connect(&mListBox, SIGNAL(selected(int)), SLOT(slotOk()));
@@ -47,6 +49,7 @@
   {
     mListBox.insertItem(addr);
   }
+  resize(300, 450);
 }
 
 
@@ -59,11 +62,19 @@
 //-----------------------------------------------------------------------------
 void KMAddrBookSelDlg::slotOk()
 {
-  int idx = mListBox.currentItem();
-
-  if (idx>=0) mAddress = mListBox.text(idx);
-  else mAddress = QString::null;
-
+  mAddress = QString::null;
+  unsigned int idx;
+  unsigned int count = 0;
+  for (idx = 0; idx < mListBox.count(); idx++)
+  {
+    if( mListBox.isSelected(idx) ) {
+      if( count > 0 ) {
+        mAddress += ", ";
+      }
+      mAddress += mListBox.text(idx);
+      count++;
+    }
+  }
   accept();
 }
 


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

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