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

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

#include "groupselectdlg.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqframe.h>
#include <ntqgroupbox.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "passwd.h"
#include "groupselectdlg.ui.h"

/*
 *  Constructs a GroupSelectDlg 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.
 */
GroupSelectDlg::GroupSelectDlg( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "GroupSelectDlg" );
    setSizeGripEnabled( true );
    GroupSelectDlgLayout = new TQGridLayout( this, 1, 1, 11, 6, "GroupSelectDlgLayout"); 

    Layout1 = new TQHBoxLayout( 0, 0, 6, "Layout1"); 
    Horizontal_Spacing2 = new TQSpacerItem( 285, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout1->addItem( Horizontal_Spacing2 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( true );
    buttonOk->setDefault( true );
    Layout1->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( true );
    Layout1->addWidget( buttonCancel );

    GroupSelectDlgLayout->addMultiCellLayout( Layout1, 4, 4, 0, 1 );

    frame16 = new TQFrame( this, "frame16" );
    frame16->setFrameShape( TQFrame::HLine );
    frame16->setFrameShadow( TQFrame::Raised );

    GroupSelectDlgLayout->addMultiCellWidget( frame16, 3, 3, 0, 1 );
    spacer90 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    GroupSelectDlgLayout->addItem( spacer90, 2, 1 );

    groupBox87 = new TQGroupBox( this, "groupBox87" );
    groupBox87->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 100, 0, groupBox87->sizePolicy().hasHeightForWidth() ) );
    groupBox87->setColumnLayout(0, TQt::Vertical );
    groupBox87->layout()->setSpacing( 6 );
    groupBox87->layout()->setMargin( 11 );
    groupBox87Layout = new TQVBoxLayout( groupBox87->layout() );
    groupBox87Layout->setAlignment( TQt::AlignTop );

    groupListView = new TQListView( groupBox87, "groupListView" );
    groupListView->addColumn( tr2i18n( "Name" ) );
    groupListView->addColumn( tr2i18n( "GID" ) );
    groupListView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, 100, 0, groupListView->sizePolicy().hasHeightForWidth() ) );
    groupListView->setSelectionMode( TQListView::Extended );
    groupBox87Layout->addWidget( groupListView );

    GroupSelectDlgLayout->addMultiCellWidget( groupBox87, 0, 2, 0, 0 );

    accessBtnGrp = new TQButtonGroup( this, "accessBtnGrp" );
    accessBtnGrp->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)5, 0, 0, accessBtnGrp->sizePolicy().hasHeightForWidth() ) );
    accessBtnGrp->setColumnLayout(0, TQt::Vertical );
    accessBtnGrp->layout()->setSpacing( 6 );
    accessBtnGrp->layout()->setMargin( 11 );
    accessBtnGrpLayout = new TQVBoxLayout( accessBtnGrp->layout() );
    accessBtnGrpLayout->setAlignment( TQt::AlignTop );

    defaultRadio = new TQRadioButton( accessBtnGrp, "defaultRadio" );
    defaultRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, defaultRadio->sizePolicy().hasHeightForWidth() ) );
    defaultRadio->setChecked( true );
    accessBtnGrpLayout->addWidget( defaultRadio );

    readRadio = new TQRadioButton( accessBtnGrp, "readRadio" );
    readRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, readRadio->sizePolicy().hasHeightForWidth() ) );
    accessBtnGrpLayout->addWidget( readRadio );

    writeRadio = new TQRadioButton( accessBtnGrp, "writeRadio" );
    writeRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, writeRadio->sizePolicy().hasHeightForWidth() ) );
    accessBtnGrpLayout->addWidget( writeRadio );

    adminRadio = new TQRadioButton( accessBtnGrp, "adminRadio" );
    adminRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, adminRadio->sizePolicy().hasHeightForWidth() ) );
    accessBtnGrpLayout->addWidget( adminRadio );

    noAccessRadio = new TQRadioButton( accessBtnGrp, "noAccessRadio" );
    noAccessRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, noAccessRadio->sizePolicy().hasHeightForWidth() ) );
    accessBtnGrpLayout->addWidget( noAccessRadio );

    GroupSelectDlgLayout->addWidget( accessBtnGrp, 0, 1 );

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

    unixRadio = new TQRadioButton( kindBtnGrp, "unixRadio" );
    unixRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, unixRadio->sizePolicy().hasHeightForWidth() ) );
    unixRadio->setChecked( false );
    kindBtnGrp->insert( unixRadio, 0 );
    kindBtnGrpLayout->addWidget( unixRadio );

    nisRadio = new TQRadioButton( kindBtnGrp, "nisRadio" );
    nisRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, nisRadio->sizePolicy().hasHeightForWidth() ) );
    nisRadio->setChecked( false );
    kindBtnGrp->insert( nisRadio, 1 );
    kindBtnGrpLayout->addWidget( nisRadio );

    bothRadio = new TQRadioButton( kindBtnGrp, "bothRadio" );
    bothRadio->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, bothRadio->sizePolicy().hasHeightForWidth() ) );
    bothRadio->setChecked( true );
    kindBtnGrpLayout->addWidget( bothRadio );

    GroupSelectDlgLayout->addWidget( kindBtnGrp, 1, 1 );
    languageChange();
    resize( TQSize(406, 370).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( buttonCancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );

    // tab order
    setTabOrder( groupListView, defaultRadio );
    setTabOrder( defaultRadio, bothRadio );
    setTabOrder( bothRadio, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GroupSelectDlg::languageChange()
{
    setCaption( tr2i18n( "Select Groups" ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    groupBox87->setTitle( tr2i18n( "Selec&t Groups" ) );
    groupListView->header()->setLabel( 0, tr2i18n( "Name" ) );
    groupListView->header()->setLabel( 1, tr2i18n( "GID" ) );
    accessBtnGrp->setTitle( tr2i18n( "Acc&ess" ) );
    defaultRadio->setText( tr2i18n( "&Default" ) );
    readRadio->setText( tr2i18n( "&Read access" ) );
    writeRadio->setText( tr2i18n( "&Write access" ) );
    adminRadio->setText( tr2i18n( "&Admin access" ) );
    noAccessRadio->setText( tr2i18n( "&No access at all" ) );
    kindBtnGrp->setTitle( tr2i18n( "&Kind of Group" ) );
    unixRadio->setText( tr2i18n( "&UNIX group" ) );
    nisRadio->setText( tr2i18n( "NI&S group" ) );
    bothRadio->setText( tr2i18n( "UNIX and NIS gr&oup" ) );
}

/****************************************************************************
** GroupSelectDlg meta object code from reading C++ file 'groupselectdlg.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 "groupselectdlg.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

#include <ntqvariant.h>
const char *GroupSelectDlg::className() const
{
    return "GroupSelectDlg";
}

TQMetaObject *GroupSelectDlg::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GroupSelectDlg( "GroupSelectDlg", &GroupSelectDlg::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* GroupSelectDlg::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[] = {
	{ "specifiedGroups", &static_QUType_varptr, "\x04", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"init", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ 0, &static_QUType_TQVariant, "\x04", TQUParameter::Out }
    };
    static const TQUMethod slot_1 = {"getSelectedGroups", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_2 = {"getAccess", 1, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ 0, &static_QUType_TQString, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_3 = {"getGroupKind", 1, param_slot_3 };
    static const TQUMethod slot_4 = {"languageChange", 0, 0 };
    static const TQUMethod slot_5 = {"accept", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "init(const TQStringList&)", &slot_0, TQMetaData::Public },
	{ "getSelectedGroups()", &slot_1, TQMetaData::Public },
	{ "getAccess()", &slot_2, TQMetaData::Public },
	{ "getGroupKind()", &slot_3, TQMetaData::Public },
	{ "languageChange()", &slot_4, TQMetaData::Protected },
	{ "accept()", &slot_5, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"GroupSelectDlg", parentObject,
	slot_tbl, 6,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_GroupSelectDlg.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool GroupSelectDlg::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: init((const TQStringList&)*((const TQStringList*)static_QUType_ptr.get(_o+1))); break;
    case 1: static_QUType_TQVariant.set(_o,TQVariant(getSelectedGroups())); break;
    case 2: static_QUType_int.set(_o,getAccess()); break;
    case 3: static_QUType_TQString.set(_o,getGroupKind()); break;
    case 4: languageChange(); break;
    case 5: accept(); break;
    default:
	return TQDialog::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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