Bug 98973 - unable to remove "recipient line"
Summary: unable to remove "recipient line"
Status: RESOLVED WORKSFORME
Alias: None
Product: kmail
Classification: Applications
Component: composer (show other bugs)
Version: 1.7.92
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-09 22:49 UTC by Edwin Schepers
Modified: 2007-12-01 22:20 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Edwin Schepers 2005-02-09 22:49:28 UTC
Version:           1.7.92 (using KDE 3.3.92 (beta2), compiled sources)
Compiler:          gcc version 3.3.2 20031022 (Red Hat Linux 3.3.2-1)
OS:                Linux (i686) release 2.4.22-1.2115.nptl

Hi,
If I have multiple recipient lines (in the composer), I'm unable to delete the last one. (If I have one, I also can't delete that one)
If this is intented, the button "Remove recipient line" should be disabled.

Regards,
Edwin
Comment 1 Till Adam 2005-02-13 11:47:17 UTC
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 * );


Comment 2 Edwin Schepers 2005-04-02 23:03:25 UTC
Hi,
I am still unable to delete the last one, although the button is not disabled.
Comment 3 Oded Arbel 2005-08-08 10:06:23 UTC
This is not an issue with current kmail, although for the last recipient line the button is not disabled unless its the only recipient line. I think this is incorrect. 

Also - might be related - if I have several recipients and the click the "remove recipient" button on the last empty line, the "type" selector (To,CC,BCC) is changed to match that of the previous recipient line, regardless of what is was set before I clicked "remove". I'm not sure if this is correct or not, but its weird and it won't matter anyway if the "remove recipient" button will actually be disabled for the last line.
Comment 4 Thomas McGuire 2007-07-09 17:39:02 UTC
Can you please try again with KMail 1.9.7?
Removing the last recipient should work fine there.
Comment 5 Thomas McGuire 2007-12-01 22:20:00 UTC
No response, assuming fixed.
If not, reopen.