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

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

#include "kmyfirewallruleeditorcustomrule.h"

#include <ntqvariant.h>
#include <tqwidget.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqcheckbox.h>
#include <ntqlineedit.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    buttonGroup3 = new TQButtonGroup( this, "buttonGroup3" );
    buttonGroup3->setColumnLayout(0, TQt::Vertical );
    buttonGroup3->layout()->setSpacing( 6 );
    buttonGroup3->layout()->setMargin( 11 );
    buttonGroup3Layout = new TQVBoxLayout( buttonGroup3->layout() );
    buttonGroup3Layout->setAlignment( TQt::AlignTop );

    c_options = new TQCheckBox( buttonGroup3, "c_options" );
    c_options->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, c_options->sizePolicy().hasHeightForWidth() ) );
    TQFont c_options_font(  c_options->font() );
    c_options->setFont( c_options_font ); 
    buttonGroup3Layout->addWidget( c_options );

    textLabel14 = new TQLabel( buttonGroup3, "textLabel14" );
    textLabel14->setEnabled( false );
    textLabel14->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)3, (TQSizePolicy::SizeType)5, 0, 0, textLabel14->sizePolicy().hasHeightForWidth() ) );
    buttonGroup3Layout->addWidget( textLabel14 );

    t_options = new TQLineEdit( buttonGroup3, "t_options" );
    t_options->setEnabled( false );
    t_options->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, t_options->sizePolicy().hasHeightForWidth() ) );
    buttonGroup3Layout->addWidget( t_options );
    KMyFirewallRuleEditorCustomRuleLayout->addWidget( buttonGroup3 );

    buttonGroup2 = new TQButtonGroup( this, "buttonGroup2" );
    buttonGroup2->setColumnLayout(0, TQt::Vertical );
    buttonGroup2->layout()->setSpacing( 6 );
    buttonGroup2->layout()->setMargin( 11 );
    buttonGroup2Layout = new TQGridLayout( buttonGroup2->layout() );
    buttonGroup2Layout->setAlignment( TQt::AlignTop );

    t_target = new TQLineEdit( buttonGroup2, "t_target" );
    t_target->setEnabled( true );
    t_target->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, t_target->sizePolicy().hasHeightForWidth() ) );

    buttonGroup2Layout->addWidget( t_target, 0, 0 );
    KMyFirewallRuleEditorCustomRuleLayout->addWidget( buttonGroup2 );

    buttonGroup1 = new TQButtonGroup( this, "buttonGroup1" );
    buttonGroup1->setColumnLayout(0, TQt::Vertical );
    buttonGroup1->layout()->setSpacing( 6 );
    buttonGroup1->layout()->setMargin( 11 );
    buttonGroup1Layout = new TQGridLayout( buttonGroup1->layout() );
    buttonGroup1Layout->setAlignment( TQt::AlignTop );

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

    buttonGroup1Layout->addWidget( t_target_options, 2, 1 );

    textLabel13 = new TQLabel( buttonGroup1, "textLabel13" );
    textLabel13->setEnabled( false );
    TQFont textLabel13_font(  textLabel13->font() );
    textLabel13_font.setBold( true );
    textLabel13->setFont( textLabel13_font ); 

    buttonGroup1Layout->addWidget( textLabel13, 2, 0 );

    c_target_options = new TQCheckBox( buttonGroup1, "c_target_options" );
    TQFont c_target_options_font(  c_target_options->font() );
    c_target_options->setFont( c_target_options_font ); 

    buttonGroup1Layout->addMultiCellWidget( c_target_options, 0, 0, 0, 1 );

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

    buttonGroup1Layout->addMultiCellWidget( textLabel7, 1, 1, 0, 1 );
    KMyFirewallRuleEditorCustomRuleLayout->addWidget( buttonGroup1 );

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

    b_cancel = new TQPushButton( this, "b_cancel" );
    layout61->addWidget( b_cancel );
    spacer6 = new TQSpacerItem( 80, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout61->addItem( spacer6 );

    b_help = new TQPushButton( this, "b_help" );
    layout61->addWidget( b_help );
    spacer17 = new TQSpacerItem( 141, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout61->addItem( spacer17 );

    b_apply = new TQPushButton( this, "b_apply" );
    layout61->addWidget( b_apply );
    KMyFirewallRuleEditorCustomRuleLayout->addLayout( layout61 );
    languageChange();
    resize( TQSize(491, 473).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( b_cancel, TQ_SIGNAL( clicked() ), this, TQ_SLOT( reject() ) );
    connect( b_help, TQ_SIGNAL( clicked() ), this, TQ_SLOT( slotHelp() ) );
    connect( b_apply, TQ_SIGNAL( clicked() ), this, TQ_SLOT( accept() ) );
    connect( c_options, TQ_SIGNAL( toggled(bool) ), t_options, TQ_SLOT( setEnabled(bool) ) );
    connect( c_options, TQ_SIGNAL( toggled(bool) ), textLabel14, TQ_SLOT( setEnabled(bool) ) );
    connect( c_target_options, TQ_SIGNAL( toggled(bool) ), textLabel7, TQ_SLOT( setEnabled(bool) ) );
    connect( c_target_options, TQ_SIGNAL( toggled(bool) ), textLabel13, TQ_SLOT( setEnabled(bool) ) );
    connect( c_target_options, TQ_SIGNAL( toggled(bool) ), t_target_options, TQ_SLOT( setEnabled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void KMyFirewallRuleEditorCustomRule::languageChange()
{
    textLabel8->setText( tr2i18n( "Custom Options" ) );
    buttonGroup3->setTitle( tr2i18n( "Rule Options" ) );
    c_options->setText( tr2i18n( "Use custom options" ) );
    textLabel14->setText( tr2i18n( "<p>Define the options for you rule here. You may use any option that your current iptbales installation supports.</p>" ) );
    buttonGroup2->setTitle( tr2i18n( "Target" ) );
    buttonGroup1->setTitle( tr2i18n( "Target Options" ) );
    textLabel13->setText( tr2i18n( "Target options:" ) );
    c_target_options->setText( tr2i18n( "Enable target options" ) );
    textLabel7->setText( tr2i18n( "Here you may define the target option for the rule. Please keep in mind that not all targets have options to set. " ) );
    b_cancel->setText( tr2i18n( "&Cancel" ) );
    b_help->setText( tr2i18n( "&Help" ) );
    b_apply->setText( tr2i18n( "&Apply" ) );
}

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

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

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

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

TQMetaObject *KMyFirewallRuleEditorCustomRule::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_KMyFirewallRuleEditorCustomRule( "KMyFirewallRuleEditorCustomRule", &KMyFirewallRuleEditorCustomRule::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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