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

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

#include "mainconfigbase.h"

#include <ntqvariant.h>
#include <kcombobox.h>
#include <knuminput.h>
#include <kpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlabel.h>
#include <ntqcheckbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a MainConfigBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
MainConfigBase::MainConfigBase( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    vbox = new TQVBoxLayout( this, 0, 6, "vbox"); 

    grpGeneralSettings = new TQGroupBox( this, "grpGeneralSettings" );
    grpGeneralSettings->setColumnLayout(0, TQt::Vertical );
    grpGeneralSettings->layout()->setSpacing( 6 );
    grpGeneralSettings->layout()->setMargin( 11 );
    grpGeneralSettingsLayout = new TQGridLayout( grpGeneralSettings->layout() );
    grpGeneralSettingsLayout->setAlignment( TQt::AlignTop );

    pb_activate = new KPushButton( grpGeneralSettings, "pb_activate" );

    grpGeneralSettingsLayout->addMultiCellWidget( pb_activate, 1, 1, 2, 3 );
    spacerrow2 = new TQSpacerItem( 146, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    grpGeneralSettingsLayout->addMultiCell( spacerrow2, 2, 2, 2, 4 );

    lb_numConfig = new TQLabel( grpGeneralSettings, "lb_numConfig" );

    grpGeneralSettingsLayout->addWidget( lb_numConfig, 2, 0 );

    cmb_presetConfig = new KComboBox( false, grpGeneralSettings, "cmb_presetConfig" );

    grpGeneralSettingsLayout->addWidget( cmb_presetConfig, 1, 1 );

    sb_numConfigs = new KIntNumInput( grpGeneralSettings, "sb_numConfigs" );
    sb_numConfigs->setEnabled( true );
    sb_numConfigs->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)1, (TQSizePolicy::SizeType)0, 0, 0, sb_numConfigs->sizePolicy().hasHeightForWidth() ) );
    sb_numConfigs->setMinValue( 1 );
    sb_numConfigs->setMaxValue( 10 );

    grpGeneralSettingsLayout->addWidget( sb_numConfigs, 2, 1 );

    lb_config = new TQLabel( grpGeneralSettings, "lb_config" );

    grpGeneralSettingsLayout->addWidget( lb_config, 1, 0 );
    spacer1 = new TQSpacerItem( 106, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    grpGeneralSettingsLayout->addMultiCell( spacer1, 0, 0, 3, 4 );
    spacer2 = new TQSpacerItem( 66, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    grpGeneralSettingsLayout->addItem( spacer2, 1, 4 );

    cb_usePreset = new TQCheckBox( grpGeneralSettings, "cb_usePreset" );

    grpGeneralSettingsLayout->addMultiCellWidget( cb_usePreset, 0, 0, 0, 2 );
    vbox->addWidget( grpGeneralSettings );
    languageChange();
    resize( TQSize(581, 135).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MainConfigBase::languageChange()
{
    grpGeneralSettings->setTitle( tr2i18n( "General Settings" ) );
    pb_activate->setText( tr2i18n( "&Activate" ) );
    TQToolTip::add( pb_activate, tr2i18n( "Applies the configuration to the interface." ) );
    lb_numConfig->setText( tr2i18n( "Number of configurations:" ) );
    TQToolTip::add( lb_numConfig, tr2i18n( "Modifies the number of configurations that this tool should provide." ) );
    TQToolTip::add( cmb_presetConfig, tr2i18n( "Selects which of the configurations is to be applied." ) );
    lb_config->setText( tr2i18n( "Configuration to load:" ) );
    TQToolTip::add( lb_config, tr2i18n( "Selects which of the configurations is to be applied." ) );
    cb_usePreset->setText( tr2i18n( "Load preset &configuration on startup" ) );
    TQToolTip::add( cb_usePreset, tr2i18n( "When this box is checked, your settings are applied when you launch the Control Center module." ) );
}

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

TQMetaObject *MainConfigBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MainConfigBase( "MainConfigBase", &MainConfigBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

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

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

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

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

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

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