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

kmail

  • sources
  • kde-4.14
  • kdepim
  • kmail
  • configuredialog
configuredialog.cpp
Go to the documentation of this file.
1 /* -*- mode: C++; c-file-style: "gnu" -*-
2  * kmail: KDE mail client
3  * Copyright (C) 2000 Espen Sand, espen@kde.org
4  * Copyright (C) 2001-2003 Marc Mutz, mutz@kde.org
5  * Contains code segments and ideas from earlier kmail dialog code.
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along
18  * with this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "settings/globalsettings.h"
24 #include "kmkernel.h"
25 // my headers:
26 #include "configuredialog.h"
27 #include "configuredialog_p.h"
28 
29 #include <KWindowSystem>
30 
31 // other headers:
32 #include <assert.h>
33 #include <stdlib.h>
34 
35 ConfigureDialog::ConfigureDialog( QWidget *parent, bool modal )
36  : KCMultiDialog( parent )
37 {
38  setFaceType( List );
39  setButtons( Help | Default | Cancel | Apply | Ok | Reset );
40  setModal( modal );
41  KWindowSystem::setIcons( winId(), qApp->windowIcon().pixmap( IconSize( KIconLoader::Desktop ), IconSize( KIconLoader::Desktop ) ), qApp->windowIcon().pixmap(IconSize( KIconLoader::Small ), IconSize( KIconLoader::Small ) ) );
42  addModule( QLatin1String("kmail_config_identity") );
43  addModule( QLatin1String("kmail_config_accounts") );
44  addModule( QLatin1String("kmail_config_appearance") );
45  addModule( QLatin1String("kmail_config_composer") );
46  addModule( QLatin1String("kmail_config_security") );
47  addModule( QLatin1String("kmail_config_misc") );
48 
49  connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
50  connect( this, SIGNAL(applyClicked()), SLOT(slotApply()) );
51 
52  // We store the size of the dialog on hide, because otherwise
53  // the KCMultiDialog starts with the size of the first kcm, not
54  // the largest one. This way at least after the first showing of
55  // the largest kcm the size is kept.
56  const int width = GlobalSettings::self()->configureDialogWidth();
57  const int height = GlobalSettings::self()->configureDialogHeight();
58  if ( width != 0 && height != 0 ) {
59  resize( width, height );
60  }
61 
62 }
63 
64 void ConfigureDialog::hideEvent( QHideEvent *ev )
65 {
66  GlobalSettings::self()->setConfigureDialogWidth( width() );
67  GlobalSettings::self()->setConfigureDialogHeight( height() );
68  KDialog::hideEvent( ev );
69 }
70 
71 ConfigureDialog::~ConfigureDialog()
72 {
73 }
74 
75 void ConfigureDialog::slotApply()
76 {
77  slotApplyClicked();
78  if (KMKernel::self())
79  KMKernel::self()->slotRequestConfigSync();
80  emit configChanged();
81 }
82 
83 void ConfigureDialog::slotOk()
84 {
85  slotOkClicked();
86  if (KMKernel::self())
87  KMKernel::self()->slotRequestConfigSync();
88  emit configChanged();
89 }
90 
QHideEvent
globalsettings.h
QWidget
configuredialog.h
ConfigureDialog::ConfigureDialog
ConfigureDialog(QWidget *parent=0, bool modal=true)
Definition: configuredialog.cpp:35
KMKernel::self
static KMKernel * self()
normal control stuff
Definition: kmkernel.cpp:1471
configuredialog_p.h
ConfigureDialog::configChanged
void configChanged()
KMKernel::slotRequestConfigSync
void slotRequestConfigSync()
Call this slot instead of directly KConfig::sync() to minimize the overall config writes...
Definition: kmkernel.cpp:1358
ConfigureDialog::slotOk
void slotOk()
Saves the GlobalSettings stuff before passing on to KCMultiDialog.
Definition: configuredialog.cpp:83
ConfigureDialog::slotApply
void slotApply()
Saves the GlobalSettings stuff before passing on to KCMultiDialog.
Definition: configuredialog.cpp:75
GlobalSettings::self
static GlobalSettings * self()
Definition: globalsettings.cpp:30
kmkernel.h
QLatin1String
ConfigureDialog::~ConfigureDialog
~ConfigureDialog()
Definition: configuredialog.cpp:71
KCMultiDialog
ConfigureDialog::hideEvent
void hideEvent(QHideEvent *i)
Definition: configuredialog.cpp:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:32 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kmail

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