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

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

#include "kmyfirewallportwidget.h"

#include <ntqvariant.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <ntqcheckbox.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    TextLabel3 = new TQLabel( this, "TextLabel3" );
    TextLabel3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)5, 0, 0, TextLabel3->sizePolicy().hasHeightForWidth() ) );

    KMyFirewallPortWidgetLayout->addWidget( TextLabel3, 0, 0 );

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

    KMyFirewallPortWidgetLayout->addWidget( sb_port1, 0, 1 );

    l_to = new TQLabel( this, "l_to" );
    l_to->setEnabled( false );
    l_to->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, l_to->sizePolicy().hasHeightForWidth() ) );

    KMyFirewallPortWidgetLayout->addWidget( l_to, 1, 0 );

    c_port_name = new TQCheckBox( this, "c_port_name" );
    c_port_name->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, c_port_name->sizePolicy().hasHeightForWidth() ) );

    KMyFirewallPortWidgetLayout->addWidget( c_port_name, 0, 2 );

    cb_port_name = new TQComboBox( false, this, "cb_port_name" );
    cb_port_name->setEnabled( false );

    KMyFirewallPortWidgetLayout->addMultiCellWidget( cb_port_name, 0, 0, 3, 4 );

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

    KMyFirewallPortWidgetLayout->addWidget( sb_port2, 1, 1 );

    c_portrange = new TQCheckBox( this, "c_portrange" );
    c_portrange->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, c_portrange->sizePolicy().hasHeightForWidth() ) );

    KMyFirewallPortWidgetLayout->addMultiCellWidget( c_portrange, 1, 1, 2, 3 );

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

    KMyFirewallPortWidgetLayout->addWidget( c_inv, 1, 4 );
    languageChange();
    resize( TQSize(444, 72).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( c_portrange, TQ_SIGNAL( toggled(bool) ), c_port_name, TQ_SLOT( setDisabled(bool) ) );
    connect( c_port_name, TQ_SIGNAL( toggled(bool) ), c_portrange, TQ_SLOT( setDisabled(bool) ) );
    connect( c_portrange, TQ_SIGNAL( toggled(bool) ), l_to, TQ_SLOT( setEnabled(bool) ) );
    connect( c_portrange, TQ_SIGNAL( toggled(bool) ), sb_port2, TQ_SLOT( setEnabled(bool) ) );
    connect( c_port_name, TQ_SIGNAL( toggled(bool) ), sb_port1, TQ_SLOT( setDisabled(bool) ) );
    connect( c_port_name, TQ_SIGNAL( toggled(bool) ), cb_port_name, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMyFirewallPortWidget::languageChange()
{
    setCaption( tr2i18n( "PortWidget" ) );
    TextLabel3->setText( tr2i18n( "Port:" ) );
    l_to->setText( tr2i18n( "to:" ) );
    c_port_name->setText( tr2i18n( "Service name:" ) );
    c_portrange->setText( tr2i18n( "Use port range" ) );
    c_inv->setText( tr2i18n( "Invert" ) );
}

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

TQMetaObject *KMyFirewallPortWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KMyFirewallPortWidget( "KMyFirewallPortWidget", &KMyFirewallPortWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KMyFirewallPortWidget::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(
	"KMyFirewallPortWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KMyFirewallPortWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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