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

kget

  • sources
  • kde-4.12
  • kdenetwork
  • kget
  • conf
verificationpreferences.cpp
Go to the documentation of this file.
1 /***************************************************************************
2 * Copyright (C) 2009 Matthias Fuchs <mat69@gmx.net> *
3 * *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
8 * *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
13 * *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . *
18 ***************************************************************************/
19 
20 #include "verificationpreferences.h"
21 #include "settings.h"
22 
23 #include <KConfigDialog>
24 #include <KDialog>
25 #include <KLineEdit>
26 #include <KLocale>
27 #include <KUrlRequester>
28 
29 VerificationPreferences::VerificationPreferences(KConfigDialog *parent, Qt::WindowFlags f)
30  : QWidget(parent, f)
31 {
32  ui.setupUi(this);
33 
34  m_tempKeyServers = Settings::signatureKeyServers();
35  ui.keyservers->upButton()->setText(i18n("&Increase Priority"));
36  ui.keyservers->downButton()->setText(i18n("&Decrease Priority"));
37  ui.keyservers->setItems(m_tempKeyServers);
38 
39 #ifndef HAVE_QGPGME
40  ui.signatureGroup->hide();
41 #endif
42 
43  connect(ui.keyservers,SIGNAL(changed()),this,SIGNAL(changed()));
44  connect(parent, SIGNAL(accepted()), SLOT(slotAccpeted()));
45  connect(parent, SIGNAL(rejected()), SLOT(slotRejected()));
46  connect(parent, SIGNAL(defaultClicked()), SLOT(slotDefaultClicked()));
47 }
48 
49 void VerificationPreferences::slotAccpeted()
50 {
51  ui.keyservers->lineEdit()->clear();
52  m_tempKeyServers = ui.keyservers->items();
53  Settings::self()->setSignatureKeyServers(m_tempKeyServers);
54  Settings::self()->writeConfig();
55 }
56 
57 void VerificationPreferences::slotRejected()
58 {
59  //PreferencesDialog is not recreated, so we have to manually stop the
60  //settings from changing
61  ui.keyservers->setItems(m_tempKeyServers);
62  ui.keyservers->lineEdit()->clear();
63 }
64 
65 void VerificationPreferences::slotDefaultClicked()
66 {
67  ui.keyservers->lineEdit()->clear();
68  KConfigSkeletonItem *item = Settings::self()->findItem("SignatureKeyServers");
69  if (item) {
70  item->readDefault(Settings::self()->config());
71  ui.keyservers->setItems(Settings::signatureKeyServers());
72  }
73 }
74 
75 #include "verificationpreferences.moc"
VerificationPreferences::changed
void changed()
Emitted when the mirrors change.
QWidget
VerificationPreferences::VerificationPreferences
VerificationPreferences(KConfigDialog *parent, Qt::WindowFlags f=0)
Definition: verificationpreferences.cpp:29
Settings::setSignatureKeyServers
static void setSignatureKeyServers(const QStringList &v)
Set SignatureKeyServers.
Definition: settings.h:1085
Settings::self
static Settings * self()
Definition: settings.cpp:17
KConfigDialog
verificationpreferences.h
Settings::signatureKeyServers
static QStringList signatureKeyServers()
Get SignatureKeyServers.
Definition: settings.h:1095
settings.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:53:18 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kget

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

kdenetwork API Reference

Skip menu "kdenetwork API Reference"
  • kget
  • kopete
  •   kopete
  •   libkopete
  • krdc
  • krfb

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