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

#include "prefs.h"

#include <kstaticdeleter.h>

Prefs *Prefs::mSelf = 0;
static KStaticDeleter<Prefs> staticPrefsDeleter;

Prefs *Prefs::self()
{
  if ( !mSelf ) {
    staticPrefsDeleter.setObject( mSelf, new Prefs() );
    mSelf->readConfig();
  }

  return mSelf;
}

Prefs::Prefs(  )
  : TDEConfigSkeleton( TQString::fromLatin1( "khangmanrc" ) )
{
  mSelf = this;
  setCurrentGroup( TQString::fromLatin1( "Language" ) );

  TDEConfigSkeleton::ItemInt  *itemCurrentLevel;
  itemCurrentLevel = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "CurrentLevel" ), mCurrentLevel, 0 );
  addItem( itemCurrentLevel, TQString::fromLatin1( "CurrentLevel" ) );
  TDEConfigSkeleton::ItemString  *itemLevelFile;
  itemLevelFile = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "LevelFile" ), mLevelFile, "animals.kvtml" );
  addItem( itemLevelFile, TQString::fromLatin1( "LevelFile" ) );
  TDEConfigSkeleton::ItemBool  *itemShowCharToolbar;
  itemShowCharToolbar = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "ShowCharToolbar" ), mShowCharToolbar, false );
  addItem( itemShowCharToolbar, TQString::fromLatin1( "ShowCharToolbar" ) );

                TDEConfigBase *globalConf = TDEGlobal::config();
                globalConf->setGroup("Locale");
                TQString userLanguage = globalConf->readEntry("Language", "en");
                if (userLanguage.isEmpty())
                {
                  userLanguage = "en";
                }
                else
                {
                  //keep only the first 2 characters
                  userLanguage = userLanguage.left(2);
                }
            
  TDEConfigSkeleton::ItemString  *itemSelectedLanguage;
  itemSelectedLanguage = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "SelectedLanguage" ), mSelectedLanguage, userLanguage );
  addItem( itemSelectedLanguage, TQString::fromLatin1( "SelectedLanguage" ) );

  setCurrentGroup( TQString::fromLatin1( "Look" ) );

  TQValueList<TDEConfigSkeleton::ItemEnum::Choice> valuesMode;
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "sea" );
    valuesMode.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "desert" );
    valuesMode.append( choice );
  }
  TDEConfigSkeleton::ItemEnum  *itemMode;
  itemMode = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "Mode" ), mMode, valuesMode, EnumMode::sea );
  addItem( itemMode, TQString::fromLatin1( "Mode" ) );

  setCurrentGroup( TQString::fromLatin1( "General" ) );

  TDEConfigSkeleton::ItemBool  *itemOneLetter;
  itemOneLetter = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "OneLetter" ), mOneLetter, false );
  addItem( itemOneLetter, TQString::fromLatin1( "OneLetter" ) );
  TDEConfigSkeleton::ItemBool  *itemWonDialog;
  itemWonDialog = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "WonDialog" ), mWonDialog, false );
  addItem( itemWonDialog, TQString::fromLatin1( "WonDialog" ) );
  TDEConfigSkeleton::ItemBool  *itemSound;
  itemSound = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Sound" ), mSound, false );
  addItem( itemSound, TQString::fromLatin1( "Sound" ) );
  TDEConfigSkeleton::ItemInt  *itemHintTimer;
  itemHintTimer = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "HintTimer" ), mHintTimer, 4 );
  addItem( itemHintTimer, TQString::fromLatin1( "HintTimer" ) );
  TDEConfigSkeleton::ItemInt  *itemMissedTimer;
  itemMissedTimer = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "MissedTimer" ), mMissedTimer, 1 );
  addItem( itemMissedTimer, TQString::fromLatin1( "MissedTimer" ) );

  setCurrentGroup( TQString::fromLatin1( "Advanced" ) );

  TDEConfigSkeleton::ItemBool  *itemHint;
  itemHint = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "Hint" ), mHint, false );
  addItem( itemHint, TQString::fromLatin1( "Hint" ) );
  TDEConfigSkeleton::ItemBool  *itemAccentedLetters;
  itemAccentedLetters = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "AccentedLetters" ), mAccentedLetters, false );
  addItem( itemAccentedLetters, TQString::fromLatin1( "AccentedLetters" ) );
  TDEConfigSkeleton::ItemBool  *itemUpperCase;
  itemUpperCase = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "UpperCase" ), mUpperCase, false );
  addItem( itemUpperCase, TQString::fromLatin1( "UpperCase" ) );

  setCurrentGroup( TQString::fromLatin1( "Fonts" ) );

  TDEConfigSkeleton::ItemString  *itemGuessFontFamily;
  itemGuessFontFamily = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "GuessFontFamily" ), mGuessFontFamily, "Dustismo Roman" );
  addItem( itemGuessFontFamily, TQString::fromLatin1( "GuessFontFamily" ) );
  TDEConfigSkeleton::ItemString  *itemMissesFontFamily;
  itemMissesFontFamily = new TDEConfigSkeleton::ItemString( currentGroup(), TQString::fromLatin1( "MissesFontFamily" ), mMissesFontFamily, "Domestic Manners" );
  addItem( itemMissesFontFamily, TQString::fromLatin1( "MissesFontFamily" ) );

  setCurrentGroup( TQString::fromLatin1( "TDENewStuff" ) );

  TDEConfigSkeleton::ItemPath  *itemProvidersUrl;
  itemProvidersUrl = new TDEConfigSkeleton::ItemPath( currentGroup(), TQString::fromLatin1( "ProvidersUrl" ), mProvidersUrl, "https://www.trinitydesktop.org/ocs/providers.xml" );
  addItem( itemProvidersUrl, TQString::fromLatin1( "ProvidersUrl" ) );
}

Prefs::~Prefs()
{
  if ( mSelf == this )
    staticPrefsDeleter.setObject( mSelf, 0, false );
}

