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

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

#include "configcrypto.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqbuttongroup.h>
#include <ntqradiobutton.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "configcrypto.ui.h"

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

    gb_keys = new TQGroupBox( this, "gb_keys" );
    gb_keys->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 1, gb_keys->sizePolicy().hasHeightForWidth() ) );
    gb_keys->setColumnLayout(0, TQt::Vertical );
    gb_keys->layout()->setSpacing( KDialog::spacingHint() );
    gb_keys->layout()->setMargin( KDialog::marginHint() );
    gb_keysLayout = new TQGridLayout( gb_keys->layout() );
    gb_keysLayout->setAlignment( TQt::AlignTop );

    lb_key1 = new TQLabel( gb_keys, "lb_key1" );

    gb_keysLayout->addWidget( lb_key1, 0, 0 );

    lb_key3 = new TQLabel( gb_keys, "lb_key3" );

    gb_keysLayout->addWidget( lb_key3, 2, 0 );

    lb_key2 = new TQLabel( gb_keys, "lb_key2" );

    gb_keysLayout->addWidget( lb_key2, 1, 0 );

    lb_key4 = new TQLabel( gb_keys, "lb_key4" );

    gb_keysLayout->addWidget( lb_key4, 3, 0 );

    format_1 = new TQLabel( gb_keys, "format_1" );
    format_1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, format_1->sizePolicy().hasHeightForWidth() ) );
    format_1->setTextFormat( TQLabel::RichText );

    gb_keysLayout->addWidget( format_1, 0, 2 );

    format_2 = new TQLabel( gb_keys, "format_2" );
    format_2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, format_2->sizePolicy().hasHeightForWidth() ) );
    format_2->setTextFormat( TQLabel::RichText );

    gb_keysLayout->addWidget( format_2, 1, 2 );

    le_key1 = new KLineEdit( gb_keys, "le_key1" );
    le_key1->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, le_key1->sizePolicy().hasHeightForWidth() ) );

    gb_keysLayout->addWidget( le_key1, 0, 1 );

    le_key2 = new KLineEdit( gb_keys, "le_key2" );
    le_key2->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, le_key2->sizePolicy().hasHeightForWidth() ) );

    gb_keysLayout->addWidget( le_key2, 1, 1 );

    format_3 = new TQLabel( gb_keys, "format_3" );
    format_3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, format_3->sizePolicy().hasHeightForWidth() ) );
    format_3->setTextFormat( TQLabel::RichText );

    gb_keysLayout->addWidget( format_3, 2, 2 );

    le_key3 = new KLineEdit( gb_keys, "le_key3" );
    le_key3->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, le_key3->sizePolicy().hasHeightForWidth() ) );

    gb_keysLayout->addWidget( le_key3, 2, 1 );

    format_4 = new TQLabel( gb_keys, "format_4" );
    format_4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, format_4->sizePolicy().hasHeightForWidth() ) );
    format_4->setTextFormat( TQLabel::RichText );

    gb_keysLayout->addWidget( format_4, 3, 2 );

    le_key4 = new KLineEdit( gb_keys, "le_key4" );
    le_key4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, le_key4->sizePolicy().hasHeightForWidth() ) );

    gb_keysLayout->addWidget( le_key4, 3, 1 );

    ConfigCryptoLayout->addMultiCellWidget( gb_keys, 2, 2, 0, 2 );

    bg_cryptoMode = new TQButtonGroup( this, "bg_cryptoMode" );
    bg_cryptoMode->setColumnLayout(0, TQt::Vertical );
    bg_cryptoMode->layout()->setSpacing( KDialog::spacingHint() );
    bg_cryptoMode->layout()->setMargin( KDialog::marginHint() );
    bg_cryptoModeLayout = new TQHBoxLayout( bg_cryptoMode->layout() );
    bg_cryptoModeLayout->setAlignment( TQt::AlignTop );

    rb_openMode = new TQRadioButton( bg_cryptoMode, "rb_openMode" );
    bg_cryptoModeLayout->addWidget( rb_openMode );

    rb_restrictMode = new TQRadioButton( bg_cryptoMode, "rb_restrictMode" );
    bg_cryptoModeLayout->addWidget( rb_restrictMode );

    ConfigCryptoLayout->addMultiCellWidget( bg_cryptoMode, 1, 1, 0, 2 );
    spacer3 = new TQSpacerItem( 80, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    ConfigCryptoLayout->addItem( spacer3, 0, 2 );

    lb_useKey = new TQLabel( this, "lb_useKey" );

    ConfigCryptoLayout->addWidget( lb_useKey, 0, 0 );

    cmb_activeKey = new TQComboBox( false, this, "cmb_activeKey" );

    ConfigCryptoLayout->addWidget( cmb_activeKey, 0, 1 );
    languageChange();
    resize( TQSize(360, 236).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( le_key1, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotUpdateKey1Status(const TQString&) ) );
    connect( le_key2, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotUpdateKey2Status(const TQString&) ) );
    connect( le_key3, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotUpdateKey3Status(const TQString&) ) );
    connect( le_key4, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotUpdateKey4Status(const TQString&) ) );

    // tab order
    setTabOrder( cmb_activeKey, rb_openMode );
    setTabOrder( rb_openMode, rb_restrictMode );
    setTabOrder( rb_restrictMode, le_key1 );
    setTabOrder( le_key1, le_key2 );
    setTabOrder( le_key2, le_key3 );
    setTabOrder( le_key3, le_key4 );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigCrypto::languageChange()
{
    gb_keys->setTitle( tr2i18n( "Crypto Keys" ) );
    lb_key1->setText( tr2i18n( "Key 1:" ) );
    TQToolTip::add( lb_key1, tr2i18n( "The first encryption key. 5 or 13 characters are ASCII keys, 10 or 26 characters are hexadecimal keys." ) );
    lb_key3->setText( tr2i18n( "Key 3:" ) );
    TQToolTip::add( lb_key3, tr2i18n( "The third encryption key. 5 or 13 characters are ASCII keys, 10 or 26 characters are hexadecimal keys." ) );
    lb_key2->setText( tr2i18n( "Key 2:" ) );
    TQToolTip::add( lb_key2, tr2i18n( "The second encryption key. 5 or 13 characters are ASCII keys, 10 or 26 characters are hexadecimal keys." ) );
    lb_key4->setText( tr2i18n( "Key 4:" ) );
    TQToolTip::add( lb_key4, tr2i18n( "The fourth encryption key. 5 or 13 characters are ASCII keys, 10 or 26 characters are hexadecimal keys." ) );
    format_1->setText( tr2i18n( "<font color=\"#ff0000\">unrecognized</font>" ) );
    format_2->setText( tr2i18n( "<font color=\"#ff0000\">unrecognised</font>" ) );
    format_3->setText( tr2i18n( "<font color=\"#ff0000\">unrecognised</font>" ) );
    format_4->setText( tr2i18n( "<font color=\"#ff0000\">unrecognised</font>" ) );
    bg_cryptoMode->setTitle( tr2i18n( "Crypto Mode" ) );
    TQToolTip::add( bg_cryptoMode, tr2i18n( "Sets which types of packets the card will accept." ) );
    rb_openMode->setText( tr2i18n( "Ope&n" ) );
    TQToolTip::add( rb_openMode, tr2i18n( "Makes the card accept encrypted and unencrypted packets." ) );
    rb_restrictMode->setText( tr2i18n( "Restricted" ) );
    TQToolTip::add( rb_restrictMode, tr2i18n( "Makes the card only accept encrypted packets." ) );
    lb_useKey->setText( tr2i18n( "Key to use:" ) );
    TQToolTip::add( lb_useKey, tr2i18n( "Sets which of the four keys is to be used for transmitting packets." ) );
    cmb_activeKey->clear();
    cmb_activeKey->insertItem( tr2i18n( "Key 1" ) );
    cmb_activeKey->insertItem( tr2i18n( "Key 2" ) );
    cmb_activeKey->insertItem( tr2i18n( "Key 3" ) );
    cmb_activeKey->insertItem( tr2i18n( "Key 4" ) );
}

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

TQMetaObject *ConfigCrypto::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_ConfigCrypto( "ConfigCrypto", &ConfigCrypto::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* ConfigCrypto::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 TQUParameter param_slot_0[] = {
	{ "key", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"slotUpdateKey1Status", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "key", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"slotUpdateKey2Status", 1, param_slot_1 };
    static const TQUParameter param_slot_2[] = {
	{ "key", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"slotUpdateKey3Status", 1, param_slot_2 };
    static const TQUParameter param_slot_3[] = {
	{ "key", &static_QUType_TQString, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"slotUpdateKey4Status", 1, param_slot_3 };
    static const TQUMethod slot_4 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "slotUpdateKey1Status(const TQString&)", &slot_0, TQMetaData::Public },
	{ "slotUpdateKey2Status(const TQString&)", &slot_1, TQMetaData::Public },
	{ "slotUpdateKey3Status(const TQString&)", &slot_2, TQMetaData::Public },
	{ "slotUpdateKey4Status(const TQString&)", &slot_3, TQMetaData::Public },
	{ "languageChange()", &slot_4, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"ConfigCrypto", parentObject,
	slot_tbl, 5,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_ConfigCrypto.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool ConfigCrypto::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: slotUpdateKey1Status((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 1: slotUpdateKey2Status((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 2: slotUpdateKey3Status((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 3: slotUpdateKey4Status((const TQString&)static_QUType_TQString.get(_o+1)); break;
    case 4: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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