• 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
  • conf
configuredialog.cpp
Go to the documentation of this file.
1 /*
2  configuredialog.cpp
3 
4  This file is part of kleopatra
5  Copyright (C) 2000 Espen Sand, espen@kde.org
6  Copyright (C) 2001-2002 Marc Mutz <mutz@kde.org>
7  Copyright (c) 2004,2008 Klarälvdalens Datakonsult AB
8 
9  Libkleopatra is free software; you can redistribute it and/or
10  modify it under the terms of the GNU General Public License,
11  version 2, as published by the Free Software Foundation.
12 
13  Libkleopatra is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with this program; if not, write to the Free Software
20  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 
22  In addition, as a special exception, the copyright holders give
23  permission to link the code of this program with any edition of
24  the Qt library by Trolltech AS, Norway (or with modified versions
25  of Qt that use the same license as Qt), and distribute linked
26  combinations including the two. You must obey the GNU General
27  Public License in all respects for all of the code used other than
28  Qt. If you modify this file, you may extend this exception to
29  your version of the file, but you are not obligated to do so. If
30  you do not wish to do so, delete this exception statement from
31  your version.
32 */
33 
34 #include <config-kleopatra.h>
35 
36 #include "configuredialog.h"
37 
38 #include <kwindowsystem.h>
39 #include <kconfig.h>
40 #include <kiconloader.h>
41 #include <kcmultidialog.h>
42 #include <klocale.h>
43 #include <kconfiggroup.h>
44 
45 #include <QApplication>
46 #include <QIcon>
47 
48 #ifdef KLEO_STATIC_KCMODULES
49 # include <KDesktopFile>
50 # define KCM_IMPORT_PLUGIN( x ) extern "C" KCModule * create_##x( QWidget * parent=0, const QVariantList & args=QVariantList() );
51 # define addMyModule( x ) addModule( KCModuleInfo( KDesktopFile( "services", QLatin1String(#x) + QLatin1String(".desktop") ) ), create_##x() )
52 #else // KLEO_STATIC_KCMODULES
53 # define KCM_IMPORT_PLUGIN( x )
54 # define addMyModule( x ) addModule( QLatin1String(#x) )
55 #endif // KLEO_STATIC_KCMODULES
56 
57 KCM_IMPORT_PLUGIN( kleopatra_config_dirserv )
58 #ifndef KDEPIM_MOBILE_UI
59 KCM_IMPORT_PLUGIN( kleopatra_config_appear )
60 #endif
61 #ifdef HAVE_KLEOPATRACLIENT_LIBRARY
62 # ifndef KDEPIM_MOBILE_UI
63 KCM_IMPORT_PLUGIN( kleopatra_config_cryptooperations )
64 # endif
65 KCM_IMPORT_PLUGIN( kleopatra_config_smimevalidation )
66 #endif
67 KCM_IMPORT_PLUGIN( kleopatra_config_gnupgsystem )
68 
69 ConfigureDialog::ConfigureDialog( QWidget * parent )
70  : KCMultiDialog( parent )
71 {
72  setFaceType( KPageDialog::List );
73  setCaption( i18n( "Configure" ) );
74 #ifdef Q_OS_UNIX
75  KWindowSystem::setIcons( winId(), qApp->windowIcon().pixmap( IconSize( KIconLoader::Desktop ), IconSize( KIconLoader::Desktop ) ),
76  qApp->windowIcon().pixmap( IconSize( KIconLoader::Small ), IconSize( KIconLoader::Small ) ) );
77 #endif
78  showButton( User1, true );
79 #ifdef _WIN32_WCE
80  showButton( Help , false );
81 #endif
82 
83  addMyModule( kleopatra_config_dirserv );
84 #ifndef KDEPIM_MOBILE_UI
85  addMyModule( kleopatra_config_appear );
86 #endif
87 #ifdef HAVE_KLEOPATRACLIENT_LIBRARY
88 # ifndef KDEPIM_MOBILE_UI
89  addMyModule( kleopatra_config_cryptooperations );
90 # endif
91  addMyModule( kleopatra_config_smimevalidation );
92 #endif
93  addMyModule( kleopatra_config_gnupgsystem );
94 
95  // We store the minimum size of the dialog on hide, because otherwise
96  // the KCMultiDialog starts with the size of the first kcm, not
97  // the largest one. This way at least after the first showing of
98  // the largest kcm the size is kept.
99  const KConfigGroup geometry( KGlobal::config(), "Geometry" );
100  const int width = geometry.readEntry( "ConfigureDialogWidth", 0);
101  const int height = geometry.readEntry( "ConfigureDialogHeight", 0 );
102  if ( width != 0 && height != 0 ) {
103  setMinimumSize( width, height );
104  }
105 #ifdef _WIN32_WCE
106  setWindowState( Qt::WindowFullScreen );
107 #endif
108 }
109 
110 void ConfigureDialog::hideEvent( QHideEvent * e ) {
111  const QSize minSize = minimumSizeHint();
112  KConfigGroup geometry( KGlobal::config(), "Geometry" );
113  geometry.writeEntry( "ConfigureDialogWidth", minSize.width() );
114  geometry.writeEntry( "ConfigureDialogHeight",minSize.height() );
115  KCMultiDialog::hideEvent( e );
116 }
117 
118 ConfigureDialog::~ConfigureDialog() {
119 }
120 
121 #undef addMyModule
122 #undef KCM_IMPORT_PLUGIN
123 
124 #include "configuredialog.moc"
addMyModule
#define addMyModule(x)
Definition: configuredialog.cpp:54
QWidget
configuredialog.h
ConfigureDialog
Definition: configuredialog.h:39
KCM_IMPORT_PLUGIN
#define KCM_IMPORT_PLUGIN(x)
Definition: configuredialog.cpp:53
ConfigureDialog::~ConfigureDialog
~ConfigureDialog()
Definition: configuredialog.cpp:118
KCMultiDialog
ConfigureDialog::hideEvent
void hideEvent(QHideEvent *)
Definition: configuredialog.cpp:110
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:40 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