kmail

smimeconfiguration.cpp

00001 #include <kdialog.h>
00002 #include <klocale.h>
00003 /****************************************************************************
00004 ** Form implementation generated from reading ui file './smimeconfiguration.ui'
00005 **
00006 ** Created: Mi Dez 16 18:28:44 2009
00007 **
00008 ** WARNING! All changes made in this file will be lost!
00009 ****************************************************************************/
00010 
00011 #include "smimeconfiguration.h"
00012 
00013 #include <qvariant.h>
00014 #include <qpushbutton.h>
00015 #include <qradiobutton.h>
00016 #include <qgroupbox.h>
00017 #include <qlabel.h>
00018 #include <qlineedit.h>
00019 #include <qcheckbox.h>
00020 #include <qbuttongroup.h>
00021 #include <qframe.h>
00022 #include <qlayout.h>
00023 #include <qtooltip.h>
00024 #include <qwhatsthis.h>
00025 #include "../certmanager/lib/ui/keyrequester.h"
00026 
00027 /*
00028  *  Constructs a SMimeConfiguration as a child of 'parent', with the
00029  *  name 'name' and widget flags set to 'f'.
00030  */
00031 SMimeConfiguration::SMimeConfiguration( QWidget* parent, const char* name, WFlags fl )
00032     : QWidget( parent, name, fl )
00033 {
00034     if ( !name )
00035     setName( "SMimeConfiguration" );
00036     SMimeConfigurationLayout = new QVBoxLayout( this, 11, 6, "SMimeConfigurationLayout"); 
00037 
00038     CRLRB = new QRadioButton( this, "CRLRB" );
00039     CRLRB->setChecked( TRUE );
00040     SMimeConfigurationLayout->addWidget( CRLRB );
00041 
00042     OCSPRB = new QRadioButton( this, "OCSPRB" );
00043     SMimeConfigurationLayout->addWidget( OCSPRB );
00044 
00045     OCSPGroupBox = new QGroupBox( this, "OCSPGroupBox" );
00046     OCSPGroupBox->setColumnLayout(0, Qt::Vertical );
00047     OCSPGroupBox->layout()->setSpacing( 6 );
00048     OCSPGroupBox->layout()->setMargin( 11 );
00049     OCSPGroupBoxLayout = new QVBoxLayout( OCSPGroupBox->layout() );
00050     OCSPGroupBoxLayout->setAlignment( Qt::AlignTop );
00051 
00052     layout4 = new QHBoxLayout( 0, 0, 6, "layout4"); 
00053 
00054     textLabel1 = new QLabel( OCSPGroupBox, "textLabel1" );
00055     layout4->addWidget( textLabel1 );
00056 
00057     OCSPResponderURL = new QLineEdit( OCSPGroupBox, "OCSPResponderURL" );
00058     layout4->addWidget( OCSPResponderURL );
00059     OCSPGroupBoxLayout->addLayout( layout4 );
00060 
00061     layout5 = new QHBoxLayout( 0, 0, 6, "layout5"); 
00062 
00063     textLabel2 = new QLabel( OCSPGroupBox, "textLabel2" );
00064     layout5->addWidget( textLabel2 );
00065 
00066     OCSPResponderSignature = new Kleo::KeyRequester( OCSPGroupBox, "OCSPResponderSignature" );
00067     layout5->addWidget( OCSPResponderSignature );
00068     spacer7 = new QSpacerItem( 150, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00069     layout5->addItem( spacer7 );
00070     OCSPGroupBoxLayout->addLayout( layout5 );
00071 
00072     ignoreServiceURLCB = new QCheckBox( OCSPGroupBox, "ignoreServiceURLCB" );
00073     OCSPGroupBoxLayout->addWidget( ignoreServiceURLCB );
00074     SMimeConfigurationLayout->addWidget( OCSPGroupBox );
00075 
00076     doNotCheckCertPolicyCB = new QCheckBox( this, "doNotCheckCertPolicyCB" );
00077     SMimeConfigurationLayout->addWidget( doNotCheckCertPolicyCB );
00078 
00079     neverConsultCB = new QCheckBox( this, "neverConsultCB" );
00080     SMimeConfigurationLayout->addWidget( neverConsultCB );
00081 
00082     fetchMissingCB = new QCheckBox( this, "fetchMissingCB" );
00083     SMimeConfigurationLayout->addWidget( fetchMissingCB );
00084 
00085     HTTPGroupBox = new QButtonGroup( this, "HTTPGroupBox" );
00086     HTTPGroupBox->setColumnLayout(0, Qt::Vertical );
00087     HTTPGroupBox->layout()->setSpacing( 6 );
00088     HTTPGroupBox->layout()->setMargin( 11 );
00089     HTTPGroupBoxLayout = new QVBoxLayout( HTTPGroupBox->layout() );
00090     HTTPGroupBoxLayout->setAlignment( Qt::AlignTop );
00091 
00092     disableHTTPCB = new QCheckBox( HTTPGroupBox, "disableHTTPCB" );
00093     HTTPGroupBoxLayout->addWidget( disableHTTPCB );
00094 
00095     frameHTTP = new QFrame( HTTPGroupBox, "frameHTTP" );
00096     frameHTTP->setFrameShape( QFrame::NoFrame );
00097     frameHTTP->setFrameShadow( QFrame::Plain );
00098     frameHTTPLayout = new QGridLayout( frameHTTP, 1, 1, 0, 6, "frameHTTPLayout"); 
00099 
00100     layout5_2 = new QGridLayout( 0, 1, 1, 0, 6, "layout5_2"); 
00101 
00102     systemHTTPProxy = new QLabel( frameHTTP, "systemHTTPProxy" );
00103 
00104     layout5_2->addWidget( systemHTTPProxy, 0, 1 );
00105 
00106     useCustomHTTPProxyRB = new QRadioButton( frameHTTP, "useCustomHTTPProxyRB" );
00107 
00108     layout5_2->addWidget( useCustomHTTPProxyRB, 1, 0 );
00109 
00110     honorHTTPProxyRB = new QRadioButton( frameHTTP, "honorHTTPProxyRB" );
00111 
00112     layout5_2->addWidget( honorHTTPProxyRB, 0, 0 );
00113 
00114     customHTTPProxy = new QLineEdit( frameHTTP, "customHTTPProxy" );
00115 
00116     layout5_2->addWidget( customHTTPProxy, 1, 1 );
00117 
00118     frameHTTPLayout->addMultiCellLayout( layout5_2, 1, 1, 0, 1 );
00119 
00120     ignoreHTTPDPCB = new QCheckBox( frameHTTP, "ignoreHTTPDPCB" );
00121 
00122     frameHTTPLayout->addWidget( ignoreHTTPDPCB, 0, 0 );
00123     HTTPGroupBoxLayout->addWidget( frameHTTP );
00124     SMimeConfigurationLayout->addWidget( HTTPGroupBox );
00125 
00126     LDAPGroupBox = new QGroupBox( this, "LDAPGroupBox" );
00127     LDAPGroupBox->setColumnLayout(0, Qt::Vertical );
00128     LDAPGroupBox->layout()->setSpacing( 6 );
00129     LDAPGroupBox->layout()->setMargin( 11 );
00130     LDAPGroupBoxLayout = new QVBoxLayout( LDAPGroupBox->layout() );
00131     LDAPGroupBoxLayout->setAlignment( Qt::AlignTop );
00132 
00133     disableLDAPCB = new QCheckBox( LDAPGroupBox, "disableLDAPCB" );
00134     LDAPGroupBoxLayout->addWidget( disableLDAPCB );
00135 
00136     frameLDAP = new QFrame( LDAPGroupBox, "frameLDAP" );
00137     frameLDAP->setFrameShape( QFrame::NoFrame );
00138     frameLDAP->setFrameShadow( QFrame::Plain );
00139     frameLDAPLayout = new QVBoxLayout( frameLDAP, 0, 6, "frameLDAPLayout"); 
00140 
00141     ignoreLDAPDPCB = new QCheckBox( frameLDAP, "ignoreLDAPDPCB" );
00142     frameLDAPLayout->addWidget( ignoreLDAPDPCB );
00143 
00144     layout5_3 = new QHBoxLayout( 0, 0, 6, "layout5_3"); 
00145 
00146     customLDAPLabel = new QLabel( frameLDAP, "customLDAPLabel" );
00147     layout5_3->addWidget( customLDAPLabel );
00148 
00149     customLDAPProxy = new QLineEdit( frameLDAP, "customLDAPProxy" );
00150     layout5_3->addWidget( customLDAPProxy );
00151     frameLDAPLayout->addLayout( layout5_3 );
00152     LDAPGroupBoxLayout->addWidget( frameLDAP );
00153     SMimeConfigurationLayout->addWidget( LDAPGroupBox );
00154     spacer23 = new QSpacerItem( 20, 73, QSizePolicy::Minimum, QSizePolicy::Expanding );
00155     SMimeConfigurationLayout->addItem( spacer23 );
00156     languageChange();
00157     resize( QSize(557, 586).expandedTo(minimumSizeHint()) );
00158     clearWState( WState_Polished );
00159 
00160     // signals and slots connections
00161     connect( CRLRB, SIGNAL( toggled(bool) ), OCSPGroupBox, SLOT( setDisabled(bool) ) );
00162     connect( OCSPRB, SIGNAL( toggled(bool) ), OCSPGroupBox, SLOT( setEnabled(bool) ) );
00163     connect( useCustomHTTPProxyRB, SIGNAL( toggled(bool) ), customHTTPProxy, SLOT( setEnabled(bool) ) );
00164     connect( honorHTTPProxyRB, SIGNAL( toggled(bool) ), customHTTPProxy, SLOT( setDisabled(bool) ) );
00165     connect( disableLDAPCB, SIGNAL( toggled(bool) ), frameLDAP, SLOT( setDisabled(bool) ) );
00166 }
00167 
00168 /*
00169  *  Destroys the object and frees any allocated resources
00170  */
00171 SMimeConfiguration::~SMimeConfiguration()
00172 {
00173     // no need to delete child widgets, Qt does it all for us
00174 }
00175 
00176 /*
00177  *  Sets the strings of the subwidgets using the current
00178  *  language.
00179  */
00180 void SMimeConfiguration::languageChange()
00181 {
00182     CRLRB->setText( tr2i18n( "Validate certificates using CRLs" ) );
00183     QWhatsThis::add( CRLRB, tr2i18n( "If this option is selected, S/MIME certificates are validated using Certificate Revocation Lists (CRLs)." ) );
00184     OCSPRB->setText( tr2i18n( "Validate certificates online (OCSP)" ) );
00185     QWhatsThis::add( OCSPRB, tr2i18n( "If this option is selected, S/MIME certificates are validated online using the Online Certificates Status Protocol (OCSP). Fill in the URL of the OCSP responder below." ) );
00186     OCSPGroupBox->setTitle( tr2i18n( "Online Certificate Validation" ) );
00187     textLabel1->setText( tr2i18n( "OCSP responder URL:" ) );
00188     QWhatsThis::add( OCSPResponderURL, tr2i18n( "Enter here the address of the server for online validation of certificates (OCSP responder). The URL is usually starting with http://." ) );
00189     textLabel2->setText( tr2i18n( "OCSP responder signature:" ) );
00190     ignoreServiceURLCB->setText( tr2i18n( "Ignore service URL of certificates" ) );
00191     doNotCheckCertPolicyCB->setText( tr2i18n( "Do not check certificate policies" ) );
00192     QWhatsThis::add( doNotCheckCertPolicyCB, tr2i18n( "By default GnuPG uses the file ~/.gnupg/policies.txt to check if a certificate policy is allowed. If this option is selected, policies are not checked." ) );
00193     neverConsultCB->setText( tr2i18n( "Never consult a CRL" ) );
00194     QWhatsThis::add( neverConsultCB, tr2i18n( "If this option is checked, Certificate Revocation Lists are never used to validate S/MIME certificates." ) );
00195     fetchMissingCB->setText( tr2i18n( "Fetch missing issuer certificates" ) );
00196     QWhatsThis::add( fetchMissingCB, tr2i18n( "If this option is checked, missing issuer certificates are fetched when necessary (this applies to both validation methods, CRLs and OCSP)" ) );
00197     HTTPGroupBox->setTitle( tr2i18n( "HTTP Requests" ) );
00198     disableHTTPCB->setText( tr2i18n( "Do not perform any HTTP requests" ) );
00199     QWhatsThis::add( disableHTTPCB, tr2i18n( "Entirely disables the use of HTTP for S/MIME." ) );
00200     systemHTTPProxy->setText( tr2i18n( "no proxy" ) );
00201     useCustomHTTPProxyRB->setText( tr2i18n( "Use this proxy for HTTP requests: " ) );
00202     honorHTTPProxyRB->setText( tr2i18n( "Use system HTTP proxy:" ) );
00203     QWhatsThis::add( honorHTTPProxyRB, tr2i18n( "If this option is selected, the value of the HTTP proxy shown on the right (which comes from the environment variable http_proxy) will be used for any HTTP request." ) );
00204     QWhatsThis::add( customHTTPProxy, tr2i18n( "Enter here the location of your HTTP Proxy, which will be used for all HTTP requests relating to S/MIME. The syntax is host:port, for instance myproxy.nowhere.com:3128." ) );
00205     ignoreHTTPDPCB->setText( tr2i18n( "Ignore HTTP CRL distribution point of certificates" ) );
00206     QWhatsThis::add( ignoreHTTPDPCB, tr2i18n( "When looking for the location of a CRL, the to-be-tested certificate usually contains what are known as \"CRL Distribution Point\" (DP) entries, which are URLs describing the way to access the URL. The first found DP entry is used.  With this option all entries using the HTTP scheme are ignored when looking for a suitable DP." ) );
00207     LDAPGroupBox->setTitle( tr2i18n( "LDAP Requests" ) );
00208     disableLDAPCB->setText( tr2i18n( "Do not perform any LDAP requests" ) );
00209     QWhatsThis::add( disableLDAPCB, tr2i18n( "Entirely disables the use of LDAP for S/MIME." ) );
00210     ignoreLDAPDPCB->setText( tr2i18n( "Ignore LDAP CRL distribution point of certificates" ) );
00211     QWhatsThis::add( ignoreLDAPDPCB, tr2i18n( "When looking for the location of a CRL, the to-be-tested certificate usually contains what are known as \"CRL Distribution Point\" (DP) entries, which are URLs describing the way to access the URL. The first found DP entry is used.  With this option all entries using the LDAP scheme are ignored when looking for a suitable DP." ) );
00212     customLDAPLabel->setText( tr2i18n( "Primary host for LDAP requests:" ) );
00213     QWhatsThis::add( customLDAPProxy, tr2i18n( "Entering a LDAP server here will make all LDAP requests go to that server first. More precisely, this setting overrides any specified host and port part in a LDAP URL and will also be used if host and port have been omitted from the URL. Other LDAP servers will be used only if the connection to the \"proxy\" failed.\n"
00214 "The syntax is \"HOST\" or \"HOST:PORT\". If PORT is omitted, port 389 (standard LDAP port) is used." ) );
00215 }
00216 
00217 #include "smimeconfiguration.moc"