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

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

#include "groupconfiggui.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <tdelistbox.h>
#include <ntqpushbutton.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "groupconfiggui.ui.h"

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

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setFrameShape( TQButtonGroup::NoFrame );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 0 );
    buttonGroup1Layout = new TQVBoxLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

    allUsersRadio = new TQRadioButton( buttonGroup1, "allUsersRadio" );
    allUsersRadio->setChecked( true );
    buttonGroup1Layout->addWidget( allUsersRadio );

    groupUsersRadio = new TQRadioButton( buttonGroup1, "groupUsersRadio" );
    buttonGroup1Layout->addWidget( groupUsersRadio );
    GroupConfigGUILayout->addWidget( buttonGroup1 );

    usersGrpBx = new TQGroupBox( this, "usersGrpBx" );
    usersGrpBx->setEnabled( false );
    usersGrpBx->setColumnLayout(0, TQt::Vertical );
    usersGrpBx->layout()->setSpacing( 6 );
    usersGrpBx->layout()->setMargin( 11 );
    usersGrpBxLayout = new TQGridLayout( usersGrpBx->layout() );
    usersGrpBxLayout->setAlignment( TQt::AlignTop );

    listBox = new TDEListBox( usersGrpBx, "listBox" );

    usersGrpBxLayout->addMultiCellWidget( listBox, 0, 2, 0, 0 );
    spacer6 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    usersGrpBxLayout->addItem( spacer6, 2, 1 );

    removeBtn = new KPushButton( usersGrpBx, "removeBtn" );
    removeBtn->setEnabled( false );

    usersGrpBxLayout->addWidget( removeBtn, 1, 1 );

    addBtn = new KPushButton( usersGrpBx, "addBtn" );

    usersGrpBxLayout->addWidget( addBtn, 0, 1 );

    writeAccessChk = new TQCheckBox( usersGrpBx, "writeAccessChk" );

    usersGrpBxLayout->addMultiCellWidget( writeAccessChk, 3, 3, 0, 1 );
    GroupConfigGUILayout->addWidget( usersGrpBx );

    layout2 = new TQHBoxLayout( 0, 0, 6, "layout2"); 
    spacer8 = new TQSpacerItem( 180, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout2->addItem( spacer8 );

    otherGroupBtn = new KPushButton( this, "otherGroupBtn" );
    otherGroupBtn->setEnabled( false );
    otherGroupBtn->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, otherGroupBtn->sizePolicy().hasHeightForWidth() ) );
    layout2->addWidget( otherGroupBtn );
    GroupConfigGUILayout->addLayout( layout2 );
    languageChange();
    resize( TQSize(521, 371).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( groupUsersRadio, TQ_SIGNAL( toggled(bool) ), usersGrpBx, TQ_SLOT( setEnabled(bool) ) );
    connect( groupUsersRadio, TQ_SIGNAL( toggled(bool) ), otherGroupBtn, TQ_SLOT( setEnabled(bool) ) );
    connect( listBox, TQ_SIGNAL( selectionChanged(TQListBoxItem*) ), this, TQ_SLOT( listBox_selectionChanged(TQListBoxItem*) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GroupConfigGUI::languageChange()
{
    buttonGroup1->setTitle( TQString::null );
    allUsersRadio->setText( tr2i18n( "Allow all users to share folders" ) );
    groupUsersRadio->setText( tr2i18n( "Only users of the '%1' group are allowed to share folders" ) );
    usersGrpBx->setTitle( tr2i18n( "Users of '%1' Group" ) );
    removeBtn->setText( tr2i18n( "Remove User" ) );
    addBtn->setText( tr2i18n( "Add User" ) );
    writeAccessChk->setText( tr2i18n( "Group members can share folders without root password" ) );
    otherGroupBtn->setText( tr2i18n( "Change Group..." ) );
}

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

TQMetaObject *GroupConfigGUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GroupConfigGUI( "GroupConfigGUI", &GroupConfigGUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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