00001 #include <kdialog.h>
00002 #include <klocale.h>
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include "smimeconfiguration.h"
00013
00014 #include <qvariant.h>
00015 #include <qpushbutton.h>
00016 #include <qradiobutton.h>
00017 #include <qgroupbox.h>
00018 #include <qlabel.h>
00019 #include <qlineedit.h>
00020 #include <qcheckbox.h>
00021 #include <qbuttongroup.h>
00022 #include <qframe.h>
00023 #include <qlayout.h>
00024 #include <qtooltip.h>
00025 #include <qwhatsthis.h>
00026 #include "../certmanager/lib/ui/keyrequester.h"
00027
00028
00029
00030
00031
00032 SMimeConfiguration::SMimeConfiguration( QWidget* parent, const char* name, WFlags fl )
00033 : QWidget( parent, name, fl )
00034 {
00035 if ( !name )
00036 setName( "SMimeConfiguration" );
00037 SMimeConfigurationLayout = new QVBoxLayout( this, 11, 6, "SMimeConfigurationLayout");
00038
00039 CRLRB = new QRadioButton( this, "CRLRB" );
00040 CRLRB->setChecked( TRUE );
00041 SMimeConfigurationLayout->addWidget( CRLRB );
00042
00043 OCSPRB = new QRadioButton( this, "OCSPRB" );
00044 SMimeConfigurationLayout->addWidget( OCSPRB );
00045
00046 OCSPGroupBox = new QGroupBox( this, "OCSPGroupBox" );
00047 OCSPGroupBox->setColumnLayout(0, Qt::Vertical );
00048 OCSPGroupBox->layout()->setSpacing( 6 );
00049 OCSPGroupBox->layout()->setMargin( 11 );
00050 OCSPGroupBoxLayout = new QVBoxLayout( OCSPGroupBox->layout() );
00051 OCSPGroupBoxLayout->setAlignment( Qt::AlignTop );
00052
00053 layout4 = new QHBoxLayout( 0, 0, 6, "layout4");
00054
00055 textLabel1 = new QLabel( OCSPGroupBox, "textLabel1" );
00056 layout4->addWidget( textLabel1 );
00057
00058 OCSPResponderURL = new QLineEdit( OCSPGroupBox, "OCSPResponderURL" );
00059 layout4->addWidget( OCSPResponderURL );
00060 OCSPGroupBoxLayout->addLayout( layout4 );
00061
00062 layout5 = new QHBoxLayout( 0, 0, 6, "layout5");
00063
00064 textLabel2 = new QLabel( OCSPGroupBox, "textLabel2" );
00065 layout5->addWidget( textLabel2 );
00066
00067 OCSPResponderSignature = new Kleo::KeyRequester( OCSPGroupBox, "OCSPResponderSignature" );
00068 layout5->addWidget( OCSPResponderSignature );
00069 spacer7 = new QSpacerItem( 150, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
00070 layout5->addItem( spacer7 );
00071 OCSPGroupBoxLayout->addLayout( layout5 );
00072
00073 ignoreServiceURLCB = new QCheckBox( OCSPGroupBox, "ignoreServiceURLCB" );
00074 OCSPGroupBoxLayout->addWidget( ignoreServiceURLCB );
00075 SMimeConfigurationLayout->addWidget( OCSPGroupBox );
00076
00077 doNotCheckCertPolicyCB = new QCheckBox( this, "doNotCheckCertPolicyCB" );
00078 SMimeConfigurationLayout->addWidget( doNotCheckCertPolicyCB );
00079
00080 neverConsultCB = new QCheckBox( this, "neverConsultCB" );
00081 SMimeConfigurationLayout->addWidget( neverConsultCB );
00082
00083 fetchMissingCB = new QCheckBox( this, "fetchMissingCB" );
00084 SMimeConfigurationLayout->addWidget( fetchMissingCB );
00085
00086 HTTPGroupBox = new QButtonGroup( this, "HTTPGroupBox" );
00087 HTTPGroupBox->setColumnLayout(0, Qt::Vertical );
00088 HTTPGroupBox->layout()->setSpacing( 6 );
00089 HTTPGroupBox->layout()->setMargin( 11 );
00090 HTTPGroupBoxLayout = new QVBoxLayout( HTTPGroupBox->layout() );
00091 HTTPGroupBoxLayout->setAlignment( Qt::AlignTop );
00092
00093 disableHTTPCB = new QCheckBox( HTTPGroupBox, "disableHTTPCB" );
00094 HTTPGroupBoxLayout->addWidget( disableHTTPCB );
00095
00096 frameHTTP = new QFrame( HTTPGroupBox, "frameHTTP" );
00097 frameHTTP->setFrameShape( QFrame::NoFrame );
00098 frameHTTP->setFrameShadow( QFrame::Plain );
00099 frameHTTPLayout = new QGridLayout( frameHTTP, 1, 1, 0, 6, "frameHTTPLayout");
00100
00101 layout5_2 = new QGridLayout( 0, 1, 1, 0, 6, "layout5_2");
00102
00103 systemHTTPProxy = new QLabel( frameHTTP, "systemHTTPProxy" );
00104
00105 layout5_2->addWidget( systemHTTPProxy, 0, 1 );
00106
00107 useCustomHTTPProxyRB = new QRadioButton( frameHTTP, "useCustomHTTPProxyRB" );
00108
00109 layout5_2->addWidget( useCustomHTTPProxyRB, 1, 0 );
00110
00111 honorHTTPProxyRB = new QRadioButton( frameHTTP, "honorHTTPProxyRB" );
00112
00113 layout5_2->addWidget( honorHTTPProxyRB, 0, 0 );
00114
00115 customHTTPProxy = new QLineEdit( frameHTTP, "customHTTPProxy" );
00116
00117 layout5_2->addWidget( customHTTPProxy, 1, 1 );
00118
00119 frameHTTPLayout->addMultiCellLayout( layout5_2, 1, 1, 0, 1 );
00120
00121 ignoreHTTPDPCB = new QCheckBox( frameHTTP, "ignoreHTTPDPCB" );
00122
00123 frameHTTPLayout->addWidget( ignoreHTTPDPCB, 0, 0 );
00124 HTTPGroupBoxLayout->addWidget( frameHTTP );
00125 SMimeConfigurationLayout->addWidget( HTTPGroupBox );
00126
00127 LDAPGroupBox = new QGroupBox( this, "LDAPGroupBox" );
00128 LDAPGroupBox->setColumnLayout(0, Qt::Vertical );
00129 LDAPGroupBox->layout()->setSpacing( 6 );
00130 LDAPGroupBox->layout()->setMargin( 11 );
00131 LDAPGroupBoxLayout = new QVBoxLayout( LDAPGroupBox->layout() );
00132 LDAPGroupBoxLayout->setAlignment( Qt::AlignTop );
00133
00134 disableLDAPCB = new QCheckBox( LDAPGroupBox, "disableLDAPCB" );
00135 LDAPGroupBoxLayout->addWidget( disableLDAPCB );
00136
00137 frameLDAP = new QFrame( LDAPGroupBox, "frameLDAP" );
00138 frameLDAP->setFrameShape( QFrame::NoFrame );
00139 frameLDAP->setFrameShadow( QFrame::Plain );
00140 frameLDAPLayout = new QVBoxLayout( frameLDAP, 0, 6, "frameLDAPLayout");
00141
00142 ignoreLDAPDPCB = new QCheckBox( frameLDAP, "ignoreLDAPDPCB" );
00143 frameLDAPLayout->addWidget( ignoreLDAPDPCB );
00144
00145 layout5_3 = new QHBoxLayout( 0, 0, 6, "layout5_3");
00146
00147 customLDAPLabel = new QLabel( frameLDAP, "customLDAPLabel" );
00148 layout5_3->addWidget( customLDAPLabel );
00149
00150 customLDAPProxy = new QLineEdit( frameLDAP, "customLDAPProxy" );
00151 layout5_3->addWidget( customLDAPProxy );
00152 frameLDAPLayout->addLayout( layout5_3 );
00153 LDAPGroupBoxLayout->addWidget( frameLDAP );
00154 SMimeConfigurationLayout->addWidget( LDAPGroupBox );
00155 spacer23 = new QSpacerItem( 20, 73, QSizePolicy::Minimum, QSizePolicy::Expanding );
00156 SMimeConfigurationLayout->addItem( spacer23 );
00157 languageChange();
00158 resize( QSize(557, 586).expandedTo(minimumSizeHint()) );
00159 clearWState( WState_Polished );
00160
00161
00162 connect( CRLRB, SIGNAL( toggled(bool) ), OCSPGroupBox, SLOT( setDisabled(bool) ) );
00163 connect( OCSPRB, SIGNAL( toggled(bool) ), OCSPGroupBox, SLOT( setEnabled(bool) ) );
00164 connect( useCustomHTTPProxyRB, SIGNAL( toggled(bool) ), customHTTPProxy, SLOT( setEnabled(bool) ) );
00165 connect( honorHTTPProxyRB, SIGNAL( toggled(bool) ), customHTTPProxy, SLOT( setDisabled(bool) ) );
00166 connect( disableLDAPCB, SIGNAL( toggled(bool) ), frameLDAP, SLOT( setDisabled(bool) ) );
00167 }
00168
00169
00170
00171
00172 SMimeConfiguration::~SMimeConfiguration()
00173 {
00174
00175 }
00176
00177
00178
00179
00180
00181 void SMimeConfiguration::languageChange()
00182 {
00183 CRLRB->setText( tr2i18n( "Validate certificates using CRLs" ) );
00184 QWhatsThis::add( CRLRB, tr2i18n( "If this option is selected, S/MIME certificates are validated using Certificate Revocation Lists (CRLs)." ) );
00185 OCSPRB->setText( tr2i18n( "Validate certificates online (OCSP)" ) );
00186 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." ) );
00187 OCSPGroupBox->setTitle( tr2i18n( "Online Certificate Validation" ) );
00188 textLabel1->setText( tr2i18n( "OCSP responder URL:" ) );
00189 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://." ) );
00190 textLabel2->setText( tr2i18n( "OCSP responder signature:" ) );
00191 ignoreServiceURLCB->setText( tr2i18n( "Ignore service URL of certificates" ) );
00192 doNotCheckCertPolicyCB->setText( tr2i18n( "Do not check certificate policies" ) );
00193 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." ) );
00194 neverConsultCB->setText( tr2i18n( "Never consult a CRL" ) );
00195 QWhatsThis::add( neverConsultCB, tr2i18n( "If this option is checked, Certificate Revocation Lists are never used to validate S/MIME certificates." ) );
00196 fetchMissingCB->setText( tr2i18n( "Fetch missing issuer certificates" ) );
00197 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)" ) );
00198 HTTPGroupBox->setTitle( tr2i18n( "HTTP Requests" ) );
00199 disableHTTPCB->setText( tr2i18n( "Do not perform any HTTP requests" ) );
00200 QWhatsThis::add( disableHTTPCB, tr2i18n( "Entirely disables the use of HTTP for S/MIME." ) );
00201 systemHTTPProxy->setText( tr2i18n( "no proxy" ) );
00202 useCustomHTTPProxyRB->setText( tr2i18n( "Use this proxy for HTTP requests: " ) );
00203 honorHTTPProxyRB->setText( tr2i18n( "Use system HTTP proxy:" ) );
00204 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." ) );
00205 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." ) );
00206 ignoreHTTPDPCB->setText( tr2i18n( "Ignore HTTP CRL distribution point of certificates" ) );
00207 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." ) );
00208 LDAPGroupBox->setTitle( tr2i18n( "LDAP Requests" ) );
00209 disableLDAPCB->setText( tr2i18n( "Do not perform any LDAP requests" ) );
00210 QWhatsThis::add( disableLDAPCB, tr2i18n( "Entirely disables the use of LDAP for S/MIME." ) );
00211 ignoreLDAPDPCB->setText( tr2i18n( "Ignore LDAP CRL distribution point of certificates" ) );
00212 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." ) );
00213 customLDAPLabel->setText( tr2i18n( "Primary host for LDAP requests:" ) );
00214 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"
00215 "The syntax is \"HOST\" or \"HOST:PORT\". If PORT is omitted, port 389 (standard LDAP port) is used." ) );
00216 }
00217
00218 #include "smimeconfiguration.moc"