From cc29364f06178f8f6b457384f2ec37a042bd9d43 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 1 Sep 2010 00:37:02 +0000 Subject: * Massive set of changes to bring in all fixes and enhancements from the Enterprise PIM branch * Ensured that the Trinity changes were applied on top of those enhancements, and any redundancy removed * Added journal read support to the CalDAV resource * Fixed CalDAV resource to use events URL for tasks and journals when separate URL checkbox unchecked git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1170461 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kmail/kmfilterdlg.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'kmail/kmfilterdlg.cpp') diff --git a/kmail/kmfilterdlg.cpp b/kmail/kmfilterdlg.cpp index c5589c94..558031f0 100644 --- a/kmail/kmfilterdlg.cpp +++ b/kmail/kmfilterdlg.cpp @@ -15,6 +15,8 @@ using KMail::AccountManager; #include "filterimporterexporter.h" using KMail::FilterImporterExporter; +#include "foldersetselector.h" +#include "globalsettings.h" // other KDE headers: #include @@ -45,6 +47,8 @@ using KMail::FilterImporterExporter; // other headers: #include +using namespace KMail; + // What's this help texts const char * _wt_filterlist = @@ -634,6 +638,14 @@ KMFilterListBox::KMFilterListBox( const TQString & title, TQWidget *parent, cons TQWhatsThis::add( mBtnDelete, i18n(_wt_filterlist_delete) ); TQWhatsThis::add( mBtnRename, i18n(_wt_filterlist_rename) ); + // third row + if ( !popFilter ) { + hb = new TQHBox( this ); + hb->setSpacing( 4 ); + TQPushButton *btn = new TQPushButton( i18n("Select Source Folders"), hb ); + connect( btn, TQT_SIGNAL(clicked()), TQT_SLOT(slotSelectSourceFolders()) ); + } + //----------- now connect everything connect( mListBox, TQT_SIGNAL(highlighted(int)), @@ -699,7 +711,7 @@ void KMFilterListBox::slotUpdateFilterName() if ( mFilterList.at(mIdxSelItem)->isAutoNaming() ) { // auto-naming of patterns - if ( p->first() && !p->first()->field().stripWhiteSpace().isEmpty() ) + if ( !p->isEmpty() && p->first() && !p->first()->field().stripWhiteSpace().isEmpty() ) shouldBeName = TQString( "<%1>: %2" ).arg( p->first()->field() ).arg( p->first()->contents() ); else shouldBeName = "<" + i18n("unnamed") + ">"; @@ -955,6 +967,17 @@ void KMFilterListBox::slotRename() slotUpdateFilterName(); } +void KMFilterListBox::slotSelectSourceFolders() +{ + FolderSetSelector dlg( kmkernel->getKMMainWidget()->folderTree(), this ); + dlg.setCaption( i18n( "Select Folders to Filter" ) ); + if ( !GlobalSettings::filterSourceFolders().isEmpty() ) + dlg.setSelectedFolders( GlobalSettings::filterSourceFolders() ); + if ( dlg.exec() == TQDialog::Accepted ) { + GlobalSettings::setFilterSourceFolders( dlg.selectedFolders() ); + } +} + void KMFilterListBox::enableControls() { bool theFirst = ( mIdxSelItem == 0 ); -- cgit v1.2.3