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

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

#include "nfsdialoggui.h"

#include <ntqvariant.h>
#include <tdelistview.h>
#include <ntqgroupbox.h>
#include <ntqpushbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "nfsdialoggui.ui.h"

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

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

    addHostBtn = new TQPushButton( groupBox, "addHostBtn" );

    groupBoxLayout->addWidget( addHostBtn, 0, 1 );

    modifyHostBtn = new TQPushButton( groupBox, "modifyHostBtn" );
    modifyHostBtn->setEnabled( false );

    groupBoxLayout->addWidget( modifyHostBtn, 1, 1 );

    removeHostBtn = new TQPushButton( groupBox, "removeHostBtn" );
    removeHostBtn->setEnabled( false );

    groupBoxLayout->addWidget( removeHostBtn, 2, 1 );
    spacer3 = new TQSpacerItem( 20, 40, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    groupBoxLayout->addItem( spacer3, 3, 1 );

    listView = new TDEListView( groupBox, "listView" );
    listView->addColumn( tr2i18n( "Name/Address" ) );
    listView->addColumn( tr2i18n( "Parameters" ) );
    listView->setProperty( "selectionMode", "Extended" );
    listView->setFullWidth( true );

    groupBoxLayout->addMultiCellWidget( listView, 0, 3, 0, 0 );
    NFSDialogGUILayout->addWidget( groupBox );
    languageChange();
    resize( TQSize(466, 338).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( listView, TQ_SIGNAL( selectionChanged() ), this, TQ_SLOT( listView_selectionChanged() ) );

    // tab order
    setTabOrder( addHostBtn, modifyHostBtn );
    setTabOrder( modifyHostBtn, removeHostBtn );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void NFSDialogGUI::languageChange()
{
    groupBox->setTitle( tr2i18n( "Allowed &Hosts" ) );
    TQToolTip::add( groupBox, tr2i18n( "A list of allowed hosts" ) );
    TQWhatsThis::add( groupBox, tr2i18n( "Here you can see a list of hosts which are allowed to access this directory via NFS.\n"
"The first column shows the name or address of the host, the second column shows the access parameters. The name '*' donates public access." ) );
    addHostBtn->setText( tr2i18n( "&Add Host..." ) );
    modifyHostBtn->setText( tr2i18n( "Mo&dify Host..." ) );
    removeHostBtn->setText( tr2i18n( "&Remove Host" ) );
    listView->header()->setLabel( 0, tr2i18n( "Name/Address" ) );
    listView->header()->setLabel( 1, tr2i18n( "Parameters" ) );
}

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

TQMetaObject *NFSDialogGUI::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_NFSDialogGUI( "NFSDialogGUI", &NFSDialogGUI::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

bool NFSDialogGUI::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: listView_selectionChanged(); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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