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

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

#include "kmyfirewallgenericinterfacenatwidget.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <knuminput.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    textLabel7 = new TQLabel( this, "textLabel7" );
    textLabel7->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, textLabel7->sizePolicy().hasHeightForWidth() ) );
    textLabel7->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignTop ) );

    KMyFirewallGenericInterfaceNATWidgetLayout->addWidget( textLabel7, 0, 0 );

    m_c_enable_nat = new TQCheckBox( this, "m_c_enable_nat" );

    KMyFirewallGenericInterfaceNATWidgetLayout->addWidget( m_c_enable_nat, 1, 0 );

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

    textLabel8 = new TQLabel( groupBox4, "textLabel8" );

    groupBox4Layout->addMultiCellWidget( textLabel8, 0, 0, 0, 1 );

    m_gb_nat_ip = new TQGroupBox( groupBox4, "m_gb_nat_ip" );
    m_gb_nat_ip->setFrameShadow( TQGroupBox::Plain );
    m_gb_nat_ip->setLineWidth( 1 );
    m_gb_nat_ip->setColumnLayout(0, TQt::Vertical );
    m_gb_nat_ip->layout()->setSpacing( 6 );
    m_gb_nat_ip->layout()->setMargin( 5 );
    m_gb_nat_ipLayout = new TQHBoxLayout( m_gb_nat_ip->layout() );
    m_gb_nat_ipLayout->setAlignment( TQt::AlignTop );

    textLabel3 = new TQLabel( m_gb_nat_ip, "textLabel3" );
    m_gb_nat_ipLayout->addWidget( textLabel3 );

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

    m_sb_addr_1 = new KIntSpinBox( m_gb_nat_ip, "m_sb_addr_1" );
    m_sb_addr_1->setEnabled( false );
    m_sb_addr_1->setMaxValue( 255 );
    layout19->addWidget( m_sb_addr_1 );

    textLabel4_2 = new TQLabel( m_gb_nat_ip, "textLabel4_2" );
    textLabel4_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, textLabel4_2->sizePolicy().hasHeightForWidth() ) );
    textLabel4_2->setAlignment( int( TQLabel::AlignBottom ) );
    layout19->addWidget( textLabel4_2 );

    m_sb_addr_2 = new KIntSpinBox( m_gb_nat_ip, "m_sb_addr_2" );
    m_sb_addr_2->setEnabled( false );
    m_sb_addr_2->setMaxValue( 255 );
    layout19->addWidget( m_sb_addr_2 );

    textLabel4_4_2 = new TQLabel( m_gb_nat_ip, "textLabel4_4_2" );
    textLabel4_4_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, textLabel4_4_2->sizePolicy().hasHeightForWidth() ) );
    textLabel4_4_2->setAlignment( int( TQLabel::AlignBottom ) );
    layout19->addWidget( textLabel4_4_2 );

    m_sb_addr_3 = new KIntSpinBox( m_gb_nat_ip, "m_sb_addr_3" );
    m_sb_addr_3->setEnabled( false );
    m_sb_addr_3->setMaxValue( 255 );
    layout19->addWidget( m_sb_addr_3 );

    textLabel4_3_2 = new TQLabel( m_gb_nat_ip, "textLabel4_3_2" );
    textLabel4_3_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, textLabel4_3_2->sizePolicy().hasHeightForWidth() ) );
    textLabel4_3_2->setAlignment( int( TQLabel::AlignBottom ) );
    layout19->addWidget( textLabel4_3_2 );

    m_sb_addr_4 = new KIntSpinBox( m_gb_nat_ip, "m_sb_addr_4" );
    m_sb_addr_4->setEnabled( false );
    m_sb_addr_4->setMaxValue( 255 );
    layout19->addWidget( m_sb_addr_4 );
    m_gb_nat_ipLayout->addLayout( layout19 );

    groupBox4Layout->addMultiCellWidget( m_gb_nat_ip, 3, 3, 0, 1 );

    m_c_use_masquerade = new TQCheckBox( groupBox4, "m_c_use_masquerade" );

    groupBox4Layout->addMultiCellWidget( m_c_use_masquerade, 2, 2, 0, 1 );

    m_cb_external_interface = new KComboBox( false, groupBox4, "m_cb_external_interface" );

    groupBox4Layout->addWidget( m_cb_external_interface, 1, 1 );

    textLabel3_2 = new TQLabel( groupBox4, "textLabel3_2" );
    textLabel3_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)5, 0, 0, textLabel3_2->sizePolicy().hasHeightForWidth() ) );

    groupBox4Layout->addWidget( textLabel3_2, 1, 0 );

    KMyFirewallGenericInterfaceNATWidgetLayout->addWidget( groupBox4, 2, 0 );
    languageChange();
    resize( TQSize(690, 762).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_c_enable_nat, TQ_SIGNAL( toggled(bool) ), groupBox4, TQ_SLOT( setEnabled(bool) ) );
    connect( m_c_use_masquerade, TQ_SIGNAL( toggled(bool) ), m_gb_nat_ip, TQ_SLOT( setDisabled(bool) ) );
    connect( m_c_use_masquerade, TQ_SIGNAL( toggled(bool) ), m_sb_addr_1, TQ_SLOT( setDisabled(bool) ) );
    connect( m_c_use_masquerade, TQ_SIGNAL( toggled(bool) ), m_sb_addr_2, TQ_SLOT( setDisabled(bool) ) );
    connect( m_c_use_masquerade, TQ_SIGNAL( toggled(bool) ), m_sb_addr_3, TQ_SLOT( setDisabled(bool) ) );
    connect( m_c_use_masquerade, TQ_SIGNAL( toggled(bool) ), m_sb_addr_4, TQ_SLOT( setDisabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMyFirewallGenericInterfaceNATWidget::languageChange()
{
    textLabel7->setText( tr2i18n( "<p>You can make your firewall act as a NAT router here.<br>\n"
"By enabling NAT you can provide your Internet connection to other hosts that \n"
"are using your computer a their default gateway.</p>" ) );
    m_c_enable_nat->setText( tr2i18n( "&Enable NAT (Network Address Translation)" ) );
    groupBox4->setTitle( tr2i18n( "NAT options" ) );
    textLabel8->setText( tr2i18n( "<p>By using the MASQUERADE target you are able to setup NAT without needing to have a static IP address. This is normaly the case for cheap DSL, Cable or Modem internet connections.</p>" ) );
    m_gb_nat_ip->setTitle( TQString::null );
    textLabel3->setText( tr2i18n( "Public IP:" ) );
    textLabel4_2->setText( tr2i18n( "." ) );
    textLabel4_4_2->setText( tr2i18n( "." ) );
    textLabel4_3_2->setText( tr2i18n( "." ) );
    m_c_use_masquerade->setText( tr2i18n( "Use the &MASQUERADE target for NAT" ) );
    TQToolTip::add( m_c_use_masquerade, tr2i18n( "<p>Enable this if you don't have a static IP address.<br>Normaly this is the case for dial-in connections using a modem of ISDN line<p>" ) );
    textLabel3_2->setText( tr2i18n( "Network interface connected to the Internet:" ) );
}

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

TQMetaObject *KMyFirewallGenericInterfaceNATWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KMyFirewallGenericInterfaceNATWidget( "KMyFirewallGenericInterfaceNATWidget", &KMyFirewallGenericInterfaceNATWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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