#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/arnaud/Works/Corporation/Gaia/Games/New/kmastermind/src/leveldlg.ui'
**
** Created: ven sep 2 17:56:03 2005
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.4   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "leveldlg.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qbuttongroup.h>
#include <qradiobutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a LevelDlg as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
LevelDlg::LevelDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "LevelDlg" );
    setSizeGripEnabled( FALSE );
    setModal( TRUE );
    LevelDlgLayout = new QVBoxLayout( this, 11, 6, "LevelDlgLayout"); 
    LevelDlgLayout->setResizeMode( QLayout::Fixed );

    levelGroup = new QButtonGroup( this, "levelGroup" );
    levelGroup->setColumnLayout(0, Qt::Vertical );
    levelGroup->layout()->setSpacing( 6 );
    levelGroup->layout()->setMargin( 11 );
    levelGroupLayout = new QVBoxLayout( levelGroup->layout() );
    levelGroupLayout->setAlignment( Qt::AlignTop );

    radioNovice = new QRadioButton( levelGroup, "radioNovice" );
    radioNovice->setChecked( TRUE );
    levelGroupLayout->addWidget( radioNovice );

    radioMedium = new QRadioButton( levelGroup, "radioMedium" );
    levelGroupLayout->addWidget( radioMedium );

    radioExpert = new QRadioButton( levelGroup, "radioExpert" );
    levelGroupLayout->addWidget( radioExpert );
    LevelDlgLayout->addWidget( levelGroup );

    Layout1 = new QHBoxLayout( 0, 0, 6, "Layout1"); 
    Horizontal_Spacing2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new QPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    Layout1->addWidget( buttonOk );

    buttonCancel = new QPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    Layout1->addWidget( buttonCancel );
    LevelDlgLayout->addLayout( Layout1 );
    languageChange();
    resize( QSize(197, 163).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
}

/*
 *  Destroys the object and frees any allocated resources
 */
LevelDlg::~LevelDlg()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void LevelDlg::languageChange()
{
    setCaption( tr2i18n( "Select the level" ) );
    levelGroup->setTitle( tr2i18n( "levels" ) );
    radioNovice->setText( tr2i18n( "&novice" ) );
    radioNovice->setAccel( QKeySequence( tr2i18n( "Alt+N" ) ) );
    radioMedium->setText( tr2i18n( "&medium" ) );
    radioMedium->setAccel( QKeySequence( tr2i18n( "Alt+M" ) ) );
    radioExpert->setText( tr2i18n( "&expert" ) );
    radioExpert->setAccel( QKeySequence( tr2i18n( "Alt+E" ) ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonOk->setAccel( QKeySequence( QString::null ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    buttonCancel->setAccel( QKeySequence( QString::null ) );
}

#include "leveldlg.moc"
