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

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

#include "confpagemisc.h"

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

/*
 *  Constructs a confPageMisc as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
confPageMisc::confPageMisc( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "confPageMisc" );
    confPageMiscLayout = new TQGridLayout( this, 1, 1, 0, 6, "confPageMiscLayout"); 

    kcfg_AutoSaveInterval = new KIntSpinBox( this, "kcfg_AutoSaveInterval" );
    kcfg_AutoSaveInterval->setMaxValue( 1440 );
    kcfg_AutoSaveInterval->setMinValue( 1 );

    confPageMiscLayout->addWidget( kcfg_AutoSaveInterval, 1, 2 );

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

    confPageMiscLayout->addWidget( textLabel1, 1, 1 );
    spacer1 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    confPageMiscLayout->addItem( spacer1, 1, 3 );
    spacer4 = new TQSpacerItem( 20, 30, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    confPageMiscLayout->addItem( spacer4, 3, 2 );
    spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    confPageMiscLayout->addItem( spacer3, 1, 0 );

    kcfg_AutoSave = new TQCheckBox( this, "kcfg_AutoSave" );
    kcfg_AutoSave->setChecked( true );

    confPageMiscLayout->addMultiCellWidget( kcfg_AutoSave, 0, 0, 0, 3 );

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

    confPageMiscLayout->addMultiCellWidget( kcfg_Unicode, 2, 2, 0, 2 );
    languageChange();
    resize( TQSize(289, 123).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_AutoSave, TQ_SIGNAL( toggled(bool) ), kcfg_AutoSaveInterval, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_AutoSave, TQ_SIGNAL( toggled(bool) ), textLabel1, TQ_SLOT( setEnabled(bool) ) );

    // buddies
    textLabel1->setBuddy( kcfg_AutoSaveInterval );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void confPageMisc::languageChange()
{
    setCaption( tr2i18n( "Miscellaneous" ) );
    kcfg_AutoSaveInterval->setSuffix( tr2i18n( " minutes" ) );
    kcfg_AutoSaveInterval->setSpecialValueText( tr2i18n( "1 minute" ) );
    TQWhatsThis::add( kcfg_AutoSaveInterval, tr2i18n( "This is the number of minutes KJots will wait before automatically saving changes." ) );
    textLabel1->setText( tr2i18n( "S&ave every:" ) );
    TQWhatsThis::add( textLabel1, tr2i18n( "This is the number of minutes KJots will wait before automatically saving changes." ) );
    kcfg_AutoSave->setText( tr2i18n( "&Save changes periodically" ) );
    TQWhatsThis::add( kcfg_AutoSave, tr2i18n( "When \"Enable autosave\" is checked, KJots will automatically save changes made to books at the interval defined below." ) );
    kcfg_Unicode->setText( tr2i18n( "Use Unico&de encoding" ) );
}

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

TQMetaObject *confPageMisc::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_confPageMisc( "confPageMisc", &confPageMisc::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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