[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-pim
Subject:    Re: [Kde-pim] KMail's Security settings
From:       David Faure <dfaure () klaralvdalens-datakonsult ! se>
Date:       2004-08-09 19:38:14
Message-ID: 200408092138.15977.dfaure () klaralvdalens-datakonsult ! se
[Download RAW message or body]

On Friday 23 July 2004 17:51, André Wöbbeking wrote:
> Hi,
> 
> David already fixed most connects but he missed the group box on the 
> Warnings tab. The group box is checkable but a change doesn't enable 
> the Apply button. And the state of the group box is neither read nor 
> written to the config file.

Indeed :/

Fixed by the attached patch - OK to commit?

-- 
David Faure -- faure@kde.org, dfaure@klaralvdalens-datakonsult.se
Qt/KDE/KOffice developer
Klarälvdalens Datakonsult AB, Platform-independent software solutions

["diff" (text/x-diff)]

Index: warningconfiguration.ui
===================================================================
RCS file: /home/kde/kdepim/kmail/warningconfiguration.ui,v
retrieving revision 1.2
diff -u -p -r1.2 warningconfiguration.ui
--- warningconfiguration.ui	29 May 2004 19:13:38 -0000	1.2
+++ warningconfiguration.ui	9 Aug 2004 19:36:55 -0000
@@ -84,7 +84,7 @@ It is recommended to leave this option t
         </widget>
         <widget class="QGroupBox">
             <property name="name">
-                <cstring>groupBox8</cstring>
+                <cstring>warnGroupBox</cstring>
             </property>
             <property name="title">
                 <string>Warn if certificates/keys expire soon (configure thresholds \
                below)</string>
Index: configuredialog.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/configuredialog.cpp,v
retrieving revision 1.464.2.16
diff -u -p -r1.464.2.16 configuredialog.cpp
--- configuredialog.cpp	22 Jul 2004 23:13:50 -0000	1.464.2.16
+++ configuredialog.cpp	9 Aug 2004 19:36:58 -0000
@@ -3564,6 +3564,7 @@ SecurityPageWarningTab::SecurityPageWarn
   mWidget = new WarningConfiguration( this );
   vlay->addWidget( mWidget );
 
+  connect( mWidget->warnGroupBox, SIGNAL(toggled(bool)), SLOT(slotEmitChanged()) );
   connect( mWidget->mWarnUnsigned, SIGNAL(toggled(bool)), SLOT(slotEmitChanged()) );
   connect( mWidget->warnUnencryptedCB, SIGNAL(toggled(bool)), \
SLOT(slotEmitChanged()) );  connect( mWidget->warnReceiverNotInCertificateCB, \
SIGNAL(toggled(bool)), SLOT(slotEmitChanged()) ); @@ -3586,6 +3587,10 @@ void \
SecurityPage::WarningTab::load() {  mWidget->mWarnUnsigned->setChecked( \
composer.readBoolEntry( "crypto-warning-unsigned", false ) );  \
mWidget->warnReceiverNotInCertificateCB->setChecked( composer.readBoolEntry( \
"crypto-warn-recv-not-in-cert", true ) );  
+  // The "-int" part of the key name is because there used to be a separate boolean
+  // config entry for enabling/disabling. This is done with the single bool value \
now. +  mWidget->warnGroupBox->setChecked( composer.readBoolEntry( \
"crypto-warn-when-near-expire", true ) ); +
   mWidget->mWarnSignKeyExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-key-near-expire-int", 14 ) );  \
mWidget->mWarnSignChainCertExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-chaincert-near-expire-int", 14 ) );  \
mWidget->mWarnSignRootCertExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-root-near-expire-int", 14 ) ); @@ -3607,12 +3612,15 @@ void \
SecurityPage::WarningTab::installPr  if ( composer.hasKey( \
                "crypto-warn-recv-not-in-cert" ) )
     mWidget->warnReceiverNotInCertificateCB->setChecked( composer.readBoolEntry( \
"crypto-warn-recv-not-in-cert" ) );  
+  if ( composer.hasKey( "crypto-warn-when-near-expire" ) )
+    mWidget->warnGroupBox->setChecked( composer.readBoolEntry( \
"crypto-warn-when-near-expire" ) ); +
   if ( composer.hasKey( "crypto-warn-sign-key-near-expire-int" ) )
-    mWidget->mWarnSignKeyExpiresSB->setValue( composer.readBoolEntry( \
"crypto-warn-sign-key-near-expire-int" ) ); +    \
mWidget->mWarnSignKeyExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-key-near-expire-int" ) );  if ( composer.hasKey( \
                "crypto-warn-sign-chaincert-near-expire-int" ) )
-    mWidget->mWarnSignChainCertExpiresSB->setValue( composer.readBoolEntry( \
"crypto-warn-sign-chaincert-near-expire-int" ) ); +    \
mWidget->mWarnSignChainCertExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-chaincert-near-expire-int" ) );  if ( composer.hasKey( \
                "crypto-warn-sign-root-near-expire-int" ) )
-    mWidget->mWarnSignRootCertExpiresSB->setValue( composer.readBoolEntry( \
"crypto-warn-sign-root-near-expire-int" ) ); +    \
mWidget->mWarnSignRootCertExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-sign-root-near-expire-int" ) );  
   if ( composer.hasKey( "crypto-warn-encr-key-near-expire-int" ) )
     mWidget->mWarnEncrKeyExpiresSB->setValue( composer.readNumEntry( \
"crypto-warn-encr-key-near-expire-int" ) ); @@ -3629,6 +3637,7 @@ void \
SecurityPage::WarningTab::save() {  composer.writeEntry( \
"crypto-warning-unencrypted", mWidget->warnUnencryptedCB->isChecked() );  \
composer.writeEntry( "crypto-warning-unsigned", mWidget->mWarnUnsigned->isChecked() \
);  
+  composer.writeEntry( "crypto-warn-when-near-expire", \
mWidget->warnGroupBox->isChecked() );  composer.writeEntry( \
"crypto-warn-sign-key-near-expire-int",  mWidget->mWarnSignKeyExpiresSB->value() );
   composer.writeEntry( "crypto-warn-sign-chaincert-near-expire-int",
Index: keyresolver.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/keyresolver.cpp,v
retrieving revision 1.7
diff -u -p -r1.7 keyresolver.cpp
--- keyresolver.cpp	1 Aug 2004 17:18:03 -0000	1.7
+++ keyresolver.cpp	9 Aug 2004 19:36:58 -0000
@@ -500,7 +500,7 @@ Kpgp::Result Kleo::KeyResolver::checkKey
     : ( sign
 	? signingKeyNearExpiryWarningThresholdInDays()
 	: encryptKeyNearExpiryWarningThresholdInDays() );
-  if ( daysTillExpiry <= threshold ) {
+  if ( threshold > -1 && daysTillExpiry <= threshold ) {
     const QString msg =
       key.protocol() == GpgME::Context::OpenPGP
       ? ( mine ? sign
Index: messagecomposer.cpp
===================================================================
RCS file: /home/kde/kdepim/kmail/messagecomposer.cpp,v
retrieving revision 1.28
diff -u -p -r1.28 messagecomposer.cpp
--- messagecomposer.cpp	1 Aug 2004 21:29:57 -0000	1.28
+++ messagecomposer.cpp	9 Aug 2004 19:36:59 -0000
@@ -107,36 +107,48 @@ static inline bool showKeyApprovalDialog
 
 static inline int encryptKeyNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( "crypto-warn-encr-key-near-expire-int", 14 \
);  return kMax( 1, num );
 }
 
 static inline int signingKeyNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( "crypto-warn-sign-key-near-expire-int", 14 \
);  return kMax( 1, num );
 }
 
 static inline int encryptRootCertNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( "crypto-warn-encr-root-near-expire-int", 14 \
);  return kMax( 1, num );
 }
 
 static inline int signingRootCertNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( "crypto-warn-sign-root-near-expire-int", 14 \
);  return kMax( 1, num );
 }
 
 static inline int encryptChainCertNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( \
"crypto-warn-encr-chaincert-near-expire-int", 14 );  return kMax( 1, num );
 }
 
 static inline int signingChainCertNearExpiryWarningThresholdInDays() {
   const KConfigGroup composer( KMKernel::config(), "Composer" );
+  if ( ! composer.readBoolEntry( "crypto-warn-when-near-expire", true ) )
+    return -1;
   const int num = composer.readNumEntry( \
"crypto-warn-sign-chaincert-near-expire-int", 14 );  return kMax( 1, num );
 }



_______________________________________________
kde-pim mailing list
kde-pim@mail.kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
kde-pim home page at http://pim.kde.org/

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic