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

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

#include "generaloptionsbase.h"

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

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

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

    GeneralOptionsBaseLayout->addMultiCellWidget( kcfg_AutoSave, 0, 0, 0, 2 );

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

    GeneralOptionsBaseLayout->addWidget( kcfg_AutoBackup, 1, 0 );

    kcfg_BackupTime = new KIntSpinBox( this, "kcfg_BackupTime" );
    kcfg_BackupTime->setMaxValue( 120 );
    kcfg_BackupTime->setMinValue( 5 );

    GeneralOptionsBaseLayout->addWidget( kcfg_BackupTime, 1, 1 );

    lblBackupInterva = new TQLabel( this, "lblBackupInterva" );

    GeneralOptionsBaseLayout->addWidget( lblBackupInterva, 1, 2 );

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

    GeneralOptionsBaseLayout->addMultiCellWidget( kcfg_SmartAppend, 2, 2, 0, 2 );

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

    GeneralOptionsBaseLayout->addMultiCellWidget( kcfg_AutoEntryApply, 3, 3, 0, 2 );

    kcfg_HeaderResizeMode = new TQButtonGroup( this, "kcfg_HeaderResizeMode" );
    kcfg_HeaderResizeMode->setColumnLayout(0, TQt::Vertical );
    kcfg_HeaderResizeMode->layout()->setSpacing( 6 );
    kcfg_HeaderResizeMode->layout()->setMargin( 11 );
    kcfg_HeaderResizeModeLayout = new TQVBoxLayout( kcfg_HeaderResizeMode->layout() );
    kcfg_HeaderResizeModeLayout->setAlignment( TQt::AlignTop );

    hb_auto = new TQRadioButton( kcfg_HeaderResizeMode, "hb_auto" );
    kcfg_HeaderResizeModeLayout->addWidget( hb_auto );

    hb_percent = new TQRadioButton( kcfg_HeaderResizeMode, "hb_percent" );
    kcfg_HeaderResizeModeLayout->addWidget( hb_percent );

    hb_fixed = new TQRadioButton( kcfg_HeaderResizeMode, "hb_fixed" );
    kcfg_HeaderResizeModeLayout->addWidget( hb_fixed );

    GeneralOptionsBaseLayout->addMultiCellWidget( kcfg_HeaderResizeMode, 4, 4, 0, 2 );
    spacer4 = new TQSpacerItem( 51, 123, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    GeneralOptionsBaseLayout->addItem( spacer4, 5, 0 );
    languageChange();
    resize( TQSize(332, 369).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_AutoBackup, TQ_SIGNAL( toggled(bool) ), kcfg_BackupTime, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GeneralOptionsBase::languageChange()
{
    kcfg_AutoSave->setText( tr2i18n( "&Save vocabularies automatically on close and quit" ) );
    TQToolTip::add( kcfg_AutoSave, tr2i18n( "Allow automatic saving of your work" ) );
    TQWhatsThis::add( kcfg_AutoSave, tr2i18n( "Your work will be automatically saved if you check this option" ) );
    kcfg_AutoBackup->setText( tr2i18n( "&Create a backup every" ) );
    TQToolTip::add( kcfg_AutoBackup, tr2i18n( "Allow automatic saving of your work" ) );
    TQWhatsThis::add( kcfg_AutoBackup, tr2i18n( "Your work will be automatically saved if you check this option" ) );
    lblBackupInterva->setText( tr2i18n( "minutes" ) );
    kcfg_SmartAppend->setText( tr2i18n( "Smart a&ppending" ) );
    TQToolTip::add( kcfg_SmartAppend, tr2i18n( "If checked, the entry dialog will popup repeatedly" ) );
    TQWhatsThis::add( kcfg_SmartAppend, tr2i18n( "If this feature is activated, you will repeatedly be prompted with the entry dialog. After entering the first original you have to enter the corresponding translations. Afterwards you proceed with the next original and its translations until you stop by pressing the ESC key." ) );
    kcfg_AutoEntryApply->setText( tr2i18n( "Appl&y changes without asking" ) );
    TQToolTip::add( kcfg_AutoEntryApply, tr2i18n( "Your changes will be applied automatically." ) );
    TQWhatsThis::add( kcfg_AutoEntryApply, tr2i18n( "If checked, you will not be asked if you really want this change; it will be applied automatically." ) );
    kcfg_HeaderResizeMode->setTitle( tr2i18n( "Column Resizing" ) );
    hb_auto->setText( tr2i18n( "A&utomatic" ) );
    TQToolTip::add( hb_auto, tr2i18n( "KVocTrain determines the resizing of the columns" ) );
    TQWhatsThis::add( hb_auto, tr2i18n( "KVocTrain makes each column the same width except the leftmost with the lesson names, which is half the size of the others. The second column, which contains the picture that describes the state of the row, has a fixed width." ) );
    hb_percent->setText( tr2i18n( "P&ercentage" ) );
    TQToolTip::add( hb_percent, tr2i18n( "The columns resize using the same factor that the window is resized to." ) );
    TQWhatsThis::add( hb_percent, tr2i18n( "If this is checked, the columns resize by the same amount as the window" ) );
    hb_fixed->setText( tr2i18n( "&Fixed" ) );
    TQToolTip::add( hb_fixed, tr2i18n( "There is no resizing of the columns" ) );
    TQWhatsThis::add( hb_fixed, tr2i18n( "When checked, the columns are not resized" ) );
}

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

TQMetaObject *GeneralOptionsBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GeneralOptionsBase( "GeneralOptionsBase", &GeneralOptionsBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* GeneralOptionsBase::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(
	"GeneralOptionsBase", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_GeneralOptionsBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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