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

#include "settings.h"

#include <kstaticdeleter.h>

Settings *Settings::mSelf = 0;
static KStaticDeleter<Settings> staticSettingsDeleter;

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

  return mSelf;
}

const char* const Settings::EnumButton::enumToString[] = { "left", "mid", "right" };
const char* const Settings::EnumType::enumToString[] = { "flag", "explosion", "error" };

Settings::Settings(  )
  : TDEConfigSkeleton( TQString::fromLatin1( "kminesrc" ) )
{
  mSelf = this;
  setCurrentGroup( TQString::fromLatin1( "Options" ) );

  TDEConfigSkeleton::ItemInt  *itemCaseSize;
  itemCaseSize = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "case size" ), mCaseSize, 20 );
  itemCaseSize->setMinValue(4);
  itemCaseSize->setMaxValue(100);
  addItem( itemCaseSize, TQString::fromLatin1( "CaseSize" ) );
  TDEConfigSkeleton::ItemInt  *itemCustomWidth;
  itemCustomWidth = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "custom width" ), mCustomWidth, 10 );
  itemCustomWidth->setMinValue(5);
  itemCustomWidth->setMaxValue(50);
  addItem( itemCustomWidth, TQString::fromLatin1( "CustomWidth" ) );
  TDEConfigSkeleton::ItemInt  *itemCustomHeight;
  itemCustomHeight = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "custom height" ), mCustomHeight, 10 );
  itemCustomHeight->setMinValue(5);
  itemCustomHeight->setMaxValue(50);
  addItem( itemCustomHeight, TQString::fromLatin1( "CustomHeight" ) );
  TDEConfigSkeleton::ItemInt  *itemCustomMines;
  itemCustomMines = new TDEConfigSkeleton::ItemInt( currentGroup(), TQString::fromLatin1( "custom mines" ), mCustomMines, 20 );
  addItem( itemCustomMines, TQString::fromLatin1( "CustomMines" ) );
  TDEConfigSkeleton::ItemBool  *itemUncertainMark;
  itemUncertainMark = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "uncertain mark" ), mUncertainMark, true );
  addItem( itemUncertainMark, TQString::fromLatin1( "UncertainMark" ) );
  TDEConfigSkeleton::ItemBool  *itemKeyboardGame;
  itemKeyboardGame = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "keyboard game" ), mKeyboardGame, false );
  addItem( itemKeyboardGame, TQString::fromLatin1( "KeyboardGame" ) );
  TDEConfigSkeleton::ItemBool  *itemPauseFocus;
  itemPauseFocus = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "pause focus" ), mPauseFocus, true );
  addItem( itemPauseFocus, TQString::fromLatin1( "PauseFocus" ) );
  TDEConfigSkeleton::ItemBool  *itemMagicReveal;
  itemMagicReveal = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "magic reveal" ), mMagicReveal, false );
  addItem( itemMagicReveal, TQString::fromLatin1( "MagicReveal" ) );
  TQValueList<TDEConfigSkeleton::ItemEnum::Choice> valueslevel;
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "Easy" );
    valueslevel.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "Normal" );
    valueslevel.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "Expert" );
    valueslevel.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "Custom" );
    valueslevel.append( choice );
  }
  TDEConfigSkeleton::ItemEnum  *itemLevel;
  itemLevel = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "level" ), mLevel, valueslevel, EnumLevel::Easy );
  addItem( itemLevel, TQString::fromLatin1( "level" ) );
  TQValueList<TDEConfigSkeleton::ItemEnum::Choice> valuesMouseAction;
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "Reveal" );
    valuesMouseAction.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "AutoReveal" );
    valuesMouseAction.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "ToggleFlag" );
    valuesMouseAction.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "ToggleUncertainFlag" );
    valuesMouseAction.append( choice );
  }
  {
    TDEConfigSkeleton::ItemEnum::Choice choice;
    choice.name = TQString::fromLatin1( "None" );
    valuesMouseAction.append( choice );
  }
  TDEConfigSkeleton::ItemEnum  *itemMouseAction[3];
  itemMouseAction[0] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "mouse left" ), mMouseAction[0], valuesMouseAction, EnumMouseAction::Reveal );
  addItem( itemMouseAction[0], TQString::fromLatin1( "leftMouseAction" ) );
  itemMouseAction[1] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "mouse mid" ), mMouseAction[1], valuesMouseAction, EnumMouseAction::AutoReveal );
  addItem( itemMouseAction[1], TQString::fromLatin1( "midMouseAction" ) );
  itemMouseAction[2] = new TDEConfigSkeleton::ItemEnum( currentGroup(), TQString::fromLatin1( "mouse right" ), mMouseAction[2], valuesMouseAction, EnumMouseAction::ToggleFlag );
  addItem( itemMouseAction[2], TQString::fromLatin1( "rightMouseAction" ) );
  TDEConfigSkeleton::ItemColor  *itemColor[3];
  itemColor[0] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "flag color" ), mColor[0], TQColor( "#ff0000" ) );
  addItem( itemColor[0], TQString::fromLatin1( "flagColor" ) );
  itemColor[1] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "explosion color" ), mColor[1], TQColor( "#ff0000" ) );
  addItem( itemColor[1], TQString::fromLatin1( "explosionColor" ) );
  itemColor[2] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "error color" ), mColor[2], TQColor( "#ff0000" ) );
  addItem( itemColor[2], TQString::fromLatin1( "errorColor" ) );
  TDEConfigSkeleton::ItemColor  *itemMineColor[8];
  itemMineColor[0] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #0" ), mMineColor[0], TQColor( "#0000ff" ) );
  addItem( itemMineColor[0], TQString::fromLatin1( "MineColor0" ) );
  itemMineColor[1] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #1" ), mMineColor[1], TQColor( "#008800" ) );
  addItem( itemMineColor[1], TQString::fromLatin1( "MineColor1" ) );
  itemMineColor[2] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #2" ), mMineColor[2], TQColor( "#888800" ) );
  addItem( itemMineColor[2], TQString::fromLatin1( "MineColor2" ) );
  itemMineColor[3] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #3" ), mMineColor[3], TQColor( "#880088" ) );
  addItem( itemMineColor[3], TQString::fromLatin1( "MineColor3" ) );
  itemMineColor[4] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #4" ), mMineColor[4], TQColor( "#ff0000" ) );
  addItem( itemMineColor[4], TQString::fromLatin1( "MineColor4" ) );
  itemMineColor[5] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #5" ), mMineColor[5], TQColor( "#880000" ) );
  addItem( itemMineColor[5], TQString::fromLatin1( "MineColor5" ) );
  itemMineColor[6] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #6" ), mMineColor[6], TQColor( "#000000" ) );
  addItem( itemMineColor[6], TQString::fromLatin1( "MineColor6" ) );
  itemMineColor[7] = new TDEConfigSkeleton::ItemColor( currentGroup(), TQString::fromLatin1( "color #7" ), mMineColor[7], TQColor( "#000000" ) );
  addItem( itemMineColor[7], TQString::fromLatin1( "MineColor7" ) );
  TDEConfigSkeleton::ItemBool  *itemMenubarVisible;
  itemMenubarVisible = new TDEConfigSkeleton::ItemBool( currentGroup(), TQString::fromLatin1( "menubar visible" ), mMenubarVisible, true );
  addItem( itemMenubarVisible, TQString::fromLatin1( "MenubarVisible" ) );
}

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

