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

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

#include "vncprefs.h"

#include <ntqvariant.h>
#include <kdialog.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqcombobox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "vncprefs.ui.h"

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

    groupBox = new TQGroupBox( this, "groupBox" );
    groupBox->setColumnLayout(0, TQt::Vertical );
    groupBox->layout()->setSpacing( KDialog::spacingHint() );
    groupBox->layout()->setMargin( KDialog::marginHint() );
    groupBoxLayout = new TQGridLayout( groupBox->layout() );
    groupBoxLayout->setAlignment( TQt::AlignTop );

    cbUseEncryption = new TQCheckBox( groupBox, "cbUseEncryption" );
    cbUseEncryption->setEnabled( false );

    groupBoxLayout->addMultiCellWidget( cbUseEncryption, 1, 1, 0, 2 );

    cbUseTDEWallet = new TQCheckBox( groupBox, "cbUseTDEWallet" );
    cbUseTDEWallet->setEnabled( true );

    groupBoxLayout->addMultiCellWidget( cbUseTDEWallet, 2, 2, 0, 2 );

    connectionTypeLabel = new TQLabel( groupBox, "connectionTypeLabel" );
    connectionTypeLabel->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)1, 0, 0, connectionTypeLabel->sizePolicy().hasHeightForWidth() ) );

    groupBoxLayout->addWidget( connectionTypeLabel, 0, 0 );

    cmbQuality = new TQComboBox( false, groupBox, "cmbQuality" );
    cmbQuality->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, cmbQuality->sizePolicy().hasHeightForWidth() ) );
    cmbQuality->setMinimumSize( TQSize( 280, 0 ) );

    groupBoxLayout->addWidget( cmbQuality, 0, 1 );
    Spacer = new TQSpacerItem( 84, 16, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBoxLayout->addItem( Spacer, 0, 2 );
    VncPrefsLayout->addWidget( groupBox );

    cbShowPrefs = new TQCheckBox( this, "cbShowPrefs" );
    VncPrefsLayout->addWidget( cbShowPrefs );
    languageChange();
    resize( TQSize(472, 126).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // buddies
    connectionTypeLabel->setBuddy( cmbQuality );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void VncPrefs::languageChange()
{
    groupBox->setTitle( tr2i18n( "Connection" ) );
    cbUseEncryption->setText( tr2i18n( "&Enable encryption (secure, but slow and not always possible)" ) );
    TQWhatsThis::add( cbUseEncryption, tr2i18n( "Enable this option to encrypt the connection. Only newer servers support this option. Encrypting prevents others from eavesdropping, but can slow down the connection considerably." ) );
    cbUseTDEWallet->setText( tr2i18n( "Use K&Wallet for passwords" ) );
    TQWhatsThis::add( cbUseTDEWallet, tr2i18n( "Enable this option to store your passwords with TDEWallet." ) );
    connectionTypeLabel->setText( tr2i18n( "Connection &type:" ) );
    cmbQuality->clear();
    cmbQuality->insertItem( tr2i18n( "High Quality (LAN, direct connection)" ) );
    cmbQuality->insertItem( tr2i18n( "Medium Quality (DSL, Cable, fast Internet)" ) );
    cmbQuality->insertItem( tr2i18n( "Low Quality (Modem, ISDN, slow Internet)" ) );
    TQWhatsThis::add( cmbQuality, tr2i18n( "Use this to specify the performance of your connection. Note that you should select the speed of the weakest link - even if you have a high speed connection, it will not help you if the remote computer uses a slow modem. Choosing a level of quality that is too high on a slow link will cause slower response times. Choosing a lower quality will increase latencies in high speed connections and results in lower image quality, especially in 'Low Quality' mode." ) );
    cbShowPrefs->setText( tr2i18n( "&Show this dialog again for this host" ) );
    TQWhatsThis::add( cbShowPrefs, tr2i18n( "Select this option if you do not want to be asked for the settings when connecting to a host. For hosts with existing profiles these profiles will be taken. New hosts will be configured with the defaults." ) );
}

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

TQMetaObject *VncPrefs::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_VncPrefs( "VncPrefs", &VncPrefs::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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