#include <kdialog.h>
#include <tdelocale.h>

/****************************************************************************
** Form implementation generated from reading ui file 'prefquizbase.ui'
**
** Created by: The TQt user interface compiler (TQt 3.5.0)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "prefquizbase.h"

#include <ntqvariant.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PrefQuizBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
PrefQuizBase::PrefQuizBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "PrefQuizBase" );
    setMinimumSize( TQSize( 300, 350 ) );
    PrefQuizBaseLayout = new TQGridLayout( this, 1, 1, 0, 6, "PrefQuizBaseLayout"); 

    grpMultiple = new TQButtonGroup( this, "grpMultiple" );
    grpMultiple->setColumnLayout(0, TQt::Vertical );
    grpMultiple->layout()->setSpacing( 6 );
    grpMultiple->layout()->setMargin( 11 );
    grpMultipleLayout = new TQGridLayout( grpMultiple->layout() );
    grpMultipleLayout->setAlignment( TQt::AlignTop );

    kcfg_AutoCheck = new TQCheckBox( grpMultiple, "kcfg_AutoCheck" );

    grpMultipleLayout->addWidget( kcfg_AutoCheck, 0, 0 );

    PrefQuizBaseLayout->addWidget( grpMultiple, 1, 0 );

    grpQA = new TQButtonGroup( this, "grpQA" );
    grpQA->setColumnLayout(0, TQt::Vertical );
    grpQA->layout()->setSpacing( 6 );
    grpQA->layout()->setMargin( 11 );
    grpQALayout = new TQGridLayout( grpQA->layout() );
    grpQALayout->setAlignment( TQt::AlignTop );

    kcfg_HintError = new TQCheckBox( grpQA, "kcfg_HintError" );

    grpQALayout->addWidget( kcfg_HintError, 0, 0 );

    PrefQuizBaseLayout->addWidget( grpQA, 2, 0 );

    grpScore = new TQButtonGroup( this, "grpScore" );
    grpScore->setColumnLayout(0, TQt::Vertical );
    grpScore->layout()->setSpacing( 6 );
    grpScore->layout()->setMargin( 11 );
    grpScoreLayout = new TQGridLayout( grpScore->layout() );
    grpScoreLayout->setAlignment( TQt::AlignTop );

    kcfg_Percent = new TQCheckBox( grpScore, "kcfg_Percent" );

    grpScoreLayout->addWidget( kcfg_Percent, 0, 0 );

    PrefQuizBaseLayout->addWidget( grpScore, 3, 0 );
    spcVert = new TQSpacerItem( 21, 31, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    PrefQuizBaseLayout->addItem( spcVert, 4, 0 );

    KeepDiscard = new TQButtonGroup( this, "KeepDiscard" );
    KeepDiscard->setFrameShape( TQButtonGroup::GroupBoxPanel );
    KeepDiscard->setColumnLayout(0, TQt::Vertical );
    KeepDiscard->layout()->setSpacing( 6 );
    KeepDiscard->layout()->setMargin( 11 );
    KeepDiscardLayout = new TQGridLayout( KeepDiscard->layout() );
    KeepDiscardLayout->setAlignment( TQt::AlignTop );
    spcHorz = new TQSpacerItem( 20, 70, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    KeepDiscardLayout->addMultiCell( spcHorz, 1, 2, 0, 0 );

    lblSeconds = new TQLabel( KeepDiscard, "lblSeconds" );
    lblSeconds->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, lblSeconds->sizePolicy().hasHeightForWidth() ) );

    KeepDiscardLayout->addWidget( lblSeconds, 1, 2 );

    kcfg_FlipDelay = new KIntNumInput( KeepDiscard, "kcfg_FlipDelay" );

    KeepDiscardLayout->addWidget( kcfg_FlipDelay, 1, 1 );

    kcfg_KeepDiscard = new TQButtonGroup( KeepDiscard, "kcfg_KeepDiscard" );
    kcfg_KeepDiscard->setFrameShape( TQButtonGroup::NoFrame );
    kcfg_KeepDiscard->setProperty( "selectedId", 0 );
    kcfg_KeepDiscard->setColumnLayout(0, TQt::Vertical );
    kcfg_KeepDiscard->layout()->setSpacing( 6 );
    kcfg_KeepDiscard->layout()->setMargin( 0 );
    kcfg_KeepDiscardLayout = new TQGridLayout( kcfg_KeepDiscard->layout() );
    kcfg_KeepDiscardLayout->setAlignment( TQt::AlignTop );

    optCorrect = new TQRadioButton( kcfg_KeepDiscard, "optCorrect" );

    kcfg_KeepDiscardLayout->addWidget( optCorrect, 0, 0 );

    optError = new TQRadioButton( kcfg_KeepDiscard, "optError" );

    kcfg_KeepDiscardLayout->addWidget( optError, 1, 0 );

    KeepDiscardLayout->addMultiCellWidget( kcfg_KeepDiscard, 2, 2, 1, 2 );

    kcfg_AutoFlip = new TQCheckBox( KeepDiscard, "kcfg_AutoFlip" );
    KeepDiscard->insert( kcfg_AutoFlip, 2 );

    KeepDiscardLayout->addMultiCellWidget( kcfg_AutoFlip, 0, 0, 0, 2 );

    PrefQuizBaseLayout->addWidget( KeepDiscard, 0, 0 );
    languageChange();
    resize( TQSize(300, 356).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_AutoFlip, TQ_SIGNAL( toggled(bool) ), kcfg_FlipDelay, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_AutoFlip, TQ_SIGNAL( toggled(bool) ), kcfg_KeepDiscard, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PrefQuizBase::languageChange()
{
    setCaption( tr2i18n( "Quiz" ) );
    grpMultiple->setTitle( tr2i18n( "Multiple Choice" ) );
    TQWhatsThis::add( grpMultiple, tr2i18n( "Specify behavior for a multiple choice session" ) );
    kcfg_AutoCheck->setText( tr2i18n( "Check selection a&utomatically" ) );
    TQToolTip::add( kcfg_AutoCheck, tr2i18n( "Check to correct automatically" ) );
    TQWhatsThis::add( kcfg_AutoCheck, tr2i18n( "Select if a choice should be checked immediately" ) );
    grpQA->setTitle( tr2i18n( "Question && Answer" ) );
    TQWhatsThis::add( grpQA, tr2i18n( "Specify behavior for a question and answer session" ) );
    kcfg_HintError->setText( tr2i18n( "&Treat hint as error" ) );
    TQToolTip::add( kcfg_HintError, tr2i18n( "Check to count hint as error" ) );
    TQWhatsThis::add( kcfg_HintError, tr2i18n( "Select if questions where the hint function has been used should be counted as errors" ) );
    grpScore->setTitle( tr2i18n( "Score" ) );
    TQWhatsThis::add( grpScore, tr2i18n( "Specify behavior of the score presentation in any session" ) );
    kcfg_Percent->setText( tr2i18n( "&Show score as a percentage" ) );
    TQToolTip::add( kcfg_Percent, tr2i18n( "Check to show score as a percentage" ) );
    TQWhatsThis::add( kcfg_Percent, tr2i18n( "Select if the score should be shown as a percentage" ) );
    KeepDiscard->setTitle( tr2i18n( "Flashcard" ) );
    TQWhatsThis::add( KeepDiscard, tr2i18n( "Specify behavior of a flashcard session" ) );
    lblSeconds->setText( tr2i18n( "seconds and" ) );
    TQWhatsThis::add( lblSeconds, tr2i18n( "Specify the amount of time between card flips" ) );
    TQToolTip::add( kcfg_FlipDelay, tr2i18n( "Delay to flip card" ) );
    TQWhatsThis::add( kcfg_FlipDelay, tr2i18n( "Delay in seconds to flip card" ) );
    kcfg_KeepDiscard->setTitle( TQString::null );
    optCorrect->setText( tr2i18n( "Count &as correct" ) );
    TQToolTip::add( optCorrect, tr2i18n( "Select how to count card" ) );
    TQWhatsThis::add( optCorrect, tr2i18n( "Select if the previous card should be counted as correct when moving to the next card" ) );
    optError->setText( tr2i18n( "Count as &error" ) );
    TQToolTip::add( optError, tr2i18n( "Select how to count card" ) );
    TQWhatsThis::add( optError, tr2i18n( "Select if the previous card should be counted as incorrect when moving to the next card" ) );
    kcfg_AutoFlip->setText( tr2i18n( "&Flip card automatically after" ) );
    TQToolTip::add( kcfg_AutoFlip, tr2i18n( "Check to flip card automatically" ) );
    TQWhatsThis::add( kcfg_AutoFlip, tr2i18n( "Select if you want a card to turn over automatically after the given amount of time" ) );
}

void PrefQuizBase::slotAutoFlipClicked()
{
    tqWarning( "PrefQuizBase::slotAutoFlipClicked(): Not implemented yet" );
}

/****************************************************************************
** PrefQuizBase meta object code from reading C++ file 'prefquizbase.h'
**
** Created by: The TQt Meta Object Compiler version 26 (TQt 3.5.0)
** WARNING! All changes made in this file will be lost!
*****************************************************************************/

#undef TQT_NO_COMPAT
#include "prefquizbase.h"
#include <ntqmetaobject.h>
#include <ntqapplication.h>

#include <private/qucomextra_p.h>
#if !defined(Q_MOC_OUTPUT_REVISION) || (Q_MOC_OUTPUT_REVISION != 26)
#error "This file was generated using the moc from 3.5.0. It"
#error "cannot be used with the include files from this version of TQt."
#error "(The moc has changed too much.)"
#endif

const char *PrefQuizBase::className() const
{
    return "PrefQuizBase";
}

TQMetaObject *PrefQuizBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PrefQuizBase( "PrefQuizBase", &PrefQuizBase::staticMetaObject );

#ifndef TQT_NO_TRANSLATION
TQString PrefQuizBase::tr( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "PrefQuizBase", s, c, TQApplication::DefaultCodec );
    else
	return TQString::fromLatin1( s );
}
#ifndef TQT_NO_TRANSLATION_UTF8
TQString PrefQuizBase::trUtf8( const char *s, const char *c )
{
    if ( tqApp )
	return tqApp->translate( "PrefQuizBase", s, c, TQApplication::UnicodeUTF8 );
    else
	return TQString::fromUtf8( s );
}
#endif // TQT_NO_TRANSLATION_UTF8

#endif // TQT_NO_TRANSLATION

TQMetaObject* PrefQuizBase::staticMetaObject()
{
    if ( metaObj ) {
	return metaObj;
}
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->lock();
    if ( metaObj ) {
	if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
	return metaObj;
    }
#endif // TQT_THREAD_SUPPORT
    TQMetaObject* parentObject = TQWidget::staticMetaObject();
    static const TQUMethod slot_0 = {"slotAutoFlipClicked", 0, 0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotAutoFlipClicked()", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PrefQuizBase", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PrefQuizBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

void* PrefQuizBase::tqt_cast( const char* clname )
{
    if ( !qstrcmp( clname, "PrefQuizBase" ) )
	return this;
    return TQWidget::tqt_cast( clname );
}

bool PrefQuizBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotAutoFlipClicked(); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool PrefQuizBase::tqt_emit( int _id, TQUObject* _o )
{
    return TQWidget::tqt_emit(_id,_o);
}
#ifndef TQT_NO_PROPERTIES

bool PrefQuizBase::tqt_property( int id, int f, TQVariant* v)
{
    return TQWidget::tqt_property( id, f, v);
}

bool PrefQuizBase::tqt_static_property( TQObject* , int , int , TQVariant* ){ return false; }
#endif // TQT_NO_PROPERTIES
