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

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

#include "kmyfirewallruleeditorlimit.h"

#include <ntqvariant.h>
#include <kpushbutton.h>
#include <tqwidget.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqspinbox.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    TextLabel1 = new TQLabel( this, "TextLabel1" );
    TextLabel1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, TextLabel1->sizePolicy().hasHeightForWidth() ) );
    TextLabel1->setMinimumSize( TQSize( 0, 40 ) );
    TextLabel1->setMaximumSize( TQSize( 32767, 40 ) );
    TQFont TextLabel1_font(  TextLabel1->font() );
    TextLabel1_font.setFamily( "Arial" );
    TextLabel1_font.setBold( true );
    TextLabel1->setFont( TextLabel1_font ); 
    TextLabel1->setFrameShape( TQLabel::StyledPanel );
    TextLabel1->setFrameShadow( TQLabel::Plain );
    TextLabel1->setLineWidth( 2 );
    TextLabel1->setAlignment( int( TQLabel::WordBreak | TQLabel::AlignCenter ) );
    KMyFirewallRuleEditorLimitLayout->addWidget( TextLabel1 );

    gb_conntrack = new TQGroupBox( this, "gb_conntrack" );
    gb_conntrack->setColumnLayout(0, TQt::Vertical );
    gb_conntrack->layout()->setSpacing( 6 );
    gb_conntrack->layout()->setMargin( 11 );
    gb_conntrackLayout = new TQVBoxLayout( gb_conntrack->layout() );
    gb_conntrackLayout->setAlignment( TQt::AlignTop );

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

    c_use_limit = new TQCheckBox( gb_conntrack, "c_use_limit" );
    Layout17->addWidget( c_use_limit );
    gb_conntrackLayout->addLayout( Layout17 );

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

    c_limit = new TQCheckBox( gb_conntrack, "c_limit" );
    c_limit->setEnabled( false );
    c_limit->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, c_limit->sizePolicy().hasHeightForWidth() ) );
    Layout26->addWidget( c_limit );
    Spacer60 = new TQSpacerItem( 20, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout26->addItem( Spacer60 );

    sb_limit = new TQSpinBox( gb_conntrack, "sb_limit" );
    sb_limit->setEnabled( false );
    sb_limit->setMinValue( 1 );
    Layout26->addWidget( sb_limit );

    TextLabel7 = new TQLabel( gb_conntrack, "TextLabel7" );
    TextLabel7->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)1, 0, 0, TextLabel7->sizePolicy().hasHeightForWidth() ) );
    Layout26->addWidget( TextLabel7 );

    cb_interval = new TQComboBox( false, gb_conntrack, "cb_interval" );
    cb_interval->setEnabled( false );
    cb_interval->setEditable( false );
    cb_interval->setInsertionPolicy( TQComboBox::NoInsertion );
    cb_interval->setDuplicatesEnabled( false );
    Layout26->addWidget( cb_interval );
    gb_conntrackLayout->addLayout( Layout26 );

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

    c_burst = new TQCheckBox( gb_conntrack, "c_burst" );
    c_burst->setEnabled( false );
    c_burst->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)3, 0, 0, c_burst->sizePolicy().hasHeightForWidth() ) );
    Layout27->addWidget( c_burst );
    Spacer61 = new TQSpacerItem( 20, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    Layout27->addItem( Spacer61 );

    sb_burst = new TQSpinBox( gb_conntrack, "sb_burst" );
    sb_burst->setEnabled( false );
    sb_burst->setMinValue( 1 );
    sb_burst->setValue( 5 );
    Layout27->addWidget( sb_burst );
    gb_conntrackLayout->addLayout( Layout27 );
    KMyFirewallRuleEditorLimitLayout->addWidget( gb_conntrack );
    spacer15 = new TQSpacerItem( 20, 21, TQSizePolicy::Minimum, TQSizePolicy::Preferred );
    KMyFirewallRuleEditorLimitLayout->addItem( spacer15 );

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

    kPushButton1 = new KPushButton( this, "kPushButton1" );
    layout10->addWidget( kPushButton1 );
    Spacer12_2_2 = new TQSpacerItem( 60, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout10->addItem( Spacer12_2_2 );

    b_help = new TQPushButton( this, "b_help" );
    layout10->addWidget( b_help );
    Spacer12_2 = new TQSpacerItem( 60, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout10->addItem( Spacer12_2 );

    b_ok = new TQPushButton( this, "b_ok" );
    layout10->addWidget( b_ok );
    KMyFirewallRuleEditorLimitLayout->addLayout( layout10 );
    languageChange();
    resize( TQSize(387, 238).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( b_ok, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotOk() ) );
    connect( c_use_limit, TQ_SIGNAL( toggled(bool) ), c_limit, TQ_SLOT( setEnabled(bool) ) );
    connect( c_limit, TQ_SIGNAL( toggled(bool) ), c_burst, TQ_SLOT( setEnabled(bool) ) );
    connect( c_limit, TQ_SIGNAL( toggled(bool) ), sb_limit, TQ_SLOT( setEnabled(bool) ) );
    connect( c_limit, TQ_SIGNAL( toggled(bool) ), cb_interval, TQ_SLOT( setEnabled(bool) ) );
    connect( c_burst, TQ_SIGNAL( toggled(bool) ), sb_burst, TQ_SLOT( setEnabled(bool) ) );
    connect( b_help, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotHelp() ) );
    connect( kPushButton1, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMyFirewallRuleEditorLimit::languageChange()
{
    setCaption( tr2i18n( "Limit Matches" ) );
    TextLabel1->setText( tr2i18n( "Limit Options" ) );
    gb_conntrack->setTitle( tr2i18n( "Configure Limit " ) );
    c_use_limit->setText( tr2i18n( "Limit packet matching" ) );
    c_limit->setText( tr2i18n( "Set limit rate:" ) );
    TextLabel7->setText( tr2i18n( "/" ) );
    cb_interval->clear();
    cb_interval->insertItem( tr2i18n( "second" ) );
    cb_interval->insertItem( tr2i18n( "minute" ) );
    cb_interval->insertItem( tr2i18n( "hour" ) );
    c_burst->setText( tr2i18n( "Set burst limit:" ) );
    kPushButton1->setText( tr2i18n( "&Cancel" ) );
    b_help->setText( tr2i18n( "&Help" ) );
    b_ok->setText( tr2i18n( "&Apply" ) );
}

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

void KMyFirewallRuleEditorLimit::slotOk()
{
    tqWarning( "KMyFirewallRuleEditorLimit::slotOk(): Not implemented yet" );
}

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

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

TQMetaObject *KMyFirewallRuleEditorLimit::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KMyFirewallRuleEditorLimit( "KMyFirewallRuleEditorLimit", &KMyFirewallRuleEditorLimit::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* KMyFirewallRuleEditorLimit::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 = {"slotOk", 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 },
	{ "slotOk()", &slot_1, TQMetaData::Public },
	{ "reject()", &slot_2, TQMetaData::Public },
	{ "languageChange()", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"KMyFirewallRuleEditorLimit", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_KMyFirewallRuleEditorLimit.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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