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

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

#include "queryoptionsbase.h"

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

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

    kcfg_AltLearn = new TQCheckBox( this, "kcfg_AltLearn" );

    QueryOptionsBaseLayout->addWidget( kcfg_AltLearn, 2, 0 );

    kcfg_SwapDirection = new TQCheckBox( this, "kcfg_SwapDirection" );

    QueryOptionsBaseLayout->addWidget( kcfg_SwapDirection, 1, 0 );

    unnamed = new TQGroupBox( this, "unnamed" );
    unnamed->setColumnLayout(0, TQt::Vertical );
    unnamed->layout()->setSpacing( 6 );
    unnamed->layout()->setMargin( 11 );
    unnamedLayout = new TQGridLayout( unnamed->layout() );
    unnamedLayout->setAlignment( TQt::AlignTop );

    kcfg_Suggestions = new TQCheckBox( unnamed, "kcfg_Suggestions" );
    kcfg_Suggestions->setEnabled( true );

    unnamedLayout->addMultiCellWidget( kcfg_Suggestions, 0, 0, 0, 6 );

    kcfg_Split = new TQCheckBox( unnamed, "kcfg_Split" );
    kcfg_Split->setEnabled( true );

    unnamedLayout->addMultiCellWidget( kcfg_Split, 1, 1, 0, 6 );

    label_split_max_fields = new TQLabel( unnamed, "label_split_max_fields" );

    unnamedLayout->addMultiCellWidget( label_split_max_fields, 3, 3, 1, 3 );

    kcfg_IKnow = new TQCheckBox( unnamed, "kcfg_IKnow" );
    kcfg_IKnow->setEnabled( true );

    unnamedLayout->addMultiCellWidget( kcfg_IKnow, 5, 5, 0, 6 );

    label_at = new TQLabel( unnamed, "label_at" );
    label_at->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, label_at->sizePolicy().hasHeightForWidth() ) );

    unnamedLayout->addWidget( label_at, 2, 1 );

    kcfg_Periods = new TQCheckBox( unnamed, "kcfg_Periods" );
    kcfg_Periods->setEnabled( true );

    unnamedLayout->addWidget( kcfg_Periods, 2, 2 );

    kcfg_Semicolons = new TQCheckBox( unnamed, "kcfg_Semicolons" );
    kcfg_Semicolons->setEnabled( true );

    unnamedLayout->addWidget( kcfg_Semicolons, 2, 4 );

    kcfg_Commas = new TQCheckBox( unnamed, "kcfg_Commas" );
    kcfg_Commas->setEnabled( true );
    kcfg_Commas->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, kcfg_Commas->sizePolicy().hasHeightForWidth() ) );

    unnamedLayout->addMultiCellWidget( kcfg_Commas, 2, 2, 5, 6 );

    kcfg_Colons = new TQCheckBox( unnamed, "kcfg_Colons" );
    kcfg_Colons->setEnabled( true );

    unnamedLayout->addWidget( kcfg_Colons, 2, 3 );

    kcfg_ShowMore = new TQCheckBox( unnamed, "kcfg_ShowMore" );
    kcfg_ShowMore->setEnabled( true );

    unnamedLayout->addMultiCellWidget( kcfg_ShowMore, 4, 4, 0, 6 );
    spacer12 = new TQSpacerItem( 16, 48, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    unnamedLayout->addMultiCell( spacer12, 2, 3, 0, 0 );

    kcfg_Fields = new KIntNumInput( unnamed, "kcfg_Fields" );
    kcfg_Fields->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, kcfg_Fields->sizePolicy().hasHeightForWidth() ) );
    kcfg_Fields->setMaximumSize( TQSize( 32767, 32767 ) );
    kcfg_Fields->setMinValue( 2 );
    kcfg_Fields->setMaxValue( 10 );

    unnamedLayout->addMultiCellWidget( kcfg_Fields, 3, 3, 4, 5 );
    spacer13 = new TQSpacerItem( 111, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    unnamedLayout->addItem( spacer13, 3, 6 );

    QueryOptionsBaseLayout->addWidget( unnamed, 3, 0 );
    spacer6 = new TQSpacerItem( 290, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    QueryOptionsBaseLayout->addItem( spacer6, 4, 0 );

    QueryTimeout = new TQGroupBox( this, "QueryTimeout" );
    QueryTimeout->setProperty( "exclusive", TQVariant( false ) );
    QueryTimeout->setColumnLayout(0, TQt::Vertical );
    QueryTimeout->layout()->setSpacing( 6 );
    QueryTimeout->layout()->setMargin( 11 );
    QueryTimeoutLayout = new TQGridLayout( QueryTimeout->layout() );
    QueryTimeoutLayout->setAlignment( TQt::AlignTop );

    kcfg_QueryTimeout = new TQButtonGroup( QueryTimeout, "kcfg_QueryTimeout" );
    kcfg_QueryTimeout->setFrameShape( TQButtonGroup::NoFrame );
    kcfg_QueryTimeout->setColumnLayout(0, TQt::Vertical );
    kcfg_QueryTimeout->layout()->setSpacing( 6 );
    kcfg_QueryTimeout->layout()->setMargin( 0 );
    kcfg_QueryTimeoutLayout = new TQGridLayout( kcfg_QueryTimeout->layout() );
    kcfg_QueryTimeoutLayout->setAlignment( TQt::AlignTop );

    r_show_to = new TQRadioButton( kcfg_QueryTimeout, "r_show_to" );
    kcfg_QueryTimeout->insert( r_show_to, 1 );

    kcfg_QueryTimeoutLayout->addWidget( r_show_to, 1, 0 );

    r_no_limit = new TQRadioButton( kcfg_QueryTimeout, "r_no_limit" );
    kcfg_QueryTimeout->insert( r_no_limit, 0 );

    kcfg_QueryTimeoutLayout->addWidget( r_no_limit, 0, 0 );

    r_cont_to = new TQRadioButton( kcfg_QueryTimeout, "r_cont_to" );

    kcfg_QueryTimeoutLayout->addWidget( r_cont_to, 2, 0 );

    QueryTimeoutLayout->addMultiCellWidget( kcfg_QueryTimeout, 0, 1, 0, 0 );

    layout3 = new TQGridLayout( 0, 1, 1, 0, 6, "layout3"); 

    label_mqtime = new TQLabel( QueryTimeout, "label_mqtime" );

    layout3->addWidget( label_mqtime, 0, 0 );

    kcfg_ShowCounter = new TQCheckBox( QueryTimeout, "kcfg_ShowCounter" );
    kcfg_ShowCounter->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)0, 0, 0, kcfg_ShowCounter->sizePolicy().hasHeightForWidth() ) );

    layout3->addWidget( kcfg_ShowCounter, 1, 1 );
    Spacer1 = new TQSpacerItem( 83, 20, TQSizePolicy::Minimum, TQSizePolicy::Minimum );
    layout3->addItem( Spacer1, 1, 0 );

    kcfg_MaxTimePer = new KIntNumInput( QueryTimeout, "kcfg_MaxTimePer" );
    kcfg_MaxTimePer->setMinValue( 0 );
    kcfg_MaxTimePer->setMaxValue( 604800 );

    layout3->addWidget( kcfg_MaxTimePer, 0, 1 );

    QueryTimeoutLayout->addLayout( layout3, 0, 1 );
    spacer9 = new TQSpacerItem( 200, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    QueryTimeoutLayout->addItem( spacer9, 1, 1 );

    QueryOptionsBaseLayout->addWidget( QueryTimeout, 0, 0 );
    languageChange();
    resize( TQSize(452, 404).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), kcfg_Periods, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), kcfg_Colons, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), kcfg_Semicolons, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), kcfg_Commas, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), kcfg_Fields, TQ_SLOT( setEnabled(bool) ) );
    connect( r_no_limit, TQ_SIGNAL( toggled(bool) ), kcfg_MaxTimePer, TQ_SLOT( setDisabled(bool) ) );
    connect( r_no_limit, TQ_SIGNAL( toggled(bool) ), kcfg_ShowCounter, TQ_SLOT( setDisabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), label_at, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_Split, TQ_SIGNAL( toggled(bool) ), label_split_max_fields, TQ_SLOT( setEnabled(bool) ) );
    connect( r_no_limit, TQ_SIGNAL( toggled(bool) ), label_mqtime, TQ_SLOT( setDisabled(bool) ) );

    // tab order
    setTabOrder( kcfg_MaxTimePer, kcfg_ShowCounter );
    setTabOrder( kcfg_ShowCounter, kcfg_SwapDirection );
    setTabOrder( kcfg_SwapDirection, kcfg_AltLearn );
    setTabOrder( kcfg_AltLearn, kcfg_Suggestions );
    setTabOrder( kcfg_Suggestions, kcfg_Split );
    setTabOrder( kcfg_Split, kcfg_Periods );
    setTabOrder( kcfg_Periods, kcfg_Colons );
    setTabOrder( kcfg_Colons, kcfg_Semicolons );
    setTabOrder( kcfg_Semicolons, kcfg_Commas );
    setTabOrder( kcfg_Commas, kcfg_Fields );
    setTabOrder( kcfg_Fields, kcfg_ShowMore );
    setTabOrder( kcfg_ShowMore, kcfg_IKnow );

    // buddies
    label_split_max_fields->setBuddy( kcfg_Fields );
    label_mqtime->setBuddy( kcfg_MaxTimePer );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void QueryOptionsBase::languageChange()
{
    kcfg_AltLearn->setText( tr2i18n( "&Use alternative learning method" ) );
    TQToolTip::add( kcfg_AltLearn, tr2i18n( "Use the Leitner learning method" ) );
    TQWhatsThis::add( kcfg_AltLearn, tr2i18n( "By checking this, you will use the Leitner method of learning which requires you to answer correctly to each question 4 times in a row. " ) );
    kcfg_SwapDirection->setText( tr2i18n( "S&wap direction randomly" ) );
    unnamed->setTitle( tr2i18n( "Random Query Options" ) );
    kcfg_Suggestions->setText( tr2i18n( "&Enable suggestion lists" ) );
    TQToolTip::add( kcfg_Suggestions, tr2i18n( "If checked, pressing F5 or F6 will display a list of suggestions" ) );
    TQWhatsThis::add( kcfg_Suggestions, tr2i18n( "When this options is enabled, you can enter part of an answer, then press F5 or F6 to get a list of translations starting with or containing the text you typed." ) );
    kcfg_Split->setText( tr2i18n( "Split &translations" ) );
    TQToolTip::add( kcfg_Split, tr2i18n( "Split translations and show multiple answer fields" ) );
    TQWhatsThis::add( kcfg_Split, tr2i18n( "When this options is enabled, the program will split translations into several parts, show multiple answer fields, and you will need to answer each one of them. This is useful for example when a word has several meanings that have different translations in the other language." ) );
    label_split_max_fields->setText( tr2i18n( "Maximum number of &fields:" ) );
    TQToolTip::add( label_split_max_fields, tr2i18n( "Maximum number of fields to split translations into" ) );
    TQWhatsThis::add( label_split_max_fields, tr2i18n( "Enter the maximum number of answer fields you want to have. When splitting translations, the program will only split into this many parts, and the last part will contain the rest of the translation." ) );
    kcfg_IKnow->setText( tr2i18n( "Enable I Know &button" ) );
    TQToolTip::add( kcfg_IKnow, tr2i18n( "Enable the I Know It button on the Random Query screen" ) );
    TQWhatsThis::add( kcfg_IKnow, tr2i18n( "If this is checked, the I Know button will be available. It allows you to tell the query that you know the result without writing it or having it checked. This is available by default. If you uncheck this, the I Know button will not be available." ) );
    label_at->setText( tr2i18n( "at" ) );
    kcfg_Periods->setText( tr2i18n( "pe&riods" ) );
    TQToolTip::add( kcfg_Periods, tr2i18n( "Split translations at periods" ) );
    TQWhatsThis::add( kcfg_Periods, tr2i18n( "When this options is enabled, translations will be split at periods if they have any (except any trailing periods that will be removed)." ) );
    kcfg_Semicolons->setText( tr2i18n( "sem&icolons" ) );
    TQToolTip::add( kcfg_Semicolons, tr2i18n( "Split translations at semicolons" ) );
    TQWhatsThis::add( kcfg_Semicolons, tr2i18n( "When this options is enabled, translations that have not been split at periods or colons will be split at semicolons if they have any." ) );
    kcfg_Commas->setText( tr2i18n( "co&mmas" ) );
    TQToolTip::add( kcfg_Commas, tr2i18n( "Split translations at commas" ) );
    TQWhatsThis::add( kcfg_Commas, tr2i18n( "When this options is enabled, translations that have not been split at periods, colons or semicolons will be split at commas if they have any." ) );
    kcfg_Colons->setText( tr2i18n( "co&lons" ) );
    TQToolTip::add( kcfg_Colons, tr2i18n( "Split translations at colons" ) );
    TQWhatsThis::add( kcfg_Colons, tr2i18n( "When this options is enabled, translations that have not been split at periods will be split at colons if they have any." ) );
    kcfg_ShowMore->setText( tr2i18n( "Enable S&how More button" ) );
    TQToolTip::add( kcfg_ShowMore, tr2i18n( "Enable the Show More button on the Random Query screen" ) );
    TQWhatsThis::add( kcfg_ShowMore, tr2i18n( "When this is checked, you will be able to use a Show More button which allow you to get the next letter in your answer in the query. If this is unchecked, the Show More button will not be enabled, you will not be able to use it." ) );
    TQToolTip::add( kcfg_Fields, tr2i18n( "Maximum number of fields to split translations into" ) );
    TQWhatsThis::add( kcfg_Fields, tr2i18n( "Enter the maximum number of answer fields you want to have. When splitting translations, the program will only split into this many parts, and the last part will contain the rest of the translation." ) );
    QueryTimeout->setTitle( tr2i18n( "Time Per Query" ) );
    kcfg_QueryTimeout->setTitle( TQString::null );
    r_show_to->setText( tr2i18n( "&Show solution" ) );
    r_no_limit->setText( tr2i18n( "&No time limitation" ) );
    TQToolTip::add( r_no_limit, tr2i18n( "Check this if you do not want any time limitation per query." ) );
    TQWhatsThis::add( r_no_limit, tr2i18n( "When this is checked, there is no time limitation for each query" ) );
    r_cont_to->setText( tr2i18n( "&Continue after timeout" ) );
    label_mqtime->setText( tr2i18n( "Ma&x. time (s):" ) );
    kcfg_ShowCounter->setText( tr2i18n( "S&how remaining time" ) );
    TQToolTip::add( kcfg_ShowCounter, tr2i18n( "If checked, activate a progress bar to show the remaining time." ) );
    TQWhatsThis::add( kcfg_ShowCounter, tr2i18n( "Check this button if you want to activate a progress bar to show the remaining time for each query." ) );
    TQToolTip::add( kcfg_MaxTimePer, tr2i18n( "Set the maximum time allowed per query." ) );
    TQWhatsThis::add( kcfg_MaxTimePer, tr2i18n( "You may set a time limit KVocTrain grants you to remember the correct answer. Set here the maximum time you want to allow per query." ) );
}

/****************************************************************************
** QueryOptionsBase meta object code from reading C++ file 'queryoptionsbase.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 "queryoptionsbase.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 *QueryOptionsBase::className() const
{
    return "QueryOptionsBase";
}

TQMetaObject *QueryOptionsBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_QueryOptionsBase( "QueryOptionsBase", &QueryOptionsBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* QueryOptionsBase::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 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"QueryOptionsBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_QueryOptionsBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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