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

libkleo

  • sources
  • kde-4.12
  • kdepim
  • libkleo
  • ui
cryptoconfigmodule.cpp
Go to the documentation of this file.
1 /*
2  cryptoconfigmodule.cpp
3 
4  This file is part of kgpgcertmanager
5  Copyright (c) 2004 Klar�vdalens Datakonsult AB
6 
7  Libkleopatra is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License,
9  version 2, as published by the Free Software Foundation.
10 
11  Libkleopatra is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 
20  In addition, as a special exception, the copyright holders give
21  permission to link the code of this program with any edition of
22  the Qt library by Trolltech AS, Norway (or with modified versions
23  of Qt that use the same license as Qt), and distribute linked
24  combinations including the two. You must obey the GNU General
25  Public License in all respects for all of the code used other than
26  Qt. If you modify this file, you may extend this exception to
27  your version of the file, but you are not obligated to do so. If
28  you do not wish to do so, delete this exception statement from
29  your version.
30 */
31 
32 #include "cryptoconfigmodule.h"
33 #include "cryptoconfigmodule_p.h"
34 #include "directoryserviceswidget.h"
35 #include "kdhorizontalline.h"
36 #include "filenamerequester.h"
37 
38 #include "kleo/cryptoconfig.h"
39 
40 #include <klineedit.h>
41 #include <klocale.h>
42 #include <kdebug.h>
43 #include <knuminput.h>
44 #include <kiconloader.h>
45 #include <kglobal.h>
46 #include <kcomponentdata.h>
47 #include <kicon.h>
48 #ifndef KDEPIM_ONLY_KLEO
49 # include <kurlrequester.h>
50 #endif
51 
52 #include <QApplication>
53 #include <QLabel>
54 #include <QLayout>
55 #include <QPushButton>
56 #include <QRegExp>
57 #include <QPixmap>
58 #include <QVBoxLayout>
59 #include <QList>
60 #include <QHBoxLayout>
61 #include <QGridLayout>
62 #include <QScrollArea>
63 #include <QDesktopWidget>
64 #include <QCheckBox>
65 #include <QStyle>
66 #include <QComboBox>
67 #include <QGroupBox>
68 
69 #include <cassert>
70 #include <memory>
71 
72 using namespace Kleo;
73 
74 namespace {
75 
76 class ScrollArea : public QScrollArea {
77 public:
78  explicit ScrollArea( QWidget* p ) : QScrollArea( p ) {}
79  /* reimp */ QSize sizeHint() const {
80  const QSize wsz = widget() ? widget()->sizeHint() : QSize();
81  return QSize( wsz.width() + style()->pixelMetric( QStyle::PM_ScrollBarExtent ), QScrollArea::sizeHint().height() );
82  }
83 };
84 
85 }
86 inline KIcon loadIcon( const QString &s ) {
87  QString ss = s;
88  return KIcon( ss.replace( QRegExp( QLatin1String("[^a-zA-Z0-9_]") ), QLatin1String("-") ) );
89 }
90 
91 static unsigned int num_components_with_options( const Kleo::CryptoConfig * config ) {
92  if ( !config )
93  return 0;
94  const QStringList components = config->componentList();
95  unsigned int result = 0;
96  for ( QStringList::const_iterator it = components.begin() ; it != components.end() ; ++it )
97  if ( const Kleo::CryptoConfigComponent * const comp = config->component( *it ) )
98  if ( !comp->groupList().empty() )
99  ++result;
100  return result;
101 }
102 
103 static KPageView::FaceType determineJanusFace( const Kleo::CryptoConfig * config, Kleo::CryptoConfigModule::Layout layout, bool & ok ) {
104  ok = true;
105  if ( num_components_with_options( config ) < 2 ) {
106  ok = false;
107  return KPageView::Plain;
108  }
109  return
110  layout == CryptoConfigModule::LinearizedLayout ? KPageView::Plain :
111  layout == CryptoConfigModule::TabbedLayout ? KPageView::Tabbed :
112  /* else */ KPageView::List ;
113 }
114 
115 Kleo::CryptoConfigModule::CryptoConfigModule( Kleo::CryptoConfig* config, QWidget * parent )
116  : KPageWidget( parent ), mConfig( config )
117 {
118  init( IconListLayout );
119 }
120 
121 Kleo::CryptoConfigModule::CryptoConfigModule( Kleo::CryptoConfig* config, Layout layout, QWidget * parent )
122  : KPageWidget( parent ), mConfig( config )
123 {
124  init( layout );
125 }
126 
127 void Kleo::CryptoConfigModule::init( Layout layout ) {
128  if ( QLayout * l = this->layout() )
129  l->setMargin( 0 );
130 
131  Kleo::CryptoConfig * const config = mConfig;
132 
133  bool configOK = false;
134  const KPageView::FaceType type = determineJanusFace( config, layout, configOK );
135 
136  setFaceType(type);
137 
138  QVBoxLayout * vlay = 0;
139  QWidget * vbox = 0;
140 
141  if ( type == Plain ) {
142  QWidget * w = new QWidget(this);
143  QVBoxLayout * l = new QVBoxLayout( w );
144  l->setSpacing( KDialog::spacingHint() );
145  l->setMargin( 0 );
146  QScrollArea * s = new QScrollArea( w );
147  s->setFrameStyle( QFrame::NoFrame );
148  s->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
149  s->setWidgetResizable( true );
150  l->addWidget( s );
151  vbox = new QWidget( s->viewport() );
152  vlay = new QVBoxLayout( vbox );
153  vlay->setMargin( 0 );
154  s->setWidget( vbox );
155  addPage( w, configOK ? QString() : i18n("GpgConf Error") );
156  }
157 
158  const QStringList components = config->componentList();
159  for ( QStringList::const_iterator it = components.begin(); it != components.end(); ++it ) {
160  //kDebug(5150) <<"Component" << (*it).toLocal8Bit() <<":";
161  Kleo::CryptoConfigComponent* comp = config->component( *it );
162  Q_ASSERT( comp );
163  if ( comp->groupList().empty() )
164  continue;
165 
166  std::auto_ptr<CryptoConfigComponentGUI> compGUI( new CryptoConfigComponentGUI( this, comp ) );
167  compGUI->setObjectName( *it );
168  // KJanusWidget doesn't seem to have iterators, so we store a copy...
169  mComponentGUIs.append( compGUI.get() );
170 
171  if ( type == Plain ) {
172  QGroupBox * gb = new QGroupBox( comp->description(), vbox );
173  ( new QVBoxLayout( gb ) )->addWidget( compGUI.release() );
174  vlay->addWidget( gb );
175  } else {
176  vbox = new QWidget(this);
177  vlay = new QVBoxLayout( vbox );
178  vlay->setSpacing( KDialog::spacingHint() );
179  vlay->setMargin( 0 );
180  KPageWidgetItem *pageItem = new KPageWidgetItem( vbox, comp->description() );
181  if ( type != Tabbed )
182  pageItem->setIcon( loadIcon( comp->iconName() ) );
183  addPage(pageItem);
184 
185  QScrollArea* scrollArea = type == Tabbed ? new QScrollArea( vbox ) : new ScrollArea( vbox );
186  scrollArea->setSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::Preferred );
187  scrollArea->setWidgetResizable( true );
188 
189  vlay->addWidget( scrollArea );
190  const QSize compGUISize = compGUI->sizeHint();
191  scrollArea->setWidget( compGUI.release() );
192 
193  // Set a nice startup size
194  const int deskHeight = QApplication::desktop()->height();
195  int dialogHeight;
196  if (deskHeight > 1000) // very big desktop ?
197  dialogHeight = 800;
198  else if (deskHeight > 650) // big desktop ?
199  dialogHeight = 500;
200  else // small (800x600, 640x480) desktop
201  dialogHeight = 400;
202  assert( scrollArea->widget() );
203  if ( type != Tabbed )
204  scrollArea->setMinimumHeight( qMin( compGUISize.height(), dialogHeight ) );
205  }
206  }
207  if ( mComponentGUIs.empty() ) {
208  const QString msg = i18n("The gpgconf tool used to provide the information "
209  "for this dialog does not seem to be installed "
210  "properly. It did not return any components. "
211  "Try running \"%1\" on the command line for more "
212  "information.",
213  components.empty() ? QLatin1String("gpgconf --list-components") : QLatin1String("gpgconf --list-options gpg") );
214  QLabel * label = new QLabel( msg, vbox );
215  label->setWordWrap( true);
216  label->setMinimumHeight( fontMetrics().lineSpacing() * 5 );
217  vlay->addWidget( label );
218  }
219 }
220 
221 bool Kleo::CryptoConfigModule::hasError() const {
222  return mComponentGUIs.empty();
223 }
224 
225 void Kleo::CryptoConfigModule::save()
226 {
227  bool changed = false;
228  QList<CryptoConfigComponentGUI *>::Iterator it = mComponentGUIs.begin();
229  for( ; it != mComponentGUIs.end(); ++it ) {
230  if ( (*it)->save() )
231  changed = true;
232  }
233  if ( changed )
234  mConfig->sync(true /*runtime*/);
235 }
236 
237 void Kleo::CryptoConfigModule::reset()
238 {
239  QList<CryptoConfigComponentGUI *>::Iterator it = mComponentGUIs.begin();
240  for( ; it != mComponentGUIs.end(); ++it ) {
241  (*it)->load();
242  }
243 }
244 
245 void Kleo::CryptoConfigModule::defaults()
246 {
247  QList<CryptoConfigComponentGUI *>::Iterator it = mComponentGUIs.begin();
248  for( ; it != mComponentGUIs.end(); ++it ) {
249  (*it)->defaults();
250  }
251 }
252 
253 void Kleo::CryptoConfigModule::cancel()
254 {
255  mConfig->clear();
256 }
257 
259 
260 Kleo::CryptoConfigComponentGUI::CryptoConfigComponentGUI(
261  CryptoConfigModule* module, Kleo::CryptoConfigComponent* component,
262  QWidget* parent )
263  : QWidget( parent ),
264  mComponent( component )
265 {
266  QGridLayout * glay = new QGridLayout( this );
267  glay->setSpacing( KDialog::spacingHint() );
268  const QStringList groups = mComponent->groupList();
269  if ( groups.size() > 1 ) {
270  glay->setColumnMinimumWidth( 0, KDHorizontalLine::indentHint() );
271  for ( QStringList::const_iterator it = groups.begin(), end = groups.end() ; it != end; ++it ) {
272  Kleo::CryptoConfigGroup* group = mComponent->group( *it );
273  Q_ASSERT( group );
274  if ( !group )
275  continue;
276  const QString title = group->description();
277  KDHorizontalLine * hl = new KDHorizontalLine( title.isEmpty() ? *it : title, this );
278  const int row = glay->rowCount();
279  glay->addWidget( hl, row, 0, 1, 3 );
280  mGroupGUIs.append( new CryptoConfigGroupGUI( module, group, glay, this ) );
281  }
282  } else if ( !groups.empty() ) {
283  mGroupGUIs.append( new CryptoConfigGroupGUI( module, mComponent->group( groups.front() ), glay, this ) );
284  }
285  glay->setRowStretch( glay->rowCount(), 1 );
286 }
287 
288 
289 bool Kleo::CryptoConfigComponentGUI::save()
290 {
291  bool changed = false;
292  QList<CryptoConfigGroupGUI *>::Iterator it = mGroupGUIs.begin();
293  for( ; it != mGroupGUIs.end(); ++it ) {
294  if ( (*it)->save() )
295  changed = true;
296  }
297  return changed;
298 }
299 
300 void Kleo::CryptoConfigComponentGUI::load()
301 {
302  QList<CryptoConfigGroupGUI *>::Iterator it = mGroupGUIs.begin();
303  for( ; it != mGroupGUIs.end(); ++it )
304  (*it)->load();
305 }
306 
307 void Kleo::CryptoConfigComponentGUI::defaults()
308 {
309  QList<CryptoConfigGroupGUI *>::Iterator it = mGroupGUIs.begin();
310  for( ; it != mGroupGUIs.end(); ++it )
311  (*it)->defaults();
312 }
313 
315 
316 Kleo::CryptoConfigGroupGUI::CryptoConfigGroupGUI(
317  CryptoConfigModule* module, Kleo::CryptoConfigGroup* group,
318  QGridLayout * glay, QWidget* widget)
319  : QObject( module ), mGroup( group )
320 {
321  const int startRow = glay->rowCount();
322  const QStringList entries = mGroup->entryList();
323  for( QStringList::const_iterator it = entries.begin(), end = entries.end() ; it != end; ++it ) {
324  Kleo::CryptoConfigEntry* entry = group->entry( *it );
325  Q_ASSERT( entry );
326  if ( entry->level() > CryptoConfigEntry::Level_Advanced ) {
327  kDebug(5150) << "entry" << *it << "too advanced, skipping";
328  continue;
329  }
330  CryptoConfigEntryGUI* entryGUI =
331  CryptoConfigEntryGUIFactory::createEntryGUI( module, entry, *it, glay, widget );
332  if ( entryGUI ) {
333  mEntryGUIs.append( entryGUI );
334  entryGUI->load();
335  }
336  }
337  const int endRow = glay->rowCount() - 1;
338  if ( endRow < startRow )
339  return;
340 
341  const QString iconName = group->iconName();
342  if ( iconName.isEmpty() )
343  return;
344 
345  QLabel * l = new QLabel( widget );
346  l->setPixmap( loadIcon( iconName ).pixmap( KIconLoader::SizeMedium, KIconLoader::SizeMedium ) );
347  glay->addWidget( l, startRow, 0, endRow-startRow+1, 1, Qt::AlignTop );
348 }
349 
350 bool Kleo::CryptoConfigGroupGUI::save()
351 {
352  bool changed = false;
353  QList<CryptoConfigEntryGUI *>::Iterator it = mEntryGUIs.begin();
354  for( ; it != mEntryGUIs.end(); ++it ) {
355  if ( (*it)->isChanged() ) {
356  (*it)->save();
357  changed = true;
358  }
359  }
360  return changed;
361 }
362 
363 void Kleo::CryptoConfigGroupGUI::load()
364 {
365  QList<CryptoConfigEntryGUI *>::Iterator it = mEntryGUIs.begin();
366  for( ; it != mEntryGUIs.end(); ++it )
367  (*it)->load();
368 }
369 
370 void Kleo::CryptoConfigGroupGUI::defaults()
371 {
372  QList<CryptoConfigEntryGUI *>::Iterator it = mEntryGUIs.begin();
373  for( ; it != mEntryGUIs.end(); ++it )
374  (*it)->resetToDefault();
375 }
376 
378 
379 typedef CryptoConfigEntryGUI * (*constructor)( CryptoConfigModule *, Kleo::CryptoConfigEntry *, const QString &, QGridLayout *, QWidget * );
380 
381 namespace {
382 template <typename T_Widget>
383 CryptoConfigEntryGUI * _create( CryptoConfigModule * m, Kleo::CryptoConfigEntry * e, const QString & n, QGridLayout * l, QWidget * p ) {
384  return new T_Widget( m, e, n, l, p );
385 }
386 }
387 
388 static const struct WidgetsByEntryName {
389  const char * entryGlob;
390  constructor create;
391 } widgetsByEntryName[] = {
392  { "*/*/debug-level", &_create<CryptoConfigEntryDebugLevel> },
393  { "gpg/*/keyserver", &_create<CryptoConfigEntryKeyserver> }
394 };
395 static const unsigned int numWidgetsByEntryName = sizeof widgetsByEntryName / sizeof *widgetsByEntryName;
396 
397 static const constructor listWidgets[CryptoConfigEntry::NumArgType] = {
398  // None: A list of options with no arguments (e.g. -v -v -v) is shown as a spinbox
399  &_create<CryptoConfigEntrySpinBox>,
400  0, // String
401  // Int/UInt: Let people type list of numbers (1,2,3....). Untested.
402  &_create<CryptoConfigEntryLineEdit>,
403  &_create<CryptoConfigEntryLineEdit>,
404  0, // Path
405  0, // URL
406  &_create<CryptoConfigEntryLDAPURL>,
407  0, // DirPath
408 };
409 
410 static const constructor scalarWidgets[CryptoConfigEntry::NumArgType] = {
411  &_create<CryptoConfigEntryCheckBox>, // None
412  &_create<CryptoConfigEntryLineEdit>, // String
413  &_create<CryptoConfigEntrySpinBox>, // Int
414  &_create<CryptoConfigEntrySpinBox>, // UInt
415  &_create<CryptoConfigEntryPath>, // Path
416  &_create<CryptoConfigEntryURL>, // URL
417  0, // LDAPURL
418  &_create<CryptoConfigEntryDirPath>, // DirPath
419 };
420 
421 CryptoConfigEntryGUI* Kleo::CryptoConfigEntryGUIFactory::createEntryGUI( CryptoConfigModule* module, Kleo::CryptoConfigEntry* entry, const QString& entryName, QGridLayout * glay, QWidget* widget )
422 {
423  assert( entry );
424 
425  // try to lookup by path:
426  const QString path = entry->path();
427  for ( unsigned int i = 0 ; i < numWidgetsByEntryName ; ++i )
428  if ( QRegExp( QLatin1String( widgetsByEntryName[i].entryGlob ), Qt::CaseSensitive, QRegExp::Wildcard ).exactMatch( path ) )
429  return widgetsByEntryName[i].create( module, entry, entryName, glay, widget );
430 
431  // none found, so look up by type:
432  const unsigned int argType = entry->argType();
433  assert( argType < CryptoConfigEntry::NumArgType );
434  if ( entry->isList() )
435  if ( const constructor create = listWidgets[argType] )
436  return create( module, entry, entryName, glay, widget );
437  else
438  kWarning(5150) <<"No widget implemented for list of type" << entry->argType();
439  else
440  if ( const constructor create = scalarWidgets[argType] )
441  return create( module, entry, entryName, glay, widget );
442  else
443  kWarning(5150) <<"No widget implemented for type" << entry->argType();
444 
445  return 0;
446 }
447 
449 
450 Kleo::CryptoConfigEntryGUI::CryptoConfigEntryGUI(
451  CryptoConfigModule* module,
452  Kleo::CryptoConfigEntry* entry,
453  const QString& entryName )
454  : QObject( module ), mEntry( entry ), mName( entryName ), mChanged( false )
455 {
456  connect( this, SIGNAL(changed()), module, SIGNAL(changed()) );
457 }
458 
459 QString Kleo::CryptoConfigEntryGUI::description() const
460 {
461  QString descr = mEntry->description();
462  if ( descr.isEmpty() ) // shouldn't happen
463  return QString::fromLatin1( "<%1>" ).arg( mName );
464  if ( i18nc( "Translate this to 'yes' or 'no' (use the English words!) "
465  "depending on whether your language uses "
466  "Sentence style capitalisation in GUI labels (yes) or not (no). "
467  "Context: We get some backend strings in that have the wrong "
468  "capitalizaion (in English, at least) so we need to force the "
469  "first character to upper-case. It is this behaviour you can "
470  "control for your language with this translation.", "yes" ) == QLatin1String( "yes" ) )
471  descr[0] = descr[0].toUpper();
472  return descr;
473 }
474 
475 void Kleo::CryptoConfigEntryGUI::resetToDefault()
476 {
477  mEntry->resetToDefault();
478  load();
479 }
480 
482 
483 Kleo::CryptoConfigEntryLineEdit::CryptoConfigEntryLineEdit(
484  CryptoConfigModule* module,
485  Kleo::CryptoConfigEntry* entry, const QString& entryName,
486  QGridLayout * glay, QWidget* widget )
487  : CryptoConfigEntryGUI( module, entry, entryName )
488 {
489  const int row = glay->rowCount();
490  mLineEdit = new KLineEdit( widget );
491  QLabel *label = new QLabel( description(), widget );
492  label->setBuddy( mLineEdit );
493  glay->addWidget( label, row, 1 );
494  glay->addWidget( mLineEdit, row, 2 );
495  if ( entry->isReadOnly() ) {
496  label->setEnabled( false );
497  mLineEdit->setEnabled( false );
498  } else {
499  connect( mLineEdit, SIGNAL(textChanged(QString)), SLOT(slotChanged()) );
500  }
501 }
502 
503 void Kleo::CryptoConfigEntryLineEdit::doSave()
504 {
505  mEntry->setStringValue( mLineEdit->text() );
506 }
507 
508 void Kleo::CryptoConfigEntryLineEdit::doLoad()
509 {
510  mLineEdit->setText( mEntry->stringValue() );
511 }
512 
514 
515 static const struct {
516  const char * label;
517  const char * name;
518 } debugLevels[] = {
519  { I18N_NOOP( "0 - None (no debugging at all)" ), "none" },
520  { I18N_NOOP( "1 - Basic (some basic debug messages)" ), "basic" },
521  { I18N_NOOP( "2 - Advanced (more verbose debug messages)" ), "advanced" },
522  { I18N_NOOP( "3 - Expert (even more detailed messages)" ), "expert" },
523  { I18N_NOOP( "4 - Guru (all of the debug messages you can get)" ), "guru" },
524 };
525 static const unsigned int numDebugLevels = sizeof debugLevels / sizeof *debugLevels;
526 
527 Kleo::CryptoConfigEntryDebugLevel::CryptoConfigEntryDebugLevel( CryptoConfigModule * module, Kleo::CryptoConfigEntry * entry,
528  const QString & entryName, QGridLayout * glay, QWidget * widget )
529  : CryptoConfigEntryGUI( module, entry, entryName ),
530  mComboBox( new QComboBox( widget ) )
531 {
532  QLabel *label = new QLabel( i18n("Set the debugging level to"), widget );
533  label->setBuddy( mComboBox );
534 
535  for ( unsigned int i = 0 ; i < numDebugLevels ; ++i )
536  mComboBox->addItem( i18n( debugLevels[i].label ) );
537 
538  if ( entry->isReadOnly() ) {
539  label->setEnabled( false );
540  mComboBox->setEnabled( false );
541  } else {
542  connect( mComboBox, SIGNAL(currentIndexChanged(int)), SLOT(slotChanged()) );
543  }
544 
545  const int row = glay->rowCount();
546  glay->addWidget( label, row, 1 );
547  glay->addWidget( mComboBox, row, 2 );
548 }
549 
550 void Kleo::CryptoConfigEntryDebugLevel::doSave()
551 {
552  const unsigned int idx = mComboBox->currentIndex();
553  if ( idx < numDebugLevels )
554  mEntry->setStringValue( QLatin1String( debugLevels[idx].name ) );
555  else
556  mEntry->setStringValue( QString() );
557 }
558 
559 void Kleo::CryptoConfigEntryDebugLevel::doLoad()
560 {
561  const QString str = mEntry->stringValue();
562  for ( unsigned int i = 0 ; i < numDebugLevels ; ++i )
563  if ( str == QLatin1String( debugLevels[i].name ) ) {
564  mComboBox->setCurrentIndex( i );
565  return;
566  }
567  mComboBox->setCurrentIndex( 0 );
568 }
569 
571 
572 Kleo::CryptoConfigEntryPath::CryptoConfigEntryPath(
573  CryptoConfigModule* module,
574  Kleo::CryptoConfigEntry* entry, const QString& entryName,
575  QGridLayout * glay, QWidget* widget )
576  : CryptoConfigEntryGUI( module, entry, entryName ),
577  mUrlRequester( 0 ),
578  mFileNameRequester( 0 )
579 {
580  const int row = glay->rowCount();
581  QWidget * req;
582 #ifdef KDEPIM_ONLY_KLEO
583  req = mFileNameRequester = new FileNameRequester( widget );
584  mFileNameRequester->setExistingOnly( false );
585  mFileNameRequester->setFilter( QDir::Files );
586 #else
587  req = mUrlRequester = new KUrlRequester( widget );
588  mUrlRequester->setMode( KFile::File | KFile::LocalOnly );
589 #endif
590  QLabel *label = new QLabel( description(), widget );
591  label->setBuddy( req );
592  glay->addWidget( label, row, 1 );
593  glay->addWidget( req, row, 2 );
594  if ( entry->isReadOnly() ) {
595  label->setEnabled( false );
596 #ifndef KDEPIM_ONLY_KLEO
597  if ( mUrlRequester )
598  mUrlRequester->setEnabled( false );
599 #endif
600  if ( mFileNameRequester )
601  mFileNameRequester->setEnabled( false );
602  } else {
603 #ifndef KDEPIM_ONLY_KLEO
604  if ( mUrlRequester )
605  connect( mUrlRequester, SIGNAL(textChanged(QString)),
606  this, SLOT(slotChanged()) );
607 #endif
608  if ( mFileNameRequester )
609  connect( mFileNameRequester, SIGNAL(fileNameChanged(QString)),
610  this, SLOT(slotChanged()) );
611  }
612 }
613 
614 void Kleo::CryptoConfigEntryPath::doSave()
615 {
616 #ifdef KDEPIM_ONLY_KLEO
617  mEntry->setURLValue( KUrl::fromPath( mFileNameRequester->fileName() ) );
618 #else
619  mEntry->setURLValue( mUrlRequester->url() );
620 #endif
621 }
622 
623 void Kleo::CryptoConfigEntryPath::doLoad()
624 {
625 #ifdef KDEPIM_ONLY_KLEO
626  mFileNameRequester->setFileName( mEntry->urlValue().toLocalFile() );
627 #else
628  mUrlRequester->setUrl( mEntry->urlValue() );
629 #endif
630 }
631 
633 
634 Kleo::CryptoConfigEntryDirPath::CryptoConfigEntryDirPath(
635  CryptoConfigModule* module,
636  Kleo::CryptoConfigEntry* entry, const QString& entryName,
637  QGridLayout * glay, QWidget* widget )
638  : CryptoConfigEntryGUI( module, entry, entryName ),
639  mUrlRequester( 0 ),
640  mFileNameRequester( 0 )
641 {
642  const int row = glay->rowCount();
643  QWidget * req;
644 #ifdef KDEPIM_ONLY_KLEO
645  req = mFileNameRequester = new FileNameRequester( widget );
646  mFileNameRequester->setExistingOnly( false );
647  mFileNameRequester->setFilter( QDir::Dirs );
648 #else
649  req = mUrlRequester = new KUrlRequester( widget );
650  mUrlRequester->setMode( KFile::Directory | KFile::LocalOnly );
651 #endif
652  QLabel *label = new QLabel( description(), widget );
653  label->setBuddy( req );
654  glay->addWidget( label, row, 1 );
655  glay->addWidget( req, row, 2 );
656  if ( entry->isReadOnly() ) {
657  label->setEnabled( false );
658 #ifndef KDEPIM_ONLY_KLEO
659  if ( mUrlRequester )
660  mUrlRequester->setEnabled( false );
661 #endif
662  if ( mFileNameRequester )
663  mFileNameRequester->setEnabled( false );
664  } else {
665 #ifndef KDEPIM_ONLY_KLEO
666  if ( mUrlRequester )
667  connect( mUrlRequester, SIGNAL(textChanged(QString)),
668  this, SLOT(slotChanged()) );
669 #endif
670  if ( mFileNameRequester )
671  connect( mFileNameRequester, SIGNAL(fileNameChanged(QString)),
672  this, SLOT(slotChanged()) );
673  }
674 }
675 
676 void Kleo::CryptoConfigEntryDirPath::doSave()
677 {
678 #ifdef KDEPIM_ONLY_KLEO
679  mEntry->setURLValue( KUrl::fromPath( mFileNameRequester->fileName() ) );
680 #else
681  mEntry->setURLValue( mUrlRequester->url() );
682 #endif
683 }
684 
685 void Kleo::CryptoConfigEntryDirPath::doLoad()
686 {
687 #ifdef KDEPIM_ONLY_KLEO
688  mFileNameRequester->setFileName( mEntry->urlValue().toLocalFile() );
689 #else
690  mUrlRequester->setUrl( mEntry->urlValue() );
691 #endif
692 }
693 
695 
696 Kleo::CryptoConfigEntryURL::CryptoConfigEntryURL(
697  CryptoConfigModule* module,
698  Kleo::CryptoConfigEntry* entry, const QString& entryName,
699  QGridLayout * glay, QWidget* widget )
700  : CryptoConfigEntryGUI( module, entry, entryName ),
701  mLineEdit( 0 )
702 #ifndef KDEPIM_ONLY_KLEO
703  , mUrlRequester( 0 )
704 #endif
705 {
706  const int row = glay->rowCount();
707  QWidget * req;
708 #ifdef KDEPIM_ONLY_KLEO
709  req = mLineEdit = new QLineEdit( widget );
710 #else
711  req = mUrlRequester = new KUrlRequester( widget );
712  mUrlRequester->setMode( KFile::File | KFile::ExistingOnly );
713 #endif
714  QLabel *label = new QLabel( description(), widget );
715  label->setBuddy( req );
716  glay->addWidget( label, row, 1 );
717  glay->addWidget( req, row, 2 );
718  if ( entry->isReadOnly() ) {
719  label->setEnabled( false );
720 #ifndef KDEPIM_ONLY_KLEO
721  if ( mUrlRequester )
722  mUrlRequester->setEnabled( false );
723 #endif
724  if ( mLineEdit )
725  mLineEdit->setEnabled( false );
726  } else {
727  connect( req, SIGNAL(textChanged(QString)),
728  this, SLOT(slotChanged()) );
729  }
730 }
731 
732 void Kleo::CryptoConfigEntryURL::doSave()
733 {
734 #ifdef KDEPIM_ONLY_KLEO
735  mEntry->setURLValue( KUrl( mLineEdit->text() ) );
736 #else
737  mEntry->setURLValue( mUrlRequester->url() );
738 #endif
739 }
740 
741 void Kleo::CryptoConfigEntryURL::doLoad()
742 {
743 #ifdef KDEPIM_ONLY_KLEO
744  mLineEdit->setText( mEntry->urlValue().url() );
745 #else
746  mUrlRequester->setUrl( mEntry->urlValue().url() );
747 #endif
748 }
749 
751 
752 Kleo::CryptoConfigEntrySpinBox::CryptoConfigEntrySpinBox(
753  CryptoConfigModule* module,
754  Kleo::CryptoConfigEntry* entry, const QString& entryName,
755  QGridLayout * glay, QWidget* widget )
756  : CryptoConfigEntryGUI( module, entry, entryName )
757 {
758 
759  if ( entry->argType() == Kleo::CryptoConfigEntry::ArgType_None && entry->isList() ) {
760  mKind = ListOfNone;
761  } else if ( entry->argType() == Kleo::CryptoConfigEntry::ArgType_UInt ) {
762  mKind = UInt;
763  } else {
764  Q_ASSERT( entry->argType() == Kleo::CryptoConfigEntry::ArgType_Int );
765  mKind = Int;
766  }
767 
768  const int row = glay->rowCount();
769  mNumInput = new KIntNumInput( widget );
770  QLabel *label = new QLabel( description(), widget );
771  label->setBuddy( mNumInput );
772  glay->addWidget( label, row, 1 );
773  glay->addWidget( mNumInput, row, 2 );
774 
775  if ( entry->isReadOnly() ) {
776  label->setEnabled( false );
777  mNumInput->setEnabled( false );
778  } else {
779  if ( mKind == UInt || mKind == ListOfNone )
780  mNumInput->setMinimum( 0 );
781  connect( mNumInput, SIGNAL(valueChanged(int)), SLOT(slotChanged()) );
782  }
783 }
784 
785 void Kleo::CryptoConfigEntrySpinBox::doSave()
786 {
787  int value = mNumInput->value();
788  switch ( mKind ) {
789  case ListOfNone:
790  mEntry->setNumberOfTimesSet( value );
791  break;
792  case UInt:
793  mEntry->setUIntValue( value );
794  break;
795  case Int:
796  mEntry->setIntValue( value );
797  break;
798  }
799 }
800 
801 void Kleo::CryptoConfigEntrySpinBox::doLoad()
802 {
803  int value = 0;
804  switch ( mKind ) {
805  case ListOfNone:
806  value = mEntry->numberOfTimesSet();
807  break;
808  case UInt:
809  value = mEntry->uintValue();
810  break;
811  case Int:
812  value = mEntry->intValue();
813  break;
814  }
815  mNumInput->setValue( value );
816 }
817 
819 
820 Kleo::CryptoConfigEntryCheckBox::CryptoConfigEntryCheckBox(
821  CryptoConfigModule* module,
822  Kleo::CryptoConfigEntry* entry, const QString& entryName,
823  QGridLayout * glay, QWidget* widget )
824  : CryptoConfigEntryGUI( module, entry, entryName )
825 {
826  const int row = glay->rowCount();
827  mCheckBox = new QCheckBox( widget );
828  glay->addWidget( mCheckBox, row, 1, 1, 2 );
829  mCheckBox->setText( description() );
830  if ( entry->isReadOnly() ) {
831  mCheckBox->setEnabled( false );
832  } else {
833  connect( mCheckBox, SIGNAL(toggled(bool)), SLOT(slotChanged()) );
834  }
835 }
836 
837 void Kleo::CryptoConfigEntryCheckBox::doSave()
838 {
839  mEntry->setBoolValue( mCheckBox->isChecked() );
840 }
841 
842 void Kleo::CryptoConfigEntryCheckBox::doLoad()
843 {
844  mCheckBox->setChecked( mEntry->boolValue() );
845 }
846 
847 
848 
849 Kleo::CryptoConfigEntryLDAPURL::CryptoConfigEntryLDAPURL(
850  CryptoConfigModule* module,
851  Kleo::CryptoConfigEntry* entry,
852  const QString& entryName,
853  QGridLayout * glay, QWidget* widget )
854  : CryptoConfigEntryGUI( module, entry, entryName )
855 {
856  mLabel = new QLabel( widget );
857  mPushButton = new QPushButton( entry->isReadOnly() ? i18n("Show...") : i18n( "Edit..." ), widget );
858 
859 
860  const int row = glay->rowCount();
861  QLabel *label = new QLabel( description(), widget );
862  label->setBuddy( mPushButton );
863  glay->addWidget( label, row, 1 );
864  QHBoxLayout * hlay = new QHBoxLayout;
865  glay->addLayout( hlay, row, 2 );
866  hlay->addWidget( mLabel, 1 );
867  hlay->addWidget( mPushButton );
868 
869  if ( entry->isReadOnly() )
870  mLabel->setEnabled( false );
871  connect( mPushButton, SIGNAL(clicked()), SLOT(slotOpenDialog()) );
872 }
873 
874 void Kleo::CryptoConfigEntryLDAPURL::doLoad()
875 {
876  setURLList( mEntry->urlValueList() );
877 }
878 
879 void Kleo::CryptoConfigEntryLDAPURL::doSave()
880 {
881  mEntry->setURLValueList( mURLList );
882 }
883 
884 void Kleo::CryptoConfigEntryLDAPURL::slotOpenDialog()
885 {
886  // I'm a bad boy and I do it all on the stack. Enough classes already :)
887  // This is just a simple dialog around the directory-services-widget
888  KDialog dialog( mPushButton->parentWidget() );
889  dialog.setCaption( i18n( "Configure LDAP Servers" ) );
890  if ( mEntry->isReadOnly() )
891  dialog.setButtons( KDialog::Ok );
892  else
893  dialog.setButtons( KDialog::Default|KDialog::Cancel|KDialog::Ok );
894  DirectoryServicesWidget* dirserv = new DirectoryServicesWidget( &dialog );
895  dirserv->setX509ReadOnly( mEntry->isReadOnly() );
896  dirserv->setAllowedSchemes( DirectoryServicesWidget::LDAP );
897  dirserv->setAllowedProtocols( DirectoryServicesWidget::X509Protocol );
898  dirserv->addX509Services( mURLList );
899  dialog.setMainWidget( dirserv );
900  connect( &dialog, SIGNAL(defaultClicked()), dirserv, SLOT(clear()) );
901  if ( dialog.exec() ) {
902  setURLList( dirserv->x509Services() );
903  slotChanged();
904  }
905 }
906 
907 void Kleo::CryptoConfigEntryLDAPURL::setURLList( const KUrl::List& urlList )
908 {
909  mURLList = urlList;
910  if ( mURLList.isEmpty() )
911  mLabel->setText( i18n( "No server configured yet" ) );
912  else
913  mLabel->setText( i18np( "1 server configured", "%1 servers configured", mURLList.count() ) );
914 }
915 
916 
917 
918 Kleo::CryptoConfigEntryKeyserver::CryptoConfigEntryKeyserver(
919  CryptoConfigModule* module,
920  Kleo::CryptoConfigEntry* entry,
921  const QString& entryName,
922  QGridLayout * glay, QWidget* widget )
923  : CryptoConfigEntryGUI( module, entry, entryName )
924 {
925  mLabel = new QLabel( widget );
926  mPushButton = new QPushButton( i18n( "Edit..." ), widget );
927 
928 
929  const int row = glay->rowCount();
930  QLabel *label = new QLabel( i18n("Use keyserver at"), widget );
931  label->setBuddy( mPushButton );
932  glay->addWidget( label, row, 1 );
933  QHBoxLayout * hlay = new QHBoxLayout;
934  glay->addLayout( hlay, row, 2 );
935  hlay->addWidget( mLabel, 1 );
936  hlay->addWidget( mPushButton );
937 
938  if ( entry->isReadOnly() ) {
939  mLabel->setEnabled( false );
940  mPushButton->hide();
941  } else {
942  connect( mPushButton, SIGNAL(clicked()), SLOT(slotOpenDialog()) );
943  }
944 }
945 
946 Kleo::ParsedKeyserver Kleo::parseKeyserver( const QString & str ) {
947  const QStringList list = str.split( QRegExp( QLatin1String( "[\\s,]" ) ), QString::SkipEmptyParts );
948  if ( list.empty() )
949  return Kleo::ParsedKeyserver();
950  Kleo::ParsedKeyserver result;
951  result.url = list.front();
952  Q_FOREACH( const QString & kvpair, list.mid( 1 ) ) {
953  const int idx = kvpair.indexOf( QLatin1Char( '=' ) );
954  if ( idx < 0 ) {
955  result.options.push_back( qMakePair( kvpair, QString() ) ); // null QString
956  } else {
957  const QString key = kvpair.left( idx );
958  const QString value = kvpair.mid( idx+1 );
959  if ( value.isEmpty() )
960  result.options.push_back( qMakePair( key, QString::fromLatin1("") ) ); // make sure it's not a null QString, only an empty one
961  else
962  result.options.push_back( qMakePair( key, value ) );
963  }
964  }
965  return result;
966 }
967 
968 QString Kleo::assembleKeyserver( const ParsedKeyserver & keyserver ) {
969  if ( keyserver.options.empty() )
970  return keyserver.url;
971  QString result = keyserver.url;
972  typedef QPair<QString,QString> Pair;
973  Q_FOREACH( const Pair & pair, keyserver.options )
974  if ( pair.second.isNull() )
975  result += QLatin1Char( ' ' ) + pair.first ;
976  else
977  result += QLatin1Char( ' ' ) + pair.first + QLatin1Char( '=' ) + pair.second ;
978  return result;
979 }
980 
981 void Kleo::CryptoConfigEntryKeyserver::doLoad()
982 {
983  mParsedKeyserver = parseKeyserver( mEntry->stringValue() );
984  mLabel->setText( mParsedKeyserver.url );
985 }
986 
987 void Kleo::CryptoConfigEntryKeyserver::doSave()
988 {
989  mParsedKeyserver.url = mLabel->text();
990  mEntry->setStringValue( assembleKeyserver( mParsedKeyserver ) );
991 }
992 
993 static KUrl::List string2urls( const QString & str ) {
994  return str.isEmpty() ? KUrl::List() : KUrl( str ) ;
995 }
996 
997 static QString urls2string( const KUrl::List & urls ) {
998  return urls.empty() ? QString() : urls.front().url() ;
999 }
1000 
1001 void Kleo::CryptoConfigEntryKeyserver::slotOpenDialog()
1002 {
1003  // I'm a bad boy and I do it all on the stack. Enough classes already :)
1004  // This is just a simple dialog around the directory-services-widget
1005  KDialog dialog( mPushButton->parentWidget() );
1006  dialog.setCaption( i18n( "Configure Keyservers" ) );
1007  dialog.setButtons( KDialog::Default|KDialog::Cancel|KDialog::Ok );
1008  DirectoryServicesWidget dirserv( &dialog );
1009  dirserv.setOpenPGPReadOnly( mEntry->isReadOnly() );
1010  dirserv.setAllowedSchemes( DirectoryServicesWidget::AllSchemes );
1011  dirserv.setAllowedProtocols( DirectoryServicesWidget::OpenPGPProtocol );
1012  dirserv.addOpenPGPServices( string2urls( mLabel->text() ) );
1013  dialog.setMainWidget( &dirserv );
1014  connect( &dialog, SIGNAL(defaultClicked()), &dirserv, SLOT(clear()) );
1015  if ( dialog.exec() ) {
1016  mLabel->setText( urls2string( dirserv.openPGPServices() ) );
1017  slotChanged();
1018  }
1019 }
1020 
1021 #include "cryptoconfigmodule.moc"
1022 #include "cryptoconfigmodule_p.moc"
Kleo::CryptoConfigEntryURL::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:741
Kleo::CryptoConfigEntryDebugLevel::CryptoConfigEntryDebugLevel
CryptoConfigEntryDebugLevel(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:527
Kleo::CryptoConfigEntryLineEdit::CryptoConfigEntryLineEdit
CryptoConfigEntryLineEdit(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:483
determineJanusFace
static KPageView::FaceType determineJanusFace(const Kleo::CryptoConfig *config, Kleo::CryptoConfigModule::Layout layout, bool &ok)
Definition: cryptoconfigmodule.cpp:103
Kleo::CryptoConfigEntrySpinBox::CryptoConfigEntrySpinBox
CryptoConfigEntrySpinBox(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:752
Kleo::CryptoConfigEntryLineEdit::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:508
Kleo::CryptoConfigEntryDebugLevel::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:559
Kleo::CryptoConfigEntryGUIFactory::createEntryGUI
static CryptoConfigEntryGUI * createEntryGUI(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *widget)
Definition: cryptoconfigmodule.cpp:421
Kleo::ParsedKeyserver
Definition: cryptoconfigmodule.h:44
Kleo::CryptoConfigEntryPath::CryptoConfigEntryPath
CryptoConfigEntryPath(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:572
Kleo::DirectoryServicesWidget::setOpenPGPReadOnly
void setOpenPGPReadOnly(bool ro)
Definition: directoryserviceswidget.h:122
Kleo::CryptoConfigEntryKeyserver::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:987
numDebugLevels
static const unsigned int numDebugLevels
Definition: cryptoconfigmodule.cpp:525
Kleo::CryptoConfigModule::save
void save()
Definition: cryptoconfigmodule.cpp:225
Kleo::parseKeyserver
KLEO_EXPORT ParsedKeyserver parseKeyserver(const QString &str)
Definition: cryptoconfigmodule.cpp:946
Kleo::CryptoConfigComponentGUI
A widget corresponding to a component in the crypto config.
Definition: cryptoconfigmodule_p.h:69
Kleo::FileNameRequester::setExistingOnly
void setExistingOnly(bool on)
Definition: filenamerequester.cpp:142
Kleo::CryptoConfigGroupGUI::save
bool save()
Definition: cryptoconfigmodule.cpp:350
Kleo::DirectoryServicesWidget::openPGPServices
KUrl::List openPGPServices() const
Definition: directoryserviceswidget.cpp:580
filenamerequester.h
NumArgType
Definition: cryptoconfig.h:90
Kleo::CryptoConfigModule::Layout
Layout
Definition: cryptoconfigmodule.h:60
Kleo::CryptoConfigEntryGUI::CryptoConfigEntryGUI
CryptoConfigEntryGUI(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName)
Definition: cryptoconfigmodule.cpp:450
Kleo::CryptoConfigGroupGUI
A class managing widgets corresponding to a group in the crypto config.
Definition: cryptoconfigmodule_p.h:88
QWidget
Kleo::CryptoConfigEntryDirPath::CryptoConfigEntryDirPath
CryptoConfigEntryDirPath(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:634
Kleo::CryptoConfigModule::defaults
void defaults()
Definition: cryptoconfigmodule.cpp:245
urls2string
static QString urls2string(const KUrl::List &urls)
Definition: cryptoconfigmodule.cpp:997
Kleo::CryptoConfigEntryKeyserver::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:981
KDialog
Kleo::CryptoConfigEntryGUI::load
void load()
Definition: cryptoconfigmodule_p.h:126
Kleo::CryptoConfigGroupGUI::CryptoConfigGroupGUI
CryptoConfigGroupGUI(CryptoConfigModule *module, Kleo::CryptoConfigGroup *group, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:316
QString
name
const char * name
Definition: cryptoconfigmodule.cpp:517
Kleo::CryptoConfigEntryGUI::resetToDefault
void resetToDefault()
Definition: cryptoconfigmodule.cpp:475
QObject
Kleo::CryptoConfigComponentGUI::load
void load()
Definition: cryptoconfigmodule.cpp:300
Kleo::CryptoConfigEntryPath::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:614
cryptoconfigmodule_p.h
Level_Advanced
Definition: cryptoconfig.h:61
loadIcon
KIcon loadIcon(const QString &s)
Definition: cryptoconfigmodule.cpp:86
Kleo::CryptoConfigModule::TabbedLayout
Definition: cryptoconfigmodule.h:60
Kleo::CryptoConfigModule::CryptoConfigModule
CryptoConfigModule(Kleo::CryptoConfig *config, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:115
Kleo::CryptoConfigModule::cancel
void cancel()
Definition: cryptoconfigmodule.cpp:253
label
const char * label
Definition: cryptoconfigmodule.cpp:516
Kleo::CryptoConfigModule::IconListLayout
Definition: cryptoconfigmodule.h:60
debugLevels
static const struct @5 debugLevels[]
Kleo::CryptoConfigEntryCheckBox::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:842
Kleo::CryptoConfigEntryDebugLevel::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:550
num_components_with_options
static unsigned int num_components_with_options(const Kleo::CryptoConfig *config)
Definition: cryptoconfigmodule.cpp:91
Kleo::assembleKeyserver
KLEO_EXPORT QString assembleKeyserver(const ParsedKeyserver &keyserver)
Definition: cryptoconfigmodule.cpp:968
Kleo::CryptoConfigEntrySpinBox::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:785
Kleo::DirectoryServicesWidget::X509Protocol
Definition: directoryserviceswidget.h:61
string2urls
static KUrl::List string2urls(const QString &str)
Definition: cryptoconfigmodule.cpp:993
Kleo::CryptoConfigEntryCheckBox::CryptoConfigEntryCheckBox
CryptoConfigEntryCheckBox(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:820
Kleo::DirectoryServicesWidget::addX509Services
void addX509Services(const KUrl::List &urls)
Definition: directoryserviceswidget.cpp:588
Kleo::DirectoryServicesWidget::OpenPGPProtocol
Definition: directoryserviceswidget.h:62
constructor
CryptoConfigEntryGUI *(* constructor)(CryptoConfigModule *, Kleo::CryptoConfigEntry *, const QString &, QGridLayout *, QWidget *)
Definition: cryptoconfigmodule.cpp:379
KDHorizontalLine::indentHint
static int indentHint()
Definition: kdhorizontalline.cpp:167
numWidgetsByEntryName
static const unsigned int numWidgetsByEntryName
Definition: cryptoconfigmodule.cpp:395
Kleo::CryptoConfigEntryDirPath::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:685
Kleo::CryptoConfigEntrySpinBox::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:801
Kleo::CryptoConfigEntryLineEdit::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:503
KPageWidget
cryptoconfig.h
Kleo::CryptoConfigModule
Crypto Config Module widget, dynamically generated from CryptoConfig It's a simple QWidget so that it...
Definition: cryptoconfigmodule.h:57
Kleo::CryptoConfigComponentGUI::save
bool save()
Definition: cryptoconfigmodule.cpp:289
Kleo::DirectoryServicesWidget::x509Services
KUrl::List x509Services() const
Definition: directoryserviceswidget.cpp:593
cryptoconfigmodule.h
Kleo::CryptoConfigEntryCheckBox::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:837
Kleo::CryptoConfigGroupGUI::load
void load()
Definition: cryptoconfigmodule.cpp:363
widgetsByEntryName
static const struct WidgetsByEntryName widgetsByEntryName[]
Kleo::CryptoConfigEntryGUI::description
QString description() const
Definition: cryptoconfigmodule.cpp:459
Kleo::CryptoConfigEntryLDAPURL::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:879
Kleo::CryptoConfigComponentGUI::CryptoConfigComponentGUI
CryptoConfigComponentGUI(CryptoConfigModule *module, Kleo::CryptoConfigComponent *component, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:260
Kleo::DirectoryServicesWidget::addOpenPGPServices
void addOpenPGPServices(const KUrl::List &urls)
Definition: directoryserviceswidget.cpp:575
Kleo::CryptoConfigEntryPath::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:623
Kleo::CryptoConfigComponentGUI::defaults
void defaults()
Definition: cryptoconfigmodule.cpp:307
listWidgets
static const constructor listWidgets[CryptoConfigEntry::NumArgType]
Definition: cryptoconfigmodule.cpp:397
Kleo::CryptoConfigModule::LinearizedLayout
Definition: cryptoconfigmodule.h:60
Kleo::CryptoConfigEntryURL::CryptoConfigEntryURL
CryptoConfigEntryURL(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:696
Kleo::DirectoryServicesWidget::LDAP
Definition: directoryserviceswidget.h:53
ArgType_UInt
Definition: cryptoconfig.h:84
Kleo::CryptoConfigModule::hasError
bool hasError() const
Definition: cryptoconfigmodule.cpp:221
Kleo::FileNameRequester::setFilter
void setFilter(QDir::Filters f)
Definition: filenamerequester.cpp:150
Kleo::CryptoConfigEntryURL::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:732
Kleo::CryptoConfigGroupGUI::defaults
void defaults()
Definition: cryptoconfigmodule.cpp:370
Kleo::CryptoConfigEntryLDAPURL::doLoad
void doLoad()
Definition: cryptoconfigmodule.cpp:874
Kleo::CryptoConfigModule::reset
void reset()
Definition: cryptoconfigmodule.cpp:237
Kleo::DirectoryServicesWidget::setAllowedSchemes
void setAllowedSchemes(Schemes schemes)
Definition: directoryserviceswidget.cpp:541
kdhorizontalline.h
ArgType_None
Definition: cryptoconfig.h:81
ArgType_Int
Definition: cryptoconfig.h:83
Kleo::CryptoConfigEntryDirPath::doSave
void doSave()
Definition: cryptoconfigmodule.cpp:676
Kleo::ParsedKeyserver::options
QVector< QPair< QString, QString > > options
Definition: cryptoconfigmodule.h:46
Kleo::CryptoConfigEntryGUI
Base class for the widget managers tied to an entry in the crypto config.
Definition: cryptoconfigmodule_p.h:119
Kleo::DirectoryServicesWidget
Definition: directoryserviceswidget.h:42
Kleo::CryptoConfigEntryGUI::changed
void changed()
Kleo::CryptoConfigEntryGUI::slotChanged
void slotChanged()
Definition: cryptoconfigmodule_p.h:137
scalarWidgets
static const constructor scalarWidgets[CryptoConfigEntry::NumArgType]
Definition: cryptoconfigmodule.cpp:410
Kleo::FileNameRequester
Definition: filenamerequester.h:44
KDHorizontalLine
Definition: kdhorizontalline.h:48
Kleo::DirectoryServicesWidget::setX509ReadOnly
void setX509ReadOnly(bool ro)
Definition: directoryserviceswidget.h:129
Kleo::CryptoConfigEntryKeyserver::CryptoConfigEntryKeyserver
CryptoConfigEntryKeyserver(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:918
directoryserviceswidget.h
Kleo::DirectoryServicesWidget::AllSchemes
Definition: directoryserviceswidget.h:55
Kleo::ParsedKeyserver::url
QString url
Definition: cryptoconfigmodule.h:45
Kleo::DirectoryServicesWidget::setAllowedProtocols
void setAllowedProtocols(Protocols protocols)
Definition: directoryserviceswidget.cpp:550
Kleo::CryptoConfigEntryLDAPURL::CryptoConfigEntryLDAPURL
CryptoConfigEntryLDAPURL(CryptoConfigModule *module, Kleo::CryptoConfigEntry *entry, const QString &entryName, QGridLayout *layout, QWidget *parent=0)
Definition: cryptoconfigmodule.cpp:849
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:57:48 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

libkleo

Skip menu "libkleo"
  • 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