From kmail-devel Thu May 12 23:07:53 2005 From: Kevin Gilbert Date: Thu, 12 May 2005 23:07:53 +0000 To: kmail-devel Subject: Bugs / wishes 52683 & 97654 Message-Id: <200505130825.57237.kev.gilbert () cdu ! edu ! au> X-MARC-Message: https://marc.info/?l=kmail-devel&m=111593909608231 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--===============1618113623==" --===============1618113623== Content-Type: multipart/signed; boundary="nextPart5124121.R97nkitn4V"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit --nextPart5124121.R97nkitn4V Content-Type: multipart/mixed; boundary="Boundary-01=_579gCEfAwoXG0VF" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_579gCEfAwoXG0VF Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Patch is attached. Kevin --Boundary-01=_579gCEfAwoXG0VF Content-Type: text/x-diff; charset="us-ascii"; name="kmail-3.4-recent-rev.3.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="kmail-3.4-recent-rev.3.diff" diff -Nrud kmail.orig/configuredialog.cpp kmail/configuredialog.cpp =2D-- kmail.orig/configuredialog.cpp 2005-03-04 19:28:27.000000000 +0930 +++ kmail/configuredialog.cpp 2005-05-12 15:31:22.000000000 +0930 @@ -4281,6 +4281,13 @@ connect( mEmptyTrashCheck, SIGNAL( stateChanged( int ) ), this, SLOT( slotEmitChanged( void ) ) ); =20 + // "Sho&w recent addresses" option: + mShowRecent =3D new QCheckBox( i18n("Sho&w recent addresses"), + this ); + vlay->addWidget( mShowRecent ); + connect( mShowRecent, SIGNAL( stateChanged( int ) ), + this, SLOT( slotEmitChanged( void ) ) ); + vlay->addStretch( 1 ); =20 // and now: add QWhatsThis: @@ -4331,6 +4338,7 @@ KConfigGroup general( KMKernel::config(), "General" ); =20 mEmptyTrashCheck->setChecked( general.readBoolEntry( "empty-trash-on-exi= t", true ) ); + mShowRecent->setChecked( general.readBoolEntry( "show-recent-addresses",= true ) ); mOnStartupOpenFolder->setFolder( general.readEntry( "startupFolder", kmkernel->inboxFolder()-= >idString() ) ); mEmptyFolderConfirmCheck->setChecked( general.readBoolEntry( "confirm-be= fore-empty", true ) ); @@ -4344,6 +4352,7 @@ KConfigGroup general( KMKernel::config(), "General" ); =20 general.writeEntry( "empty-trash-on-exit", mEmptyTrashCheck->isChecked()= ); + general.writeEntry( "show-recent-addresses", mShowRecent->isChecked() ); general.writeEntry( "confirm-before-empty", mEmptyFolderConfirmCheck->is= Checked() ); general.writeEntry( "default-mailbox-format", mMailboxPrefCombo->current= Item() ); general.writeEntry( "startupFolder", mOnStartupOpenFolder->folder() ? diff -Nrud kmail.orig/configuredialog_p.h kmail/configuredialog_p.h =2D-- kmail.orig/configuredialog_p.h 2005-03-04 19:28:27.000000000 +0930 +++ kmail/configuredialog_p.h 2005-05-12 15:31:22.000000000 +0930 @@ -910,6 +910,7 @@ QComboBox *mMailboxPrefCombo; QComboBox *mActionEnterFolder; QCheckBox *mEmptyTrashCheck; + QCheckBox *mShowRecent; QCheckBox *mDelayedMarkAsRead; KIntSpinBox *mDelayedMarkTime; QCheckBox *mShowPopupAfterDnD; diff -Nrud kmail.orig/kmmainwidget.cpp kmail/kmmainwidget.cpp =2D-- kmail.orig/kmmainwidget.cpp 2005-02-23 20:38:53.000000000 +0930 +++ kmail/kmmainwidget.cpp 2005-05-12 15:35:02.000000000 +0930 @@ -86,6 +86,8 @@ using KMail::HeaderListQuickSearch; #include "kmheaders.h" #include "mailinglistpropertiesdialog.h" +#include "recentaddresses.h" +using KRecentAddress::RecentAddresses; =20 #include #include @@ -1506,6 +1508,22 @@ } =20 //------------------------------------------------------------------------= =2D---- +void KMMainWidget::slotEditRecent() +{ + KRecentAddress::RecentAddressDialog dlg( this ); + dlg.setAddresses( RecentAddresses::self( KMKernel::config() )->addresses= () ); + + if ( dlg.exec() ) + { RecentAddresses::self( KMKernel::config() )->clear(); + QStringList addrList =3D dlg.addresses(); + QStringList::Iterator it; + + for ( it =3D addrList.begin(); it !=3D addrList.end(); ++it ) + RecentAddresses::self( KMKernel::config() )->add( *it ); + } +} + +//------------------------------------------------------------------------= =2D---- void KMMainWidget::slotStartCertManager() { KProcess certManagerProc; // save to create on the heap, since @@ -2237,6 +2255,10 @@ "configure", 0, this, SLOT(slotEditVacation()), actionCollection(), "tools_edit_vacation" ); =20 + (void) new KAction( i18n("Edit Recent Addresses..."), + "contents", 0, this, SLOT(slotEditRecent()), + actionCollection(), "tools_edit_recent" ); + (void) new KAction( i18n("Filter &Log Viewer..."), 0, this, SLOT(slotFilterLogViewer()), actionCollection(), "filter_log_view= er" ); =20 diff -Nrud kmail.orig/kmmainwidget.h kmail/kmmainwidget.h =2D-- kmail.orig/kmmainwidget.h 2005-02-23 20:38:53.000000000 +0930 +++ kmail/kmmainwidget.h 2005-05-12 15:33:19.000000000 +0930 @@ -272,6 +272,7 @@ void slotCopyMsg(); void slotResendMsg(); void slotEditVacation(); + void slotEditRecent();=09 void slotStartCertManager(); void slotStartWatchGnuPG(); void slotApplyFilters(); diff -Nrud kmail.orig/kmmainwin.rc kmail/kmmainwin.rc =2D-- kmail.orig/kmmainwin.rc 2005-02-23 20:38:53.000000000 +0930 +++ kmail/kmmainwin.rc 2005-05-12 15:35:36.000000000 +0930 @@ -131,7 +131,8 @@ =2D + + diff -Nrud kmail.orig/recipientspicker.cpp kmail/recipientspicker.cpp =2D-- kmail.orig/recipientspicker.cpp 2005-02-23 20:38:54.000000000 +0930 +++ kmail/recipientspicker.cpp 2005-05-12 15:31:22.000000000 +0930 @@ -22,6 +22,7 @@ #include "recipientspicker.h" =20 #include "globalsettings.h" +#include "kmkernel.h" =20 #include =20 @@ -314,6 +315,16 @@ // BCC isn't commonly used, so hide it for now //mBccButton->hide(); =20 + mShowRecentButton =3D new QPushButton( this ); + buttonLayout->addWidget( mShowRecentButton ); + connect( mShowRecentButton, SIGNAL( clicked() ), SLOT( slotShowRecentCli= cked() ) ); + KConfigGroup general( KMKernel::config(), "General" ); + + if( general.readBoolEntry( "show-recent-addresses", true )) + mShowRecentButton->setText( i18n( "&Hide Recent" )); + else + mShowRecentButton->setText( i18n( "&Show Recent" )); + QPushButton *closeButton =3D new QPushButton( i18n("&Cancel"), this ); buttonLayout->addWidget( closeButton ); connect( closeButton, SIGNAL( clicked() ), SLOT( close() ) ); @@ -347,7 +358,7 @@ } } =20 =2Dvoid RecipientsPicker::initCollections() +void RecipientsPicker::initCollections( const char showRecent ) { KABC::StdAddressBook *addressbook =3D KABC::StdAddressBook::self(); =20 @@ -390,7 +401,7 @@ =20 insertDistributionLists(); =20 =2D insertRecentAddresses(); + insertRecentAddresses( showRecent ); =20 mSelectedRecipients =3D new RecipientsCollection; mSelectedRecipients->setTitle( i18n("Selected Recipients") ); @@ -422,8 +433,16 @@ insertCollection( collection ); } =20 =2Dvoid RecipientsPicker::insertRecentAddresses() +void RecipientsPicker::insertRecentAddresses( const char showRecent ) { + if( showRecent < 0 ) + return; + + KConfigGroup general( KMKernel::config(), "General" ); + + if( !showRecent && !general.readBoolEntry( "show-recent-addresses", true= ) ) + return; + RecipientsCollection *collection =3D new RecipientsCollection; collection->setTitle( i18n("Recent Addresses") ); =20 @@ -554,6 +573,24 @@ pick( Recipient::Bcc ); } =20 +void RecipientsPicker::slotShowRecentClicked() +{ + mCollectionCombo->clear(); + mCollectionMap.clear(); + KConfigGroup general( KMKernel::config(), "General" ); + + if( mShowRecentButton->text() =3D=3D "&Hide Recent" ) + { initCollections( -1 ); + mShowRecentButton->setText( i18n( "&Show Recent" )); + } + else + { initCollections( 1 ); + mShowRecentButton->setText( i18n ("&Hide Recent" )); + } + + updateList(); +} + void RecipientsPicker::slotPicked( QListViewItem *viewItem ) { RecipientViewItem *item =3D static_cast( viewItem ); diff -Nrud kmail.orig/recipientspicker.h kmail/recipientspicker.h =2D-- kmail.orig/recipientspicker.h 2005-01-31 06:17:04.000000000 +0930 +++ kmail/recipientspicker.h 2005-05-12 15:31:22.000000000 +0930 @@ -147,9 +147,9 @@ void pickedRecipient( const Recipient & ); =20 protected: =2D void initCollections(); + void initCollections( const char showRecent =3D 0 ); void insertDistributionLists(); =2D void insertRecentAddresses(); + void insertRecentAddresses( const char showRecent ); void insertCollection( RecipientsCollection *coll ); =20 void keyPressEvent( QKeyEvent *ev ); @@ -166,6 +166,7 @@ void slotToClicked(); void slotCcClicked(); void slotBccClicked(); + void slotShowRecentClicked(); void slotPicked( QListViewItem * ); void slotPicked(); void setFocusList(); @@ -179,7 +180,8 @@ QPushButton *mToButton; QPushButton *mCcButton; QPushButton *mBccButton; =2D =20 + QPushButton *mShowRecentButton; + QMap mCollectionMap; RecipientsCollection *mAllRecipients; RecipientsCollection *mSelectedRecipients; --Boundary-01=_579gCEfAwoXG0VF-- --nextPart5124121.R97nkitn4V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.6 (GNU/Linux) iQCVAwUAQoPe/UffMBZeBmpmAQKJjQP9Gj31hFgKx4eLfojQpvO01WC6Bft74Gvr frpge+0Z0EQXboQXhezRPBC/B9anvBPn9FEgrTbenQ2awvwhxDd/HzO4Z824r6hI XscJJrX/2VTa9CVi1PUCbr0joAszRa1jquuWNAs6H0Wvcz7SBmsvtyjCZu7IRGQG pRd3FGujBjo= =nqcC -----END PGP SIGNATURE----- --nextPart5124121.R97nkitn4V-- --===============1618113623== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ KMail developers mailing list KMail-devel@kde.org https://mail.kde.org/mailman/listinfo/kmail-devel --===============1618113623==--