// This file is generated by kconfig_compiler_kf5 from klettres.kcfg.
// All changes you do to this file will be lost.

#include "prefs.h"

#include <qglobal.h>
#include <QtCore/QFile>

class PrefsHelper
{
  public:
    PrefsHelper() : q(nullptr) {}
    ~PrefsHelper() { delete q; }
    Prefs *q;
};
Q_GLOBAL_STATIC(PrefsHelper, s_globalPrefs)
Prefs *Prefs::self()
{
  if (!s_globalPrefs()->q) {
    new Prefs;
    s_globalPrefs()->q->read();
  }

  return s_globalPrefs()->q;
}

Prefs::Prefs(  )
  : KConfigSkeleton( QStringLiteral( "klettresrc" ) )
{
  Q_ASSERT(!s_globalPrefs()->q);
  s_globalPrefs()->q = this;
  setCurrentGroup( QStringLiteral( "General" ) );

  KConfigSkeleton::ItemString  *itemLanguage;
  itemLanguage = new KConfigSkeleton::ItemString( currentGroup(), QStringLiteral( "Language" ), mLanguage, QStringLiteral( "en" ) );
  addItem( itemLanguage, QStringLiteral( "Language" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesTheme;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("kid");
    valuesTheme.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("desert");
    valuesTheme.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("savannah");
    valuesTheme.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "myTheme" ), mTheme, valuesTheme, EnumTheme::kid );
  addItem( itemTheme, QStringLiteral( "Theme" ) );
  KConfigSkeleton::ItemBool  *itemMenuBarBool;
  itemMenuBarBool = new KConfigSkeleton::ItemBool( currentGroup(), QStringLiteral( "MenuBarBool" ), mMenuBarBool, true );
  addItem( itemMenuBarBool, QStringLiteral( "MenuBarBool" ) );
  QList<KConfigSkeleton::ItemEnum::Choice> valuesMode;
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("kid");
    valuesMode.append( choice );
  }
  {
    KConfigSkeleton::ItemEnum::Choice choice;
    choice.name = QStringLiteral("grownup");
    valuesMode.append( choice );
  }
  KConfigSkeleton::ItemEnum  *itemMode;
  itemMode = new KConfigSkeleton::ItemEnum( currentGroup(), QStringLiteral( "myMode" ), mMode, valuesMode, EnumMode::grownup );
  addItem( itemMode, QStringLiteral( "Mode" ) );
  KConfigSkeleton::ItemInt  *itemLevel;
  itemLevel = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "myLevel" ), mLevel, 1 );
  itemLevel->setMinValue(1);
  itemLevel->setMaxValue(4);
  addItem( itemLevel, QStringLiteral( "Level" ) );
  KConfigSkeleton::ItemInt  *itemKidTimer;
  itemKidTimer = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "KidTimer" ), mKidTimer, 4 );
  addItem( itemKidTimer, QStringLiteral( "KidTimer" ) );
  KConfigSkeleton::ItemInt  *itemGrownTimer;
  itemGrownTimer = new KConfigSkeleton::ItemInt( currentGroup(), QStringLiteral( "GrownTimer" ), mGrownTimer, 2 );
  addItem( itemGrownTimer, QStringLiteral( "GrownTimer" ) );

  setCurrentGroup( QStringLiteral( "mFont" ) );

QFont defaultFont = QFontDatabase::systemFont(QFontDatabase::GeneralFont);
            defaultFont.setPointSize(48);
            defaultFont.setBold(true);
      
  KConfigSkeleton::ItemFont  *itemFont;
  itemFont = new KConfigSkeleton::ItemFont( currentGroup(), QStringLiteral( "mFont" ), mFont, defaultFont );
  addItem( itemFont, QStringLiteral( "Font" ) );
}

Prefs::~Prefs()
{
  s_globalPrefs()->q = nullptr;
}

