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

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

#include "generalsettings.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqspinbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    layout1 = new TQHBoxLayout( 0, 0, 6, "layout1"); 

    textLabel1 = new TQLabel( this, "textLabel1" );
    layout1->addWidget( textLabel1 );

    kcfg_source = new KComboBox( false, this, "kcfg_source" );
    layout1->addWidget( kcfg_source );
    GeneralSettingsLayout->addLayout( layout1 );

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

    kcfg_homepath = new KLineEdit( this, "kcfg_homepath" );

    layout6->addWidget( kcfg_homepath, 1, 1 );

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

    layout6->addWidget( textLabel2, 3, 0 );

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

    layout6->addWidget( textLabel1_2, 1, 0 );

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

    layout6->addWidget( textLabel1_3, 0, 0 );

    kcfg_shell = new KComboBox( false, this, "kcfg_shell" );
    kcfg_shell->setEditable( true );

    layout6->addWidget( kcfg_shell, 0, 1 );

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

    layout6->addWidget( textLabel1_3_2, 2, 0 );

    kcfg_firstGID = new KLineEdit( this, "kcfg_firstGID" );

    layout6->addWidget( kcfg_firstGID, 3, 1 );

    kcfg_firstUID = new KLineEdit( this, "kcfg_firstUID" );

    layout6->addWidget( kcfg_firstUID, 2, 1 );
    GeneralSettingsLayout->addLayout( layout6 );

    kcfg_createHomeDir = new TQCheckBox( this, "kcfg_createHomeDir" );
    GeneralSettingsLayout->addWidget( kcfg_createHomeDir );

    kcfg_copySkel = new TQCheckBox( this, "kcfg_copySkel" );
    kcfg_copySkel->setEnabled( false );
    GeneralSettingsLayout->addWidget( kcfg_copySkel );

    layout5 = new TQHBoxLayout( 0, 0, 6, "layout5"); 

    kcfg_userPrivateGroup = new TQCheckBox( this, "kcfg_userPrivateGroup" );
    layout5->addWidget( kcfg_userPrivateGroup );

    textLabel1_4 = new TQLabel( this, "textLabel1_4" );
    layout5->addWidget( textLabel1_4 );

    kcfg_defaultgroup = new TQSpinBox( this, "kcfg_defaultgroup" );
    kcfg_defaultgroup->setMaxValue( 65536 );
    layout5->addWidget( kcfg_defaultgroup );
    GeneralSettingsLayout->addLayout( layout5 );
    spacer5 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    GeneralSettingsLayout->addItem( spacer5 );
    languageChange();
    resize( TQSize(311, 237).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_userPrivateGroup, TQ_SIGNAL( toggled(bool) ), kcfg_defaultgroup, TQ_SLOT( setDisabled(bool) ) );
    connect( kcfg_createHomeDir, TQ_SIGNAL( toggled(bool) ), kcfg_copySkel, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_source, kcfg_shell );
    setTabOrder( kcfg_shell, kcfg_homepath );
    setTabOrder( kcfg_homepath, kcfg_firstUID );
    setTabOrder( kcfg_firstUID, kcfg_firstGID );
    setTabOrder( kcfg_firstGID, kcfg_createHomeDir );
    setTabOrder( kcfg_createHomeDir, kcfg_copySkel );
    setTabOrder( kcfg_copySkel, kcfg_userPrivateGroup );

    // buddies
    textLabel1->setBuddy( kcfg_source );
    textLabel2->setBuddy( kcfg_firstGID );
    textLabel1_2->setBuddy( kcfg_homepath );
    textLabel1_3->setBuddy( kcfg_shell );
    textLabel1_3_2->setBuddy( kcfg_firstUID );
    textLabel1_4->setBuddy( kcfg_defaultgroup );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GeneralSettings::languageChange()
{
    textLabel1->setText( tr2i18n( "Source of user/group database:" ) );
    kcfg_source->clear();
    kcfg_source->insertItem( tr2i18n( "Files" ) );
    kcfg_source->insertItem( tr2i18n( "LDAP" ) );
    kcfg_source->insertItem( tr2i18n( "System" ) );
    textLabel2->setText( tr2i18n( "First normal GID:" ) );
    textLabel1_2->setText( tr2i18n( "Home path template:" ) );
    textLabel1_3->setText( tr2i18n( "Shell:" ) );
    textLabel1_3_2->setText( tr2i18n( "First normal UID:" ) );
    kcfg_createHomeDir->setText( tr2i18n( "Create home folder" ) );
    kcfg_copySkel->setText( tr2i18n( "Copy skeleton to home folder" ) );
    kcfg_userPrivateGroup->setText( tr2i18n( "User private groups" ) );
    textLabel1_4->setText( tr2i18n( "Default group:" ) );
}

void GeneralSettings::kcfg_createHomeDir_toggled(bool)
{
    tqWarning( "GeneralSettings::kcfg_createHomeDir_toggled(bool): Not implemented yet" );
}

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

TQMetaObject *GeneralSettings::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GeneralSettings( "GeneralSettings", &GeneralSettings::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* GeneralSettings::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 TQUParameter param_slot_0[] = {
	{ 0, &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"kcfg_createHomeDir_toggled", 1, param_slot_0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "kcfg_createHomeDir_toggled(bool)", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"GeneralSettings", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_GeneralSettings.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool GeneralSettings::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: kcfg_createHomeDir_toggled((bool)static_QUType_bool.get(_o+1)); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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