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

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

#include "dlgautomationbase.h"

#include <ntqvariant.h>
#include <kdatetimewidget.h>
#include <kdatewidget.h>
#include <kdialog.h>
#include <klineedit.h>
#include <knuminput.h>
#include <ktimewidget.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

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

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

    le_autoSave = new KIntSpinBox( gb_automation, "le_autoSave" );
    le_autoSave->setMaxValue( 3600 );
    le_autoSave->setMinValue( 1 );

    gb_automationLayout->addWidget( le_autoSave, 0, 3 );

    cb_autoDisconnect = new TQCheckBox( gb_automation, "cb_autoDisconnect" );

    gb_automationLayout->addMultiCellWidget( cb_autoDisconnect, 1, 1, 0, 3 );

    cb_autoSave = new TQCheckBox( gb_automation, "cb_autoSave" );

    gb_automationLayout->addMultiCellWidget( cb_autoSave, 0, 0, 0, 1 );

    cb_timedDisconnect = new TQCheckBox( gb_automation, "cb_timedDisconnect" );

    gb_automationLayout->addMultiCellWidget( cb_timedDisconnect, 3, 3, 0, 1 );

    lb_autoDisconnect = new TQLabel( gb_automation, "lb_autoDisconnect" );

    gb_automationLayout->addMultiCellWidget( lb_autoDisconnect, 2, 2, 1, 2 );

    le_autoDisconnect = new KLineEdit( gb_automation, "le_autoDisconnect" );

    gb_automationLayout->addWidget( le_autoDisconnect, 2, 3 );

    spins = new KDateTimeWidget( gb_automation, "spins" );

    gb_automationLayout->addMultiCellWidget( spins, 4, 4, 1, 3 );

    cb_autoPaste = new TQCheckBox( gb_automation, "cb_autoPaste" );

    gb_automationLayout->addMultiCellWidget( cb_autoPaste, 6, 6, 0, 3 );

    cb_autoShutdown = new TQCheckBox( gb_automation, "cb_autoShutdown" );

    gb_automationLayout->addMultiCellWidget( cb_autoShutdown, 5, 5, 0, 3 );
    spacer18 = new TQSpacerItem( 40, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    gb_automationLayout->addItem( spacer18, 0, 2 );
    spacer16 = new TQSpacerItem( 50, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    gb_automationLayout->addItem( spacer16, 2, 0 );
    spacer17 = new TQSpacerItem( 50, 20, TQSizePolicy::Preferred, TQSizePolicy::Minimum );
    gb_automationLayout->addItem( spacer17, 4, 0 );
    DlgAutomationBaseLayout->addWidget( gb_automation );
    languageChange();
    resize( TQSize(401, 217).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( cb_autoDisconnect, TQ_SIGNAL( toggled(bool) ), lb_autoDisconnect, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_autoDisconnect, TQ_SIGNAL( toggled(bool) ), le_autoDisconnect, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_timedDisconnect, TQ_SIGNAL( toggled(bool) ), spins, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_autoSave, TQ_SIGNAL( toggled(bool) ), le_autoSave, TQ_SLOT( setEnabled(bool) ) );
    connect( cb_autoSave, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_autoSave, TQ_SIGNAL( valueChanged(int) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_autoDisconnect, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( le_autoDisconnect, TQ_SIGNAL( textChanged(const TQString&) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_timedDisconnect, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( spins, TQ_SIGNAL( valueChanged(const TQDateTime&) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_autoShutdown, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_autoPaste, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( slotChanged() ) );
    connect( cb_autoDisconnect, TQ_SIGNAL( toggled(bool) ), this, TQ_SLOT( disconnectToggled(bool) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void DlgAutomationBase::languageChange()
{
    gb_automation->setTitle( tr2i18n( "Automation Options" ) );
    le_autoSave->setSuffix( tr2i18n( " min" ) );
    cb_autoDisconnect->setText( tr2i18n( "Auto disconnect after completing downloads" ) );
    cb_autoSave->setText( tr2i18n( "Autosave file list every:" ) );
    cb_timedDisconnect->setText( tr2i18n( "Timed disconnect" ) );
    lb_autoDisconnect->setText( tr2i18n( "Disconnect command:" ) );
    cb_autoPaste->setText( tr2i18n( "Auto paste from clipboard" ) );
    cb_autoShutdown->setText( tr2i18n( "Auto shutdown after completing downloads" ) );
}

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

TQMetaObject *DlgAutomationBase::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_DlgAutomationBase( "DlgAutomationBase", &DlgAutomationBase::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* DlgAutomationBase::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 TQUMethod slot_1 = {"slotChanged", 0, 0 };
    static const TQUParameter param_slot_2[] = {
	{ "b", &static_QUType_bool, 0, TQUParameter::In }
    };
    static const TQUMethod slot_2 = {"disconnectToggled", 1, param_slot_2 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected },
	{ "slotChanged()", &slot_1, TQMetaData::Protected },
	{ "disconnectToggled(bool)", &slot_2, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"DlgAutomationBase", parentObject,
	slot_tbl, 3,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_DlgAutomationBase.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool DlgAutomationBase::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: languageChange(); break;
    case 1: slotChanged(); break;
    case 2: disconnectToggled((bool)static_QUType_bool.get(_o+1)); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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