#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/david/dev/src-cpp/ui/kde/kgenericbacklight/src/kgenericbacklightwidgetbase.ui'
**
** Created:
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "kgenericbacklightwidgetbase.h"

#include <qvariant.h>
#include <qlabel.h>
#include <qslider.h>
#include <qspinbox.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>

/*
 *  Constructs a kgenericbacklightWidgetBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
kgenericbacklightWidgetBase::kgenericbacklightWidgetBase( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "kgenericbacklightwidgetbase" );
    setMinimumSize( QSize( 320, 130 ) );
    setMaximumSize( QSize( 320, 130 ) );

    lblHeading = new QLabel( this, "lblHeading" );
    lblHeading->setGeometry( QRect( 10, 0, 140, 20 ) );

    slider1 = new QSlider( this, "slider1" );
    slider1->setGeometry( QRect( 11, 31, 230, 19 ) );
    slider1->setFocusPolicy( QSlider::StrongFocus );
    slider1->setMaxValue( 120000 );
    slider1->setLineStep( 500 );
    slider1->setPageStep( 1000 );
    slider1->setOrientation( QSlider::Horizontal );
    slider1->setTickmarks( QSlider::Both );
    slider1->setTickInterval( 10000 );

    spinBox1 = new QSpinBox( this, "spinBox1" );
    spinBox1->setGeometry( QRect( 250, 30, 60, 20 ) );
    spinBox1->setFocusPolicy( QSpinBox::WheelFocus );
    spinBox1->setMaxValue( 120000 );
    spinBox1->setLineStep( 500 );
    spinBox1->setValue( 0 );

    lblMaxBrightness = new QLabel( this, "lblMaxBrightness" );
    lblMaxBrightness->setGeometry( QRect( 10, 60, 160, 20 ) );

    btnClose = new QPushButton( this, "btnClose" );
    btnClose->setGeometry( QRect( 120, 90, 80, 28 ) );
    languageChange();
    resize( QSize(320, 130).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( slider1, SIGNAL( valueChanged(int) ), spinBox1, SLOT( setValue(int) ) );
    connect( spinBox1, SIGNAL( valueChanged(int) ), slider1, SLOT( setValue(int) ) );
    connect( btnClose, SIGNAL( clicked() ), this, SLOT( btnClose_clicked() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void kgenericbacklightWidgetBase::languageChange()
{
    setCaption( tr2i18n( "Display Backlight" ) );
    lblHeading->setText( tr2i18n( "<b>Adjust Display Backlight</b>" ) );
    lblMaxBrightness->setText( tr2i18n( "Max Brightness :  120000" ) );
    btnClose->setText( tr2i18n( "&Close" ) );
    btnClose->setAccel( QKeySequence( tr2i18n( "Alt+C" ) ) );
    QToolTip::add( btnClose, tr2i18n( "Close Application" ) );
}

void kgenericbacklightWidgetBase::btnClose_clicked()
{
    qWarning( "kgenericbacklightWidgetBase::btnClose_clicked(): Not implemented yet" );
}

#include "kgenericbacklightwidgetbase.moc"
