#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/arnaud/Works/Corporation/Gaia/Games/New/kmastermind/src/modedlg.ui'
**
** Created: ven sep 2 17:56:06 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 "modedlg.h"

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

/*
 *  Constructs a ModeDlg 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.
 */
ModeDlg::ModeDlg( QWidget* parent, const char* name, bool modal, WFlags fl )
    : QDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "ModeDlg" );
    setSizeGripEnabled( FALSE );
    setModal( TRUE );
    ModeDlgLayout = new QVBoxLayout( this, 11, 6, "ModeDlgLayout"); 
    ModeDlgLayout->setResizeMode( QLayout::Fixed );

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

    radioStandard = new QRadioButton( modeGroup, "radioStandard" );
    radioStandard->setChecked( TRUE );
    modeGroupLayout->addWidget( radioStandard );

    radioMachine = new QRadioButton( modeGroup, "radioMachine" );
    radioMachine->setEnabled( FALSE );
    modeGroupLayout->addWidget( radioMachine );

    radioHuman = new QRadioButton( modeGroup, "radioHuman" );
    modeGroupLayout->addWidget( radioHuman );
    ModeDlgLayout->addWidget( modeGroup );

    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 );
    ModeDlgLayout->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
 */
ModeDlg::~ModeDlg()
{
    // no need to delete child widgets, Qt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ModeDlg::languageChange()
{
    setCaption( tr2i18n( "Select the mode" ) );
    modeGroup->setTitle( tr2i18n( "modes" ) );
    radioStandard->setText( tr2i18n( "&human vs machine" ) );
    radioStandard->setAccel( QKeySequence( tr2i18n( "Alt+H" ) ) );
    radioMachine->setText( tr2i18n( "&machine vs human" ) );
    radioMachine->setAccel( QKeySequence( tr2i18n( "Alt+M" ) ) );
    radioHuman->setText( tr2i18n( "h&uman vs human" ) );
    radioHuman->setAccel( QKeySequence( tr2i18n( "Alt+U" ) ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonOk->setAccel( QKeySequence( QString::null ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    buttonCancel->setAccel( QKeySequence( QString::null ) );
}

#include "modedlg.moc"
