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

kjots

  • sources
  • kde-4.14
  • kdepim
  • kjots
kjotsconfigdlg.cpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2009-2015 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 KJotsConfigDlg::KJotsConfigDlg( const QString & title, QWidget *parent )
21  : KCMultiDialog( parent )
22 {
23  setCaption( title );
24  setFaceType( KPageDialog::List );
25  setButtons( Default | Ok | Cancel );
26  setDefaultButton( Ok );
27 
28  showButtonSeparator( true );
29 
30  addModule( QLatin1String("kjots_config_misc") );
31  connect( this, SIGNAL(okClicked()), SLOT(slotOk()) );
32 }
33 
34 KJotsConfigDlg::~KJotsConfigDlg()
35 {
36 }
37 
38 void KJotsConfigDlg::slotOk()
39 {
40 }
41 
42 KJotsConfigMisc::KJotsConfigMisc( const KComponentData &inst, QWidget *parent )
43  :KCModule( inst, parent )
44 {
45  QHBoxLayout *lay = new QHBoxLayout( this );
46  miscPage = new confPageMisc( 0 );
47  lay->addWidget( miscPage );
48  connect( miscPage->autoSaveInterval, SIGNAL(valueChanged(int)), this, SLOT(modified()) );
49  connect( miscPage->autoSave, SIGNAL(stateChanged(int)), this, SLOT(modified()) );
50  load();
51 }
52 
53 void KJotsConfigMisc::modified()
54 {
55  emit changed( true );
56 }
57 
58 void KJotsConfigMisc::load()
59 {
60  KConfig config( QLatin1String("kjotsrc") );
61  KConfigGroup group = config.group( "kjots" );
62  miscPage->autoSaveInterval->setValue( group.readEntry( "AutoSaveInterval", 5 ) );
63  miscPage->autoSave->setChecked( group.readEntry( "AutoSave", true ) );
64  emit changed( false );
65 }
66 
67 void KJotsConfigMisc::save()
68 {
69  KConfig config( QLatin1String("kjotsrc") );
70  KConfigGroup group = config.group( "kjots" );
71  group.writeEntry( "AutoSaveInterval", miscPage->autoSaveInterval->value() );
72  group.writeEntry( "AutoSave", miscPage->autoSave->isChecked() );
73  group.sync();
74  emit changed( false );
75 }
76 
77 #include "moc_kjotsconfigdlg.cpp"
QWidget
KJotsConfigMisc::load
virtual void load()
Reimplemented from KCModule.
Definition: kjotsconfigdlg.cpp:58
kjotsconfigdlg.h
KJotsConfigMisc::save
virtual void save()
Reimplemented form KCModule.
Definition: kjotsconfigdlg.cpp:67
QHBoxLayout
KJotsConfigDlg::slotOk
void slotOk()
Definition: kjotsconfigdlg.cpp:38
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
KJotsConfigDlg::~KJotsConfigDlg
~KJotsConfigDlg()
Definition: kjotsconfigdlg.cpp:34
QString
KJotsConfigMisc::KJotsConfigMisc
KJotsConfigMisc(const KComponentData &inst, QWidget *parent)
Definition: kjotsconfigdlg.cpp:42
QLatin1String
KJotsConfigDlg::KJotsConfigDlg
KJotsConfigDlg(const QString &title, QWidget *parent)
Definition: kjotsconfigdlg.cpp:20
confPageMisc
Definition: kjotsconfigdlg.h:26
KCMultiDialog
KCModule
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:12 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
  • 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