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

List:       kmail-devel
Subject:    [Bug 98973] unable to remove "recipient line"
From:       Till Adam <adam () kde ! org>
Date:       2005-02-13 10:47:18
Message-ID: 20050213104718.1586.qmail () ktown ! kde ! org
[Download RAW message or body]

------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=98973         
adam kde org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED



------- Additional Comments From adam kde org  2005-02-13 11:47 -------
CVS commit by tilladam: 

Disable the "remove recipients line" button when there is only one line.
It can not be removed then.`

BUGS: 98973


  M +20 -2     recipientseditor.cpp   1.40
  M +2 -0      recipientseditor.h   1.22


--- kdepim/kmail/recipientseditor.cpp  #1.39:1.40
 @ -339,4 +339,10  @ RecipientLine *RecipientsView::addLine()
 
   mLines.append( line );
+  // If there is only one line, removing it makes no sense
+  if ( mLines.count() == 1 ) {
+    mLines.first()->setRemoveLineButtonEnabled( false );
+  } else {
+    mLines.first()->setRemoveLineButtonEnabled( true );
+  }
 
   line->setComboWidth( mFirstColumnWidth );
 @ -355,4 +361,13  @ RecipientLine *RecipientsView::addLine()
 }
 
+
+void RecipientLine::setRemoveLineButtonEnabled( bool b )
+{
+  mRemoveButton->setEnabled( b );
+}
+
+
+// ------------ RecipientsView ---------------------
+
 void RecipientsView::calculateTotal()
 {
 @ -428,4 +443,7  @ void RecipientsView::slotDeleteLine()
     moveChild( line, childX( line ), childY( line ) - mLineHeight );
   }
+  // only one left, can't remove that one
+  if ( mLines.count() == 1 )
+    mLines.first()->setRemoveLineButtonEnabled( false );
   
   calculateTotal();

--- kdepim/kmail/recipientseditor.h  #1.21:1.22
 @ -126,4 +126,6  @ class RecipientLine : public QWidget
     int recipientsCount();
 
+    void setRemoveLineButtonEnabled( bool b );
+
   signals:
     void returnPressed( RecipientLine * );
_______________________________________________
KMail developers mailing list
KMail-devel@kde.org
https://mail.kde.org/mailman/listinfo/kmail-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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