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

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

#include "ldapsamba.h"

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

/*
 *  Constructs a LdapSamba 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.
 */
LdapSamba::LdapSamba( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "LdapSamba" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    LdapSambaLayout = new TQVBoxLayout( this, 11, 6, "LdapSambaLayout"); 

    kcfg_ldapsam = new TQCheckBox( this, "kcfg_ldapsam" );
    kcfg_ldapsam->setEnabled( true );
    LdapSambaLayout->addWidget( kcfg_ldapsam );

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

    kcfg_samloginscript = new KLineEdit( this, "kcfg_samloginscript" );
    kcfg_samloginscript->setEnabled( false );

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

    textLabel2_2_2 = new TQLabel( this, "textLabel2_2_2" );
    textLabel2_2_2->setEnabled( true );

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

    textLabel4_2_2 = new TQLabel( this, "textLabel4_2_2" );
    textLabel4_2_2->setEnabled( true );

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

    textLabel3_2_2 = new TQLabel( this, "textLabel3_2_2" );
    textLabel3_2_2->setEnabled( true );

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

    textLabel5_2_2 = new TQLabel( this, "textLabel5_2_2" );
    textLabel5_2_2->setEnabled( true );
    textLabel5_2_2->setAcceptDrops( false );

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

    kcfg_samhomepath = new KLineEdit( this, "kcfg_samhomepath" );
    kcfg_samhomepath->setEnabled( false );

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

    kcfg_samprofilepath = new KLineEdit( this, "kcfg_samprofilepath" );
    kcfg_samprofilepath->setEnabled( false );

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

    kcfg_samhomedrive = new KLineEdit( this, "kcfg_samhomedrive" );
    kcfg_samhomedrive->setEnabled( false );

    layout6->addWidget( kcfg_samhomedrive, 2, 1 );
    LdapSambaLayout->addLayout( layout6 );

    kcfg_lanmanhash = new TQCheckBox( this, "kcfg_lanmanhash" );
    kcfg_lanmanhash->setEnabled( false );
    LdapSambaLayout->addWidget( kcfg_lanmanhash );

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

    textLabel1_2 = new TQLabel( this, "textLabel1_2" );
    textLabel1_2->setEnabled( true );
    layout7->addWidget( textLabel1_2 );

    kcfg_samdomain = new KLineEdit( this, "kcfg_samdomain" );
    kcfg_samdomain->setEnabled( false );
    layout7->addWidget( kcfg_samdomain );

    domQuery = new KPushButton( this, "domQuery" );
    domQuery->setEnabled( false );
    layout7->addWidget( domQuery );
    LdapSambaLayout->addLayout( layout7 );

    textLabel1 = new TQLabel( this, "textLabel1" );
    textLabel1->setEnabled( true );
    LdapSambaLayout->addWidget( textLabel1 );

    kcfg_samdomsid = new KLineEdit( this, "kcfg_samdomsid" );
    kcfg_samdomsid->setEnabled( false );
    kcfg_samdomsid->setMaxLength( 41 );
    LdapSambaLayout->addWidget( kcfg_samdomsid );

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

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

    kcfg_samridbase = new KIntSpinBox( this, "kcfg_samridbase" );
    kcfg_samridbase->setMaxValue( 9999999 );
    kcfg_samridbase->setMinValue( 1000 );
    kcfg_samridbase->setLineStep( 2 );
    kcfg_samridbase->setValue( 1000 );
    layout5->addWidget( kcfg_samridbase );
    spacer3 = new TQSpacerItem( 40, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer3 );
    LdapSambaLayout->addLayout( layout5 );
    spacer2 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    LdapSambaLayout->addItem( spacer2 );
    languageChange();
    resize( TQSize(465, 281).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samloginscript, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samdomsid, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samhomedrive, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samhomepath, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samprofilepath, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_samdomain, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), kcfg_lanmanhash, TQ_SLOT( setEnabled(bool) ) );
    connect( kcfg_ldapsam, TQ_SIGNAL( toggled(bool) ), domQuery, TQ_SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( kcfg_ldapsam, kcfg_samloginscript );
    setTabOrder( kcfg_samloginscript, kcfg_samprofilepath );
    setTabOrder( kcfg_samprofilepath, kcfg_samhomedrive );
    setTabOrder( kcfg_samhomedrive, kcfg_samhomepath );
    setTabOrder( kcfg_samhomepath, kcfg_lanmanhash );
    setTabOrder( kcfg_lanmanhash, kcfg_samdomain );
    setTabOrder( kcfg_samdomain, kcfg_samdomsid );
    setTabOrder( kcfg_samdomsid, domQuery );

    // buddies
    textLabel2_2_2->setBuddy( kcfg_samloginscript );
    textLabel4_2_2->setBuddy( kcfg_samhomedrive );
    textLabel3_2_2->setBuddy( kcfg_samprofilepath );
    textLabel5_2_2->setBuddy( kcfg_samhomepath );
    textLabel1_2->setBuddy( kcfg_samdomain );
    textLabel1->setBuddy( kcfg_samdomsid );
    textLabel1_3->setBuddy( kcfg_samridbase );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void LdapSamba::languageChange()
{
    setCaption( tr2i18n( "Samba" ) );
    kcfg_ldapsam->setText( tr2i18n( "Manage Samba user accounts/groups" ) );
    textLabel2_2_2->setText( tr2i18n( "Default login script:" ) );
    textLabel4_2_2->setText( tr2i18n( "Home drive:" ) );
    textLabel3_2_2->setText( tr2i18n( "Profile path template:" ) );
    textLabel5_2_2->setText( tr2i18n( "Home path template:" ) );
    kcfg_lanmanhash->setText( tr2i18n( "Store LanManager hashed password" ) );
    textLabel1_2->setText( tr2i18n( "Domain name:" ) );
    domQuery->setText( tr2i18n( "&Query Server" ) );
    textLabel1->setText( tr2i18n( "Domain SID (you can obtain with 'net getlocalsid domain_name'):" ) );
    textLabel1_3->setText( tr2i18n( "Algorithmic RID base:" ) );
}

void LdapSamba::kcfg_ldapsam_toggled(bool)
{
    tqWarning( "LdapSamba::kcfg_ldapsam_toggled(bool): Not implemented yet" );
}

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

TQMetaObject *LdapSamba::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_LdapSamba( "LdapSamba", &LdapSamba::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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