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

korganizer

  • sources
  • kde-4.12
  • kdepim
  • korganizer
  • plugins
  • hebrew
hebrew/configdialog.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KOrganizer.
3 
4  Copyright (c) 2003 Jonathan Singer <jsinger@leeta.net>
5  Copyright (C) 2007 Loïc Corbasson <loic.corbasson@gmail.com>
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 #include "configdialog.h"
23 
24 #include <KConfig>
25 #include <KLocale>
26 
27 #include <QCheckBox>
28 #include <QFrame>
29 #include <QVBoxLayout>
30 
31 ConfigDialog::ConfigDialog( QWidget *parent )
32  :KDialog( parent )
33 {
34  QFrame *topFrame = new QFrame( this );
35  setMainWidget( topFrame );
36  setCaption( i18n( "Configure Holidays" ) );
37  setButtons( Ok | Cancel );
38  setDefaultButton( Ok );
39  setModal( true );
40  QVBoxLayout *topLayout = new QVBoxLayout( topFrame );
41  topLayout->setMargin( 0 );
42  topLayout->setSpacing( spacingHint() );
43 
44  mIsraelBox = new QCheckBox( topFrame );
45  mIsraelBox->setText( i18n( "Use Israeli holidays" ) );
46  topLayout->addWidget( mIsraelBox );
47 
48  mParshaBox = new QCheckBox( topFrame );
49  mParshaBox->setText( i18n( "Show weekly parsha" ) );
50  topLayout->addWidget( mParshaBox );
51 
52  mOmerBox = new QCheckBox( topFrame );
53  mOmerBox->setText( i18n( "Show day of Omer" ) );
54  topLayout->addWidget( mOmerBox );
55 
56  mCholBox = new QCheckBox( topFrame );
57  mCholBox->setText( i18n( "Show Chol HaMoed" ) );
58  topLayout->addWidget( mCholBox );
59  connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()) );
60  load();
61 }
62 
63 ConfigDialog::~ConfigDialog()
64 {
65 }
66 
67 void ConfigDialog::load()
68 {
69  KConfig config( QLatin1String("korganizerrc") );
70 
71  KConfigGroup group( &config, "Hebrew Calendar Plugin" );
72  mIsraelBox->setChecked(
73  group.readEntry( "UseIsraelSettings",
74  ( KGlobal::locale()->country() == QLatin1String( ".il" ) ) ) );
75  mParshaBox->setChecked( group.readEntry( "ShowParsha", true ) );
76  mCholBox->setChecked( group.readEntry( "ShowChol_HaMoed", true ) );
77  mOmerBox->setChecked( group.readEntry( "ShowOmer", true ) );
78 }
79 
80 void ConfigDialog::save()
81 {
82  KConfig config( QLatin1String("korganizerrc" ));
83  KConfigGroup group( &config, "Hebrew Calendar Plugin" );
84  group.writeEntry( "UseIsraelSettings", mIsraelBox->isChecked() );
85  group.writeEntry( "ShowParsha", mParshaBox->isChecked() );
86  group.writeEntry( "ShowChol_HaMoed", mCholBox->isChecked() );
87  group.writeEntry( "ShowOmer", mOmerBox->isChecked() );
88  group.sync();
89 }
90 
91 void ConfigDialog::slotOk()
92 {
93  save();
94  accept();
95 }
96 
97 #include "configdialog.moc"
ConfigDialog::load
void load()
Definition: datenums/configdialog.cpp:70
configdialog.h
QWidget
KDialog
ConfigDialog::slotOk
void slotOk()
Definition: datenums/configdialog.cpp:91
ConfigDialog::ConfigDialog
ConfigDialog(QWidget *parent=0)
Definition: datenums/configdialog.cpp:32
ConfigDialog::save
void save()
Definition: datenums/configdialog.cpp:83
ConfigDialog::~ConfigDialog
virtual ~ConfigDialog()
Definition: datenums/configdialog.cpp:66
QFrame
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:56:19 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

korganizer

Skip menu "korganizer"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

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