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

korganizer

  • sources
  • kde-4.14
  • 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 <KLocalizedString>
26 #include <KLocale>
27 
28 #include <QCheckBox>
29 #include <QFrame>
30 #include <QVBoxLayout>
31 
32 ConfigDialog::ConfigDialog( QWidget *parent )
33  :KDialog( parent )
34 {
35  QFrame *topFrame = new QFrame( this );
36  setMainWidget( topFrame );
37  setCaption( i18n( "Configure Holidays" ) );
38  setButtons( Ok | Cancel );
39  setDefaultButton( Ok );
40  setModal( true );
41  QVBoxLayout *topLayout = new QVBoxLayout( topFrame );
42  topLayout->setMargin( 0 );
43  topLayout->setSpacing( spacingHint() );
44 
45  mIsraelBox = new QCheckBox( topFrame );
46  mIsraelBox->setText( i18n( "Use Israeli holidays" ) );
47  topLayout->addWidget( mIsraelBox );
48 
49  mParshaBox = new QCheckBox( topFrame );
50  mParshaBox->setText( i18n( "Show weekly parsha" ) );
51  topLayout->addWidget( mParshaBox );
52 
53  mOmerBox = new QCheckBox( topFrame );
54  mOmerBox->setText( i18n( "Show day of Omer" ) );
55  topLayout->addWidget( mOmerBox );
56 
57  mCholBox = new QCheckBox( topFrame );
58  mCholBox->setText( i18n( "Show Chol HaMoed" ) );
59  topLayout->addWidget( mCholBox );
60  connect( this, SIGNAL(okClicked()), this, SLOT(slotOk()) );
61  load();
62 }
63 
64 ConfigDialog::~ConfigDialog()
65 {
66 }
67 
68 void ConfigDialog::load()
69 {
70  KConfig config( QLatin1String("korganizerrc") );
71 
72  KConfigGroup group( &config, "Hebrew Calendar Plugin" );
73  mIsraelBox->setChecked(
74  group.readEntry( "UseIsraelSettings",
75  ( KGlobal::locale()->country() == QLatin1String( ".il" ) ) ) );
76  mParshaBox->setChecked( group.readEntry( "ShowParsha", true ) );
77  mCholBox->setChecked( group.readEntry( "ShowChol_HaMoed", true ) );
78  mOmerBox->setChecked( group.readEntry( "ShowOmer", true ) );
79 }
80 
81 void ConfigDialog::save()
82 {
83  KConfig config( QLatin1String("korganizerrc" ));
84  KConfigGroup group( &config, "Hebrew Calendar Plugin" );
85  group.writeEntry( "UseIsraelSettings", mIsraelBox->isChecked() );
86  group.writeEntry( "ShowParsha", mParshaBox->isChecked() );
87  group.writeEntry( "ShowChol_HaMoed", mCholBox->isChecked() );
88  group.writeEntry( "ShowOmer", mOmerBox->isChecked() );
89  group.sync();
90 }
91 
92 void ConfigDialog::slotOk()
93 {
94  save();
95  accept();
96 }
97 
ConfigDialog::load
void load()
Definition: datenums/configdialog.cpp:70
QWidget
configdialog.h
KDialog
QBoxLayout::addWidget
void addWidget(QWidget *widget, int stretch, QFlags< Qt::AlignmentFlag > alignment)
QCheckBox
QVBoxLayout
ConfigDialog::slotOk
void slotOk()
Definition: datenums/configdialog.cpp:91
QLayout::setMargin
void setMargin(int margin)
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
QAbstractButton::setChecked
void setChecked(bool)
QLatin1String
QAbstractButton::setText
void setText(const QString &text)
QBoxLayout::setSpacing
void setSpacing(int spacing)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:59 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
  • 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