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

kleopatra

  • sources
  • kde-4.14
  • 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 
47 #ifdef KLEO_STATIC_KCMODULES
48 # include <KDesktopFile>
49 # define KCM_IMPORT_PLUGIN( x ) extern "C" KCModule * create_##x( QWidget * parent=0, const QVariantList & args=QVariantList() );
50 # define addMyModule( x ) addModule( KCModuleInfo( KDesktopFile( "services", QLatin1String(#x) + QLatin1String(".desktop") ) ), create_##x() )
51 #else // KLEO_STATIC_KCMODULES
52 # define KCM_IMPORT_PLUGIN( x )
53 # define addMyModule( x ) addModule( QLatin1String(#x) )
54 #endif // KLEO_STATIC_KCMODULES
55 
56 KCM_IMPORT_PLUGIN( kleopatra_config_dirserv )
57 #ifndef KDEPIM_MOBILE_UI
58 KCM_IMPORT_PLUGIN( kleopatra_config_appear )
59 #endif
60 #ifdef HAVE_KLEOPATRACLIENT_LIBRARY
61 # ifndef KDEPIM_MOBILE_UI
62 KCM_IMPORT_PLUGIN( kleopatra_config_cryptooperations )
63 # endif
64 KCM_IMPORT_PLUGIN( kleopatra_config_smimevalidation )
65 #endif
66 KCM_IMPORT_PLUGIN( kleopatra_config_gnupgsystem )
67 
68 ConfigureDialog::ConfigureDialog( QWidget * parent )
69  : KCMultiDialog( parent )
70 {
71  setFaceType( KPageDialog::List );
72  setCaption( i18n( "Configure" ) );
73 #ifdef Q_OS_UNIX
74  KWindowSystem::setIcons( winId(), qApp->windowIcon().pixmap( IconSize( KIconLoader::Desktop ), IconSize( KIconLoader::Desktop ) ),
75  qApp->windowIcon().pixmap( IconSize( KIconLoader::Small ), IconSize( KIconLoader::Small ) ) );
76 #endif
77  showButton( User1, true );
78 
79  addMyModule( kleopatra_config_dirserv );
80 #ifndef KDEPIM_MOBILE_UI
81  addMyModule( kleopatra_config_appear );
82 #endif
83 #ifdef HAVE_KLEOPATRACLIENT_LIBRARY
84 # ifndef KDEPIM_MOBILE_UI
85  addMyModule( kleopatra_config_cryptooperations );
86 # endif
87  addMyModule( kleopatra_config_smimevalidation );
88 #endif
89  addMyModule( kleopatra_config_gnupgsystem );
90 
91  // We store the minimum size of the dialog on hide, because otherwise
92  // the KCMultiDialog starts with the size of the first kcm, not
93  // the largest one. This way at least after the first showing of
94  // the largest kcm the size is kept.
95  const KConfigGroup geometry( KGlobal::config(), "Geometry" );
96  const int width = geometry.readEntry( "ConfigureDialogWidth", 0);
97  const int height = geometry.readEntry( "ConfigureDialogHeight", 0 );
98  if ( width != 0 && height != 0 ) {
99  setMinimumSize( width, height );
100  }
101 }
102 
103 void ConfigureDialog::hideEvent( QHideEvent * e ) {
104  const QSize minSize = minimumSizeHint();
105  KConfigGroup geometry( KGlobal::config(), "Geometry" );
106  geometry.writeEntry( "ConfigureDialogWidth", minSize.width() );
107  geometry.writeEntry( "ConfigureDialogHeight",minSize.height() );
108  KCMultiDialog::hideEvent( e );
109 }
110 
111 ConfigureDialog::~ConfigureDialog() {
112 }
113 
114 #undef addMyModule
115 #undef KCM_IMPORT_PLUGIN
116 
QHideEvent
QWidget
QSize::width
int width() const
addMyModule
#define addMyModule(x)
Definition: configuredialog.cpp:53
configuredialog.h
ConfigureDialog
Definition: configuredialog.h:39
QSize
KCM_IMPORT_PLUGIN
#define KCM_IMPORT_PLUGIN(x)
Definition: configuredialog.cpp:52
ConfigureDialog::~ConfigureDialog
~ConfigureDialog()
Definition: configuredialog.cpp:111
QSize::height
int height() const
KCMultiDialog
ConfigureDialog::hideEvent
void hideEvent(QHideEvent *)
Definition: configuredialog.cpp:103
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:33:10 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
  • pimprint

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