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

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

#include "kmyfirewallruleeditortargetnat.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqspinbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    GroupBox4 = new TQGroupBox( this, "GroupBox4" );
    GroupBox4->setColumnLayout(0, TQt::Vertical );
    GroupBox4->layout()->setSpacing( 2 );
    GroupBox4->layout()->setMargin( 2 );
    GroupBox4Layout = new TQVBoxLayout( GroupBox4->layout() );
    GroupBox4Layout->setAlignment( TQt::AlignTop );

    Layout28 = new TQGridLayout( 0, 1, 1, 0, 6, "Layout28"); 

    c_ip_range = new TQCheckBox( GroupBox4, "c_ip_range" );

    Layout28->addWidget( c_ip_range, 1, 0 );

    TextLabel8 = new TQLabel( GroupBox4, "TextLabel8" );
    TextLabel8->setEnabled( false );

    Layout28->addWidget( TextLabel8, 1, 1 );

    TextLabel9 = new TQLabel( GroupBox4, "TextLabel9" );
    TextLabel9->setEnabled( false );

    Layout28->addWidget( TextLabel9, 0, 1 );

    t_ip2 = new TQLineEdit( GroupBox4, "t_ip2" );
    t_ip2->setEnabled( false );
    t_ip2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, t_ip2->sizePolicy().hasHeightForWidth() ) );

    Layout28->addWidget( t_ip2, 1, 2 );

    t_ip1 = new TQLineEdit( GroupBox4, "t_ip1" );
    t_ip1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, t_ip1->sizePolicy().hasHeightForWidth() ) );

    Layout28->addWidget( t_ip1, 0, 2 );

    TextLabel2 = new TQLabel( GroupBox4, "TextLabel2" );
    TextLabel2->setAlignment( int( TQLabel::AlignVCenter ) );

    Layout28->addWidget( TextLabel2, 0, 0 );
    GroupBox4Layout->addLayout( Layout28 );

    c_use_ports = new TQCheckBox( GroupBox4, "c_use_ports" );
    c_use_ports->setEnabled( true );
    GroupBox4Layout->addWidget( c_use_ports );

    GroupBox20 = new TQGroupBox( GroupBox4, "GroupBox20" );
    GroupBox20->setEnabled( false );
    GroupBox20->setLineWidth( 0 );
    GroupBox20->setColumnLayout(0, TQt::Vertical );
    GroupBox20->layout()->setSpacing( 2 );
    GroupBox20->layout()->setMargin( 2 );
    GroupBox20Layout = new TQGridLayout( GroupBox20->layout() );
    GroupBox20Layout->setAlignment( TQt::AlignTop );

    c_use_port_range = new TQCheckBox( GroupBox20, "c_use_port_range" );

    GroupBox20Layout->addWidget( c_use_port_range, 1, 0 );

    TextLabel3 = new TQLabel( GroupBox20, "TextLabel3" );
    TextLabel3->setEnabled( false );

    GroupBox20Layout->addWidget( TextLabel3, 0, 1 );

    TextLabel11 = new TQLabel( GroupBox20, "TextLabel11" );

    GroupBox20Layout->addWidget( TextLabel11, 0, 0 );

    sb_port1 = new TQSpinBox( GroupBox20, "sb_port1" );
    sb_port1->setMaxValue( 65535 );
    sb_port1->setMinValue( 1 );

    GroupBox20Layout->addWidget( sb_port1, 0, 2 );

    sb_port2 = new TQSpinBox( GroupBox20, "sb_port2" );
    sb_port2->setEnabled( false );
    sb_port2->setMaxValue( 65535 );
    sb_port2->setMinValue( 1 );

    GroupBox20Layout->addWidget( sb_port2, 1, 2 );

    TextLabel5 = new TQLabel( GroupBox20, "TextLabel5" );
    TextLabel5->setEnabled( false );

    GroupBox20Layout->addWidget( TextLabel5, 1, 1 );
    GroupBox4Layout->addWidget( GroupBox20 );
    KMyFirewallRuleEditorTargetNatLayout->addWidget( GroupBox4 );

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

    b_ok_2 = new TQPushButton( this, "b_ok_2" );
    layout27->addWidget( b_ok_2 );

    b_cancel_2 = new TQPushButton( this, "b_cancel_2" );
    layout27->addWidget( b_cancel_2 );

    b_ok = new TQPushButton( this, "b_ok" );
    layout27->addWidget( b_ok );
    KMyFirewallRuleEditorTargetNatLayout->addLayout( layout27 );
    languageChange();
    resize( TQSize(331, 207).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( c_ip_range, TQ_SIGNAL( toggled(bool) ), TextLabel8, TQ_SLOT( setEnabled(bool) ) );
    connect( c_ip_range, TQ_SIGNAL( toggled(bool) ), t_ip2, TQ_SLOT( setEnabled(bool) ) );
    connect( b_ok, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( c_ip_range, TQ_SIGNAL( toggled(bool) ), TextLabel9, TQ_SLOT( setEnabled(bool) ) );
    connect( c_use_port_range, TQ_SIGNAL( toggled(bool) ), TextLabel3, TQ_SLOT( setEnabled(bool) ) );
    connect( c_use_port_range, TQ_SIGNAL( toggled(bool) ), TextLabel5, TQ_SLOT( setEnabled(bool) ) );
    connect( c_use_port_range, TQ_SIGNAL( toggled(bool) ), sb_port2, TQ_SLOT( setEnabled(bool) ) );
    connect( c_use_ports, TQ_SIGNAL( toggled(bool) ), GroupBox20, TQ_SLOT( setEnabled(bool) ) );
    connect( b_cancel_2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotHelp() ) );
    connect( b_ok_2, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMyFirewallRuleEditorTargetNat::languageChange()
{
    setCaption( tr2i18n( "KMyFirewall - Nat Options" ) );
    GroupBox4->setTitle( tr2i18n( "Configure Network Address Translation" ) );
    c_ip_range->setText( tr2i18n( "Use IP Range" ) );
    TextLabel8->setText( tr2i18n( "to:" ) );
    TextLabel9->setText( tr2i18n( "from:" ) );
    TextLabel2->setText( tr2i18n( "Translate to IP:" ) );
    c_use_ports->setText( tr2i18n( "Use only custom port(s)" ) );
    TQToolTip::add( c_use_ports, tr2i18n( "ATTENTION: This is only available if the rule also defines protcol TCP or UDP as a filter option!" ) );
    GroupBox20->setTitle( TQString::null );
    c_use_port_range->setText( tr2i18n( "Use a port range" ) );
    TextLabel3->setText( tr2i18n( "from:" ) );
    TextLabel11->setText( tr2i18n( "Map to port:" ) );
    TextLabel5->setText( tr2i18n( "to:" ) );
    b_ok_2->setText( tr2i18n( "&Dismiss" ) );
    b_cancel_2->setText( tr2i18n( "&Help" ) );
    b_ok->setText( tr2i18n( "&Apply" ) );
}

void KMyFirewallRuleEditorTargetNat::slotHelp()
{
    tqWarning( "KMyFirewallRuleEditorTargetNat::slotHelp(): Not implemented yet" );
}

void KMyFirewallRuleEditorTargetNat::accept()
{
    tqWarning( "KMyFirewallRuleEditorTargetNat::accept(): Not implemented yet" );
}

void KMyFirewallRuleEditorTargetNat::reject()
{
    tqWarning( "KMyFirewallRuleEditorTargetNat::reject(): Not implemented yet" );
}

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

TQMetaObject *KMyFirewallRuleEditorTargetNat::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KMyFirewallRuleEditorTargetNat( "KMyFirewallRuleEditorTargetNat", &KMyFirewallRuleEditorTargetNat::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

bool KMyFirewallRuleEditorTargetNat::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotHelp(); break;
    case 1: accept(); break;
    case 2: reject(); break;
    case 3: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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