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

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

#include "hostprops.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "hostprops.ui.h"

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

    propertiesGrp = new TQGroupBox( this, "propertiesGrp" );
    propertiesGrp->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, propertiesGrp->sizePolicy().hasHeightForWidth() ) );
    propertiesGrp->setMinimumSize( TQSize( 180, 0 ) );
    propertiesGrp->setFrameShape( TQGroupBox::Box );
    propertiesGrp->setFrameShadow( TQGroupBox::Sunken );
    propertiesGrp->setColumnLayout(0, TQt::Vertical );
    propertiesGrp->layout()->setSpacing( 6 );
    propertiesGrp->layout()->setMargin( 11 );
    propertiesGrpLayout = new TQVBoxLayout( propertiesGrp->layout() );
    propertiesGrpLayout->setAlignment( TQt::AlignTop );

    TextLabel1 = new TQLabel( propertiesGrp, "TextLabel1" );
    propertiesGrpLayout->addWidget( TextLabel1 );

    nameEdit = new TQLineEdit( propertiesGrp, "nameEdit" );
    nameEdit->setFrameShape( TQLineEdit::LineEditPanel );
    nameEdit->setFrameShadow( TQLineEdit::Sunken );
    propertiesGrpLayout->addWidget( nameEdit );

    publicChk = new TQCheckBox( propertiesGrp, "publicChk" );
    propertiesGrpLayout->addWidget( publicChk );

    HostPropsLayout->addMultiCellWidget( propertiesGrp, 0, 0, 0, 1 );

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

    readOnlyChk = new TQCheckBox( GroupBox7, "readOnlyChk" );

    GroupBox7Layout->addWidget( readOnlyChk, 0, 0 );

    secureChk = new TQCheckBox( GroupBox7, "secureChk" );

    GroupBox7Layout->addWidget( secureChk, 1, 0 );

    syncChk = new TQCheckBox( GroupBox7, "syncChk" );

    GroupBox7Layout->addWidget( syncChk, 2, 0 );

    wdelayChk = new TQCheckBox( GroupBox7, "wdelayChk" );
    wdelayChk->setEnabled( false );

    GroupBox7Layout->addWidget( wdelayChk, 3, 0 );

    hideChk = new TQCheckBox( GroupBox7, "hideChk" );

    GroupBox7Layout->addWidget( hideChk, 4, 0 );

    subtreeChk = new TQCheckBox( GroupBox7, "subtreeChk" );

    GroupBox7Layout->addWidget( subtreeChk, 5, 0 );

    secureLocksChk = new TQCheckBox( GroupBox7, "secureLocksChk" );

    GroupBox7Layout->addWidget( secureLocksChk, 6, 0 );

    HostPropsLayout->addWidget( GroupBox7, 1, 0 );

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

    allSquashChk = new TQCheckBox( GroupBox3, "allSquashChk" );
    GroupBox3Layout->addWidget( allSquashChk );

    rootSquashChk = new TQCheckBox( GroupBox3, "rootSquashChk" );
    GroupBox3Layout->addWidget( rootSquashChk );

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

    TextLabel1_2 = new TQLabel( GroupBox3, "TextLabel1_2" );
    layout15->addWidget( TextLabel1_2 );

    anonuidEdit = new TQLineEdit( GroupBox3, "anonuidEdit" );
    anonuidEdit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 100, 0, anonuidEdit->sizePolicy().hasHeightForWidth() ) );
    anonuidEdit->setMinimumSize( TQSize( 50, 0 ) );
    layout15->addWidget( anonuidEdit );
    GroupBox3Layout->addLayout( layout15 );

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

    TextLabel2 = new TQLabel( GroupBox3, "TextLabel2" );
    layout16->addWidget( TextLabel2 );

    anongidEdit = new TQLineEdit( GroupBox3, "anongidEdit" );
    anongidEdit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)4, (TQSizePolicy::SizeType)0, 0, 0, anongidEdit->sizePolicy().hasHeightForWidth() ) );
    anongidEdit->setMinimumSize( TQSize( 50, 0 ) );
    layout16->addWidget( anongidEdit );
    GroupBox3Layout->addLayout( layout16 );

    HostPropsLayout->addWidget( GroupBox3, 1, 1 );
    spacer3 = new TQSpacerItem( 20, 16, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    HostPropsLayout->addItem( spacer3, 2, 0 );
    languageChange();
    resize( TQSize(333, 332).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( publicChk, TQ_SIGNAL( toggled(bool) ), nameEdit, TQ_SLOT( setDisabled(bool) ) );
    connect( readOnlyChk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( setModified() ) );
    connect( secureChk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( setModified() ) );
    connect( syncChk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( setModified() ) );
    connect( wdelayChk, TQ_SIGNAL( pressed() ), this, TQ_SLOT( setModified() ) );
    connect( subtreeChk, TQ_SIGNAL( pressed() ), this, TQ_SLOT( setModified() ) );
    connect( secureLocksChk, TQ_SIGNAL( pressed() ), this, TQ_SLOT( setModified() ) );
    connect( allSquashChk, TQ_SIGNAL( pressed() ), this, TQ_SLOT( setModified() ) );
    connect( rootSquashChk, TQ_SIGNAL( pressed() ), this, TQ_SLOT( setModified() ) );
    connect( nameEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( setModified() ) );
    connect( hideChk, TQ_SIGNAL( clicked() ), this, TQ_SLOT( setModified() ) );
    connect( syncChk, TQ_SIGNAL( toggled(bool) ), wdelayChk, TQ_SLOT( setEnabled(bool) ) );
    connect( anonuidEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( setModified() ) );
    connect( anongidEdit, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( setModified() ) );

    // buddies
    TextLabel1->setBuddy( nameEdit );
    TextLabel1_2->setBuddy( anonuidEdit );
    TextLabel2->setBuddy( anongidEdit );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void HostProps::languageChange()
{
    propertiesGrp->setTitle( tr2i18n( "Host Properties" ) );
    TextLabel1->setText( tr2i18n( "&Name/address:" ) );
    TQWhatsThis::add( nameEdit, tr2i18n( "<b>Name / Address field</b>\n"
"<p>\n"
"Here you can enter the host name or address.<br>\n"
"The host may be specified in a number of ways:\n"
"<p>\n"
"<i>single host</i>\n"
"<p>\n"
" This is the most common format. You may specify a host either by an abbreviated name recognized by the resolver, the fully qualified domain name, or an IP address.\n"
"</p>\n"
"\n"
"<i>netgroups</i>\n"
"<p>\n"
" NIS netgroups may be given as @group. Only the host part of each netgroup members is consider in checking for membership. Empty host parts or those containing a single dash (-) are ignored.\n"
"</p>\n"
"\n"
"<i>wildcards</i>\n"
"<p>\n"
" Machine names may contain the wildcard characters * and ?. This can be used to make the exports file more compact; for instance, *.cs.foo.edu matches all hosts in the domain cs.foo.edu. However, these wildcard characters do not match the dots in a domain name, so the above pattern does not include hosts such as a.b.cs.foo.edu.\n"
"</p>\n"
"\n"
"<i>IP networks</i>\n"
"<p>\n"
" You can also export directories to all hosts on an IP (sub-) network simultaneously. This is done by specifying an IP address and netmask pair as address/netmask where the netmask can be specified in dotted-decimal format, or as a contiguous mask length (for example, either `/255.255.252.0' or `/22' appended to the network base address result in identical subnetworks with 10 bits of host).\n"
"</p>" ) );
    publicChk->setText( tr2i18n( "&Public access" ) );
    TQWhatsThis::add( publicChk, tr2i18n( "<b>Public access</b>\n"
"<p>\n"
"If you check this, the host address will be a single wildcard , which means public access.\n"
"This is just the same as if you would enter a wildcard in the address field.\n"
"</p>" ) );
    GroupBox7->setTitle( tr2i18n( "Options" ) );
    readOnlyChk->setText( tr2i18n( "&Writable" ) );
    TQWhatsThis::add( readOnlyChk, tr2i18n( "<b>Writable</b>\n"
"<p>\n"
"Allow both read and write requests on this NFS volume.\n"
"</p>\n"
"<p>\n"
"The default is to disallow any request which changes the filesystem\n"
"</p>" ) );
    secureChk->setText( tr2i18n( "&Insecure" ) );
    TQWhatsThis::add( secureChk, tr2i18n( "<b>Insecure</b>\n"
"<p>\n"
"If this option is checked, it is not required that requests originate on an internet port less than IPPORT_RESERVED (1024).\n"
"</p>\n"
"<p>\n"
"If unsure leave it unchecked.\n"
"</p>" ) );
    syncChk->setText( tr2i18n( "&Sync" ) );
    TQWhatsThis::add( syncChk, tr2i18n( "<b>Sync</b>\n"
"<p>\n"
"This option requests that all file writes be committed to disk before the write request completes. This is required for complete safety of data in the face of a server crash, but incurs a performance hit.\n"
"</p>\n"
"<p>\n"
"The default is to allow the server to write the data out whenever it is ready.\n"
"</p>" ) );
    wdelayChk->setText( tr2i18n( "No w&delay" ) );
    TQWhatsThis::add( wdelayChk, tr2i18n( "<b>No wdelay</b>\n"
"<p>\n"
"This option only has effect if sync is also set. The NFS server will normally delay committing a write request to disk slightly if it suspects that another related write request may be in progress or may arrive soon. This allows multiple write requests to be committed to disk with the one operation which can improve performance. If an NFS server received mainly small unrelated requests, this behavior could actually reduce performance, so no wdelay is available to turn it off. </p>" ) );
    hideChk->setText( tr2i18n( "No &hide" ) );
    TQWhatsThis::add( hideChk, tr2i18n( "<b>No hide</b>\n"
"<p>\n"
"This option is based on the option of the same name provided in IRIX NFS. Normally, if a server exports two filesystems one of which is mounted on the other, then the client will have to mount both filesystems explicitly to get access to them. If it just mounts the parent, it will see an empty directory at the place where the other filesystem is mounted. That filesystem is \"hidden\".\n"
"</p>\n"
"<p>\n"
"Setting the nohide option on a filesystem causes it not to be hidden, and an appropriately authorized client will be able to move from the parent to that filesystem without noticing the change.\n"
"</p>\n"
"<p>\n"
"However, some NFS clients do not cope well with this situation as, for instance, it is then possible for two files in the one apparent filesystem to have the same inode number.\n"
"</p>\n"
"<p>\n"
"The nohide option is currently only effective on single host exports. It does not work reliably with netgroup, subnet, or wildcard exports.\n"
"</p>\n"
"<p>\n"
"This option can be very useful in some situations, but it should be used with due care, and only after confirming that the client system copes with the situation effectively.\n"
"</p>" ) );
    subtreeChk->setText( tr2i18n( "No su&btree check" ) );
    TQWhatsThis::add( subtreeChk, tr2i18n( "<b>No subtree check</b>\n"
"<p>\n"
"This option disables subtree checking, which has mild security implications, but can improve reliability is some circumstances.\n"
"</p>\n"
"<p>\n"
"If a subdirectory of a filesystem is exported, but the whole filesystem is not, then whenever a NFS request arrives, the server must check not only that the accessed file is in the appropriate filesystem (which is easy) but also that it is in the exported tree (which is harder). This check is called the subtree_check.\n"
"</p>\n"
"<p>\n"
"In order to perform this check, the server must include some information about the location of the file in the \"filehandle\" that is given to the client. This can cause problems with accessing files that are renamed while a client has them open (though in many simple cases it will still work).\n"
"</p>\n"
"<p>\n"
"subtree checking is also used to make sure that files inside directories to which only root has access can only be accessed if the filesystem is exported with no_root_squash (see below), even the file itself allows more general access.\n"
"</p>\n"
"<p>\n"
"As a general guide, a home directory filesystem, which is normally exported at the root and may see lots of file renames, should be exported with subtree checking disabled. A filesystem which is mostly read-only, and at least does not see many file renames (e.g. /usr or /var) and for which subdirectories may be exported, should probably be exported with subtree checks enabled.\n"
"</p>" ) );
    secureLocksChk->setText( tr2i18n( "Insecure loc&ks" ) );
    TQWhatsThis::add( secureLocksChk, tr2i18n( "<b>Insecure locks</b>\n"
"<p>\n"
"This option tells the NFS server not to require authentication of locking requests (i.e. requests which use the NLM protocol). Normally the NFS server will require a lock request to hold a credential for a user who has read access to the file. With this flag no access checks will be performed.\n"
"</p>\n"
"<p>\n"
"Early NFS client implementations did not send credentials with lock requests, and many current NFS clients still exist which are based on the old implementations. Use this flag if you find that you can only lock files which are world readable.\n"
"</p>" ) );
    GroupBox3->setTitle( tr2i18n( "User Mapping" ) );
    allSquashChk->setText( tr2i18n( "All s&quash" ) );
    TQWhatsThis::add( allSquashChk, tr2i18n( "<b>All squash</b>\n"
"<p>\n"
"Map all uids and gids to the anonymous user. Useful for NFS-exported public FTP directories, news spool directories, etc. </p>" ) );
    rootSquashChk->setText( tr2i18n( "No &root squash" ) );
    TQWhatsThis::add( rootSquashChk, tr2i18n( "<b>No root squash</b>\n"
"<p>\n"
"Turn of root squashing. This option is mainly useful for diskless clients.\n"
"</p>\n"
"<i>root squashing</i>\n"
"<p>\n"
"Map requests from uid/gid 0 to the anonymous uid/gid. Note that this does not apply to any other uids that might be equally sensitive, such as user bin.\n"
"</p>" ) );
    TextLabel1_2->setText( tr2i18n( "Anonym. &UID:" ) );
    TQWhatsThis::add( TextLabel1_2, tr2i18n( "<b>Anonym. UID/GID</b> <p> These options explicitly set the uid and gid of the anonymous account. This option is primarily useful for PC/NFS clients, where you might want all requests appear to be from one user. </p>" ) );
    anonuidEdit->setText( tr2i18n( "FF" ) );
    TextLabel2->setText( tr2i18n( "Anonym. &GID:" ) );
    TQWhatsThis::add( TextLabel2, tr2i18n( "<b>Anonym. UID/GID</b> <p> These options explicitly set the uid and gid of the anonymous account. This option is primarily useful for PC/NFS clients, where you might want all requests appear to be from one user. </p>" ) );
    anongidEdit->setText( tr2i18n( "FF" ) );
}

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

TQMetaObject *HostProps::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_HostProps( "HostProps", &HostProps::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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

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