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

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

#include "rdpprefs.h"

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

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

    rdpGroupBox = new TQGroupBox( this, "rdpGroupBox" );
    rdpGroupBox->setColumnLayout(0, TQt::Vertical );
    rdpGroupBox->layout()->setSpacing( KDialog::spacingHint() );
    rdpGroupBox->layout()->setMargin( KDialog::marginHint() );
    rdpGroupBoxLayout = new TQGridLayout( rdpGroupBox->layout() );
    rdpGroupBoxLayout->setAlignment( TQt::AlignTop );
    spacer8 = new TQSpacerItem( 70, 21, TQSizePolicy::Fixed, TQSizePolicy::Minimum );
    rdpGroupBoxLayout->addItem( spacer8, 1, 0 );

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

    rdpGroupBoxLayout->addMultiCellWidget( cmbResolution, 0, 0, 1, 4 );

    spinWidth = new TQSpinBox( rdpGroupBox, "spinWidth" );
    spinWidth->setEnabled( false );
    spinWidth->setMaxValue( 9999 );
    spinWidth->setValue( 800 );

    rdpGroupBoxLayout->addWidget( spinWidth, 1, 2 );

    heightLabel = new TQLabel( rdpGroupBox, "heightLabel" );
    heightLabel->setEnabled( false );
    heightLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    rdpGroupBoxLayout->addWidget( heightLabel, 1, 3 );

    spinHeight = new TQSpinBox( rdpGroupBox, "spinHeight" );
    spinHeight->setEnabled( false );
    spinHeight->setMaxValue( 9999 );
    spinHeight->setValue( 600 );

    rdpGroupBoxLayout->addWidget( spinHeight, 1, 4 );

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

    rdpGroupBoxLayout->addMultiCellWidget( cmbKbLayout, 3, 3, 1, 4 );

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

    rdpGroupBoxLayout->addWidget( layoutLabel, 3, 0 );

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

    rdpGroupBoxLayout->addWidget( cbUseTDEWallet, 4, 0 );

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

    rdpGroupBoxLayout->addWidget( resolutionLabel, 0, 0 );

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

    rdpGroupBoxLayout->addWidget( colorDepthLabel, 2, 0 );

    widthLabel = new TQLabel( rdpGroupBox, "widthLabel" );
    widthLabel->setEnabled( false );
    widthLabel->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    rdpGroupBoxLayout->addWidget( widthLabel, 1, 1 );

    cmbColorDepth = new TQComboBox( false, rdpGroupBox, "cmbColorDepth" );

    rdpGroupBoxLayout->addMultiCellWidget( cmbColorDepth, 2, 2, 1, 4 );
    RdpPrefsLayout->addWidget( rdpGroupBox );

    cbShowPrefs = new TQCheckBox( this, "cbShowPrefs" );
    RdpPrefsLayout->addWidget( cbShowPrefs );
    languageChange();
    resize( TQSize(449, 177).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cmbResolution, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( resolutionChanged(int) ) );
    connect( cmbColorDepth, TQ_SIGNAL( activated(int) ), this, TQ_SLOT( colorDepth() ) );

    // tab order
    setTabOrder( cmbResolution, spinWidth );
    setTabOrder( spinWidth, spinHeight );
    setTabOrder( spinHeight, cmbColorDepth );
    setTabOrder( cmbColorDepth, cmbKbLayout );
    setTabOrder( cmbKbLayout, cbShowPrefs );

    // buddies
    heightLabel->setBuddy( spinHeight );
    layoutLabel->setBuddy( cmbKbLayout );
    resolutionLabel->setBuddy( cmbResolution );
    colorDepthLabel->setBuddy( cmbKbLayout );
    widthLabel->setBuddy( spinWidth );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void RdpPrefs::languageChange()
{
    rdpGroupBox->setTitle( tr2i18n( "Connection" ) );
    cmbResolution->clear();
    cmbResolution->insertItem( tr2i18n( "Small (640x480)" ) );
    cmbResolution->insertItem( tr2i18n( "Medium (800x600)" ) );
    cmbResolution->insertItem( tr2i18n( "Big (1024x768)" ) );
    cmbResolution->insertItem( tr2i18n( "Custom (...)" ) );
    cmbResolution->insertItem( tr2i18n( "Full Screen (Maximized)" ) );
    cmbResolution->setCurrentItem( 5 );
    TQWhatsThis::add( cmbResolution, tr2i18n( "Here you can specify the resolution of the remote desktop. This resolution determines the size of the desktop that will be presented to you." ) );
    TQWhatsThis::add( spinWidth, tr2i18n( "This is the width of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above." ) );
    heightLabel->setText( tr2i18n( "H&eight:" ) );
    TQWhatsThis::add( spinHeight, tr2i18n( "This is the height of the remote desktop. You can only change this value manually if you select Custom as desktop resolution above." ) );
    cmbKbLayout->clear();
    cmbKbLayout->insertItem( tr2i18n( "Arabic (ar)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Czech (cs)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Danish (da)" ) );
    cmbKbLayout->insertItem( tr2i18n( "German (de)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Swiss German (de-ch)" ) );
    cmbKbLayout->insertItem( tr2i18n( "British English (en-gb)" ) );
    cmbKbLayout->insertItem( tr2i18n( "US English (en-us)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Spanish (es)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Estonian (et)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Finnish (fi)" ) );
    cmbKbLayout->insertItem( tr2i18n( "French (fr)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Belgium (fr-be)" ) );
    cmbKbLayout->insertItem( tr2i18n( "French Canadian (fr-ca)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Swiss French (fr-ch)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Croatian (hr)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Hungarian (hu)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Icelandic (is)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Italian (it)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Japanese (ja)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Lithuanian (lt)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Latvian (lv)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Macedonian (mk)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Dutch (nl)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Belgian Dutch (nl-be)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Norwegian (no)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Polish (pl)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Portuguese (pt)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Brazilian (pt-br)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Russian (ru)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Slovenian (sl)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Swedish (sv)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Thai (th)" ) );
    cmbKbLayout->insertItem( tr2i18n( "Turkish (tr)" ) );
    cmbKbLayout->setCurrentItem( 4 );
    TQWhatsThis::add( cmbKbLayout, tr2i18n( "Use this to specify your keyboard layout. This layout setting is used to send the correct keyboard codes to the server." ) );
    layoutLabel->setText( tr2i18n( "&Keyboard layout:" ) );
    cbUseTDEWallet->setText( tr2i18n( "Use K&Wallet for passwords" ) );
    TQWhatsThis::add( cbUseTDEWallet, tr2i18n( "Enable this option to store your passwords with TDEWallet." ) );
    resolutionLabel->setText( tr2i18n( "Desktop &resolution:" ) );
    colorDepthLabel->setText( tr2i18n( "Color &depth:" ) );
    widthLabel->setText( tr2i18n( "&Width:" ) );
    cmbColorDepth->clear();
    cmbColorDepth->insertItem( tr2i18n( "Low Color (8 Bit)" ) );
    cmbColorDepth->insertItem( tr2i18n( "High Color (16 Bit)" ) );
    cmbColorDepth->insertItem( tr2i18n( "True Color (24 Bit)" ) );
    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." ) );
}

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

TQMetaObject *RdpPrefs::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_RdpPrefs( "RdpPrefs", &RdpPrefs::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* RdpPrefs::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[] = {
	{ 0, &static_QUType_int, 0, TQUParameter::Out }
    };
    static const TQUMethod slot_0 = {"colorDepth", 1, param_slot_0 };
    static const TQUParameter param_slot_1[] = {
	{ "depth", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_1 = {"setColorDepth", 1, param_slot_1 };
    static const TQUMethod slot_2 = {"languageChange", 0, 0 };
    static const TQUParameter param_slot_3[] = {
	{ "selection", &static_QUType_int, 0, TQUParameter::In }
    };
    static const TQUMethod slot_3 = {"resolutionChanged", 1, param_slot_3 };
    static const TQMetaData slot_tbl[] = {
	{ "colorDepth()", &slot_0, TQMetaData::Public },
	{ "setColorDepth(int)", &slot_1, TQMetaData::Public },
	{ "languageChange()", &slot_2, TQMetaData::Protected },
	{ "resolutionChanged(int)", &slot_3, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"RdpPrefs", parentObject,
	slot_tbl, 4,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_RdpPrefs.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool RdpPrefs::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: static_QUType_int.set(_o,colorDepth()); break;
    case 1: setColorDepth((int)static_QUType_int.get(_o+1)); break;
    case 2: languageChange(); break;
    case 3: resolutionChanged((int)static_QUType_int.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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