diff --git a/kmfolderdia.cpp b/kmfolderdia.cpp index 970eabb81..31a3732c2 100644 --- a/kmfolderdia.cpp +++ b/kmfolderdia.cpp @@ -46,6 +46,7 @@ #include "folderdiaacltab.h" #include "kmailicalifaceimpl.h" #include "kmmainwidget.h" +#include "globalsettings.h" #include #include @@ -435,6 +436,8 @@ KMail::FolderDiaGeneralTab::FolderDiaGeneralTab( KMFolderDialog* dlg, mContentsComboBox->insertItem( i18n( "Journal" ) ); if ( mDlg->folder() ) mContentsComboBox->setCurrentItem( mDlg->folder()->storage()->contentsType() ); + connect ( mContentsComboBox, SIGNAL ( activated( int ) ), + this, SLOT( slotFolderContentsSelectionChanged( int ) ) ); } else mContentsComboBox = 0; @@ -633,6 +636,21 @@ void FolderDiaGeneralTab::slotUpdateItems ( int current ) } } +//----------------------------------------------------------------------------- +void FolderDiaGeneralTab::slotFolderContentsSelectionChanged( int ) +{ + KMail::FolderContentsType type = + static_cast( mContentsComboBox->currentItem() ); + if( type != KMail::ContentsTypeMail && GlobalSettings::hideGroupwareFolders() ) { + QString message = i18n("You have configured this folder to contain groupware information " + "and the general configuration option to hide groupware folders is " + "set. That means that this folder will dissapear once the configuration " + "dialog is closed. If you want to remove the folder again, you will need " + "to temporarily disable hiding of groupware folders to be able to see it."); + KMessageBox::information( this, message ); + } +} + //----------------------------------------------------------------------------- bool FolderDiaGeneralTab::save() { @@ -768,8 +786,11 @@ bool FolderDiaGeneralTab::save() folder->setUserWhoField(QString::null); // Set type field - if ( mContentsComboBox ) - folder->storage()->setContentsType( static_cast( mContentsComboBox->currentItem() ) ); + if ( mContentsComboBox ) { + KMail::FolderContentsType type = + static_cast( mContentsComboBox->currentItem() ); + folder->storage()->setContentsType( type ); + } folder->setIgnoreNewMail( mIgnoreNewMailCheckBox->isChecked() ); kmkernel->folderMgr()->contentsChanged(); diff --git a/kmfolderdia.h b/kmfolderdia.h index 9a1e5bd66..dc4e947b6 100644 --- a/kmfolderdia.h +++ b/kmfolderdia.h @@ -130,6 +130,7 @@ private slots: */ void slotUpdateItems( int ); void slotFolderNameChanged( const QString& ); + void slotFolderContentsSelectionChanged( int ); private: void initializeWithValuesFromFolder( KMFolder* folder );