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

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

#include "generalconfigwidget.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <kdialog.h>
#include <knuminput.h>
#include <tdelistview.h>
#include <ntqpushbutton.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqgroupbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

    Layout4 = new TQGridLayout( 0, 1, 1, 0, KDialog::spacingHint(), "Layout4"); 

    m_pMinHeight = new KIntNumInput( this, "m_pMinHeight" );
    m_pMinHeight->setMinValue( 1 );
    m_pMinHeight->setMaxValue( 200 );

    Layout4->addWidget( m_pMinHeight, 0, 1 );

    m_pMaxHeight = new KIntNumInput( this, "m_pMaxHeight" );
    m_pMaxHeight->setMinValue( 1 );
    m_pMaxHeight->setMaxValue( 100000 );

    Layout4->addWidget( m_pMaxHeight, 1, 1 );

    m_pMinWidth = new KIntNumInput( this, "m_pMinWidth" );
    m_pMinWidth->setMinValue( 1 );
    m_pMinWidth->setMaxValue( 200 );

    Layout4->addWidget( m_pMinWidth, 0, 0 );

    m_pMaxWidth = new KIntNumInput( this, "m_pMaxWidth" );
    m_pMaxWidth->setMinValue( 1 );
    m_pMaxWidth->setMaxValue( 100000 );

    Layout4->addWidget( m_pMaxWidth, 1, 0 );
    Spacer3 = new TQSpacerItem( 0, 0, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    Layout4->addItem( Spacer3, 1, 2 );
    Spacer2 = new TQSpacerItem( 0, 0, TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum );
    Layout4->addItem( Spacer2, 0, 2 );

    GeneralConfigWidgetLayout->addMultiCellLayout( Layout4, 1, 1, 0, 1 );

    layout3 = new TQVBoxLayout( 0, 0, KDialog::spacingHint(), "layout3"); 

    TextLabel3 = new TQLabel( this, "TextLabel3" );
    layout3->addWidget( TextLabel3 );

    m_pListView = new TDEListView( this, "m_pListView" );
    m_pListView->addColumn( tr2i18n( "Effect" ) );
    m_pListView->setProperty( "selectionMode", "NoSelection" );
    m_pListView->setFullWidth( true );
    layout3->addWidget( m_pListView );

    GeneralConfigWidgetLayout->addMultiCellLayout( layout3, 2, 2, 0, 1 );

    layout4 = new TQVBoxLayout( 0, 0, KDialog::spacingHint(), "layout4"); 

    m_pSmoothScaling = new TQCheckBox( this, "m_pSmoothScaling" );
    layout4->addWidget( m_pSmoothScaling );

    m_pKeepRatio = new TQCheckBox( this, "m_pKeepRatio" );
    layout4->addWidget( m_pKeepRatio );

    m_pCenterImage = new TQCheckBox( this, "m_pCenterImage" );
    layout4->addWidget( m_pCenterImage );

    GeneralConfigWidgetLayout->addLayout( layout4, 0, 0 );

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

    m_bgColor = new KColorButton( groupBox3, "m_bgColor" );
    m_bgColor->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)0, (TQSizePolicy::SizeType)0, 0, 0, m_bgColor->sizePolicy().hasHeightForWidth() ) );
    m_bgColor->setMinimumSize( TQSize( 32, 32 ) );
    groupBox3Layout->addWidget( m_bgColor );
    spacer9 = new TQSpacerItem( 151, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    groupBox3Layout->addItem( spacer9 );

    GeneralConfigWidgetLayout->addWidget( groupBox3, 0, 1 );
    languageChange();
    resize( TQSize(398, 327).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // tab order
    setTabOrder( m_pSmoothScaling, m_pKeepRatio );
    setTabOrder( m_pKeepRatio, m_pCenterImage );
    setTabOrder( m_pCenterImage, m_pMinWidth );
    setTabOrder( m_pMinWidth, m_pMinHeight );
    setTabOrder( m_pMinHeight, m_pMaxWidth );
    setTabOrder( m_pMaxWidth, m_pMaxHeight );
    setTabOrder( m_pMaxHeight, m_pListView );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void GeneralConfigWidget::languageChange()
{
    m_pMinHeight->setLabel( tr2i18n( "Minimum height:" ) );
    TQWhatsThis::add( m_pMinHeight, tr2i18n( "The height of the image shown will not get smaller than the size you enter here.\n"
"A value of 10 would cause a 1x1 image to be stretched vertically by a factor of 10." ) );
    m_pMaxHeight->setLabel( tr2i18n( "Maximum height:" ) );
    TQWhatsThis::add( m_pMaxHeight, tr2i18n( "The height of the image shown will not get bigger than the size you enter here.\n"
"A value of 100 would cause a 1000x1000 image to be compressed vertically by a factor of 0.1." ) );
    m_pMinWidth->setLabel( tr2i18n( "Minimum width:" ) );
    TQWhatsThis::add( m_pMinWidth, tr2i18n( "The width of the image shown will not get smaller than the size you enter here.\n"
"A value of 10 would cause a 1x1 image to be stretched horizontally by a factor of 10." ) );
    m_pMaxWidth->setLabel( tr2i18n( "Maximum width:" ) );
    TQWhatsThis::add( m_pMaxWidth, tr2i18n( "The width of the image shown will not get bigger than the size you enter here.\n"
"A value of 100 would cause a 1000x1000 image to be compressed horizontally by a factor of 0.1." ) );
    TextLabel3->setText( tr2i18n( "Choose which blend effects should be used:" ) );
    m_pListView->header()->setLabel( 0, tr2i18n( "Effect" ) );
    TQWhatsThis::add( m_pListView, tr2i18n( "Every effect selected may be used to create a transition effect between the images. If you select multiple effects they will be chosen randomly." ) );
    m_pSmoothScaling->setText( tr2i18n( "Use smooth scaling (high quality but slower)" ) );
    m_pKeepRatio->setText( tr2i18n( "Keep aspect ratio" ) );
    TQWhatsThis::add( m_pKeepRatio, tr2i18n( "If this is checked KView will always try to keep the aspect ratio. That means if the width is scaled with a factor x, the height is scaled with the same factor." ) );
    m_pCenterImage->setText( tr2i18n( "Center image" ) );
    groupBox3->setTitle( tr2i18n( "&Background Color" ) );
    m_bgColor->setText( TQString::null );
}

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

TQMetaObject *GeneralConfigWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_GeneralConfigWidget( "GeneralConfigWidget", &GeneralConfigWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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