summaryrefslogtreecommitdiffstats
path: root/src/brightnesschooser.cpp
blob: 2b2c28225488408f2e369dadaf4a47b70c37d7f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#include <kdialog.h>
#include <klocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '/home/bettini/work/klcddimmer/src/brightnesschooser.ui'
**
** Created: Sat Feb 24 20:45:57 2007
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.7   edited Aug 31 2005 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "brightnesschooser.h"

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

/*
 *  Constructs a BrightnessChooser as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
BrightnessChooser::BrightnessChooser( QWidget* parent, const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    if ( !name )
	setName( "BrightnessChooser" );
    BrightnessChooserLayout = new QGridLayout( this, 1, 1, 11, 6, "BrightnessChooserLayout"); 

    layout9 = new QGridLayout( 0, 1, 1, 0, 6, "layout9"); 

    layout7 = new QHBoxLayout( 0, 0, 0, "layout7"); 
    spacer1 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
    layout7->addItem( spacer1 );

    layout5 = new QVBoxLayout( 0, 0, 6, "layout5"); 

    valueLabel = new QLabel( this, "valueLabel" );
    valueLabel->setAlignment( int( QLabel::AlignCenter ) );
    layout5->addWidget( valueLabel );

    brightnessSlider = new QSlider( this, "brightnessSlider" );
    brightnessSlider->setOrientation( QSlider::Vertical );
    layout5->addWidget( brightnessSlider );
    layout7->addLayout( layout5 );
    spacer1_2 = new QSpacerItem( 16, 20, QSizePolicy::Minimum, QSizePolicy::Minimum );
    layout7->addItem( spacer1_2 );

    layout9->addLayout( layout7, 0, 0 );

    okButton = new QPushButton( this, "okButton" );
    okButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, okButton->sizePolicy().hasHeightForWidth() ) );

    layout9->addWidget( okButton, 1, 0 );

    BrightnessChooserLayout->addLayout( layout9, 0, 0 );
    languageChange();
    resize( QSize(124, 163).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( okButton, SIGNAL( clicked() ), this, SLOT( updateBrightness() ) );
    connect( brightnessSlider, SIGNAL( valueChanged(int) ), this, SLOT( updateValue(int) ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void BrightnessChooser::languageChange()
{
    setCaption( tr2i18n( "Form1" ) );
    valueLabel->setText( tr2i18n( "0" ) );
    QToolTip::add( brightnessSlider, tr2i18n( "set the brightness and click OK or press ENTER" ) );
    okButton->setText( tr2i18n( "&OK" ) );
    okButton->setAccel( QKeySequence( tr2i18n( "Alt+O" ) ) );
}

void BrightnessChooser::updateBrightness()
{
    qWarning( "BrightnessChooser::updateBrightness(): Not implemented yet" );
}

void BrightnessChooser::updateValue(int)
{
    qWarning( "BrightnessChooser::updateValue(int): Not implemented yet" );
}

#include "brightnesschooser.moc"