kmail

composercryptoconfiguration.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './composercryptoconfiguration.ui'
00005 **
00006 ** Created: Mi Dez 16 18:28:43 2009
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "composercryptoconfiguration.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qgroupbox.h>
00016 #include <qcheckbox.h>
00017 #include <qlayout.h>
00018 #include <qtooltip.h>
00019 #include <qwhatsthis.h>
00020 
00021 /*
00022  *  Constructs a ComposerCryptoConfiguration as a child of 'parent', with the
00023  *  name 'name' and widget flags set to 'f'.
00024  */
00025 ComposerCryptoConfiguration::ComposerCryptoConfiguration( QWidget* parent, const char* name, WFlags fl )
00026     : QWidget( parent, name, fl )
00027 {
00028     if ( !name )
00029     setName( "ComposerCryptoConfiguration" );
00030     ComposerCryptoConfigurationLayout = new QVBoxLayout( this, 11, 6, "ComposerCryptoConfigurationLayout"); 
00031 
00032     optionsGroup_2 = new QGroupBox( this, "optionsGroup_2" );
00033     optionsGroup_2->setColumnLayout(0, Qt::Vertical );
00034     optionsGroup_2->layout()->setSpacing( 6 );
00035     optionsGroup_2->layout()->setMargin( 11 );
00036     optionsGroup_2Layout = new QVBoxLayout( optionsGroup_2->layout() );
00037     optionsGroup_2Layout->setAlignment( Qt::AlignTop );
00038 
00039     mAutoSignature = new QCheckBox( optionsGroup_2, "mAutoSignature" );
00040     optionsGroup_2Layout->addWidget( mAutoSignature );
00041     ComposerCryptoConfigurationLayout->addWidget( optionsGroup_2 );
00042 
00043     optionsGroup = new QGroupBox( this, "optionsGroup" );
00044     optionsGroup->setColumnLayout(0, Qt::Vertical );
00045     optionsGroup->layout()->setSpacing( 6 );
00046     optionsGroup->layout()->setMargin( 11 );
00047     optionsGroupLayout = new QVBoxLayout( optionsGroup->layout() );
00048     optionsGroupLayout->setAlignment( Qt::AlignTop );
00049 
00050     mEncToSelf = new QCheckBox( optionsGroup, "mEncToSelf" );
00051     optionsGroupLayout->addWidget( mEncToSelf );
00052 
00053     mShowEncryptionResult = new QCheckBox( optionsGroup, "mShowEncryptionResult" );
00054     optionsGroupLayout->addWidget( mShowEncryptionResult );
00055 
00056     mStoreEncrypted = new QCheckBox( optionsGroup, "mStoreEncrypted" );
00057     mStoreEncrypted->setChecked( FALSE );
00058     optionsGroupLayout->addWidget( mStoreEncrypted );
00059 
00060     mShowKeyApprovalDlg = new QCheckBox( optionsGroup, "mShowKeyApprovalDlg" );
00061     optionsGroupLayout->addWidget( mShowKeyApprovalDlg );
00062 
00063     mAutoEncrypt = new QCheckBox( optionsGroup, "mAutoEncrypt" );
00064     optionsGroupLayout->addWidget( mAutoEncrypt );
00065 
00066     mNeverEncryptWhenSavingInDrafts = new QCheckBox( optionsGroup, "mNeverEncryptWhenSavingInDrafts" );
00067     optionsGroupLayout->addWidget( mNeverEncryptWhenSavingInDrafts );
00068     ComposerCryptoConfigurationLayout->addWidget( optionsGroup );
00069     spacer22 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
00070     ComposerCryptoConfigurationLayout->addItem( spacer22 );
00071     languageChange();
00072     resize( QSize(581, 318).expandedTo(minimumSizeHint()) );
00073     clearWState( WState_Polished );
00074 
00075     // tab order
00076     setTabOrder( mEncToSelf, mShowEncryptionResult );
00077     setTabOrder( mShowEncryptionResult, mStoreEncrypted );
00078     setTabOrder( mStoreEncrypted, mShowKeyApprovalDlg );
00079     setTabOrder( mShowKeyApprovalDlg, mAutoEncrypt );
00080     setTabOrder( mAutoEncrypt, mNeverEncryptWhenSavingInDrafts );
00081 }
00082 
00083 /*
00084  *  Destroys the object and frees any allocated resources
00085  */
00086 ComposerCryptoConfiguration::~ComposerCryptoConfiguration()
00087 {
00088     // no need to delete child widgets, Qt does it all for us
00089 }
00090 
00091 /*
00092  *  Sets the strings of the subwidgets using the current
00093  *  language.
00094  */
00095 void ComposerCryptoConfiguration::languageChange()
00096 {
00097     optionsGroup_2->setTitle( tr2i18n( "Signing" ) );
00098     mAutoSignature->setText( tr2i18n( "&Automatically sign messages" ) );
00099     QWhatsThis::add( mAutoSignature, tr2i18n( "When this option is enabled, all messages you send will be signed by default; of course, it is still possible to disable signing for each message individually." ) );
00100     optionsGroup->setTitle( tr2i18n( "Encrypting" ) );
00101     mEncToSelf->setText( tr2i18n( "When encrypting emails, always also encr&ypt to the certificate of my own identity" ) );
00102     QWhatsThis::add( mEncToSelf, tr2i18n( "When this option is enabled, the message/file will not only be encrypted with the receiver's public key, but also with your key. This will enable you to decrypt the message/file at a later time. This is generally a good idea." ) );
00103     mShowEncryptionResult->setText( tr2i18n( "Show s&igned/encrypted text after composing" ) );
00104     QWhatsThis::add( mShowEncryptionResult, tr2i18n( "When this option is enabled, the signed/encrypted text will be shown in a separate window, enabling you to know how it will look before it is sent. This is a good idea when you are verifying that your encryption system works." ) );
00105     mStoreEncrypted->setText( tr2i18n( "Store sent messages encry&pted" ) );
00106     QToolTip::add( mStoreEncrypted, tr2i18n( "Check to store messages encrypted " ) );
00107     QWhatsThis::add( mStoreEncrypted, tr2i18n( "<qt>\n"
00108 "<h1>Store Messages Encrypted</h1>\n"
00109 "When this box is checked, sent messages are stored encrypted like they were sent. This is not recommended, as you will not be able to read the messages any longer if a necessary certificate expires.\n"
00110 "<p>\n"
00111 "However, there may be local rules that require you to turn this option on. When in doubt, check with your local administrator.\n"
00112 "</qt>" ) );
00113     mShowKeyApprovalDlg->setText( tr2i18n( "Always show the encryption keys &for approval" ) );
00114     QWhatsThis::add( mShowKeyApprovalDlg, tr2i18n( "When this option is enabled, the application will always show you a list of public keys from which you can choose the one it will use for encryption. If it is off, the application will only show the dialog if it cannot find the right key or if there are several which could be used." ) );
00115     mAutoEncrypt->setText( tr2i18n( "Automatically encrypt &messages whenever possible" ) );
00116     QWhatsThis::add( mAutoEncrypt, tr2i18n( "When this option is enabled, every message you send will be encrypted whenever encryption is possible and desired; of course, it is still possible to disable the automatic encryption for each message individually." ) );
00117     mNeverEncryptWhenSavingInDrafts->setText( tr2i18n( "Never sign/encrypt when sa&ving as draft" ) );
00118 }
00119 
00120 #include "composercryptoconfiguration.moc"