summaryrefslogtreecommitdiffstats
path: root/client/config/configdialog.cc
blob: 4e6db04d5a1d3c3e2d2401d42f42b0734e7e0d10 (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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
#include <kdialog.h>
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file './configdialog.ui'
**
** Created: Mon Jun 23 19:18:43 2008
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.8   edited Jan 11 14:47 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "configdialog.h"

#include <tqvariant.h>
#include <tqpushbutton.h>
#include <tqtabwidget.h>
#include <tqspinbox.h>
#include <tqcheckbox.h>
#include <tqcombobox.h>
#include <tqlabel.h>
#include <tqbuttongroup.h>
#include <tqradiobutton.h>
#include <tqlayout.h>
#include <tqtooltip.h>
#include <tqwhatsthis.h>

/*
 *  Constructs a ConfigDialog as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 */
ConfigDialog::ConfigDialog( TQWidget* parent, const char* name, WFlags fl )
    : TQWidget( parent, name, fl )
{
    if ( !name )
	setName( "ConfigDialog" );
    setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)5, 0, 0, sizePolicy().hasHeightForWidth() ) );
    ConfigDialogLayout = new TQVBoxLayout( this, 0, 6, "ConfigDialogLayout"); 

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

    tab = new TQWidget( tabWidget3, "tab" );
    tabLayout = new TQGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    titlesize = new TQSpinBox( tab, "titlesize" );
    titlesize->setMaxValue( 64 );
    titlesize->setMinValue( 16 );

    tabLayout->addWidget( titlesize, 1, 2 );

    framesize = new TQSpinBox( tab, "framesize" );
    framesize->setMaxValue( 64 );
    framesize->setMinValue( 1 );
    framesize->setValue( 4 );

    tabLayout->addWidget( framesize, 2, 2 );

    titleshadow = new TQCheckBox( tab, "titleshadow" );
    titleshadow->setChecked( TRUE );

    tabLayout->addWidget( titleshadow, 3, 2 );

    roundCorners = new TQCheckBox( tab, "roundCorners" );
    roundCorners->setChecked( TRUE );

    tabLayout->addWidget( roundCorners, 4, 2 );

    titleBarStyle = new TQComboBox( FALSE, tab, "titleBarStyle" );

    tabLayout->addWidget( titleBarStyle, 5, 2 );

    textLabel1_4 = new TQLabel( tab, "textLabel1_4" );
    textLabel1_4->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout->addWidget( textLabel1_4, 5, 1 );

    textLabel1_2 = new TQLabel( tab, "textLabel1_2" );
    textLabel1_2->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout->addWidget( textLabel1_2, 2, 1 );

    textLabel1 = new TQLabel( tab, "textLabel1" );
    textLabel1->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout->addWidget( textLabel1, 1, 1 );

    textLabel1_3 = new TQLabel( tab, "textLabel1_3" );
    textLabel1_3->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout->addMultiCellWidget( textLabel1_3, 0, 0, 0, 1 );
    spacer5 = new TQSpacerItem( 71, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    tabLayout->addItem( spacer5, 2, 0 );
    spacer4 = new TQSpacerItem( 81, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    tabLayout->addItem( spacer4, 2, 3 );

    titlealign = new TQButtonGroup( tab, "titlealign" );
    titlealign->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)5, (TQSizePolicy::SizeType)0, 0, 0, titlealign->sizePolicy().hasHeightForWidth() ) );
    titlealign->setLineWidth( 0 );
    titlealign->setColumnLayout(0, TQt::Vertical );
    titlealign->layout()->setSpacing( 6 );
    titlealign->layout()->setMargin( 0 );
    titlealignLayout = new TQHBoxLayout( titlealign->layout() );
    titlealignLayout->setAlignment( TQt::AlignTop );

    AlignLeft = new TQRadioButton( titlealign, "AlignLeft" );
    titlealignLayout->addWidget( AlignLeft );

    AlignHCenter = new TQRadioButton( titlealign, "AlignHCenter" );
    AlignHCenter->setChecked( TRUE );
    titlealignLayout->addWidget( AlignHCenter );

    AlignRight = new TQRadioButton( titlealign, "AlignRight" );
    titlealignLayout->addWidget( AlignRight );

    tabLayout->addWidget( titlealign, 0, 2 );
    tabWidget3->insertTab( tab, TQString::fromLatin1("") );

    tab_2 = new TQWidget( tabWidget3, "tab_2" );
    tabLayout_2 = new TQGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    textLabel1_5 = new TQLabel( tab_2, "textLabel1_5" );
    textLabel1_5->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout_2->addWidget( textLabel1_5, 1, 0 );

    buttonStyle = new TQComboBox( FALSE, tab_2, "buttonStyle" );

    tabLayout_2->addWidget( buttonStyle, 1, 1 );

    textLabel4 = new TQLabel( tab_2, "textLabel4" );
    textLabel4->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)5, 0, 0, textLabel4->sizePolicy().hasHeightForWidth() ) );
    textLabel4->setAlignment( int( TQLabel::AlignVCenter | TQLabel::AlignRight ) );

    tabLayout_2->addWidget( textLabel4, 0, 0 );

    buttonsize = new TQSpinBox( tab_2, "buttonsize" );
    buttonsize->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, buttonsize->sizePolicy().hasHeightForWidth() ) );
    buttonsize->setButtonSymbols( TQSpinBox::UpDownArrows );
    buttonsize->setMaxValue( 64 );
    buttonsize->setMinValue( 1 );
    buttonsize->setValue( 16 );

    tabLayout_2->addWidget( buttonsize, 0, 1 );

    animatebuttons = new TQCheckBox( tab_2, "animatebuttons" );
    animatebuttons->setEnabled( TRUE );
    animatebuttons->setChecked( TRUE );

    tabLayout_2->addWidget( animatebuttons, 2, 1 );

    layout11 = new TQHBoxLayout( 0, 0, 6, "layout11"); 
    spacer3 = new TQSpacerItem( 30, 20, TQSizePolicy::Maximum, TQSizePolicy::Minimum );
    layout11->addItem( spacer3 );

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

    btnComboBox = new TQComboBox( FALSE, tab_2, "btnComboBox" );
    btnComboBox->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)0, 0, 0, btnComboBox->sizePolicy().hasHeightForWidth() ) );
    layout11->addWidget( btnComboBox );

    tabLayout_2->addLayout( layout11, 3, 1 );

    squareButton = new TQCheckBox( tab_2, "squareButton" );
    squareButton->setChecked( TRUE );

    tabLayout_2->addMultiCellWidget( squareButton, 4, 4, 1, 2 );

    lightBorder = new TQCheckBox( tab_2, "lightBorder" );

    tabLayout_2->addMultiCellWidget( lightBorder, 5, 5, 1, 2 );

    nomodalbuttons = new TQCheckBox( tab_2, "nomodalbuttons" );
    nomodalbuttons->setChecked( TRUE );

    tabLayout_2->addWidget( nomodalbuttons, 6, 1 );

    menuClose = new TQCheckBox( tab_2, "menuClose" );
    menuClose->setEnabled( TRUE );

    tabLayout_2->addMultiCellWidget( menuClose, 7, 7, 1, 2 );
    spacer3_3 = new TQSpacerItem( 121, 21, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    tabLayout_2->addItem( spacer3_3, 1, 2 );
    tabWidget3->insertTab( tab_2, TQString::fromLatin1("") );
    ConfigDialogLayout->addWidget( tabWidget3 );
    languageChange();
    resize( TQSize(388, 265).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( animatebuttons, SIGNAL( toggled(bool) ), textLabel2, SLOT( setEnabled(bool) ) );
    connect( animatebuttons, SIGNAL( toggled(bool) ), btnComboBox, SLOT( setEnabled(bool) ) );

    // tab order
    setTabOrder( AlignLeft, AlignHCenter );
    setTabOrder( AlignHCenter, AlignRight );
    setTabOrder( AlignRight, titlesize );
    setTabOrder( titlesize, framesize );
    setTabOrder( framesize, titleshadow );
    setTabOrder( titleshadow, roundCorners );
    setTabOrder( roundCorners, buttonsize );
    setTabOrder( buttonsize, animatebuttons );
    setTabOrder( animatebuttons, btnComboBox );
    setTabOrder( btnComboBox, menuClose );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void ConfigDialog::languageChange()
{
    setCaption( tr2i18n( "Config Dialog" ) );
    titlesize->setSuffix( tr2i18n( " pixels" ) );
    framesize->setSuffix( tr2i18n( " pixels" ) );
    framesize->setSpecialValueText( tr2i18n( "1 pixel" ) );
    titleshadow->setText( tr2i18n( "&Use shadowed text" ) );
    titleshadow->setAccel( TQKeySequence( tr2i18n( "Alt+U" ) ) );
    TQWhatsThis::add( titleshadow, tr2i18n( "Check this option if you want the titlebar text to have a 3D look with a shadow behind it." ) );
    roundCorners->setText( tr2i18n( "R&ound top corners" ) );
    roundCorners->setAccel( TQKeySequence( tr2i18n( "Alt+O" ) ) );
    titleBarStyle->clear();
    titleBarStyle->insertItem( tr2i18n( "Gradients" ) );
    titleBarStyle->insertItem( tr2i18n( "Glass" ) );
    textLabel1_4->setText( tr2i18n( "Titlebar style:" ) );
    textLabel1_2->setText( tr2i18n( "Frame width:" ) );
    textLabel1->setText( tr2i18n( "Title height:" ) );
    textLabel1_3->setText( tr2i18n( "Text alignment:" ) );
    titlealign->setTitle( TQString::null );
    AlignLeft->setText( tr2i18n( "L&eft" ) );
    AlignLeft->setAccel( TQKeySequence( tr2i18n( "Alt+E" ) ) );
    TQToolTip::add( AlignLeft, TQString::null );
    AlignHCenter->setText( tr2i18n( "Ce&nter" ) );
    AlignHCenter->setAccel( TQKeySequence( tr2i18n( "Alt+N" ) ) );
    TQToolTip::add( AlignHCenter, TQString::null );
    AlignRight->setText( tr2i18n( "Ri&ght" ) );
    AlignRight->setAccel( TQKeySequence( tr2i18n( "Alt+G" ) ) );
    TQToolTip::add( AlignRight, TQString::null );
    tabWidget3->changeTab( tab, tr2i18n( "Titleb&ar" ) );
    textLabel1_5->setText( tr2i18n( "Button Style:" ) );
    buttonStyle->clear();
    buttonStyle->insertItem( tr2i18n( "Gradients" ) );
    buttonStyle->insertItem( tr2i18n( "Glass" ) );
    buttonStyle->insertItem( tr2i18n( "Reverse Gradients" ) );
    buttonStyle->insertItem( tr2i18n( "Flat" ) );
    buttonStyle->setCurrentItem( 1 );
    textLabel4->setText( tr2i18n( "Button size:" ) );
    buttonsize->setSuffix( tr2i18n( " pixels" ) );
    buttonsize->setSpecialValueText( tr2i18n( "1 pixel" ) );
    animatebuttons->setText( tr2i18n( "&Animate buttons" ) );
    animatebuttons->setAccel( TQKeySequence( tr2i18n( "Alt+A" ) ) );
    TQWhatsThis::add( animatebuttons, tr2i18n( "Check this option if you want to use button animations when hovering with the mouse." ) );
    textLabel2->setText( tr2i18n( "Animation style:" ) );
    btnComboBox->clear();
    btnComboBox->insertItem( tr2i18n( "Colorize" ) );
    btnComboBox->insertItem( tr2i18n( "Intensify" ) );
    btnComboBox->insertItem( tr2i18n( "Fade" ) );
    squareButton->setText( tr2i18n( "S&quare buttons" ) );
    squareButton->setAccel( TQKeySequence( tr2i18n( "Alt+Q" ) ) );
    lightBorder->setText( tr2i18n( "Li&ghter button borders" ) );
    lightBorder->setAccel( TQKeySequence( tr2i18n( "Alt+G" ) ) );
    nomodalbuttons->setText( tr2i18n( "&No buttons on modal windows" ) );
    nomodalbuttons->setAccel( TQKeySequence( tr2i18n( "Alt+N" ) ) );
    menuClose->setText( tr2i18n( "Close window when &menu double clicked" ) );
    menuClose->setAccel( TQKeySequence( tr2i18n( "Alt+M" ) ) );
    tabWidget3->changeTab( tab_2, tr2i18n( "&Buttons appearance" ) );
}

#include "configdialog.moc"