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

klettres

  • sources
  • kde-4.14
  • kdeedu
  • klettres
  • src
prefs.cpp
Go to the documentation of this file.
1 // This file is generated by kconfig_compiler from klettres.kcfg.
2 // All changes you do to this file will be lost.
3 
4 #include "prefs.h"
5 
6 #include <kglobal.h>
7 #include <QtCore/QFile>
8 
9 class PrefsHelper
10 {
11  public:
12  PrefsHelper() : q(0) {}
13  ~PrefsHelper() { delete q; }
14  Prefs *q;
15 };
16 K_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
17 Prefs *Prefs::self()
18 {
19  if (!s_globalPrefs->q) {
20  new Prefs;
21  s_globalPrefs->q->readConfig();
22  }
23 
24  return s_globalPrefs->q;
25 }
26 
27 Prefs::Prefs( )
28  : KConfigSkeleton( QLatin1String( "klettresrc" ) )
29 {
30  Q_ASSERT(!s_globalPrefs->q);
31  s_globalPrefs->q = this;
32  setCurrentGroup( QLatin1String( "General" ) );
33 
34  KConfigSkeleton::ItemString *itemLanguage;
35  itemLanguage = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Language" ), mLanguage, QLatin1String( "en" ) );
36  addItem( itemLanguage, QLatin1String( "Language" ) );
37  QList<KConfigSkeleton::ItemEnum::Choice2> valuesTheme;
38  {
39  KConfigSkeleton::ItemEnum::Choice2 choice;
40  choice.name = QLatin1String("kid");
41  valuesTheme.append( choice );
42  }
43  {
44  KConfigSkeleton::ItemEnum::Choice2 choice;
45  choice.name = QLatin1String("desert");
46  valuesTheme.append( choice );
47  }
48  {
49  KConfigSkeleton::ItemEnum::Choice2 choice;
50  choice.name = QLatin1String("savannah");
51  valuesTheme.append( choice );
52  }
53  KConfigSkeleton::ItemEnum *itemTheme;
54  itemTheme = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "myTheme" ), mTheme, valuesTheme, EnumTheme::kid );
55  addItem( itemTheme, QLatin1String( "Theme" ) );
56  KConfigSkeleton::ItemBool *itemMenuBarBool;
57  itemMenuBarBool = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "MenuBarBool" ), mMenuBarBool, true );
58  addItem( itemMenuBarBool, QLatin1String( "MenuBarBool" ) );
59  QList<KConfigSkeleton::ItemEnum::Choice2> valuesMode;
60  {
61  KConfigSkeleton::ItemEnum::Choice2 choice;
62  choice.name = QLatin1String("kid");
63  valuesMode.append( choice );
64  }
65  {
66  KConfigSkeleton::ItemEnum::Choice2 choice;
67  choice.name = QLatin1String("grownup");
68  valuesMode.append( choice );
69  }
70  KConfigSkeleton::ItemEnum *itemMode;
71  itemMode = new KConfigSkeleton::ItemEnum( currentGroup(), QLatin1String( "myMode" ), mMode, valuesMode, EnumMode::grownup );
72  addItem( itemMode, QLatin1String( "Mode" ) );
73  KConfigSkeleton::ItemInt *itemLevel;
74  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "myLevel" ), mLevel, 1 );
75  itemLevel->setMinValue(1);
76  itemLevel->setMaxValue(4);
77  addItem( itemLevel, QLatin1String( "Level" ) );
78  KConfigSkeleton::ItemInt *itemKidTimer;
79  itemKidTimer = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "KidTimer" ), mKidTimer, 4 );
80  addItem( itemKidTimer, QLatin1String( "KidTimer" ) );
81  KConfigSkeleton::ItemInt *itemGrownTimer;
82  itemGrownTimer = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "GrownTimer" ), mGrownTimer, 2 );
83  addItem( itemGrownTimer, QLatin1String( "GrownTimer" ) );
84 
85  setCurrentGroup( QLatin1String( "mFont" ) );
86 
87 QFont defaultFont = KGlobalSettings::largeFont();
88  defaultFont.setPointSize(48);
89  defaultFont.setBold(true);
90 
91  KConfigSkeleton::ItemFont *itemFont;
92  itemFont = new KConfigSkeleton::ItemFont( currentGroup(), QLatin1String( "mFont" ), mFont, defaultFont );
93  addItem( itemFont, QLatin1String( "Font" ) );
94 }
95 
96 Prefs::~Prefs()
97 {
98  if (!s_globalPrefs.isDestroyed()) {
99  s_globalPrefs->q = 0;
100  }
101 }
102 
Prefs::mTheme
int mTheme
Definition: prefs.h:200
QFont::setPointSize
void setPointSize(int pointSize)
Prefs::mMode
int mMode
Definition: prefs.h:202
Prefs::mGrownTimer
int mGrownTimer
Definition: prefs.h:205
Prefs::mMenuBarBool
bool mMenuBarBool
Definition: prefs.h:201
QFont
Prefs::EnumTheme::kid
Definition: prefs.h:18
Prefs::mLanguage
QString mLanguage
Definition: prefs.h:199
Prefs
Definition: prefs.h:12
prefs.h
KConfigSkeleton
QFont::setBold
void setBold(bool enable)
QList::append
void append(const T &value)
Prefs::mFont
QFont mFont
Definition: prefs.h:208
Prefs::mKidTimer
int mKidTimer
Definition: prefs.h:204
Prefs::mLevel
int mLevel
Definition: prefs.h:203
QList
Prefs::Prefs
Prefs()
Definition: prefs.cpp:27
QLatin1String
Prefs::~Prefs
~Prefs()
Definition: prefs.cpp:96
Prefs::EnumMode::grownup
Definition: prefs.h:23
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:12:27 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

klettres

Skip menu "klettres"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

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