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

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

#include "usertab.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcombobox.h>
#include <ntqtable.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "userselectdlg.h"
#include "groupselectdlg.h"
#include "usertab.ui.h"

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

    groupBox53 = new TQGroupBox( this, "groupBox53" );
    groupBox53->setColumnLayout(0, TQt::Vertical );
    groupBox53->layout()->setSpacing( 6 );
    groupBox53->layout()->setMargin( 11 );
    groupBox53Layout = new TQHBoxLayout( groupBox53->layout() );
    groupBox53Layout->setAlignment( TQt::AlignTop );

    allUnspecifiedUsersCombo = new TQComboBox( false, groupBox53, "allUnspecifiedUsersCombo" );
    groupBox53Layout->addWidget( allUnspecifiedUsersCombo );
    UserTabLayout->addWidget( groupBox53 );

    groupBox77 = new TQGroupBox( this, "groupBox77" );
    groupBox77->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 0, 0, groupBox77->sizePolicy().hasHeightForWidth() ) );
    groupBox77->setColumnLayout(0, TQt::Vertical );
    groupBox77->layout()->setSpacing( 6 );
    groupBox77->layout()->setMargin( 11 );
    groupBox77Layout = new TQGridLayout( groupBox77->layout() );
    groupBox77Layout->setAlignment( TQt::AlignTop );

    userTable = new TQTable( groupBox77, "userTable" );
    userTable->setNumCols( userTable->numCols() + 1 );
    userTable->horizontalHeader()->setLabel( userTable->numCols() - 1, tr2i18n( "Name" ) );
    userTable->setNumCols( userTable->numCols() + 1 );
    userTable->horizontalHeader()->setLabel( userTable->numCols() - 1, tr2i18n( "UID" ) );
    userTable->setNumCols( userTable->numCols() + 1 );
    userTable->horizontalHeader()->setLabel( userTable->numCols() - 1, tr2i18n( "GID" ) );
    userTable->setNumCols( userTable->numCols() + 1 );
    userTable->horizontalHeader()->setLabel( userTable->numCols() - 1, tr2i18n( "Access Rights" ) );
    userTable->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 100, 50, userTable->sizePolicy().hasHeightForWidth() ) );
    userTable->setNumRows( 0 );
    userTable->setNumCols( 4 );
    userTable->setShowGrid( false );
    userTable->setColumnMovingEnabled( true );
    userTable->setSelectionMode( TQTable::MultiRow );
    userTable->setFocusStyle( TQTable::FollowStyle );

    groupBox77Layout->addMultiCellWidget( userTable, 0, 4, 0, 0 );

    addUserBtn = new TQPushButton( groupBox77, "addUserBtn" );

    groupBox77Layout->addWidget( addUserBtn, 0, 1 );

    expertBtn = new TQPushButton( groupBox77, "expertBtn" );

    groupBox77Layout->addWidget( expertBtn, 4, 1 );

    addGroupBtn = new TQPushButton( groupBox77, "addGroupBtn" );

    groupBox77Layout->addWidget( addGroupBtn, 1, 1 );

    removeSelectedBtn = new TQPushButton( groupBox77, "removeSelectedBtn" );

    groupBox77Layout->addWidget( removeSelectedBtn, 2, 1 );
    spacer88 = new TQSpacerItem( 20, 100, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    groupBox77Layout->addItem( spacer88, 3, 1 );
    UserTabLayout->addWidget( groupBox77 );

    groupBox35 = new TQGroupBox( this, "groupBox35" );
    groupBox35->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)1, 0, 0, groupBox35->sizePolicy().hasHeightForWidth() ) );
    groupBox35->setColumnLayout(0, TQt::Vertical );
    groupBox35->layout()->setSpacing( 6 );
    groupBox35->layout()->setMargin( 11 );
    groupBox35Layout = new TQHBoxLayout( groupBox35->layout() );
    groupBox35Layout->setAlignment( TQt::AlignTop );

    TextLabel12 = new TQLabel( groupBox35, "TextLabel12" );
    TextLabel12->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, TextLabel12->sizePolicy().hasHeightForWidth() ) );
    groupBox35Layout->addWidget( TextLabel12 );

    forceUserCombo = new TQComboBox( false, groupBox35, "forceUserCombo" );
    forceUserCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, forceUserCombo->sizePolicy().hasHeightForWidth() ) );
    groupBox35Layout->addWidget( forceUserCombo );

    TextLabel13 = new TQLabel( groupBox35, "TextLabel13" );
    TextLabel13->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, TextLabel13->sizePolicy().hasHeightForWidth() ) );
    groupBox35Layout->addWidget( TextLabel13 );

    forceGroupCombo = new TQComboBox( false, groupBox35, "forceGroupCombo" );
    forceGroupCombo->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, forceGroupCombo->sizePolicy().hasHeightForWidth() ) );
    groupBox35Layout->addWidget( forceGroupCombo );
    UserTabLayout->addWidget( groupBox35 );
    languageChange();
    resize( TQSize(548, 396).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( addUserBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addUserBtnClicked() ) );
    connect( addGroupBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( addGroupBtnClicked() ) );
    connect( removeSelectedBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( removeSelectedBtnClicked() ) );
    connect( expertBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( expertBtnClicked() ) );
    connect( allUnspecifiedUsersCombo, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( changedSlot() ) );
    connect( addUserBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( changedSlot() ) );
    connect( addGroupBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( changedSlot() ) );
    connect( removeSelectedBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( changedSlot() ) );
    connect( expertBtn, TQ_SIGNAL( clicked() ), this, TQ_SLOT( changedSlot() ) );
    connect( forceUserCombo, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( changedSlot() ) );
    connect( forceGroupCombo, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( changedSlot() ) );

    // tab order
    setTabOrder( allUnspecifiedUsersCombo, userTable );
    setTabOrder( userTable, addUserBtn );
    setTabOrder( addUserBtn, addGroupBtn );
    setTabOrder( addGroupBtn, removeSelectedBtn );
    setTabOrder( removeSelectedBtn, expertBtn );
    setTabOrder( expertBtn, forceUserCombo );
    setTabOrder( forceUserCombo, forceGroupCombo );

    // buddies
    TextLabel12->setBuddy( forceUserCombo );
    TextLabel13->setBuddy( forceGroupCombo );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void UserTab::languageChange()
{
    setCaption( tr2i18n( "Users" ) );
    groupBox53->setTitle( tr2i18n( "All U&nspecified Users" ) );
    allUnspecifiedUsersCombo->clear();
    allUnspecifiedUsersCombo->insertItem( tr2i18n( "Allow" ) );
    allUnspecifiedUsersCombo->insertItem( tr2i18n( "Reject" ) );
    groupBox77->setTitle( tr2i18n( "Spec&ified Users" ) );
    userTable->horizontalHeader()->setLabel( 0, tr2i18n( "Name" ) );
    userTable->horizontalHeader()->setLabel( 1, tr2i18n( "UID" ) );
    userTable->horizontalHeader()->setLabel( 2, tr2i18n( "GID" ) );
    userTable->horizontalHeader()->setLabel( 3, tr2i18n( "Access Rights" ) );
    addUserBtn->setText( tr2i18n( "A&dd User..." ) );
    expertBtn->setText( tr2i18n( "E&xpert" ) );
    addGroupBtn->setText( tr2i18n( "Add &Group..." ) );
    removeSelectedBtn->setText( tr2i18n( "Remo&ve Selected" ) );
    groupBox35->setTitle( tr2i18n( "All Users Should be Forced to the Follo&wing User/Group" ) );
    TextLabel12->setText( tr2i18n( "Forc&e user:" ) );
    TextLabel13->setText( tr2i18n( "Fo&rce group:" ) );
}

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

TQMetaObject *UserTab::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_UserTab( "UserTab", &UserTab::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* UserTab::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 = {"addUserBtnClicked", 0, 0 };
    static const TQUMethod slot_1 = {"removeSelectedBtnClicked", 0, 0 };
    static const TQUMethod slot_2 = {"addGroupBtnClicked", 0, 0 };
    static const TQUMethod slot_3 = {"expertBtnClicked", 0, 0 };
    static const TQUMethod slot_4 = {"changedSlot", 0, 0 };
    static const TQUMethod slot_5 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "addUserBtnClicked()", &slot_0, TQMetaData::Public },
	{ "removeSelectedBtnClicked()", &slot_1, TQMetaData::Public },
	{ "addGroupBtnClicked()", &slot_2, TQMetaData::Public },
	{ "expertBtnClicked()", &slot_3, TQMetaData::Public },
	{ "changedSlot()", &slot_4, TQMetaData::Public },
	{ "languageChange()", &slot_5, TQMetaData::Protected }
    };
    static const TQUMethod signal_0 = {"changed", 0, 0 };
    static const TQMetaData signal_tbl[] = {
	{ "changed()", &signal_0, TQMetaData::Public }
    };
    metaObj = TQMetaObject::new_metaobject(
	"UserTab", parentObject,
	slot_tbl, 6,
	signal_tbl, 1,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_UserTab.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

// TQ_SIGNAL changed
void UserTab::changed()
{
    activate_signal( staticMetaObject()->signalOffset() + 0 );
}

bool UserTab::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: addUserBtnClicked(); break;
    case 1: removeSelectedBtnClicked(); break;
    case 2: addGroupBtnClicked(); break;
    case 3: expertBtnClicked(); break;
    case 4: changedSlot(); break;
    case 5: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

bool UserTab::tqt_emit( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->signalOffset() ) {
    case 0: changed(); break;
    default:
	return TQWidget::tqt_emit(_id,_o);
    }
    return true;
}
#ifndef TQT_NO_PROPERTIES

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

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