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

List:       kde-commits
Subject:    branches/kdepim/enterprise/kdepim/certmanager/lib/ui
From:       Pradeepto Bhattacharya <pradeepto () kde ! org>
Date:       2008-06-17 6:46:45
Message-ID: 1213685205.660707.12068.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 821346 by pradeepto:

 -- kolab/issue2568  (kolab/merge79) - Merging from proko2. Adding a "Start \
Certificate Manager" buttong the kleo's Encryption Key Selection Dialog.


 M  +25 -5     keyselectiondialog.cpp  
 M  +6 -1      keyselectiondialog.h  


--- branches/kdepim/enterprise/kdepim/certmanager/lib/ui/keyselectiondialog.cpp \
#821345:821346 @@ -2,7 +2,7 @@
     keyselectiondialog.cpp
 
     This file is part of libkleopatra, the KDE keymanagement library
-    Copyright (c) 2004 Klarälvdalens Datakonsult AB
+    Copyright (c) 2004 Klarävdalens Datakonsult AB
 
     Based on kpgpui.cpp
     Copyright (C) 2001,2002 the KPGP authors
@@ -60,6 +60,7 @@
 #include <kwin.h>
 #include <kconfig.h>
 #include <kmessagebox.h>
+#include <kprocess.h>
 
 // Qt
 #include <qcheckbox.h>
@@ -295,7 +296,7 @@
 					      bool rememberChoice,
 					      QWidget * parent, const char * name,
 					      bool modal )
-  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel, Ok ),
+  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel|Help, Ok ),
     mOpenPGPBackend( 0 ),
     mSMIMEBackend( 0 ),
     mRememberCB( 0 ),
@@ -314,7 +315,7 @@
 					      bool rememberChoice,
 					      QWidget * parent, const char * name,
 					      bool modal )
-  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel, Ok ),
+  : KDialogBase( parent, name, modal, title, Default|Ok|Cancel|Help, Ok ),
     mOpenPGPBackend( 0 ),
     mSMIMEBackend( 0 ),
     mRememberCB( 0 ),
@@ -391,8 +392,9 @@
            SLOT(slotRMB(Kleo::KeyListViewItem*,const QPoint&)) );
 
   setButtonText( KDialogBase::Default, i18n("&Reread Keys") );
-  connect( this, SIGNAL(defaultClicked()),
-           this, SLOT(slotRereadKeys()) );
+  setButtonGuiItem( KDialogBase::Help, i18n("&Start Certificate Manager") );
+  connect( this, SIGNAL(defaultClicked()), this, SLOT(slotRereadKeys()) );
+  connect( this, SIGNAL(helpClicked()), this, SLOT(slotStartCertificateManager()) );
 
   slotRereadKeys();
   mTopLayout->activate();
@@ -493,6 +495,24 @@
   }
 }
 
+void Kleo::KeySelectionDialog::slotHelp()
+{
+    emit helpClicked();
+}
+
+void Kleo::KeySelectionDialog::slotStartCertificateManager()
+{
+  KProcess certManagerProc;
+  certManagerProc << "kleopatra";
+
+  if( !certManagerProc.start( KProcess::DontCare ) )
+    KMessageBox::error( this, i18n( "Could not start certificate manager; "
+                                    "please check your installation." ),
+                                    i18n( "Certificate Manager Error" ) );
+  else
+    kdDebug(5006) << "\nslotStartCertManager(): certificate manager started.\n" << \
endl; +}
+
 #ifndef __KLEO_UI_SHOW_KEY_LIST_ERROR_H__
 #define __KLEO_UI_SHOW_KEY_LIST_ERROR_H__
 static void showKeyListError( QWidget * parent, const GpgME::Error & err ) {
--- branches/kdepim/enterprise/kdepim/certmanager/lib/ui/keyselectiondialog.h \
#821345:821346 @@ -2,7 +2,7 @@
     keyselectiondialog.h
 
     This file is part of libkleopatra, the KDE keymanagement library
-    Copyright (c) 2004 Klarälvdalens Datakonsult AB
+    Copyright (c) 2004 Klarävdalens Datakonsult AB
 
     Based on kpgpui.h
     Copyright (C) 2001,2002 the KPGP authors
@@ -119,12 +119,17 @@
     QStringList smimeFingerprints() const;
 
     bool rememberSelection() const;
+  protected slots:
+    // reimplemented to avoid popping up the help, since we
+    // override the button
+    void slotHelp();
 
     // Could be used by derived classes to insert their own widget
     QVBoxLayout* topLayout() const { return mTopLayout; }
 
   private slots:
     void slotRereadKeys();
+    void slotStartCertificateManager();
     void slotKeyListResult( const GpgME::KeyListResult & );
     void slotSelectionChanged();
     void slotCheckSelection() { slotCheckSelection( 0 ); }


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

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