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

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim
From:       Marc Mutz <mutz () kde ! org>
Date:       2010-08-06 14:30:34
Message-ID: 20100806143034.A6D2DAC7CA () svn ! kde ! org
[Download RAW message or body]

SVN commit 1159934 by mutz:

Kleo::KeySelectionDialog: add button to fire up the certmanager with an email address to look for

Implements kolab/issue4484.

 M  +26 -1     certmanager/lib/ui/keyselectiondialog.cpp  
 M  +13 -0     certmanager/lib/ui/keyselectiondialog.h  
 M  +1 -1      kmail/keyresolver.cpp  


--- branches/kdepim/enterprise/kdepim/certmanager/lib/ui/keyselectiondialog.cpp #1159933:1159934
@@ -317,22 +317,45 @@
 Kleo::KeySelectionDialog::KeySelectionDialog( const QString & title,
 					      const QString & text,
 					      const QString & initialQuery,
+					      const std::vector<GpgME::Key> & selectedKeys,
 					      unsigned int keyUsage,
 					      bool extendedSelection,
 					      bool rememberChoice,
 					      QWidget * parent, const char * name,
 					      bool modal )
-  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel|Help, Ok ),
+  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel|Help|User1, Ok ),
     mOpenPGPBackend( 0 ),
     mSMIMEBackend( 0 ),
     mRememberCB( 0 ),
+    mSelectedKeys( selectedKeys ),
     mKeyUsage( keyUsage ),
     mSearchText( initialQuery ),
+    mInitialQuery( initialQuery ),
     mCurrentContextMenuItem( 0 )
 {
   init( rememberChoice, extendedSelection, text, initialQuery );
 }
 
+Kleo::KeySelectionDialog::KeySelectionDialog( const QString & title,
+					      const QString & text,
+					      const QString & initialQuery,
+					      unsigned int keyUsage,
+					      bool extendedSelection,
+					      bool rememberChoice,
+					      QWidget * parent, const char * name,
+					      bool modal )
+  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel|Help|User1, Ok ),
+    mOpenPGPBackend( 0 ),
+    mSMIMEBackend( 0 ),
+    mRememberCB( 0 ),
+    mKeyUsage( keyUsage ),
+    mSearchText( initialQuery ),
+    mInitialQuery( initialQuery ),
+    mCurrentContextMenuItem( 0 )
+{
+  init( rememberChoice, extendedSelection, text, initialQuery );
+}
+
 void Kleo::KeySelectionDialog::init( bool rememberChoice, bool extendedSelection,
 				     const QString & text, const QString & initialQuery ) {
   if ( mKeyUsage & OpenPGPKeys )
@@ -408,8 +431,10 @@
 
   setButtonText( KDialogBase::Default, i18n("&Reread Keys") );
   setButtonGuiItem( KDialogBase::Help, i18n("&Start Certificate Manager") );
+  setButtonGuiItem( KDialogBase::User1, i18n("Search for &External Certificates") );
   connect( this, SIGNAL(defaultClicked()), this, SLOT(slotRereadKeys()) );
   connect( this, SIGNAL(helpClicked()), this, SLOT(slotStartCertificateManager()) );
+  connect( this, SIGNAL(user1Clicked()), this, SLOT(slotStartSearchForExternalCertificates()) );
 
   slotRereadKeys();
   mTopLayout->activate();
--- branches/kdepim/enterprise/kdepim/certmanager/lib/ui/keyselectiondialog.h #1159933:1159934
@@ -94,11 +94,20 @@
     KeySelectionDialog( const QString & title,
                         const QString & text,
 			const QString & initialPattern,
+			const std::vector<GpgME::Key> & selectedKeys,
                         unsigned int keyUsage=AllKeys,
                         bool extendedSelection=false,
 			bool rememberChoice=false,
                         QWidget * parent=0, const char * name=0,
                         bool modal=true );
+    KeySelectionDialog( const QString & title,
+                        const QString & text,
+			const QString & initialPattern,
+                        unsigned int keyUsage=AllKeys,
+                        bool extendedSelection=false,
+			bool rememberChoice=false,
+                        QWidget * parent=0, const char * name=0,
+                        bool modal=true );
     ~KeySelectionDialog();
 
     /** Returns the key ID of the selected key in single selection mode.
@@ -130,6 +139,9 @@
   private slots:
     void slotRereadKeys();
     void slotStartCertificateManager( const QString &query = QString() );
+    void slotStartSearchForExternalCertificates() {
+      slotStartCertificateManager( mInitialQuery );
+    }
     void slotKeyListResult( const GpgME::KeyListResult & );
     void slotSelectionChanged();
     void slotCheckSelection() { slotCheckSelection( 0 ); }
@@ -170,6 +182,7 @@
     QTimer * mStartSearchTimer;
     // cross-eventloop temporaries:
     QString mSearchText;
+    const QString mInitialQuery;
     Kleo::KeyListViewItem * mCurrentContextMenuItem;
     int mTruncated, mListJobCount, mSavedOffsetY;
   };
--- branches/kdepim/enterprise/kdepim/kmail/keyresolver.cpp #1159933:1159934
@@ -1583,7 +1583,7 @@
   const bool x509 = containsSMIME( mCryptoMessageFormats );
 
   Kleo::KeySelectionDialog dlg( i18n("Encryption Key Selection"),
-				msg, selectedKeys,
+				msg, KPIM::getEmailAddress(person), selectedKeys,
                                 Kleo::KeySelectionDialog::ValidEncryptionKeys
                                 & ~(opgp ? 0 : Kleo::KeySelectionDialog::OpenPGPKeys)
                                 & ~(x509 ? 0 : Kleo::KeySelectionDialog::SMIMEKeys),
[prev in list] [next in list] [prev in thread] [next in thread] 

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