kleopatra
refreshx509certscommand.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include <config-kleopatra.h>
00034
00035 #include "refreshx509certscommand.h"
00036
00037 #include <utils/gnupg-helper.h>
00038
00039 #include <KLocale>
00040 #include <KMessageBox>
00041
00042 using namespace Kleo;
00043 using namespace Kleo::Commands;
00044
00045 RefreshX509CertsCommand::RefreshX509CertsCommand( KeyListController * c )
00046 : GnuPGProcessCommand( c )
00047 {
00048
00049 }
00050
00051 RefreshX509CertsCommand::RefreshX509CertsCommand( QAbstractItemView * v, KeyListController * c )
00052 : GnuPGProcessCommand( v, c )
00053 {
00054
00055 }
00056
00057 RefreshX509CertsCommand::~RefreshX509CertsCommand() {}
00058
00059 bool RefreshX509CertsCommand::preStartHook( QWidget * parent ) const {
00060 return KMessageBox::warningContinueCancel( parent,
00061 i18nc("@info",
00062 "<para>Refreshing X.509 certificates implies downloading CRLs for all certificates, "
00063 "even if they might otherwise still be valid.</para>"
00064 "<para>This can put a severe strain on your own as well as other people's network "
00065 "connection, and can take up to an hour or more to complete, depending on "
00066 "your network connection, and the number of certificates to check.</para> "
00067 "<para>Are you sure you want to continue?</para>"),
00068 i18n("X.509 Certificate Refresh"),
00069 KStandardGuiItem::cont(), KStandardGuiItem::cancel(),
00070 QLatin1String( "warn-refresh-x509-expensive" ) )
00071 == KMessageBox::Continue;
00072 }
00073
00074 QStringList RefreshX509CertsCommand::arguments() const {
00075 return QStringList() << gpgSmPath() << "-k" << "--with-validation" << "--force-crl-refresh" << "--enable-crl-checks";
00076 }
00077
00078 QString RefreshX509CertsCommand::errorCaption() const {
00079 return i18n( "X.509 Certificate Refresh Error" );
00080 }
00081
00082 QString RefreshX509CertsCommand::successCaption() const {
00083 return i18n( "X.509 Certificate Refresh Finished" );
00084 }
00085
00086 QString RefreshX509CertsCommand::crashExitMessage( const QStringList & args ) const {
00087 return i18nc( "@info",
00088 "<para>The GpgSM process that tried to refresh X.509 certificates "
00089 "ended prematurely because of an unexpected error.</para>"
00090 "<para>Please check the output of <icode>%1</icode> for details.</para>", args.join( " " ) ) ;
00091 }
00092
00093 QString RefreshX509CertsCommand::errorExitMessage( const QStringList & args ) const {
00094 return i18nc( "@info",
00095 "<para>An error occurred while trying to refresh X.509 certificates.</para>"
00096 "<para>The output from <command>%1</command> was: <message>%2</message></para>",
00097 args[0], errorString() );
00098 }
00099
00100 QString RefreshX509CertsCommand::successMessage( const QStringList & ) const {
00101 return i18n( "X.509 certificates refreshed successfully." );
00102 }
00103
00104 #include "moc_refreshx509certscommand.cpp"