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

kjots

  • sources
  • kde-4.12
  • kdepim
  • kjots
kjotsconfigdlg.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009 Montel Laurent <montel@kde.org>
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 Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18 
19 #include "kjotsconfigdlg.h"
20 #include <QDebug>
21 KJotsConfigDlg::KJotsConfigDlg( const QString & title, QWidget *parent )
22  : KCMultiDialog( parent )
23 {
24  setCaption( title );
25  setFaceType( KPageDialog::List );
26  setButtons( Default | Ok | Cancel );
27  setDefaultButton( Ok );
28 
29  showButtonSeparator( true );
30 
31  addModule( QLatin1String("kjots_config_misc") );
32  connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
33 }
34 
35 KJotsConfigDlg::~KJotsConfigDlg()
36 {
37 }
38 
39 void KJotsConfigDlg::slotOk()
40 {
41 }
42 
43 KJotsConfigMisc::KJotsConfigMisc( const KComponentData &inst, QWidget *parent )
44  :KCModule( inst, parent )
45 {
46  QHBoxLayout *lay = new QHBoxLayout( this );
47  miscPage = new confPageMisc( 0 );
48  lay->addWidget( miscPage );
49  connect( miscPage->autoSaveInterval, SIGNAL(valueChanged(int)), this, SLOT(modified()) );
50  connect( miscPage->autoSave, SIGNAL(stateChanged(int)), this, SLOT(modified()) );
51  load();
52 }
53 
54 void KJotsConfigMisc::modified()
55 {
56  emit changed( true );
57 }
58 
59 void KJotsConfigMisc::load()
60 {
61  KConfig config( QLatin1String("kjotsrc") );
62  KConfigGroup group = config.group( "kjots" );
63  miscPage->autoSaveInterval->setValue( group.readEntry( "AutoSaveInterval", 5 ) );
64  miscPage->autoSave->setChecked( group.readEntry( "AutoSave", true ) );
65  emit changed( false );
66 }
67 
68 void KJotsConfigMisc::save()
69 {
70  KConfig config( QLatin1String("kjotsrc") );
71  KConfigGroup group = config.group( "kjots" );
72  group.writeEntry( "AutoSaveInterval", miscPage->autoSaveInterval->value() );
73  group.writeEntry( "AutoSave", miscPage->autoSave->isChecked() );
74  group.sync();
75  emit changed( false );
76 }
77 
78 #include "kjotsconfigdlg.moc"
KJotsConfigMisc::load
virtual void load()
Reimplemented from KCModule.
Definition: kjotsconfigdlg.cpp:59
kjotsconfigdlg.h
KJotsConfigMisc::save
virtual void save()
Reimplemented form KCModule.
Definition: kjotsconfigdlg.cpp:68
QWidget
KJotsConfigDlg::slotOk
void slotOk()
Definition: kjotsconfigdlg.cpp:39
KJotsConfigDlg::~KJotsConfigDlg
~KJotsConfigDlg()
Definition: kjotsconfigdlg.cpp:35
KJotsConfigMisc::KJotsConfigMisc
KJotsConfigMisc(const KComponentData &inst, QWidget *parent)
Definition: kjotsconfigdlg.cpp:43
KJotsConfigDlg::KJotsConfigDlg
KJotsConfigDlg(const QString &title, QWidget *parent)
Definition: kjotsconfigdlg.cpp:21
confPageMisc
Definition: kjotsconfigdlg.h:26
KCMultiDialog
KCModule
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kjots

Skip menu "kjots"
  • Main Page
  • Namespace List
  • 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