Page MenuHome GnuPG

No OneTemporary

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8a30cd2a2..9bf07d63c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,318 +1,321 @@
project(kleopatra)
include(MacroOptionalAddSubdirectory)
set( kleopatra_version 2.0.9 )
set( kleopatra_release FALSE )
if (NOT kleopatra_release)
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
if ( NOT KdeSubversion_FOUND )
find_package( KdeSubversion )
endif ( NOT KdeSubversion_FOUND )
if ( KdeSubversion_FOUND )
KdeSubversion_WC_INFO( ${PROJECT_SOURCE_DIR} Kleopatra )
string( SUBSTRING "${Kleopatra_WC_LAST_CHANGED_DATE}" 0 10 Kleopatra_WC_LAST_CHANGED_DATE )
set( kleopatra_version "${kleopatra_version}-svn${Kleopatra_WC_REVISION} (${Kleopatra_WC_LAST_CHANGED_DATE})" )
endif ( KdeSubversion_FOUND )
endif (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
endif (NOT kleopatra_release)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config-kleopatra.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kleopatra.h )
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_SOURCE_DIR}/libkleo
${CMAKE_SOURCE_DIR}/libkdepim
${Boost_INCLUDE_DIR}
${QGPGME_INCLUDES}
${GPGME_INCLUDES} )
if (USABLE_ASSUAN_FOUND)
include_directories(${ASSUAN_INCLUDES})
endif(USABLE_ASSUAN_FOUND)
add_definitions ( -DQT3_SUPPORT -DQT3_SUPPORT_WARNINGS -D_ASSUAN_ONLY_GPG_ERRORS )
remove_definitions ( -DQT_NO_STL )
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}")
add_subdirectory( pics )
add_subdirectory( conf )
if ( USABLE_ASSUAN_FOUND AND BUILD_libkleopatraclient )
# can't use macro_optional_add_subdirectory here, since it's split
# off into ConfigureChecks.cmake..
add_subdirectory( libkleopatraclient )
endif ( USABLE_ASSUAN_FOUND AND BUILD_libkleopatraclient )
add_subdirectory( kgpgconf )
add_subdirectory( kwatchgnupg )
add_subdirectory( tests )
if ( WIN32 )
set( _kleopatra_extra_uiserver_SRCS
uiserver/uiserver_win.cpp
)
set( _kleopatra_extra_SRCS
utils/gnupg-registry.c
selftest/registrycheck.cpp
)
else ( WIN32 )
set( _kleopatra_extra_uiserver_SRCS
uiserver/uiserver_unix.cpp
)
set( _kleopatra_extra_SRCS
)
endif ( WIN32 )
if ( USABLE_ASSUAN_FOUND )
add_definitions ( -DKLEOPATRACLIENT_NAMESPACE=KleopatraClientCopy -DKLEOPATRACLIENTCORE_EXPORT= )
set(_kleopatra_uiserver_SRCS
uiserver/uiserver.cpp
${_kleopatra_extra_uiserver_SRCS}
uiserver/assuanserverconnection.cpp
uiserver/echocommand.cpp
uiserver/decryptverifycommandemailbase.cpp
uiserver/decryptverifycommandfilesbase.cpp
uiserver/signcommand.cpp
uiserver/signencryptfilescommand.cpp
uiserver/prepencryptcommand.cpp
uiserver/encryptcommand.cpp
uiserver/selectcertificatecommand.cpp
uiserver/importfilescommand.cpp
libkleopatraclient/core/command.cpp
selftest/uiservercheck.cpp
)
if ( WIN32 )
set( _kleopatra_uiserver_extra_libs ${ASSUAN_VANILLA_LIBRARIES} )
else ( WIN32 )
set( _kleopatra_uiserver_extra_libs ${ASSUAN_PTHREAD_LIBRARIES} )
endif( WIN32 )
if ( HAVE_GPG_ERR_SOURCE_KLEO )
add_definitions( -DGPG_ERR_SOURCE_DEFAULT=GPG_ERR_SOURCE_KLEO )
else( HAVE_GPG_ERR_SOURCE_KLEO )
add_definitions( -DGPG_ERR_SOURCE_DEFAULT=GPG_ERR_SOURCE_USER_1 )
endif( HAVE_GPG_ERR_SOURCE_KLEO )
else ( USABLE_ASSUAN_FOUND )
set(_kleopatra_uiserver_SRCS)
endif ( USABLE_ASSUAN_FOUND )
kde4_add_ui_files( _kleopatra_uiserver_SRCS
crypto/gui/signingcertificateselectionwidget.ui)
set( _kleopatra_SRCS
utils/gnupg-helper.cpp
utils/filesystemwatcher.cpp
utils/kdpipeiodevice.cpp
utils/kdlogtextwidget.cpp
utils/headerview.cpp
utils/scrollarea.cpp
utils/dragqueen.cpp
utils/multivalidator.cpp
utils/progressmanager.cpp
utils/filedialog.cpp
utils/hex.cpp
utils/input.cpp
utils/output.cpp
utils/exception.cpp
utils/formatting.cpp
utils/validation.cpp
utils/wsastarter.cpp
utils/classify.cpp
utils/iodevicelogger.cpp
utils/log.cpp
utils/action_data.cpp
utils/types.cpp
selftest/selftest.cpp
selftest/enginecheck.cpp
selftest/gpgconfcheck.cpp
${_kleopatra_extra_SRCS}
models/keycache.cpp
models/keylistmodel.cpp
models/keylistsortfilterproxymodel.cpp
models/subkeylistmodel.cpp
models/useridlistmodel.cpp
view/keylistcontroller.cpp
view/keytreeview.cpp
view/searchbar.cpp
view/tabwidget.cpp
dialogs/certificateselectiondialog.cpp
dialogs/expirydialog.cpp
dialogs/lookupcertificatesdialog.cpp
dialogs/ownertrustdialog.cpp
dialogs/selftestdialog.cpp
dialogs/certifycertificatedialog.cpp
dialogs/exportsecretkeydialog.cpp
dialogs/adduseriddialog.cpp
dialogs/certificatedetailsdialog.cpp
dialogs/exportcertificatesdialog.cpp
dialogs/deletecertificatesdialog.cpp
crypto/certificateresolver.cpp
crypto/task.cpp
crypto/taskcollection.cpp
crypto/decryptverifytask.cpp
crypto/decryptverifyemailcontroller.cpp
crypto/decryptverifyfilescontroller.cpp
crypto/encryptemailtask.cpp
crypto/encryptemailcontroller.cpp
crypto/signencryptfilestask.cpp
crypto/signemailtask.cpp
crypto/signemailcontroller.cpp
crypto/gui/wizard.cpp
crypto/gui/wizardpage.cpp
crypto/gui/signingcertificateselectionwidget.cpp
crypto/gui/signingcertificateselectiondialog.cpp
crypto/gui/resultitemwidget.cpp
crypto/gui/resultlistwidget.cpp
crypto/gui/resultpage.cpp
+ crypto/gui/newresultpage.cpp
+ crypto/gui/newsignencryptfileswizard.cpp
+
crypto/gui/decryptverifyoperationwidget.cpp
crypto/gui/decryptverifyfileswizard.cpp
crypto/gui/objectspage.cpp
crypto/gui/resolverecipientspage.cpp
crypto/gui/signerresolvepage.cpp
crypto/gui/encryptemailwizard.cpp
crypto/gui/signemailwizard.cpp
crypto/gui/signencryptfileswizard.cpp
crypto/gui/signencryptwizard.cpp
crypto/controller.cpp
crypto/signencryptfilescontroller.cpp
commands/command.cpp
commands/gnupgprocesscommand.cpp
commands/detailscommand.cpp
commands/exportcertificatecommand.cpp
commands/importcertificatescommand.cpp
commands/importcertificatefromfilecommand.cpp
commands/lookupcertificatescommand.cpp
commands/reloadkeyscommand.cpp
commands/refreshx509certscommand.cpp
commands/refreshopenpgpcertscommand.cpp
commands/deletecertificatescommand.cpp
commands/decryptverifyfilescommand.cpp
commands/signencryptfilescommand.cpp
commands/encryptclipboardcommand.cpp
commands/signclipboardcommand.cpp
commands/decryptverifyclipboardcommand.cpp
commands/clearcrlcachecommand.cpp
commands/dumpcrlcachecommand.cpp
commands/dumpcertificatecommand.cpp
commands/importcrlcommand.cpp
commands/changeexpirycommand.cpp
commands/changeownertrustcommand.cpp
commands/changepassphrasecommand.cpp
commands/certifycertificatecommand.cpp
commands/selftestcommand.cpp
commands/exportsecretkeycommand.cpp
commands/exportopenpgpcertstoservercommand.cpp
commands/adduseridcommand.cpp
commands/newcertificatecommand.cpp
${_kleopatra_uiserver_files}
conf/configuredialog.cpp
newcertificatewizard/listwidget.cpp
newcertificatewizard/newcertificatewizard.cpp
aboutdata.cpp
systemtrayicon.cpp
kleopatraapplication.cpp
main.cpp )
if ( KLEO_MODEL_TEST )
add_definitions( -DKLEO_MODEL_TEST )
set( _kleopatra_SRCS ${_kleopatra_SRCS} models/modeltest.cpp )
endif ( KLEO_MODEL_TEST )
kde4_add_ui_files( _kleopatra_SRCS
dialogs/certificationoptionswidget.ui
dialogs/expirydialog.ui
dialogs/lookupcertificatesdialog.ui
dialogs/ownertrustdialog.ui
dialogs/selectchecklevelwidget.ui
dialogs/selftestdialog.ui
dialogs/exportsecretkeydialog.ui
dialogs/adduseriddialog.ui
dialogs/certificatedetailsdialog.ui
newcertificatewizard/listwidget.ui
newcertificatewizard/chooseprotocolpage.ui
newcertificatewizard/enterdetailspage.ui
newcertificatewizard/overviewpage.ui
newcertificatewizard/keycreationpage.ui
newcertificatewizard/resultpage.ui
newcertificatewizard/advancedsettingsdialog.ui
)
kde4_add_kcfg_files( _kleopatra_SRCS
kcfg/tooltippreferences.kcfgc
kcfg/emailoperationspreferences.kcfgc
kcfg/smimevalidationpreferences.kcfgc
)
if (ONLY_KLEO)
add_definitions( -DONLY_KLEO -DKDEPIM_EXPORT= )
set( _kleopatra_libkdepim_SRCS
../libkdepim/progressmanager.cpp
../libkdepim/progressdialog.cpp
../libkdepim/overlaywidget.cpp
../libkdepim/ssllabel.cpp
../libkdepim/statusbarprogresswidget.cpp
)
set( _kleopatra_libkdepim_LIBS )
else(ONLY_KLEO)
set( _kleopatra_libkdepim_SRCS )
set( _kleopatra_libkdepim_LIBS kdepim )
endif(ONLY_KLEO)
set( _kleopatra_mainwindow_SRCS
mainwindow.cpp
)
add_definitions ( -DKDE_DEFAULT_DEBUG_AREA=5151 )
kde4_add_app_icon(_kleopatra_mainwindow_SRCS "ox*-app-kleopatra.png")
kde4_add_executable(kleopatra_bin ${_kleopatra_SRCS} ${_kleopatra_mainwindow_SRCS} ${_kleopatra_uiserver_SRCS} ${_kleopatra_libkdepim_SRCS} )
set_target_properties(kleopatra_bin PROPERTIES OUTPUT_NAME kleopatra)
set( _kleopatra_extra_libs ${QT_QT3SUPPORT_LIBRARY} )
if ( NOT KDE4_KCMUTILS_LIBS )
set( KDE4_KCMUTILS_LIBS ${KDE4_KUTILS_LIBS} )
endif ( NOT KDE4_KCMUTILS_LIBS )
target_link_libraries(kleopatra_bin ${_kleopatra_extra_libs} kleo ${_kleopatra_libkdepim_LIBS} ${QGPGME_LIBRARIES} ${KDE4_KMIME_LIBRARY} ${KDE4_KCMUTILS_LIBS} ${_kleopatra_uiserver_extra_libs} )
if ( USABLE_ASSUAN_FOUND )
target_link_libraries(kleopatra_bin ${QT_QTNETWORK_LIBRARY})
ENDIF ( USABLE_ASSUAN_FOUND )
install(TARGETS kleopatra_bin DESTINATION ${BIN_INSTALL_DIR} )
########### install files ###############
install( FILES kleopatra_import.desktop DESTINATION ${XDG_APPS_INSTALL_DIR})
install( FILES kleopatra_signencryptfiles.desktop
kleopatra_signencryptfolders.desktop
kleopatra_decryptverifyfiles.desktop
kleopatra_decryptverifyfolders.desktop
DESTINATION ${SERVICES_INSTALL_DIR})
install( FILES kleopatra.rc DESTINATION ${DATA_INSTALL_DIR}/kleopatra)
kde4_install_icons( ${ICON_INSTALL_DIR} )
diff --git a/crypto/gui/newresultpage.cpp b/crypto/gui/newresultpage.cpp
new file mode 100644
index 000000000..79f54535e
--- /dev/null
+++ b/crypto/gui/newresultpage.cpp
@@ -0,0 +1,214 @@
+/* -*- mode: c++; c-basic-offset:4 -*-
+ crypto/gui/resultpage.cpp
+
+ This file is part of Kleopatra, the KDE keymanager
+ Copyright (c) 2008 Klarälvdalens Datakonsult AB
+
+ Kleopatra is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Kleopatra is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+
+#include <config-kleopatra.h>
+
+#include "newresultpage.h"
+
+#include "resultlistwidget.h"
+#include "resultitemwidget.h"
+
+#include <crypto/taskcollection.h>
+
+#include <utils/scrollarea.h>
+
+#include <KLocalizedString>
+
+#include <QCheckBox>
+#include <QHash>
+#include <QHBoxLayout>
+#include <QIcon>
+#include <QLabel>
+#include <QProgressBar>
+#include <QVBoxLayout>
+
+#include <cassert>
+
+using namespace Kleo;
+using namespace Kleo::Crypto;
+using namespace Kleo::Crypto::Gui;
+using namespace boost;
+
+class NewResultPage::Private {
+ NewResultPage* const q;
+public:
+ explicit Private( NewResultPage* qq );
+
+ void progress( const QString & msg, int progress, int total );
+ void result( const shared_ptr<const Task::Result> & result );
+ void started( const shared_ptr<Task> & result );
+ void allDone();
+ void addResultWidget( ResultItemWidget* widget );
+ void keepOpenWhenDone( bool keep );
+ QLabel * labelForTag( const QString & tag );
+
+ shared_ptr<TaskCollection> m_tasks;
+ QProgressBar* m_progressBar;
+ QHash<QString, QLabel*> m_progressLabelByTag;
+ QVBoxLayout* m_progressLabelLayout;
+ int m_lastErrorItemIndex;
+ ScrollArea* m_scrollArea;
+ ResultListWidget* m_resultList;
+ QCheckBox* m_keepOpenCB;
+};
+
+void NewResultPage::Private::addResultWidget( ResultItemWidget* widget )
+{
+ assert( widget );
+ assert( m_scrollArea->widget() );
+ assert( qobject_cast<QBoxLayout*>( m_scrollArea->widget()->layout() ) );
+ QBoxLayout & blay = *static_cast<QBoxLayout*>( m_scrollArea->widget()->layout() );
+ blay.insertWidget( widget->hasErrorResult() ? m_lastErrorItemIndex++ : ( blay.count() - 1 ), widget );
+}
+
+NewResultPage::Private::Private( NewResultPage* qq ) : q( qq ), m_lastErrorItemIndex( 0 )
+{
+ QBoxLayout* const layout = new QVBoxLayout( q );
+ QWidget* const labels = new QWidget;
+ m_progressLabelLayout = new QVBoxLayout( labels );
+ layout->addWidget( labels );
+ m_progressBar = new QProgressBar;
+ layout->addWidget( m_progressBar );
+ m_resultList = new ResultListWidget;
+ connect( m_resultList, SIGNAL(linkActivated(QString)), q, SIGNAL(linkActivated(QString)) );
+ layout->addWidget( m_resultList );
+ m_keepOpenCB = new QCheckBox;
+ m_keepOpenCB->setText( i18n( "Keep open after operation completed" ) );
+ m_keepOpenCB->setChecked(true );
+ connect( m_keepOpenCB, SIGNAL(toggled(bool)), q, SLOT(keepOpenWhenDone(bool)) );
+ layout->addWidget( m_keepOpenCB );
+}
+
+void NewResultPage::Private::progress( const QString & msg, int progress, int total )
+{
+ assert( progress >= 0 );
+ assert( total >= 0 );
+ m_progressBar->setRange( 0, total );
+ m_progressBar->setValue( progress );
+}
+
+void NewResultPage::Private::keepOpenWhenDone( bool )
+{
+}
+
+void NewResultPage::Private::allDone()
+{
+ assert( m_tasks );
+ // PENDING(marc) needed? then fix, else remove
+ //q->setAutoAdvance( !m_keepOpenCB->isChecked() && !m_tasks->errorOccurred() );
+ m_progressBar->setRange( 0, 100 );
+ m_progressBar->setValue( 100 );
+ m_tasks.reset();
+ Q_FOREACH ( const QString & i, m_progressLabelByTag.keys() ) {
+ if ( !i.isEmpty() )
+ m_progressLabelByTag.value( i )->setText( i18n("%1: All operations completed.", i ) );
+ else
+ m_progressLabelByTag.value( i )->setText( i18n("All operations completed." ) );
+ }
+ emit q->completeChanged();
+}
+
+void NewResultPage::Private::result( const shared_ptr<const Task::Result> & )
+{
+}
+
+void NewResultPage::Private::started( const shared_ptr<Task> & task )
+{
+ assert( task );
+ const QString tag = task->tag();
+ QLabel * const label = labelForTag( tag );
+ assert( label );
+ if ( tag.isEmpty() )
+ label->setText( i18nc( "number, operation description", "Operation %1: %2", m_tasks->numberOfCompletedTasks() + 1, task->label() ) );
+ else
+ label->setText( i18nc( "tag( \"OpenPGP\" or \"CMS\"), operation description", "%1: %2", tag, task->label() ) );
+}
+
+NewResultPage::NewResultPage( QWidget * parent ) : QWizardPage( parent ), d( new Private( this ) )
+{
+ setTitle( i18n( "<b>Results</b>" ) );
+}
+
+NewResultPage::~NewResultPage()
+{
+}
+
+bool NewResultPage::keepOpenWhenDone() const
+{
+ return d->m_keepOpenCB->isChecked();
+}
+
+void NewResultPage::setKeepOpenWhenDone( bool keep )
+{
+ d->m_keepOpenCB->setChecked( keep );
+}
+
+void NewResultPage::setTaskCollection( const shared_ptr<TaskCollection> & coll )
+{
+ assert( !d->m_tasks );
+ if ( d->m_tasks == coll )
+ return;
+ d->m_tasks = coll;
+ assert( d->m_tasks );
+ d->m_resultList->setTaskCollection( coll );
+ connect( d->m_tasks.get(), SIGNAL(progress(QString,int,int)),
+ this, SLOT(progress(QString,int,int)) );
+ connect( d->m_tasks.get(), SIGNAL(done()),
+ this, SLOT(allDone()) );
+ connect( d->m_tasks.get(), SIGNAL(result(boost::shared_ptr<const Kleo::Crypto::Task::Result>)),
+ this, SLOT(result(boost::shared_ptr<const Kleo::Crypto::Task::Result>)) );
+ connect( d->m_tasks.get(), SIGNAL(started(boost::shared_ptr<Kleo::Crypto::Task>)),
+ this, SLOT(started(boost::shared_ptr<Kleo::Crypto::Task>)) );
+
+ Q_FOREACH ( const shared_ptr<Task> & i, d->m_tasks->tasks() ) // create labels for all tags in collection
+ assert( i && d->labelForTag( i->tag() ) );
+ emit completeChanged();
+}
+
+QLabel* NewResultPage::Private::labelForTag( const QString & tag ) {
+ if ( QLabel * const label = m_progressLabelByTag.value( tag ) )
+ return label;
+ QLabel* label = new QLabel;
+ label->setTextFormat( Qt::RichText );
+ label->setWordWrap( true );
+ m_progressLabelLayout->addWidget( label );
+ m_progressLabelByTag.insert( tag, label );
+ return label;
+}
+
+bool NewResultPage::isComplete() const
+{
+ return d->m_tasks ? d->m_tasks->allTasksCompleted() : true;
+}
+
+
+#include "newresultpage.moc"
diff --git a/crypto/gui/newresultpage.h b/crypto/gui/newresultpage.h
new file mode 100644
index 000000000..5a34b9c80
--- /dev/null
+++ b/crypto/gui/newresultpage.h
@@ -0,0 +1,85 @@
+/* -*- mode: c++; c-basic-offset:4 -*-
+ crypto/gui/newresultpage.h
+
+ This file is part of Kleopatra, the KDE keymanager
+ Copyright (c) 2008, 2009 Klarälvdalens Datakonsult AB
+
+ Kleopatra is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Kleopatra is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+
+#ifndef __KLEOPATRA_CRYPTO_GUI_NEWRESULTPAGE_H__
+#define __KLEOPATRA_CRYPTO_GUI_NEWRESULTPAGE_H__
+
+#include <QWizardPage>
+
+#include <utils/pimpl_ptr.h>
+
+namespace boost {
+ template <typename T> class shared_ptr;
+}
+
+namespace Kleo {
+namespace Crypto {
+ class TaskCollection;
+ class Task;
+}
+}
+
+namespace Kleo {
+namespace Crypto {
+namespace Gui {
+
+class NewResultPage : public QWizardPage {
+ Q_OBJECT
+public:
+ explicit NewResultPage( QWidget * parent=0 );
+ ~NewResultPage();
+
+ void setTaskCollection( const boost::shared_ptr<TaskCollection> & coll );
+
+ /* reimp */ bool isComplete() const;
+
+ bool keepOpenWhenDone() const;
+ void setKeepOpenWhenDone( bool keep );
+
+Q_SIGNALS:
+ void linkActivated( const QString & link );
+
+private:
+ class Private;
+ kdtools::pimpl_ptr<Private> d;
+ Q_PRIVATE_SLOT( d, void progress( QString, int, int ) )
+ Q_PRIVATE_SLOT( d, void result( boost::shared_ptr<const Kleo::Crypto::Task::Result> ) )
+ Q_PRIVATE_SLOT( d, void started( boost::shared_ptr<Kleo::Crypto::Task> ) )
+ Q_PRIVATE_SLOT( d, void keepOpenWhenDone( bool ) )
+ Q_PRIVATE_SLOT( d, void allDone() )
+};
+
+}
+}
+}
+
+#endif // __KLEOPATRA_CRYPTO_GUI_NEWRESULTPAGE_H__
diff --git a/crypto/gui/newsignencryptfileswizard.cpp b/crypto/gui/newsignencryptfileswizard.cpp
new file mode 100644
index 000000000..e34128192
--- /dev/null
+++ b/crypto/gui/newsignencryptfileswizard.cpp
@@ -0,0 +1,639 @@
+/* -*- mode: c++; c-basic-offset:4 -*-
+ crypto/gui/newsignencryptfileswizard.cpp
+
+ This file is part of Kleopatra, the KDE keymanager
+ Copyright (c) 2009 Klarälvdalens Datakonsult AB
+
+ Kleopatra is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Kleopatra is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+
+#include <config-kleopatra.h>
+
+#include "newsignencryptfileswizard.h"
+
+#include "newresultpage.h"
+#include "signingcertificateselectionwidget.h"
+
+#include <view/keytreeview.h>
+#include <view/searchbar.h>
+
+#include <models/keycache.h>
+#include <models/predicates.h>
+#include <models/keylistmodel.h>
+
+#include <utils/stl_util.h>
+
+#include <KLocale>
+#include <KIcon>
+#include <KDebug>
+
+#include <QLabel>
+#include <QWizardPage>
+#include <QRadioButton>
+#include <QCheckBox>
+#include <QPushButton>
+#include <QTreeView>
+#include <QLayout>
+
+#include <QVariant>
+
+#include <gpgme++/key.h>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/bind.hpp>
+
+using namespace GpgME;
+using namespace boost;
+using namespace Kleo;
+using namespace Kleo::Crypto;
+using namespace Kleo::Crypto::Gui;
+
+enum Page {
+ OperationPageId,
+ RecipientsPageId,
+ SignerPageId,
+ ResultPageId,
+
+ NumPages
+};
+
+static void really_check( QAbstractButton & b, bool on ) {
+ const bool excl = b.autoExclusive();
+ b.setAutoExclusive( false );
+ b.setChecked( on );
+ b.setAutoExclusive( excl );
+}
+
+static bool xconnect( const QObject * a, const char * signal,
+ const QObject * b, const char * slot )
+{
+ return
+ QObject::connect( a, signal, b, slot ) &&
+ QObject::connect( b, signal, a, slot ) ;
+}
+
+static void enable_disable( QAbstractButton & button, const QAbstractItemView * view ) {
+ const QItemSelectionModel * ism = view ? view->selectionModel() : 0 ;
+ button.setEnabled( ism && ism->hasSelection() );
+}
+
+static void copy_selected_from_to( KeyTreeView & from, KeyTreeView & to ) {
+ to.addKeysSelected( from.selectedKeys() );
+ from.view()->selectionModel()->clearSelection();
+}
+
+static void move_selected_from_to( KeyTreeView & from, KeyTreeView & to ) {
+ const std::vector<Key> keys = from.selectedKeys();
+ from.removeKeys( keys );
+ to.addKeysSelected( keys );
+}
+
+static void remove_all_cms_keys( KeyTreeView & ktv ) {
+ const std::vector<Key> cms
+ = kdtools::copy_if< std::vector<Key> >( ktv.keys(), bind( &Key::protocol, _1 ) == CMS );
+ ktv.removeKeys( cms );
+}
+
+namespace {
+
+ //
+ // This is a simple QLabel subclass, used mainly to have a widget
+ // for the 'files' field of the wizard (though that one's unused as of now).
+ //
+ class ObjectsLabel : public QLabel {
+ Q_OBJECT // ### PENDING(marc) deal with lots of files (->listbox)
+ Q_PROPERTY( QStringList files READ files WRITE setFiles )
+ public:
+ explicit ObjectsLabel( QWidget * parent=0, Qt::WindowFlags f=0 )
+ : QLabel( parent, f ), m_files()
+ {
+ updateText();
+ }
+ explicit ObjectsLabel( const QStringList & files, QWidget * parent=0, Qt::WindowFlags f=0 )
+ : QLabel( parent, f ), m_files( files )
+ {
+ updateText();
+ }
+
+ QStringList files() const { return m_files; }
+ void setFiles( const QStringList & files ) {
+ if ( m_files == files )
+ return;
+ m_files = files;
+ updateText();
+ }
+
+ private:
+ QString makeText() const {
+ if ( m_files.empty() )
+ return i18n("No files selected.");
+ else
+ return i18np("Selected file:", "Selected files:", m_files.size() )
+ + QLatin1String("\n ") + m_files.join( QLatin1String("\n ") );
+ }
+ void updateText() { setText( makeText() ); }
+
+ private:
+ QStringList m_files;
+ };
+
+
+ class WizardPage : public QWizardPage {
+ Q_OBJECT
+ public:
+ explicit WizardPage( QWidget * parent=0 )
+ : QWizardPage( parent ),
+ m_presetProtocol( UnknownProtocol )
+ {
+
+ }
+
+ bool isSigningSelected() const {
+ return field("sign").toBool() || isSignEncryptSelected() ;
+ }
+
+ bool isEncryptionSelected() const {
+ return field("encrypt").toBool() || isSignEncryptSelected() ;
+ }
+
+ bool isSignEncryptSelected() const {
+ return field("signencrypt").toBool() ;
+ }
+
+ Protocol protocol() const { return m_presetProtocol; }
+ Protocol effectiveProtocol() const {
+ if ( isSignEncryptSelected() ) {
+ assert( m_presetProtocol == OpenPGP || m_presetProtocol == UnknownProtocol );
+ return OpenPGP;
+ } else {
+ return m_presetProtocol;
+ }
+ }
+
+ void setPresetProtocol( Protocol proto ) {
+ if ( proto == m_presetProtocol )
+ return;
+ m_presetProtocol = proto;
+ doSetPresetProtocol();
+ }
+
+ private:
+ virtual void doSetPresetProtocol() {}
+
+ private:
+ Protocol m_presetProtocol;
+ };
+
+
+ class OperationPage : public WizardPage {
+ Q_OBJECT
+ public:
+ explicit OperationPage( QWidget * parent=0 )
+ : WizardPage( parent ),
+ m_objectsLabel( this ),
+ m_signencrypt( i18n("Sign and Encrypt (OpenPGP only)"), this ),
+ m_encrypt( i18n("Encrypt"), this ),
+ m_sign( i18n("Sign"), this ),
+ m_armor( i18n("Text output (ASCII armor)"), this ),
+ m_removeSource( i18n("Remove unencrypted original file when done"), this )
+ {
+ setTitle( i18nc("@title","What do you want to do?") );
+ setSubTitle( i18nc("@title",
+ "Please select here whether you want to sign or encrypt files.") );
+ KDAB_SET_OBJECT_NAME( m_objectsLabel );
+ KDAB_SET_OBJECT_NAME( m_signencrypt );
+ KDAB_SET_OBJECT_NAME( m_encrypt );
+ KDAB_SET_OBJECT_NAME( m_sign );
+ KDAB_SET_OBJECT_NAME( m_armor );
+ KDAB_SET_OBJECT_NAME( m_removeSource );
+
+ QVBoxLayout * vlay = new QVBoxLayout( this );
+ vlay->addWidget( &m_objectsLabel );
+ vlay->addWidget( &m_signencrypt );
+ vlay->addWidget( &m_encrypt );
+ vlay->addWidget( &m_sign );
+ vlay->addStretch( 1 );
+ vlay->addWidget( &m_armor );
+ vlay->addWidget( &m_removeSource );
+
+ m_armor.setChecked( true );
+
+ registerField( "files", &m_objectsLabel, "files" );
+
+ registerField( "signencrypt", &m_signencrypt );
+ registerField( "encrypt", &m_encrypt );
+ registerField( "sign", &m_sign );
+
+ registerField( "armor", &m_armor );
+ registerField( "remove", &m_removeSource );
+
+ connect( &m_signencrypt, SIGNAL(clicked()), this, SIGNAL(completeChanged()) );
+ connect( &m_encrypt, SIGNAL(clicked()), this, SIGNAL(completeChanged()) );
+ connect( &m_sign, SIGNAL(clicked()), this, SIGNAL(completeChanged()) );
+
+ connect( &m_sign, SIGNAL(toggled(bool)),
+ &m_removeSource, SLOT(setDisabled(bool)) );
+ }
+
+ /* reimp */ bool isComplete() const {
+ return m_signencrypt.isChecked() || m_encrypt.isChecked() || m_sign.isChecked() ;
+ }
+ /* reimp */ int nextId() const {
+ return isEncryptionSelected() ? RecipientsPageId : SignerPageId ;
+ }
+ /* reimp */ void doSetPresetProtocol() {
+ const bool canSignEncrypt = protocol() != CMS ;
+ m_signencrypt.setEnabled( canSignEncrypt );
+ m_signencrypt.setToolTip( canSignEncrypt ? QString() :
+ i18n("This operation is not available for S/MIME") );
+ if ( !canSignEncrypt )
+ really_check( m_signencrypt, false );
+ }
+
+ private:
+ ObjectsLabel m_objectsLabel;
+ QRadioButton m_signencrypt, m_encrypt, m_sign;
+ QCheckBox m_armor, m_removeSource;
+ };
+
+
+ class RecipientsPage : public WizardPage {
+ Q_OBJECT
+ public:
+ explicit RecipientsPage( QWidget * parent=0 )
+ : WizardPage( parent ),
+ m_keysLoaded( false ),
+ m_cmsKeysLoaded( false ),
+ m_searchbar( this ),
+ m_unselectedKTV( this ),
+ m_selectPB( i18n("Add"), this ),
+ m_unselectPB( i18n("Remove"), this ),
+ m_selectedKTV( this )
+ {
+ setTitle( i18nc("@title","Whom do you want to encrypt to?") );
+ setSubTitle( i18nc("@title",
+ "Please select whom you want the files to be encrypted to. "
+ "Do not forget to pick one of your own certificates.") );
+ // the button may be there or not, the _text_ is static, though:
+ setButtonText( QWizard::CommitButton, i18nc("@action","Encrypt") );
+
+ KDAB_SET_OBJECT_NAME( m_searchbar );
+ KDAB_SET_OBJECT_NAME( m_unselectedKTV );
+ KDAB_SET_OBJECT_NAME( m_selectPB );
+ KDAB_SET_OBJECT_NAME( m_unselectPB );
+ KDAB_SET_OBJECT_NAME( m_selectedKTV );
+
+ m_selectPB.setIcon( KIcon( "list-add" ) );
+ m_unselectPB.setIcon( KIcon( "list-remove" ) );
+
+ m_selectPB.setEnabled( false );
+ m_unselectPB.setEnabled( false );
+
+ m_unselectedKTV.setHierarchicalModel( AbstractKeyListModel::createHierarchicalKeyListModel( &m_unselectedKTV ) );
+ m_unselectedKTV.setHierarchicalView( true );
+ m_selectedKTV.setFlatModel( AbstractKeyListModel::createFlatKeyListModel( &m_selectedKTV ) );
+ m_selectedKTV.setHierarchicalView( false );
+
+ QVBoxLayout * vlay = new QVBoxLayout( this );
+ vlay->addWidget( &m_searchbar );
+ vlay->addWidget( &m_unselectedKTV, 1 );
+
+ QHBoxLayout * hlay = new QHBoxLayout;
+ hlay->addStretch( 1 );
+ hlay->addWidget( &m_selectPB );
+ hlay->addWidget( &m_unselectPB );
+ hlay->addStretch( 1 );
+
+ vlay->addLayout( hlay );
+ vlay->addWidget( &m_selectedKTV, 1 );
+
+ xconnect( &m_searchbar, SIGNAL(stringFilterChanged(QString)),
+ &m_unselectedKTV, SLOT(setStringFilter(QString)) );
+ xconnect( &m_searchbar, SIGNAL(keyFilterChanged(boost::shared_ptr<Kleo::KeyFilter>)),
+ &m_unselectedKTV, SLOT(setKeyFilter(boost::shared_ptr<Kleo::KeyFilter>)) );
+
+ connect( m_unselectedKTV.view()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
+ this, SLOT(slotUnselectedSelectionChanged()) );
+ connect( m_selectedKTV.view()->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
+ this, SLOT(slotSelectedSelectionChanged()) );
+
+ connect( &m_selectPB, SIGNAL(clicked()), this, SLOT(select()) );
+ connect( &m_unselectPB, SIGNAL(clicked()), this, SLOT(unselect()) );
+ }
+
+ /* reimp */ bool isComplete() const {
+ return !m_selectedKTV.keys().empty();
+ }
+
+ /* reimp */ int nextId() const {
+ if ( isSigningSelected() )
+ return SignerPageId;
+ else
+ return ResultPageId;
+ }
+
+ /* reimp */ void initializePage() {
+
+ setCommitPage( !isSigningSelected() );
+
+ const bool signEncrypt = isSignEncryptSelected();
+ kDebug() << "m_keysLoaded" << m_keysLoaded
+ << "m_cmsKeysLoaded" << m_cmsKeysLoaded
+ << "signEncrypt" << signEncrypt;
+ if ( !m_keysLoaded ) {
+ std::vector<Key> keys = KeyCache::instance()->keys();
+ kDebug() << "keys.size" << keys.size();
+ if ( signEncrypt )
+ // only OpenPGP can do sign+encrypt in one operation
+ _detail::grep_protocol( keys, OpenPGP );
+ m_unselectedKTV.setKeys( keys );
+ m_keysLoaded = true;
+ m_cmsKeysLoaded = !signEncrypt;
+ } else if ( m_cmsKeysLoaded && signEncrypt ) {
+ remove_all_cms_keys( m_unselectedKTV );
+ remove_all_cms_keys( m_selectedKTV );
+ m_cmsKeysLoaded = false;
+ }
+ }
+
+ const std::vector<Key> & keys() const {
+ return m_selectedKTV.keys();
+ }
+
+ private Q_SLOTS:
+ void slotUnselectedSelectionChanged() {
+ enable_disable( m_selectPB, m_unselectedKTV.view() );
+ }
+ void slotSelectedSelectionChanged() {
+ enable_disable( m_unselectPB, m_selectedKTV.view() );
+ }
+ void select() {
+ copy_selected_from_to( m_unselectedKTV, m_selectedKTV );
+ emit completeChanged();
+ }
+ void unselect() {
+ move_selected_from_to( m_selectedKTV, m_unselectedKTV );
+ emit completeChanged();
+ }
+
+ private:
+ bool m_keysLoaded : 1;
+ bool m_cmsKeysLoaded : 1;
+
+ SearchBar m_searchbar;
+ KeyTreeView m_unselectedKTV;
+ QPushButton m_selectPB, m_unselectPB;
+ KeyTreeView m_selectedKTV;
+ };
+
+
+ static QVector<Protocol> make_allowed_protocols( Protocol proto ) {
+ QVector<Protocol> result;
+ if ( proto == UnknownProtocol )
+ result << OpenPGP << CMS ;
+ else
+ result << proto;
+ return result;
+ }
+
+ class SignerPage : public WizardPage {
+ Q_OBJECT
+ public:
+ explicit SignerPage( QWidget * parent=0 )
+ : WizardPage( parent ),
+ widget( this )
+ {
+ setTitle( i18nc("@title","Who do you want to sign as?") );
+ setSubTitle( i18nc("@title",
+ "Please choose an identity with which to sign the data." ) );
+ // this one is always a commit page
+ setCommitPage( true );
+
+ QVBoxLayout * vlay = new QVBoxLayout( this );
+
+ KDAB_SET_OBJECT_NAME( widget );
+ KDAB_SET_OBJECT_NAME( vlay );
+
+ //vlay->setMargin( 0 );
+ vlay->addWidget( &widget );
+
+ // ### connect something to completeChanged()
+ // ### deal with widget.rememberAsDefault()
+ }
+
+ std::vector<Key> keys() const {
+ const QMap<Protocol,Key> keys = widget.selectedCertificates();
+ std::vector<Key> result;
+ if ( effectiveProtocol() == UnknownProtocol )
+ result = kdtools::copy< std::vector<Key> >( keys.values() );
+ else
+ result.push_back( keys[effectiveProtocol()] );
+ // remove empty keys, for good measure...
+ result.erase( std::remove_if( result.begin(), result.end(), mem_fn( &Key::isNull ) ),
+ result.end() );
+ return result;
+ }
+
+ /* reimp */ bool isCompleted() const {
+ return !keys().empty();
+ }
+
+ /* reimp */ int nextId() const {
+ return ResultPageId ;
+ }
+
+ /* reimp */ void initializePage() {
+ if ( isEncryptionSelected() )
+ setButtonText( QWizard::CommitButton, i18nc("@action","Sign && Encrypt") );
+ else
+ setButtonText( QWizard::CommitButton, i18nc("@action","Sign") );
+ widget.setAllowedProtocols( make_allowed_protocols( effectiveProtocol() ) );
+ }
+ private:
+ SigningCertificateSelectionWidget widget;
+ };
+
+
+ class ResultPage : public NewResultPage {
+ Q_OBJECT
+ public:
+ explicit ResultPage( QWidget * parent=0 )
+ : NewResultPage( parent )
+ {
+ setTitle( i18nc("@title","Results") );
+ setSubTitle( i18nc("@title",
+ "Status and progress of the crypto operations is shown here." ) );
+ }
+
+ };
+
+}
+
+class NewSignEncryptFilesWizard::Private {
+ friend class ::Kleo::Crypto::Gui::NewSignEncryptFilesWizard;
+ NewSignEncryptFilesWizard * const q;
+public:
+ explicit Private( NewSignEncryptFilesWizard * qq )
+ : q( qq ),
+ operationPage( new OperationPage( q ) ),
+ recipientsPage( new RecipientsPage( q ) ),
+ signerPage( new SignerPage( q ) ),
+ resultPage( new ResultPage( q ) ),
+ signingPreset( true ),
+ signingUserMutable( true ),
+ encryptionPreset( true ),
+ encryptionUserMutable( true )
+ {
+ KDAB_SET_OBJECT_NAME( operationPage );
+ KDAB_SET_OBJECT_NAME( recipientsPage );
+ KDAB_SET_OBJECT_NAME( signerPage );
+ KDAB_SET_OBJECT_NAME( resultPage );
+
+ q->setPage( OperationPageId, operationPage );
+ q->setPage( RecipientsPageId, recipientsPage );
+ q->setPage( SignerPageId, signerPage );
+ q->setPage( ResultPageId, resultPage );
+
+ connect( q, SIGNAL(currentIdChanged(int)), q, SLOT(slotCurrentIdChanged(int)) );
+ }
+
+private:
+ void slotCurrentIdChanged( int id ) {
+ if ( id == ResultPageId )
+ emit q->operationPrepared();
+ }
+
+private:
+ int startId() const {
+ if ( signingUserMutable || encryptionUserMutable )
+ return OperationPageId;
+ else
+ if ( encryptionPreset )
+ return RecipientsPageId;
+ else
+ return SignerPageId;
+ }
+ void updateStartId() { q->setStartId( startId() ); }
+
+private:
+ OperationPage * operationPage;
+ RecipientsPage * recipientsPage;
+ SignerPage * signerPage;
+ ResultPage * resultPage;
+
+ bool signingPreset : 1;
+ bool signingUserMutable : 1;
+ bool encryptionPreset : 1;
+ bool encryptionUserMutable : 1;
+};
+
+
+NewSignEncryptFilesWizard::NewSignEncryptFilesWizard( QWidget * parent, Qt::WindowFlags f )
+ : QWizard( parent, f ), d( new Private( this ) )
+{
+
+}
+
+NewSignEncryptFilesWizard::~NewSignEncryptFilesWizard() { kDebug(); }
+
+void NewSignEncryptFilesWizard::setPresetProtocol( Protocol proto ) {
+ d->operationPage->setPresetProtocol( proto );
+ d->recipientsPage->setPresetProtocol( proto );
+ d->signerPage->setPresetProtocol( proto );
+}
+
+void NewSignEncryptFilesWizard::setSigningPreset( bool preset ) {
+ if ( preset == d->signingPreset && preset == isSigningSelected() )
+ return;
+ d->signingPreset = preset;
+ d->updateStartId();
+ if ( isEncryptionSelected() )
+ setField( "signencrypt", true );
+ else
+ setField( "sign", true );
+}
+
+void NewSignEncryptFilesWizard::setSigningUserMutable( bool mut ) {
+ if ( mut == d->signingUserMutable )
+ return;
+ d->signingUserMutable = mut;
+ d->updateStartId();
+}
+
+void NewSignEncryptFilesWizard::setEncryptionPreset( bool preset ) {
+ if ( preset == d->encryptionPreset && preset == isEncryptionSelected() )
+ return;
+ d->encryptionPreset = preset;
+ d->updateStartId();
+ if ( isSigningSelected() )
+ setField( "signencrypt", true );
+ else
+ setField( "encrypt", true );
+}
+
+void NewSignEncryptFilesWizard::setEncryptionUserMutable( bool mut ) {
+ if ( mut == d->encryptionUserMutable )
+ return;
+ d->encryptionUserMutable = mut;
+ d->updateStartId();
+}
+
+void NewSignEncryptFilesWizard::setFiles( const QStringList & files ) {
+ setField( "files", files );
+}
+
+
+bool NewSignEncryptFilesWizard::isSigningSelected() const {
+ return field("sign").toBool() || field("signencrypt").toBool() ;
+}
+
+bool NewSignEncryptFilesWizard::isEncryptionSelected() const {
+ return field("encrypt").toBool() || field("signencrypt").toBool() ;
+}
+
+bool NewSignEncryptFilesWizard::isAsciiArmorEnabled() const {
+ return field("armor").toBool();
+}
+
+bool NewSignEncryptFilesWizard::isRemoveUnencryptedFilesEnabled() const {
+ return isEncryptionSelected() && field("remove").toBool();
+}
+
+std::vector<Key> NewSignEncryptFilesWizard::resolvedRecipients() const {
+ return d->recipientsPage->keys();
+}
+
+std::vector<Key> NewSignEncryptFilesWizard::resolvedSigners() const {
+ return d->signerPage->keys();
+}
+
+
+void NewSignEncryptFilesWizard::setTaskCollection( const shared_ptr<TaskCollection> & coll ) {
+ d->resultPage->setTaskCollection( coll );
+}
+
+#include "moc_newsignencryptfileswizard.cpp"
+#include "newsignencryptfileswizard.moc"
diff --git a/crypto/gui/newsignencryptfileswizard.h b/crypto/gui/newsignencryptfileswizard.h
new file mode 100644
index 000000000..198d05cf8
--- /dev/null
+++ b/crypto/gui/newsignencryptfileswizard.h
@@ -0,0 +1,110 @@
+/* -*- mode: c++; c-basic-offset:4 -*-
+ crypto/gui/newsignencryptfileswizard.h
+
+ This file is part of Kleopatra, the KDE keymanager
+ Copyright (c) 2009 Klarälvdalens Datakonsult AB
+
+ Kleopatra is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ Kleopatra is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+ In addition, as a special exception, the copyright holders give
+ permission to link the code of this program with any edition of
+ the Qt library by Trolltech AS, Norway (or with modified versions
+ of Qt that use the same license as Qt), and distribute linked
+ combinations including the two. You must obey the GNU General
+ Public License in all respects for all of the code used other than
+ Qt. If you modify this file, you may extend this exception to
+ your version of the file, but you are not obligated to do so. If
+ you do not wish to do so, delete this exception statement from
+ your version.
+*/
+
+#ifndef __KLEOPATRA_CRYPTO_GUI_NEWSIGNENCRYPTFILESWIZARD_H__
+#define __KLEOPATRA_CRYPTO_GUI_NEWSIGNENCRYPTFILESWIZARD_H__
+
+#include <QWizard>
+
+#include <utils/pimpl_ptr.h>
+
+#include <gpgme++/global.h>
+
+#include <vector>
+
+class QFileInfo;
+class QStringList;
+template <typename T> class QList;
+
+namespace boost {
+ template <typename T> class shared_ptr;
+}
+
+namespace GpgME {
+ class Key;
+}
+
+namespace Kleo {
+namespace Crypto {
+ class TaskCollection;
+}
+}
+
+namespace Kleo {
+namespace Crypto {
+namespace Gui {
+
+ class NewSignEncryptFilesWizard : public QWizard {
+ Q_OBJECT
+ public:
+ explicit NewSignEncryptFilesWizard( QWidget * parent=0, Qt::WindowFlags f=0 );
+ ~NewSignEncryptFilesWizard();
+
+ // Inputs
+
+ void setPresetProtocol( GpgME::Protocol proto );
+
+ void setSigningPreset( bool preset );
+ void setSigningUserMutable( bool mut );
+
+ void setEncryptionPreset( bool preset );
+ void setEncryptionUserMutable( bool mut );
+
+ void setFiles( const QStringList & files );
+
+ // Outputs
+
+ bool isSigningSelected() const;
+ bool isEncryptionSelected() const;
+
+ bool isAsciiArmorEnabled() const;
+ bool isRemoveUnencryptedFilesEnabled() const;
+
+ std::vector<GpgME::Key> resolvedRecipients() const;
+ std::vector<GpgME::Key> resolvedSigners() const;
+
+ void setTaskCollection( const boost::shared_ptr<TaskCollection> & coll );
+
+ Q_SIGNALS:
+ void operationPrepared();
+
+ private:
+ class Private;
+ kdtools::pimpl_ptr<Private> d;
+ Q_PRIVATE_SLOT( d, void slotCurrentIdChanged(int) )
+ };
+
+}
+}
+}
+
+#endif /* __KLEOPATRA_CRYPTO_GUI_NEWSIGNENCRYPTFILESWIZARD_H__ */

File Metadata

Mime Type
text/x-diff
Expires
Tue, Jun 3, 5:38 AM (10 h, 43 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
45/e4/e27148a901a10b1bf706712c176b

Event Timeline