diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-01 00:37:02 +0000 |
commit | cc29364f06178f8f6b457384f2ec37a042bd9d43 (patch) | |
tree | 7c77a3184c698bbf9d98cef09fb1ba8124daceba /kmail/expirypropertiesdialog.cpp | |
parent | 4f6c584bacc8c3c694228f36ada3de77a76614a6 (diff) | |
download | tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.tar.gz tdepim-cc29364f06178f8f6b457384f2ec37a042bd9d43.zip |
* 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
Diffstat (limited to 'kmail/expirypropertiesdialog.cpp')
-rw-r--r-- | kmail/expirypropertiesdialog.cpp | 51 |
1 files changed, 33 insertions, 18 deletions
diff --git a/kmail/expirypropertiesdialog.cpp b/kmail/expirypropertiesdialog.cpp index a313cc88d..c524f8b32 100644 --- a/kmail/expirypropertiesdialog.cpp +++ b/kmail/expirypropertiesdialog.cpp @@ -28,8 +28,8 @@ using namespace KMail; * */ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* folder ) - : KDialogBase( tree, "expiry_properties", false, i18n( "Mail Expiry Properties" ), - KDialogBase::Ok|KDialogBase::Cancel, + : KDialogBase( tree, "expiry_properties", false, i18n( "Mail Expiry Properties" ), + KDialogBase::Ok|KDialogBase::Cancel, KDialogBase::Ok, true ), mFolder( folder ) { @@ -37,10 +37,10 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo TQWidget* privateLayoutWidget = new TQWidget( this, "globalVBox" ); setMainWidget( privateLayoutWidget ); privateLayoutWidget->setGeometry( TQRect( 10, 20, 270, 138 ) ); - globalVBox = new TQVBoxLayout( privateLayoutWidget, 11, 6, "globalVBox"); + globalVBox = new TQVBoxLayout( privateLayoutWidget, 11, 6, "globalVBox"); globalVBox->setSpacing( 20 ); - readHBox = new TQHBoxLayout( 0, 0, 6, "readHBox"); + readHBox = new TQHBoxLayout( 0, 0, 6, "readHBox"); expireReadMailCB = new TQCheckBox( privateLayoutWidget, "expireReadMailCB" ); expireReadMailCB->setText( i18n( "Expire read mails after" ) ); @@ -58,7 +58,7 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo readHBox->addWidget( labelDays ); globalVBox->addLayout( readHBox ); - unreadHBox = new TQHBoxLayout( 0, 0, 6, "unreadHBox"); + unreadHBox = new TQHBoxLayout( 0, 0, 6, "unreadHBox"); expireUnreadMailCB = new TQCheckBox( privateLayoutWidget, "expireUnreadMailCB" ); expireUnreadMailCB->setText( i18n( "Expire unread mails after" ) ); @@ -77,18 +77,18 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo unreadHBox->addWidget( labelDays2 ); globalVBox->addLayout( unreadHBox ); - expiryActionHBox = new TQHBoxLayout( 0, 0, 6, "expiryActionHBox"); + expiryActionHBox = new TQHBoxLayout( 0, 0, 6, "expiryActionHBox"); expiryActionLabel = new TQLabel( privateLayoutWidget, "expiryActionLabel" ); expiryActionLabel->setText( i18n( "Expiry action:" ) ); expiryActionLabel->setAlignment( int( TQLabel::AlignVCenter ) ); expiryActionHBox->addWidget( expiryActionLabel ); - actionsHBox = new TQVBoxLayout( 0, 0, 6, "actionsHBox"); + actionsHBox = new TQVBoxLayout( 0, 0, 6, "actionsHBox"); actionsGroup = new TQButtonGroup( this ); actionsGroup->hide(); // for mutual exclusion of the radio buttons - moveToHBox = new TQHBoxLayout( 0, 0, 6, "moveToHBox"); + moveToHBox = new TQHBoxLayout( 0, 0, 6, "moveToHBox"); moveToRB = new TQRadioButton( privateLayoutWidget, "moveToRB" ); actionsGroup->insert( moveToRB ); @@ -119,14 +119,14 @@ ExpiryPropertiesDialog::ExpiryPropertiesDialog( KMFolderTree* tree, KMFolder* fo int daysToExpireRead, daysToExpireUnread; mFolder->daysToExpire( daysToExpireUnread, daysToExpireRead); - if ( expiryGloballyOn - && mFolder->getReadExpireUnits() != expireNever + if ( expiryGloballyOn + && mFolder->getReadExpireUnits() != expireNever && daysToExpireRead >= 0 ) { expireReadMailCB->setChecked( true ); expireReadMailSB->setValue( daysToExpireRead ); } if ( expiryGloballyOn - && mFolder->getUnreadExpireUnits() != expireNever + && mFolder->getUnreadExpireUnits() != expireNever && daysToExpireUnread >= 0 ) { expireUnreadMailCB->setChecked( true ); expireUnreadMailSB->setValue( daysToExpireUnread ); @@ -159,11 +159,29 @@ ExpiryPropertiesDialog::~ExpiryPropertiesDialog() void ExpiryPropertiesDialog::slotOk() { bool enableGlobally = expireReadMailCB->isChecked() || expireUnreadMailCB->isChecked(); - if ( enableGlobally && moveToRB->isChecked() && !folderSelector->folder() ) { - KMessageBox::error( this, i18n("Please select a folder to expire messages into."), - i18n( "No Folder Selected" ) ); + + KMFolder *expireToFolder = folderSelector->folder(); + if ( enableGlobally && moveToRB->isChecked() && !expireToFolder ) { + KMessageBox::error( + this, + i18n( "Please select a folder to expire messages into." ), + i18n( "No Folder Selected" ) ); return; - } + } + + if ( expireToFolder ) { + if ( expireToFolder->idString() == mFolder->idString() ) { + KMessageBox::error( + this, + i18n( "Please select a different folder than the current folder " + "to expire message into." ), + i18n( "Wrong Folder Selected" ) ); + return; + } else { + mFolder->setExpireToFolderId( expireToFolder->idString() ); + } + } + mFolder->setAutoExpire( enableGlobally ); // we always write out days now mFolder->setReadExpireAge( expireReadMailSB->value() ); @@ -175,9 +193,6 @@ void ExpiryPropertiesDialog::slotOk() mFolder->setExpireAction( KMFolder::ExpireDelete ); else mFolder->setExpireAction( KMFolder::ExpireMove ); - KMFolder* expireToFolder = folderSelector->folder(); - if ( expireToFolder ) - mFolder->setExpireToFolderId( expireToFolder->idString() ); // trigger immediate expiry if there is something to do if ( enableGlobally ) |