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

kgpg

  • sources
  • kde-4.14
  • kdeutils
  • kgpg
keyexport.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002 Jean-Baptiste Mardelle <bj@altern.org>
3  * Copyright (C) 2007,2011 Rolf Eike Beer <kde@opensource.sf-tec.de>
4  * Copyright (C) 2011 Luis Ángel Fernández Fernández <laffdez@gmail.com>
5  */
6 
7 /***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #include "keyexport.h"
17 #include <KMessageBox>
18 
19 KeyExport::KeyExport(QWidget *parent, const QStringList &keyservers)
20  : KDialog(parent),
21  Ui_KeyExport()
22 {
23  setupUi(this);
24  setMainWidget(widget);
25  setCaption(i18n("Public Key Export"));
26  setButtons(KDialog::Ok | KDialog::Cancel);
27  setDefaultButton(KDialog::Ok);
28  newFilename->setWindowTitle(i18n("Save File"));
29  newFilename->setMode(KFile::File);
30 
31  if (!keyservers.isEmpty()) {
32  checkServer->setEnabled(true);
33  checkServer->setToolTip(QString());
34  destServer->addItems(keyservers);
35  }
36 }
37 
38 void KeyExport::accept()
39 {
40  if (checkFile->isChecked()) {
41  if (QFile::exists(newFilename->url().path().simplified())) {
42  const QString message = i18n("Overwrite existing file %1?", newFilename->url().fileName());
43  int result = KMessageBox::warningContinueCancel(this, message, QString(), KStandardGuiItem::overwrite());
44  if (KMessageBox::Cancel == result)
45  return;
46  }
47  }
48 
49  QDialog::accept();
50 }
51 
52 #include "keyexport.moc"
QWidget
KeyExport::KeyExport
KeyExport(QWidget *parent=0, const QStringList &keyservers=QStringList())
Definition: keyexport.cpp:19
KDialog
QFile::exists
bool exists() const
QList::isEmpty
bool isEmpty() const
Ui_KeyExport
QString
QDialog::accept
virtual void accept()
QStringList
keyexport.h
KeyExport::accept
virtual void accept()
Definition: keyexport.cpp:38
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:42:08 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kgpg

Skip menu "kgpg"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeutils API Reference

Skip menu "kdeutils API Reference"
  • ark
  • filelight
  • kcalc
  • kcharselect
  • kdf
  • kfloppy
  • kgpg
  • ktimer
  • kwallet
  • sweeper

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