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

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

#include "MultiMeterSettingsWidget.h"

#include <ntqvariant.h>
#include <kcolorbutton.h>
#include <kdialog.h>
#include <knumvalidator.h>
#include <ntqpushbutton.h>
#include <ntqgroupbox.h>
#include <ntqlineedit.h>
#include <ntqcheckbox.h>
#include <ntqtabwidget.h>
#include <ntqlabel.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>
#include "kcolorbutton.h"
#include "MultiMeterSettingsWidget.ui.h"

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

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

    m_title = new TQLineEdit( GroupBox7, "m_title" );

    GroupBox7Layout->addWidget( m_title, 0, 0 );

    m_showUnit = new TQCheckBox( GroupBox7, "m_showUnit" );

    GroupBox7Layout->addWidget( m_showUnit, 0, 1 );
    MultiMeterSettingsWidgetLayout->addWidget( GroupBox7 );

    TabWidget2 = new TQTabWidget( this, "TabWidget2" );

    tab = new TQWidget( TabWidget2, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, KDialog::marginHint(), KDialog::spacingHint(), "tabLayout"); 

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

    m_upperLimitActive = new TQCheckBox( GroupBox1_2, "m_upperLimitActive" );

    GroupBox1_2Layout->addWidget( m_upperLimitActive, 0, 0 );
    Spacer1_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    GroupBox1_2Layout->addItem( Spacer1_2, 0, 1 );

    m_lblUpperLimit = new TQLabel( GroupBox1_2, "m_lblUpperLimit" );
    m_lblUpperLimit->setEnabled( false );

    GroupBox1_2Layout->addWidget( m_lblUpperLimit, 0, 2 );

    m_upperLimit = new TQLineEdit( GroupBox1_2, "m_upperLimit" );
    m_upperLimit->setEnabled( false );
    m_upperLimit->setMinimumSize( TQSize( 70, 0 ) );

    GroupBox1_2Layout->addWidget( m_upperLimit, 0, 3 );

    tabLayout->addWidget( GroupBox1_2, 1, 0 );

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

    m_lowerLimitActive = new TQCheckBox( GroupBox1, "m_lowerLimitActive" );

    GroupBox1Layout->addWidget( m_lowerLimitActive, 0, 0 );
    Spacer1 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    GroupBox1Layout->addItem( Spacer1, 0, 1 );

    m_lblLowerLimit = new TQLabel( GroupBox1, "m_lblLowerLimit" );
    m_lblLowerLimit->setEnabled( false );

    GroupBox1Layout->addWidget( m_lblLowerLimit, 0, 2 );

    m_lowerLimit = new TQLineEdit( GroupBox1, "m_lowerLimit" );
    m_lowerLimit->setEnabled( false );
    m_lowerLimit->setMinimumSize( TQSize( 70, 0 ) );

    GroupBox1Layout->addWidget( m_lowerLimit, 0, 3 );

    tabLayout->addWidget( GroupBox1, 0, 0 );
    TabWidget2->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( TabWidget2, "tab_2" );
    tabLayout_2 = new TQHBoxLayout( tab_2, KDialog::marginHint(), KDialog::spacingHint(), "tabLayout_2"); 

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

    textLabel1 = new TQLabel( tab_2, "textLabel1" );
    layout1->addWidget( textLabel1 );

    textLabel2 = new TQLabel( tab_2, "textLabel2" );
    layout1->addWidget( textLabel2 );

    textLabel3 = new TQLabel( tab_2, "textLabel3" );
    layout1->addWidget( textLabel3 );
    tabLayout_2->addLayout( layout1 );

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

    m_normalDigitColor = new KColorButton( tab_2, "m_normalDigitColor" );
    m_normalDigitColor->setColor( TQColor( 0, 255, 0 ) );
    layout2->addWidget( m_normalDigitColor );

    m_alarmDigitColor = new KColorButton( tab_2, "m_alarmDigitColor" );
    m_alarmDigitColor->setColor( TQColor( 255, 0, 0 ) );
    layout2->addWidget( m_alarmDigitColor );

    m_backgroundColor = new KColorButton( tab_2, "m_backgroundColor" );
    layout2->addWidget( m_backgroundColor );
    tabLayout_2->addLayout( layout2 );
    TabWidget2->insertTab( tab_2, TQString::fromLatin1("") );
    MultiMeterSettingsWidgetLayout->addWidget( TabWidget2 );
    languageChange();
    resize( TQSize(378, 229).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( m_lowerLimitActive, TQ_SIGNAL( toggled(bool) ), m_lowerLimit, TQ_SLOT( setEnabled(bool) ) );
    connect( m_upperLimitActive, TQ_SIGNAL( toggled(bool) ), m_upperLimit, TQ_SLOT( setEnabled(bool) ) );
    connect( m_lowerLimitActive, TQ_SIGNAL( toggled(bool) ), m_lblLowerLimit, TQ_SLOT( setEnabled(bool) ) );
    connect( m_upperLimitActive, TQ_SIGNAL( toggled(bool) ), m_lblUpperLimit, TQ_SLOT( setEnabled(bool) ) );
    init();
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void MultiMeterSettingsWidget::languageChange()
{
    GroupBox7->setTitle( tr2i18n( "Title" ) );
    TQWhatsThis::add( m_title, tr2i18n( "Enter the title of the display here." ) );
    m_showUnit->setText( tr2i18n( "&Show unit" ) );
    TQWhatsThis::add( m_showUnit, tr2i18n( "Enable this to append the unit to the title of the display." ) );
    GroupBox1_2->setTitle( tr2i18n( "Alarm for Maximum Value" ) );
    m_upperLimitActive->setText( tr2i18n( "E&nable alarm" ) );
    TQWhatsThis::add( m_upperLimitActive, tr2i18n( "Enable the maximum value alarm." ) );
    m_lblUpperLimit->setText( tr2i18n( "Upper limit:" ) );
    GroupBox1->setTitle( tr2i18n( "Alarm for Minimum Value" ) );
    m_lowerLimitActive->setText( tr2i18n( "&Enable alarm" ) );
    TQWhatsThis::add( m_lowerLimitActive, tr2i18n( "Enable the minimum value alarm." ) );
    m_lblLowerLimit->setText( tr2i18n( "Lower limit:" ) );
    TabWidget2->changeTab( tab, tr2i18n( "Alarms" ) );
    textLabel1->setText( tr2i18n( "Normal digit color:" ) );
    textLabel2->setText( tr2i18n( "Alarm digit color:" ) );
    textLabel3->setText( tr2i18n( "Background color:" ) );
    m_normalDigitColor->setText( TQString::null );
    m_alarmDigitColor->setText( TQString::null );
    m_backgroundColor->setText( TQString::null );
    TabWidget2->changeTab( tab_2, tr2i18n( "Colors" ) );
}

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

TQMetaObject *MultiMeterSettingsWidget::metaObj = 0;
static TQMetaObjectCleanUp cleanUp_MultiMeterSettingsWidget( "MultiMeterSettingsWidget", &MultiMeterSettingsWidget::staticMetaObject );

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

#endif // TQT_NO_TRANSLATION

TQMetaObject* MultiMeterSettingsWidget::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[] = {
	{ "c", &static_QUType_varptr, "\x0a", TQUParameter::In }
    };
    static const TQUMethod slot_0 = {"setMeterBackgroundColor", 1, param_slot_0 };
    static const TQUMethod slot_1 = {"languageChange", 0, 0 };
    static const TQMetaData slot_tbl[] = {
	{ "setMeterBackgroundColor(const TQColor&)", &slot_0, TQMetaData::Public },
	{ "languageChange()", &slot_1, TQMetaData::Protected }
    };
    metaObj = TQMetaObject::new_metaobject(
	"MultiMeterSettingsWidget", parentObject,
	slot_tbl, 2,
	0, 0,
#ifndef TQT_NO_PROPERTIES
	0, 0,
	0, 0,
#endif // TQT_NO_PROPERTIES
	0, 0 );
    cleanUp_MultiMeterSettingsWidget.setMetaObject( metaObj );
#ifdef TQT_THREAD_SUPPORT
    if (tqt_sharedMetaObjectMutex) tqt_sharedMetaObjectMutex->unlock();
#endif // TQT_THREAD_SUPPORT
    return metaObj;
}

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

bool MultiMeterSettingsWidget::tqt_invoke( int _id, TQUObject* _o )
{
    switch ( _id - staticMetaObject()->slotOffset() ) {
    case 0: setMeterBackgroundColor((const TQColor&)*((const TQColor*)static_QUType_ptr.get(_o+1))); break;
    case 1: languageChange(); break;
    default:
	return TQWidget::tqt_invoke( _id, _o );
    }
    return true;
}

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

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

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