From f8999fa3ef98e190cfe2a3b64ded3d2a341d0340 Mon Sep 17 00:00:00 2001 From: Daniel Molkentin Date: Tue, 25 Jan 2005 11:27:31 +0000 Subject: [PATCH] Some adjustments to the picker according to the input from relevantive: - Don't close the picker on pressing any "add to" button - Consequenty, Replace "OK" and "Cancel" by "Close" - Remove current selection after click Both the new and the old behavior will be tested today. CCMAIL:ellen@relevantive.de svn path=/trunk/kdepim/; revision=382257 --- recipientspicker.cpp | 28 +++++++--------------------- recipientspicker.h | 1 - 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/recipientspicker.cpp b/recipientspicker.cpp index bb4fd93a2..0be9fd1d3 100644 --- a/recipientspicker.cpp +++ b/recipientspicker.cpp @@ -228,18 +228,11 @@ RecipientsPicker::RecipientsPicker( QWidget *parent ) buttonLayout->addWidget( mBccButton ); connect( mBccButton, SIGNAL( clicked() ), SLOT( slotBccClicked() ) ); // BCC isn't commonly used, so hide it for now - mBccButton->hide(); + //mBccButton->hide(); - QPushButton *okButton = new QPushButton( i18n("&OK"), this ); - buttonLayout->addWidget( okButton ); - connect( okButton, SIGNAL( clicked() ), SLOT( slotOk() ) ); - // It might be confusing to have "Add As ..." in addition to "Ok", so we might - // want to hide this button. - // okButton->hide(); - - QPushButton *cancelButton = new QPushButton( i18n("&Cancel"), this ); - buttonLayout->addWidget( cancelButton ); - connect( cancelButton, SIGNAL( clicked() ), SLOT( close() ) ); + QPushButton *closeButton = new QPushButton( i18n("&Close"), this ); + buttonLayout->addWidget( closeButton ); + connect( closeButton, SIGNAL( clicked() ), SLOT( close() ) ); initCollections(); @@ -253,9 +246,7 @@ RecipientsPicker::RecipientsPicker( QWidget *parent ) setTabOrder( mCollectionCombo, mSearchLine ); setTabOrder( mSearchLine, mRecipientList ); - setTabOrder( mRecipientList, okButton ); - setTabOrder( okButton, cancelButton ); - setTabOrder( cancelButton, mCollectionCombo ); + setTabOrder( closeButton, mCollectionCombo ); } RecipientsPicker::~RecipientsPicker() @@ -415,11 +406,6 @@ void RecipientsPicker::slotBccClicked() pick( Recipient::Bcc ); } -void RecipientsPicker::slotOk() -{ - pick( Recipient::Undefined ); -} - void RecipientsPicker::slotPicked( QListViewItem *viewItem ) { kdDebug() << "RecipientsPicker::slotPicked()" << endl; @@ -429,7 +415,7 @@ void RecipientsPicker::slotPicked( QListViewItem *viewItem ) RecipientItem *i = item->recipientItem(); emit pickedRecipient( Recipient( i->recipient(), Recipient::Undefined ) ); } - close(); + mRecipientList->clearSelection(); } void RecipientsPicker::pick( Recipient::Type type ) @@ -447,7 +433,7 @@ void RecipientsPicker::pick( Recipient::Type type ) } } } - close(); + mRecipientList->clearSelection(); } void RecipientsPicker::keyPressEvent( QKeyEvent *ev ) diff --git a/recipientspicker.h b/recipientspicker.h index 2f070115f..6f6f9440d 100644 --- a/recipientspicker.h +++ b/recipientspicker.h @@ -141,7 +141,6 @@ class RecipientsPicker : public QWidget void slotToClicked(); void slotCcClicked(); void slotBccClicked(); - void slotOk(); void slotPicked( QListViewItem * ); void setFocusList();