00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011 #include "folderpropertiesdialog.h"
00012
00013 #include <qvariant.h>
00014 #include <kdialog.h>
00015 #include <qpushbutton.h>
00016 #include <qgroupbox.h>
00017 #include <qlineedit.h>
00018 #include <qlabel.h>
00019 #include <qcheckbox.h>
00020 #include <kicondialog.h>
00021 #include <knuminput.h>
00022 #include <kcombobox.h>
00023 #include <qcombobox.h>
00024 #include <qlayout.h>
00025 #include <qtooltip.h>
00026 #include <qwhatsthis.h>
00027 #include "kmfolderdir.h"
00028 #include "kmfolder.h"
00029 #include "./folderpropertiesdialog.ui.h"
00030
00031
00032
00033
00034
00035 KMFolderDialogUI::KMFolderDialogUI( QWidget* parent, const char* name, WFlags fl )
00036 : QWidget( parent, name, fl )
00037 {
00038 if ( !name )
00039 setName( "KMFolderDialogUI" );
00040 KMFolderDialogUILayout = new QVBoxLayout( this, 0, KDialog::spacingHint(), "KMFolderDialogUILayout");
00041
00042 GroupBox2 = new QGroupBox( this, "GroupBox2" );
00043 GroupBox2->setColumnLayout(0, Qt::Vertical );
00044 GroupBox2->layout()->setSpacing( KDialog::spacingHint() );
00045 GroupBox2->layout()->setMargin( KDialog::marginHint() );
00046 GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
00047 GroupBox2Layout->setAlignment( Qt::AlignTop );
00048
00049 mNameEdit = new QLineEdit( GroupBox2, "mNameEdit" );
00050 mNameEdit->setFrameShape( QLineEdit::LineEditPanel );
00051 mNameEdit->setFrameShadow( QLineEdit::Sunken );
00052
00053 GroupBox2Layout->addMultiCellWidget( mNameEdit, 0, 0, 2, 7 );
00054
00055 TextLabel1 = new QLabel( GroupBox2, "TextLabel1" );
00056
00057 GroupBox2Layout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );
00058
00059 mHoldsMailingList = new QCheckBox( GroupBox2, "mHoldsMailingList" );
00060
00061 GroupBox2Layout->addMultiCellWidget( mHoldsMailingList, 3, 3, 0, 7 );
00062 Spacer1_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00063 GroupBox2Layout->addItem( Spacer1_2, 4, 0 );
00064
00065 TextLabel2_2 = new QLabel( GroupBox2, "TextLabel2_2" );
00066 TextLabel2_2->setEnabled( FALSE );
00067
00068 GroupBox2Layout->addMultiCellWidget( TextLabel2_2, 4, 4, 1, 3 );
00069 Spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00070 GroupBox2Layout->addItem( Spacer1, 2, 0 );
00071
00072 TextLabel3 = new QLabel( GroupBox2, "TextLabel3" );
00073 TextLabel3->setEnabled( FALSE );
00074
00075 GroupBox2Layout->addMultiCellWidget( TextLabel3, 2, 2, 1, 2 );
00076
00077 mNormalIconButton = new KIconButton( GroupBox2, "mNormalIconButton" );
00078 mNormalIconButton->setEnabled( FALSE );
00079 mNormalIconButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, mNormalIconButton->sizePolicy().hasHeightForWidth() ) );
00080 mNormalIconButton->setMinimumSize( QSize( 28, 28 ) );
00081 mNormalIconButton->setMaximumSize( QSize( 28, 28 ) );
00082
00083 GroupBox2Layout->addWidget( mNormalIconButton, 2, 3 );
00084 Spacer1_4 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00085 GroupBox2Layout->addItem( Spacer1_4, 2, 4 );
00086
00087 mUnreadIconButton = new KIconButton( GroupBox2, "mUnreadIconButton" );
00088 mUnreadIconButton->setEnabled( FALSE );
00089 mUnreadIconButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, 0, 0, mUnreadIconButton->sizePolicy().hasHeightForWidth() ) );
00090 mUnreadIconButton->setMinimumSize( QSize( 28, 28 ) );
00091 mUnreadIconButton->setMaximumSize( QSize( 28, 28 ) );
00092
00093 GroupBox2Layout->addWidget( mUnreadIconButton, 2, 6 );
00094
00095 TextLabel4 = new QLabel( GroupBox2, "TextLabel4" );
00096 TextLabel4->setEnabled( FALSE );
00097
00098 GroupBox2Layout->addWidget( TextLabel4, 2, 5 );
00099 spacer9 = new QSpacerItem( 101, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00100 GroupBox2Layout->addItem( spacer9, 2, 7 );
00101
00102 mIconsCheckBox = new QCheckBox( GroupBox2, "mIconsCheckBox" );
00103
00104 GroupBox2Layout->addMultiCellWidget( mIconsCheckBox, 1, 1, 0, 7 );
00105
00106 mMailingListPostAddress = new QLineEdit( GroupBox2, "mMailingListPostAddress" );
00107 mMailingListPostAddress->setEnabled( FALSE );
00108 mMailingListPostAddress->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 0, 0, mMailingListPostAddress->sizePolicy().hasHeightForWidth() ) );
00109
00110 GroupBox2Layout->addMultiCellWidget( mMailingListPostAddress, 4, 4, 4, 7 );
00111 KMFolderDialogUILayout->addWidget( GroupBox2 );
00112
00113 GroupBox3 = new QGroupBox( this, "GroupBox3" );
00114 GroupBox3->setColumnLayout(0, Qt::Vertical );
00115 GroupBox3->layout()->setSpacing( KDialog::spacingHint() );
00116 GroupBox3->layout()->setMargin( KDialog::marginHint() );
00117 GroupBox3Layout = new QGridLayout( GroupBox3->layout() );
00118 GroupBox3Layout->setAlignment( Qt::AlignTop );
00119
00120 TextLabel2_3 = new QLabel( GroupBox3, "TextLabel2_3" );
00121 TextLabel2_3->setEnabled( FALSE );
00122
00123 GroupBox3Layout->addWidget( TextLabel2_3, 1, 1 );
00124 Spacer1_2_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00125 GroupBox3Layout->addItem( Spacer1_2_2, 1, 0 );
00126
00127 mExpireRead = new QCheckBox( GroupBox3, "mExpireRead" );
00128
00129 GroupBox3Layout->addMultiCellWidget( mExpireRead, 0, 0, 0, 3 );
00130 Spacer1_2_2_2 = new QSpacerItem( 20, 20, QSizePolicy::Fixed, QSizePolicy::Minimum );
00131 GroupBox3Layout->addItem( Spacer1_2_2_2, 3, 0 );
00132
00133 TextLabel2_3_2 = new QLabel( GroupBox3, "TextLabel2_3_2" );
00134 TextLabel2_3_2->setEnabled( FALSE );
00135
00136 GroupBox3Layout->addWidget( TextLabel2_3_2, 3, 1 );
00137
00138 mExpireUnread = new QCheckBox( GroupBox3, "mExpireUnread" );
00139
00140 GroupBox3Layout->addMultiCellWidget( mExpireUnread, 2, 2, 0, 3 );
00141
00142 mExpireReadNum = new KIntNumInput( GroupBox3, "mExpireReadNum" );
00143 mExpireReadNum->setEnabled( FALSE );
00144 mExpireReadNum->setMinValue( 1 );
00145 mExpireReadNum->setMaxValue( 500 );
00146
00147 GroupBox3Layout->addWidget( mExpireReadNum, 1, 2 );
00148
00149 mExpireUnreadNum = new KIntNumInput( GroupBox3, "mExpireUnreadNum" );
00150 mExpireUnreadNum->setEnabled( FALSE );
00151 mExpireUnreadNum->setMinValue( 1 );
00152 mExpireUnreadNum->setMaxValue( 500 );
00153
00154 GroupBox3Layout->addWidget( mExpireUnreadNum, 3, 2 );
00155
00156 mExpireUnreadUnits = new KComboBox( FALSE, GroupBox3, "mExpireUnreadUnits" );
00157 mExpireUnreadUnits->setEnabled( FALSE );
00158
00159 GroupBox3Layout->addWidget( mExpireUnreadUnits, 3, 3 );
00160
00161 mExpireReadUnits = new KComboBox( FALSE, GroupBox3, "mExpireReadUnits" );
00162 mExpireReadUnits->setEnabled( FALSE );
00163
00164 GroupBox3Layout->addWidget( mExpireReadUnits, 1, 3 );
00165 Spacer6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00166 GroupBox3Layout->addMultiCell( Spacer6, 0, 3, 4, 4 );
00167 KMFolderDialogUILayout->addWidget( GroupBox3 );
00168
00169 GroupBox1 = new QGroupBox( this, "GroupBox1" );
00170 GroupBox1->setColumnLayout(0, Qt::Vertical );
00171 GroupBox1->layout()->setSpacing( KDialog::spacingHint() );
00172 GroupBox1->layout()->setMargin( KDialog::marginHint() );
00173 GroupBox1Layout = new QGridLayout( GroupBox1->layout() );
00174 GroupBox1Layout->setAlignment( Qt::AlignTop );
00175
00176 textLabel1 = new QLabel( GroupBox1, "textLabel1" );
00177
00178 GroupBox1Layout->addWidget( textLabel1, 1, 0 );
00179
00180 mIdentity = new QComboBox( FALSE, GroupBox1, "mIdentity" );
00181
00182 GroupBox1Layout->addWidget( mIdentity, 1, 1 );
00183
00184 mMailboxType = new KComboBox( FALSE, GroupBox1, "mMailboxType" );
00185
00186 GroupBox1Layout->addWidget( mMailboxType, 0, 1 );
00187
00188 TextLabel1_2 = new QLabel( GroupBox1, "TextLabel1_2" );
00189
00190 GroupBox1Layout->addWidget( TextLabel1_2, 0, 0 );
00191
00192 TextLabel1_3 = new QLabel( GroupBox1, "TextLabel1_3" );
00193
00194 GroupBox1Layout->addWidget( TextLabel1_3, 2, 0 );
00195 Spacer7 = new QSpacerItem( 120, 80, QSizePolicy::Expanding, QSizePolicy::Minimum );
00196 GroupBox1Layout->addMultiCell( Spacer7, 0, 2, 2, 2 );
00197
00198 mListDisplays = new QComboBox( FALSE, GroupBox1, "mListDisplays" );
00199
00200 GroupBox1Layout->addWidget( mListDisplays, 2, 1 );
00201 KMFolderDialogUILayout->addWidget( GroupBox1 );
00202 languageChange();
00203 resize( QSize(344, 428).expandedTo(minimumSizeHint()) );
00204 clearWState( WState_Polished );
00205
00206
00207 connect( mIconsCheckBox, SIGNAL( toggled(bool) ), TextLabel3, SLOT( setEnabled(bool) ) );
00208 connect( mIconsCheckBox, SIGNAL( toggled(bool) ), TextLabel4, SLOT( setEnabled(bool) ) );
00209 connect( mHoldsMailingList, SIGNAL( toggled(bool) ), mMailingListPostAddress, SLOT( setEnabled(bool) ) );
00210 connect( mHoldsMailingList, SIGNAL( toggled(bool) ), TextLabel2_2, SLOT( setEnabled(bool) ) );
00211 connect( mIconsCheckBox, SIGNAL( toggled(bool) ), mNormalIconButton, SLOT( setEnabled(bool) ) );
00212 connect( mIconsCheckBox, SIGNAL( toggled(bool) ), mUnreadIconButton, SLOT( setEnabled(bool) ) );
00213 connect( mExpireRead, SIGNAL( toggled(bool) ), TextLabel2_3, SLOT( setEnabled(bool) ) );
00214 connect( mExpireRead, SIGNAL( toggled(bool) ), mExpireReadNum, SLOT( setEnabled(bool) ) );
00215 connect( mExpireRead, SIGNAL( toggled(bool) ), mExpireReadUnits, SLOT( setEnabled(bool) ) );
00216 connect( mExpireUnread, SIGNAL( toggled(bool) ), TextLabel2_3_2, SLOT( setEnabled(bool) ) );
00217 connect( mExpireUnread, SIGNAL( toggled(bool) ), mExpireUnreadNum, SLOT( setEnabled(bool) ) );
00218 connect( mExpireUnread, SIGNAL( toggled(bool) ), mExpireUnreadUnits, SLOT( setEnabled(bool) ) );
00219 connect( mNormalIconButton, SIGNAL( iconChanged(QString) ), this, SLOT( slotChangeIcon(QString) ) );
00220
00221
00222 TextLabel1->setBuddy( mNameEdit );
00223 TextLabel2_2->setBuddy( mMailingListPostAddress );
00224 TextLabel3->setBuddy( mNormalIconButton );
00225 TextLabel4->setBuddy( mUnreadIconButton );
00226 TextLabel2_3->setBuddy( mExpireReadNum );
00227 TextLabel2_3_2->setBuddy( mExpireUnreadNum );
00228 textLabel1->setBuddy( mIdentity );
00229 TextLabel1_2->setBuddy( mMailboxType );
00230 TextLabel1_3->setBuddy( mListDisplays );
00231 }
00232
00233
00234
00235
00236 KMFolderDialogUI::~KMFolderDialogUI()
00237 {
00238
00239 }
00240
00241
00242
00243
00244
00245 void KMFolderDialogUI::languageChange()
00246 {
00247 setCaption( tr2i18n( "Folder Properties" ) );
00248 GroupBox2->setTitle( tr2i18n( "General" ) );
00249 TextLabel1->setText( tr2i18n( "&Name:" ) );
00250 mHoldsMailingList->setText( tr2i18n( "Folder holds a &mailing list" ) );
00251 TextLabel2_2->setText( tr2i18n( "List &address:" ) );
00252 TextLabel3->setText( tr2i18n( "N&ormal:" ) );
00253 mNormalIconButton->setText( QString::null );
00254 mUnreadIconButton->setText( QString::null );
00255 TextLabel4->setText( tr2i18n( "Unr&ead:" ) );
00256 mIconsCheckBox->setText( tr2i18n( "Use custom &icons" ) );
00257 GroupBox3->setTitle( tr2i18n( "Message Expiring" ) );
00258 TextLabel2_3->setText( tr2i18n( "E&xpire after:" ) );
00259 mExpireRead->setText( tr2i18n( "Expire &read messages" ) );
00260 TextLabel2_3_2->setText( tr2i18n( "Expire a&fter:" ) );
00261 mExpireUnread->setText( tr2i18n( "Expire &unread messages" ) );
00262 mExpireUnreadUnits->clear();
00263 mExpireUnreadUnits->insertItem( tr2i18n( "Day(s)" ) );
00264 mExpireUnreadUnits->insertItem( tr2i18n( "Week(s)" ) );
00265 mExpireUnreadUnits->insertItem( tr2i18n( "Month(s)" ) );
00266 mExpireReadUnits->clear();
00267 mExpireReadUnits->insertItem( tr2i18n( "Day(s)" ) );
00268 mExpireReadUnits->insertItem( tr2i18n( "Week(s)" ) );
00269 mExpireReadUnits->insertItem( tr2i18n( "Month(s)" ) );
00270 GroupBox1->setTitle( tr2i18n( "Advanced" ) );
00271 textLabel1->setText( tr2i18n( "Sender identit&y:" ) );
00272 TextLabel1_2->setText( tr2i18n( "&Storage format:" ) );
00273 TextLabel1_3->setText( tr2i18n( "&List displays:" ) );
00274 mListDisplays->clear();
00275 mListDisplays->insertItem( tr2i18n( "Sender" ) );
00276 mListDisplays->insertItem( tr2i18n( "Receiver" ) );
00277 }
00278
00279 #include "folderpropertiesdialog.moc"