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

#include "preferences.h"

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

class PreferencesHelper
{
  public:
    PreferencesHelper() : q(0) {}
    ~PreferencesHelper() { delete q; }
    Preferences *q;
};
K_GLOBAL_STATIC(PreferencesHelper, s_globalPreferences)
Preferences *Preferences::self()
{
  if (!s_globalPreferences->q) {
    new Preferences;
    s_globalPreferences->q->readConfig();
  }

  return s_globalPreferences->q;
}

Preferences::Preferences(  )
  : KConfigSkeleton( QLatin1String( "kigorc" ) )
{
  Q_ASSERT(!s_globalPreferences->q);
  s_globalPreferences->q = this;
  setCurrentGroup( QLatin1String( "Backend" ) );

  KConfigSkeleton::ItemString  *itemEngineCommand;
  itemEngineCommand = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "EngineCommand" ), mEngineCommand, QLatin1String( "gnugo --mode gtp" ) );
  addItem( itemEngineCommand, QLatin1String( "EngineCommand" ) );
  KConfigSkeleton::ItemBool  *itemEngineWorking;
  itemEngineWorking = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "EngineWorking" ), mEngineWorking, true );
  addItem( itemEngineWorking, QLatin1String( "EngineWorking" ) );

  setCurrentGroup( QLatin1String( "UserInterface" ) );

  KConfigSkeleton::ItemString  *itemTheme;
  itemTheme = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Theme" ), mTheme, QLatin1String( "default" ) );
  addItem( itemTheme, QLatin1String( "Theme" ) );
  KConfigSkeleton::ItemBool  *itemShowBoardLabels;
  itemShowBoardLabels = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowBoardLabels" ), mShowBoardLabels, true );
  addItem( itemShowBoardLabels, QLatin1String( "ShowBoardLabels" ) );
  KConfigSkeleton::ItemBool  *itemShowMoveNumbers;
  itemShowMoveNumbers = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "ShowMoveNumbers" ), mShowMoveNumbers, false );
  addItem( itemShowMoveNumbers, QLatin1String( "ShowMoveNumbers" ) );
  KConfigSkeleton::ItemDouble  *itemHintVisibleTime;
  itemHintVisibleTime = new KConfigSkeleton::ItemDouble( currentGroup(), QLatin1String( "HintVisibleTime" ), mHintVisibleTime, 3.0 );
  itemHintVisibleTime->setMinValue(1.0);
  itemHintVisibleTime->setMaxValue(5.0);
  addItem( itemHintVisibleTime, QLatin1String( "HintVisibleTime" ) );

  setCurrentGroup( QLatin1String( "Game" ) );

  KConfigSkeleton::ItemBool  *itemBlackPlayerHuman;
  itemBlackPlayerHuman = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "BlackPlayerHuman" ), mBlackPlayerHuman, true );
  addItem( itemBlackPlayerHuman, QLatin1String( "BlackPlayerHuman" ) );
  KConfigSkeleton::ItemString  *itemBlackPlayerName;
  itemBlackPlayerName = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "BlackPlayerName" ), mBlackPlayerName, QLatin1String( "Black Player" ) );
  addItem( itemBlackPlayerName, QLatin1String( "BlackPlayerName" ) );
  KConfigSkeleton::ItemInt  *itemBlackPlayerStrength;
  itemBlackPlayerStrength = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "BlackPlayerStrength" ), mBlackPlayerStrength, 10 );
  itemBlackPlayerStrength->setMinValue(1);
  itemBlackPlayerStrength->setMaxValue(10);
  addItem( itemBlackPlayerStrength, QLatin1String( "BlackPlayerStrength" ) );
  KConfigSkeleton::ItemBool  *itemWhitePlayerHuman;
  itemWhitePlayerHuman = new KConfigSkeleton::ItemBool( currentGroup(), QLatin1String( "WhitePlayerHuman" ), mWhitePlayerHuman, false );
  addItem( itemWhitePlayerHuman, QLatin1String( "WhitePlayerHuman" ) );
  KConfigSkeleton::ItemString  *itemWhitePlayerName;
  itemWhitePlayerName = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "WhitePlayerName" ), mWhitePlayerName, QLatin1String( "White Player" ) );
  addItem( itemWhitePlayerName, QLatin1String( "WhitePlayerName" ) );
  KConfigSkeleton::ItemInt  *itemWhitePlayerStrength;
  itemWhitePlayerStrength = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "WhitePlayerStrength" ), mWhitePlayerStrength, 1 );
  itemWhitePlayerStrength->setMinValue(1);
  itemWhitePlayerStrength->setMaxValue(10);
  addItem( itemWhitePlayerStrength, QLatin1String( "WhitePlayerStrength" ) );
  KConfigSkeleton::ItemInt  *itemBoardSize;
  itemBoardSize = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "BoardSize" ), mBoardSize, 9 );
  itemBoardSize->setMinValue(3);
  itemBoardSize->setMaxValue(19);
  addItem( itemBoardSize, QLatin1String( "BoardSize" ) );
  KConfigSkeleton::ItemDouble  *itemKomi;
  itemKomi = new KConfigSkeleton::ItemDouble( currentGroup(), QLatin1String( "Komi" ), mKomi, 4.5 );
  itemKomi->setMinValue(0);
  itemKomi->setMaxValue(50);
  addItem( itemKomi, QLatin1String( "Komi" ) );
  KConfigSkeleton::ItemInt  *itemFixedHandicapValue;
  itemFixedHandicapValue = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "FixedHandicapValue" ), mFixedHandicapValue, 4 );
  itemFixedHandicapValue->setMinValue(2);
  itemFixedHandicapValue->setMaxValue(9);
  addItem( itemFixedHandicapValue, QLatin1String( "FixedHandicapValue" ) );
}

Preferences::~Preferences()
{
  if (!s_globalPreferences.isDestroyed()) {
    s_globalPreferences->q = 0;
  }
}

