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

kleopatra

  • sources
  • kde-4.12
  • kdepim
  • kleopatra
  • dialogs
exportcertificatesdialog.cpp
Go to the documentation of this file.
1 /* -*- mode: c++; c-basic-offset:4 -*-
2  dialogs/exportcertificatesdialog.cpp
3 
4  This file is part of Kleopatra, the KDE keymanager
5  Copyright (c) 2007 Klarälvdalens Datakonsult AB
6 
7  Kleopatra is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 2 of the License, or
10  (at your option) any later version.
11 
12  Kleopatra is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the Qt library by Trolltech AS, Norway (or with modified versions
24  of Qt that use the same license as Qt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  Qt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 */
32 
33 #include <config-kleopatra.h>
34 
35 #include "exportcertificatesdialog.h"
36 
37 #include "libkleo/ui/filenamerequester.h"
38 
39 #include <KGuiItem>
40 #include <KLocale>
41 #include <KPushButton>
42 
43 #include <QGridLayout>
44 #include <QLabel>
45 
46 using namespace Kleo;
47 using namespace Kleo::Dialogs;
48 
49 class ExportCertificatesDialog::Private {
50  friend class ::Kleo::Dialogs::ExportCertificatesDialog;
51  ExportCertificatesDialog * const q;
52 public:
53  explicit Private( ExportCertificatesDialog * qq );
54  ~Private();
55  void fileNamesChanged();
56 
57 private:
58  FileNameRequester* pgpRequester;
59  FileNameRequester* cmsRequester;
60 };
61 
62 
63 ExportCertificatesDialog::Private::Private( ExportCertificatesDialog * qq )
64  : q( qq )
65 {
66  q->setButtons( KDialog::Ok | KDialog::Cancel );
67  q->setButtonGuiItem( KDialog::Ok, KGuiItem( i18n( "Export" ) ) );
68  QWidget* const main = new QWidget;
69  QGridLayout* const grid = new QGridLayout( main );
70  QLabel* const pgpLabel = new QLabel;
71  pgpLabel->setText( i18n(" OpenPGP export file:" ) );
72  grid->addWidget( pgpLabel, 0, 0 );
73  pgpRequester = new FileNameRequester;
74  connect( pgpRequester, SIGNAL(fileNameChanged(QString)), q, SLOT(fileNamesChanged()) );
75  grid->addWidget( pgpRequester, 0, 1 );
76  QLabel* const cmsLabel = new QLabel;
77  cmsLabel->setText( i18n( "S/MIME export file:" ) );
78  grid->addWidget( cmsLabel, 1, 0 );
79  cmsRequester = new FileNameRequester;
80  connect( cmsRequester, SIGNAL(fileNameChanged(QString)), q, SLOT(fileNamesChanged()) );
81  grid->addWidget( cmsRequester, 1, 1 );
82  q->setMainWidget( main );
83  fileNamesChanged();
84 }
85 
86 ExportCertificatesDialog::Private::~Private() {}
87 
88 
89 
90 ExportCertificatesDialog::ExportCertificatesDialog( QWidget * parent, Qt::WindowFlags f )
91  : KDialog( parent, f ), d( new Private( this ) )
92 {
93 
94 }
95 
96 void ExportCertificatesDialog::Private::fileNamesChanged()
97 {
98  q->button( KDialog::Ok )->setEnabled( !pgpRequester->fileName().isEmpty() && !cmsRequester->fileName().isEmpty() );
99 }
100 
101 ExportCertificatesDialog::~ExportCertificatesDialog() {}
102 
103 
104 void ExportCertificatesDialog::setOpenPgpExportFileName( const QString & fileName )
105 {
106  d->pgpRequester->setFileName( fileName );
107 }
108 
109 QString ExportCertificatesDialog::openPgpExportFileName() const
110 {
111  return d->pgpRequester->fileName();
112 }
113 
114 void ExportCertificatesDialog::setCmsExportFileName( const QString & fileName )
115 {
116  d->cmsRequester->setFileName( fileName );
117 }
118 
119 QString ExportCertificatesDialog::cmsExportFileName() const
120 {
121  return d->cmsRequester->fileName();
122 }
123 
124 #include "moc_exportcertificatesdialog.cpp"
125 
Kleo::Dialogs::ExportCertificatesDialog
Definition: exportcertificatesdialog.h:45
Kleo::Dialogs::ExportCertificatesDialog::cmsExportFileName
QString cmsExportFileName() const
Definition: exportcertificatesdialog.cpp:119
pgpLabel
static QString pgpLabel(const QString &attr)
Definition: adduseriddialog.cpp:67
QWidget
KDialog
Kleo::Dialogs::ExportCertificatesDialog::setOpenPgpExportFileName
void setOpenPgpExportFileName(const QString &fileName)
Definition: exportcertificatesdialog.cpp:104
d
#define d
Definition: adduseridcommand.cpp:90
Kleo::Dialogs::ExportCertificatesDialog::openPgpExportFileName
QString openPgpExportFileName() const
Definition: exportcertificatesdialog.cpp:109
Kleo::Dialogs::ExportCertificatesDialog::~ExportCertificatesDialog
~ExportCertificatesDialog()
Definition: exportcertificatesdialog.cpp:101
Kleo::Dialogs::ExportCertificatesDialog::setCmsExportFileName
void setCmsExportFileName(const QString &fileName)
Definition: exportcertificatesdialog.cpp:114
Ok
Definition: setinitialpindialog.cpp:59
q
#define q
Definition: adduseridcommand.cpp:91
main
int main(int argc, char **argv)
Definition: kgpgconf/main.cpp:37
exportcertificatesdialog.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:41 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kleopatra

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

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal