• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdepim
  • Sitemap
  • Contact Us
 

kleopatra

changepassphrasecommand.cpp

Go to the documentation of this file.
00001 /* -*- mode: c++; c-basic-offset:4 -*-
00002     commands/changepassphrasecommand.cpp
00003 
00004     This file is part of Kleopatra, the KDE keymanager
00005     Copyright (c) 2008 Klarälvdalens Datakonsult AB
00006 
00007     Kleopatra is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     Kleopatra is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021     In addition, as a special exception, the copyright holders give
00022     permission to link the code of this program with any edition of
00023     the Qt library by Trolltech AS, Norway (or with modified versions
00024     of Qt that use the same license as Qt), and distribute linked
00025     combinations including the two.  You must obey the GNU General
00026     Public License in all respects for all of the code used other than
00027     Qt.  If you modify this file, you may extend this exception to
00028     your version of the file, but you are not obligated to do so.  If
00029     you do not wish to do so, delete this exception statement from
00030     your version.
00031 */
00032 
00033 #include <config-kleopatra.h>
00034 
00035 #include "changepassphrasecommand.h"
00036 
00037 #include "command_p.h"
00038 
00039 #include <utils/gnupg-helper.h>
00040 
00041 #include <gpgme++/key.h>
00042 
00043 #include <KLocale>
00044 #include <KMessageBox>
00045 
00046 using namespace Kleo;
00047 using namespace Kleo::Commands;
00048 using namespace GpgME;
00049 
00050 ChangePassphraseCommand::ChangePassphraseCommand( KeyListController * c )
00051     : GnuPGProcessCommand( c )
00052 {
00053 
00054 }
00055 
00056 ChangePassphraseCommand::ChangePassphraseCommand( QAbstractItemView * v, KeyListController * c )
00057     : GnuPGProcessCommand( v, c )
00058 {
00059 
00060 }
00061 
00062 ChangePassphraseCommand::ChangePassphraseCommand( const Key & key )
00063     : GnuPGProcessCommand( key )
00064 {
00065 
00066 }
00067 
00068 ChangePassphraseCommand::~ChangePassphraseCommand() {}
00069 
00070 QStringList ChangePassphraseCommand::arguments() const {
00071     const Key key = d->key();
00072     if ( key.protocol() == OpenPGP )
00073         return QStringList() << gpgPath() << "--batch" << "--edit-key" << key.primaryFingerprint() << "passwd";
00074     else
00075         return QStringList() << gpgSmPath() << "--passwd" << key.primaryFingerprint();
00076 }
00077 
00078 QString ChangePassphraseCommand::errorCaption() const {
00079     return i18n( "Passphrase Change Error" );
00080 }
00081 
00082 QString ChangePassphraseCommand::successCaption() const {
00083     return i18n( "Passphrase Change Finished" );
00084 }
00085 
00086 QString ChangePassphraseCommand::crashExitMessage( const QStringList & args ) const {
00087     return i18nc("@info",
00088                  "<para>The GPG or GpgSM process that tried to change the passphrase "
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 ChangePassphraseCommand::errorExitMessage( const QStringList & args ) const {
00094     return i18nc("@info",
00095                  "<para>An error occurred while trying to change the passphrase.</para> "
00096                  "<para>The output from <command>%1</command> was: <message>%2</message></para>",
00097                  args[0], errorString() );
00098 }
00099 
00100 QString ChangePassphraseCommand::successMessage( const QStringList & ) const {
00101     return i18n( "Passphrase changed successfully." );
00102 }
00103 
00104 #include "moc_changepassphrasecommand.cpp"

kleopatra

Skip menu "kleopatra"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdepim

Skip menu "kdepim"
  • akonadi
  •   clients
  •   kabc
  •   kcal
  •   kcm
  • akregator
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt
  • kdgantt1
  • kjots
  • kleopatra
  • kmail
  • kmobiletools
  • knode
  • knotes
  • kontact
  • kontactinterfaces
  • korganizer
  •   korgac
  • kpilot
  • ktimetracker
  • libkdepim
  • libkholidays
  • libkleo
  • libkpgp
  • maildir
Generated for kdepim by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal