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

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

#include "prefwidget.h"

#include <ntqvariant.h>
#include <klineedit.h>
#include <kpushbutton.h>
#include <ntqpushbutton.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqgroupbox.h>
#include <ntqcheckbox.h>
#include <ntqlabel.h>
#include <ntqspinbox.h>
#include <kurlrequester.h>
#include <ntqslider.h>
#include <ntqlcdnumber.h>
#include <ntqtoolbutton.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PrefWidget as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The qdialog will by default be modeless, unless you set 'modal' to
 *  true to construct a modal qdialog.
 */
PrefWidget::PrefWidget( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "PrefWidget" );
    PrefWidgetLayout = new TQGridLayout( this, 1, 1, 11, 6, "PrefWidgetLayout"); 

    m_list = new TQListView( this, "m_list" );
    m_list->addColumn( tr2i18n( "Counter [s]" ) );
    m_list->addColumn( tr2i18n( "Delay [s]" ) );
    m_list->addColumn( tr2i18n( "State" ) );
    m_list->addColumn( tr2i18n( "Command" ) );
    m_list->setAllColumnsShowFocus( true );

    PrefWidgetLayout->addMultiCellWidget( m_list, 0, 2, 0, 0 );

    m_add = new TQPushButton( this, "m_add" );

    PrefWidgetLayout->addWidget( m_add, 0, 1 );

    m_remove = new TQPushButton( this, "m_remove" );
    m_remove->setEnabled( false );

    PrefWidgetLayout->addWidget( m_remove, 1, 1 );

    m_help = new TQPushButton( this, "m_help" );

    PrefWidgetLayout->addWidget( m_help, 2, 1 );
    Spacer4 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    PrefWidgetLayout->addItem( Spacer4, 3, 1 );

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

    m_loop = new TQCheckBox( m_settings, "m_loop" );

    m_settingsLayout->addMultiCellWidget( m_loop, 2, 2, 0, 3 );

    TextLabel2 = new TQLabel( m_settings, "TextLabel2" );

    m_settingsLayout->addWidget( TextLabel2, 1, 0 );

    m_delay = new TQSpinBox( m_settings, "m_delay" );
    m_delay->setMaxValue( 99999 );

    m_settingsLayout->addMultiCellWidget( m_delay, 1, 1, 1, 2 );

    m_one = new TQCheckBox( m_settings, "m_one" );

    m_settingsLayout->addMultiCellWidget( m_one, 3, 3, 0, 3 );

    TextLabel3 = new TQLabel( m_settings, "TextLabel3" );

    m_settingsLayout->addWidget( TextLabel3, 1, 3 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    m_settingsLayout->addItem( Spacer1, 1, 4 );

    m_commandLine = new KURLRequester( m_settings, "m_commandLine" );

    m_settingsLayout->addMultiCellWidget( m_commandLine, 0, 0, 2, 4 );

    TextLabel1 = new TQLabel( m_settings, "TextLabel1" );

    m_settingsLayout->addMultiCellWidget( TextLabel1, 0, 0, 0, 1 );

    PrefWidgetLayout->addWidget( m_settings, 4, 0 );

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

    m_slider = new TQSlider( m_state, "m_slider" );
    m_slider->setOrientation( TQSlider::Horizontal );

    m_stateLayout->addMultiCellWidget( m_slider, 2, 2, 0, 2 );

    m_counter = new TQLCDNumber( m_state, "m_counter" );

    m_stateLayout->addMultiCellWidget( m_counter, 1, 1, 0, 2 );

    m_pause = new TQToolButton( m_state, "m_pause" );

    m_stateLayout->addWidget( m_pause, 0, 1 );

    m_start = new TQToolButton( m_state, "m_start" );

    m_stateLayout->addWidget( m_start, 0, 2 );

    m_stop = new TQToolButton( m_state, "m_stop" );

    m_stateLayout->addWidget( m_stop, 0, 0 );

    PrefWidgetLayout->addWidget( m_state, 4, 1 );
    languageChange();
    resize( TQSize(479, 344).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PrefWidget::languageChange()
{
    setCaption( tr2i18n( "Timer Settings" ) );
    m_list->header()->setLabel( 0, tr2i18n( "Counter [s]" ) );
    m_list->header()->setLabel( 1, tr2i18n( "Delay [s]" ) );
    m_list->header()->setLabel( 2, tr2i18n( "State" ) );
    m_list->header()->setLabel( 3, tr2i18n( "Command" ) );
    m_add->setText( tr2i18n( "&New" ) );
    m_remove->setText( tr2i18n( "&Remove" ) );
    m_help->setText( tr2i18n( "&Help" ) );
    m_settings->setTitle( tr2i18n( "Settings" ) );
    m_loop->setText( tr2i18n( "&Loop" ) );
    TextLabel2->setText( tr2i18n( "Delay:" ) );
    m_one->setText( tr2i18n( "Start only &one instance" ) );
    TextLabel3->setText( tr2i18n( "seconds" ) );
    TextLabel1->setText( tr2i18n( "Command line:" ) );
    m_state->setTitle( tr2i18n( "State" ) );
    m_pause->setText( tr2i18n( "||" ) );
    m_start->setText( tr2i18n( ">" ) );
    m_stop->setText( tr2i18n( "=" ) );
}

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

TQMetaObject *PrefWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_PrefWidget( "PrefWidget", &PrefWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* PrefWidget::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 = TQDialog::staticMetaObject();
    static const TQUMethod slot_0 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "languageChange()", &slot_0, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"PrefWidget", parentObject,
	slot_tbl, 1,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_PrefWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

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

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

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

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