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

List:       kde-commits
Subject:    kdepim/certmanager/lib/backends/qgpgme
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-05-16 22:11:40
Message-ID: 20040516221140.310948EA6 () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Error dialog for combined sign/ecnrypt operation.


  M +14 -2     qgpgmesignencryptjob.cpp   1.7
  M +10 -0     qgpgmesignencryptjob.h   1.6


--- kdepim/certmanager/lib/backends/qgpgme/qgpgmesignencryptjob.cpp  #1.6:1.7
@@ -37,10 +37,11 @@
 #include "qgpgmesignencryptjob.h"
 
+#include <klocale.h>
+#include <kmessagebox.h>
+
 #include <qgpgme/eventloopinteractor.h>
 #include <qgpgme/dataprovider.h>
 
 #include <gpgmepp/context.h>
-#include <gpgmepp/signingresult.h>
-#include <gpgmepp/encryptionresult.h>
 #include <gpgmepp/data.h>
 #include <gpgmepp/key.h>
@@ -109,3 +110,14 @@ void Kleo::QGpgMESignEncryptJob::doOpera
 }
 
+void Kleo::QGpgMESignEncryptJob::showErrorDialog( QWidget * parent ) const {
+  if ( !mResult.first.error() && !mResult.second.error() )
+    return;
+  if ( mResult.first.error().isCanceled() || mResult.second.error().isCanceled() )
+    return;
+  const QString msg = mResult.first.error()
+    ? i18n("Signing failed: %1" ).arg( QString::fromLocal8Bit( mResult.first.error().asString() ) )
+    : i18n("Encryption failed: %1").arg( QString::fromLocal8Bit( mResult.second.error().asString() ) ) ;
+  KMessageBox::error( parent, msg );
+}
+
 #include "qgpgmesignencryptjob.moc"

--- kdepim/certmanager/lib/backends/qgpgme/qgpgmesignencryptjob.h  #1.5:1.6
@@ -38,6 +38,11 @@
 #include "qgpgmejob.h"
 
+#include <gpgmepp/signingresult.h>
+#include <gpgmepp/encryptionresult.h>
+
 #include <qcstring.h>
 
+#include <utility>
+
 namespace GpgME {
   class Error;
@@ -65,4 +70,7 @@ namespace Kleo {
             QByteArray & cipherText );
 
+    /*! \reimp from Job */
+    void showErrorDialog( QWidget * parent ) const;
+
   private slots:
     void slotOperationDoneEvent( GpgME::Context * context, const GpgME::Error & e ) {
@@ -74,4 +82,6 @@ namespace Kleo {
     GpgME::Error setup( const std::vector<GpgME::Key> &,
                         const QByteArray & );
+  private:
+    std::pair<GpgME::SigningResult,GpgME::EncryptionResult> mResult;
   };
 


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

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