summaryrefslogtreecommitdiff
path: root/noncore/settings/appearance2
authorsandman <sandman>2002-10-01 20:59:06 (UTC)
committer sandman <sandman>2002-10-01 20:59:06 (UTC)
commit609b04531d5a1caae189397922eb0068aa0e2634 (patch) (unidiff)
tree170ae3b543b48cf2007de7dc0b580778efce9a2f /noncore/settings/appearance2
parent2906826d9ebc268bc233f97956ee1dc5b338c69b (diff)
downloadopie-609b04531d5a1caae189397922eb0068aa0e2634.zip
opie-609b04531d5a1caae189397922eb0068aa0e2634.tar.gz
opie-609b04531d5a1caae189397922eb0068aa0e2634.tar.bz2
adjusted to new OFontSelector c'tor
Diffstat (limited to 'noncore/settings/appearance2') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/appearance2/appearance.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp
index a5d216c..e269aec 100644
--- a/noncore/settings/appearance2/appearance.cpp
+++ b/noncore/settings/appearance2/appearance.cpp
@@ -158,193 +158,193 @@ void Appearance::loadDecos ( QListBox *list )
158 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 158 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
159 QLibrary *lib = new QLibrary ( path + "/" + *it ); 159 QLibrary *lib = new QLibrary ( path + "/" + *it );
160 WindowDecorationInterface *iface; 160 WindowDecorationInterface *iface;
161 161
162 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) 162 if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK )
163 list-> insertItem ( new DecoListItem ( lib, iface )); 163 list-> insertItem ( new DecoListItem ( lib, iface ));
164 else 164 else
165 delete lib; 165 delete lib;
166 } 166 }
167 } 167 }
168} 168}
169 169
170void Appearance::loadColors ( QListBox *list ) 170void Appearance::loadColors ( QListBox *list )
171{ 171{
172 list-> clear ( ); 172 list-> clear ( );
173 { 173 {
174 Config config ( "qpe" ); 174 Config config ( "qpe" );
175 config. setGroup ( "Appearance" ); 175 config. setGroup ( "Appearance" );
176 176
177 list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), config )); 177 list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), config ));
178 } 178 }
179 179
180 QString path = QPEApplication::qpeDir ( ) + "/etc/colors/"; 180 QString path = QPEApplication::qpeDir ( ) + "/etc/colors/";
181 QStringList sl = QDir ( path ). entryList ( "*.scheme" ); 181 QStringList sl = QDir ( path ). entryList ( "*.scheme" );
182 182
183 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { 183 for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) {
184 QString name = (*it). left ((*it). find ( ".scheme" )); 184 QString name = (*it). left ((*it). find ( ".scheme" ));
185 Config config ( path + *it, Config::File ); 185 Config config ( path + *it, Config::File );
186 config. setGroup ( "Colors" ); 186 config. setGroup ( "Colors" );
187 187
188 list-> insertItem ( new ColorListItem ( name, config )); 188 list-> insertItem ( new ColorListItem ( name, config ));
189 } 189 }
190} 190}
191 191
192 192
193QWidget *Appearance::createStyleTab ( QWidget *parent ) 193QWidget *Appearance::createStyleTab ( QWidget *parent )
194{ 194{
195 Config config ( "qpe" ); 195 Config config ( "qpe" );
196 config. setGroup ( "Appearance" ); 196 config. setGroup ( "Appearance" );
197 197
198 QWidget* tab = new QWidget( parent, "StyleTab" ); 198 QWidget* tab = new QWidget( parent, "StyleTab" );
199 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 4, 4 ); 199 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 4, 4 );
200 200
201 m_style_list = new QListBox( tab, "m_style_list" ); 201 m_style_list = new QListBox( tab, "m_style_list" );
202 vertLayout->addWidget( m_style_list ); 202 vertLayout->addWidget( m_style_list );
203 203
204 m_style_settings = new QPushButton ( tr( "Settings..." ), tab ); 204 m_style_settings = new QPushButton ( tr( "Settings..." ), tab );
205 connect ( m_style_settings, SIGNAL( clicked ( )), this, SLOT( styleSettingsClicked ( ))); 205 connect ( m_style_settings, SIGNAL( clicked ( )), this, SLOT( styleSettingsClicked ( )));
206 vertLayout-> addWidget ( m_style_settings ); 206 vertLayout-> addWidget ( m_style_settings );
207 207
208 loadStyles ( m_style_list ); 208 loadStyles ( m_style_list );
209 209
210 QString s = config. readEntry ( "Style", "Light" ); 210 QString s = config. readEntry ( "Style", "Light" );
211 m_style_list-> setCurrentItem ( m_style_list-> findItem ( s )); 211 m_style_list-> setCurrentItem ( m_style_list-> findItem ( s ));
212 m_original_style = m_style_list-> currentItem ( ); 212 m_original_style = m_style_list-> currentItem ( );
213 styleClicked ( m_original_style ); 213 styleClicked ( m_original_style );
214 214
215 connect( m_style_list, SIGNAL( highlighted( int ) ), this, SLOT( styleClicked( int ) ) ); 215 connect( m_style_list, SIGNAL( highlighted( int ) ), this, SLOT( styleClicked( int ) ) );
216 216
217 return tab; 217 return tab;
218} 218}
219 219
220QWidget *Appearance::createDecoTab ( QWidget *parent ) 220QWidget *Appearance::createDecoTab ( QWidget *parent )
221{ 221{
222 Config config ( "qpe" ); 222 Config config ( "qpe" );
223 config. setGroup ( "Appearance" ); 223 config. setGroup ( "Appearance" );
224 224
225 QWidget* tab = new QWidget( parent, "DecoTab" ); 225 QWidget* tab = new QWidget( parent, "DecoTab" );
226 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 4, 4 ); 226 QVBoxLayout* vertLayout = new QVBoxLayout( tab, 4, 4 );
227 227
228 m_deco_list = new QListBox( tab, "m_deco_list" ); 228 m_deco_list = new QListBox( tab, "m_deco_list" );
229 vertLayout->addWidget( m_deco_list ); 229 vertLayout->addWidget( m_deco_list );
230 230
231 loadDecos ( m_deco_list ); 231 loadDecos ( m_deco_list );
232 232
233 QString s = config. readEntry ( "Decoration" ); 233 QString s = config. readEntry ( "Decoration" );
234 m_deco_list-> setCurrentItem ( m_deco_list-> findItem ( s )); 234 m_deco_list-> setCurrentItem ( m_deco_list-> findItem ( s ));
235 m_original_deco = m_deco_list-> currentItem ( ); 235 m_original_deco = m_deco_list-> currentItem ( );
236 if ( m_deco_list-> currentItem ( ) < 0 ) 236 if ( m_deco_list-> currentItem ( ) < 0 )
237 m_deco_list-> setCurrentItem ( 0 ); 237 m_deco_list-> setCurrentItem ( 0 );
238 decoClicked ( m_original_deco ); 238 decoClicked ( m_original_deco );
239 239
240 connect( m_deco_list, SIGNAL( highlighted( int ) ), this, SLOT( decoClicked( int ) ) ); 240 connect( m_deco_list, SIGNAL( highlighted( int ) ), this, SLOT( decoClicked( int ) ) );
241 241
242 return tab; 242 return tab;
243} 243}
244 244
245QWidget *Appearance::createFontTab ( QWidget *parent ) 245QWidget *Appearance::createFontTab ( QWidget *parent )
246{ 246{
247 Config config ( "qpe" ); 247 Config config ( "qpe" );
248 config. setGroup ( "Appearance" ); 248 config. setGroup ( "Appearance" );
249 249
250 QString familyStr = config.readEntry( "FontFamily", "Helvetica" ); 250 QString familyStr = config.readEntry( "FontFamily", "Helvetica" );
251 QString styleStr = config.readEntry( "FontStyle", "Regular" ); 251 QString styleStr = config.readEntry( "FontStyle", "Regular" );
252 int size = config.readNumEntry( "FontSize", 10 ); 252 int size = config.readNumEntry( "FontSize", 10 );
253 253
254 m_fontselect = new OFontSelector ( parent, "FontTab" ); 254 m_fontselect = new OFontSelector ( false, parent, "FontTab" );
255 m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 255 m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
256 256
257 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), 257 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )),
258 this, SLOT( fontClicked ( const QFont & ))); 258 this, SLOT( fontClicked ( const QFont & )));
259 259
260 return m_fontselect; 260 return m_fontselect;
261} 261}
262 262
263QWidget *Appearance::createColorTab ( QWidget *parent ) 263QWidget *Appearance::createColorTab ( QWidget *parent )
264{ 264{
265 Config config ( "qpe" ); 265 Config config ( "qpe" );
266 config. setGroup ( "Appearance" ); 266 config. setGroup ( "Appearance" );
267 267
268 268
269 QWidget *tab = new QWidget( parent, "ColorTab" ); 269 QWidget *tab = new QWidget( parent, "ColorTab" );
270 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 4, 4 ); 270 QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 4, 4 );
271 gridLayout->setRowStretch ( 3, 10 ); 271 gridLayout->setRowStretch ( 3, 10 );
272 272
273 m_color_list = new QListBox ( tab ); 273 m_color_list = new QListBox ( tab );
274 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); 274 gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 );
275 connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) ); 275 connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) );
276 276
277 loadColors ( m_color_list ); 277 loadColors ( m_color_list );
278 m_color_list-> setCurrentItem ( 0 ); 278 m_color_list-> setCurrentItem ( 0 );
279 279
280 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" ); 280 QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" );
281 tempButton->setText( tr( "Edit..." ) ); 281 tempButton->setText( tr( "Edit..." ) );
282 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) ); 282 connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) );
283 gridLayout->addWidget( tempButton, 0, 1 ); 283 gridLayout->addWidget( tempButton, 0, 1 );
284 284
285 tempButton = new QPushButton( tab, "deleteSchemeButton" ); 285 tempButton = new QPushButton( tab, "deleteSchemeButton" );
286 tempButton->setText( tr( "Delete" ) ); 286 tempButton->setText( tr( "Delete" ) );
287 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) ); 287 connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) );
288 gridLayout->addWidget( tempButton, 1, 1 ); 288 gridLayout->addWidget( tempButton, 1, 1 );
289 289
290 tempButton = new QPushButton( tab, "saveSchemeButton" ); 290 tempButton = new QPushButton( tab, "saveSchemeButton" );
291 tempButton->setText( tr( "Save" ) ); 291 tempButton->setText( tr( "Save" ) );
292 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) ); 292 connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) );
293 gridLayout->addWidget( tempButton, 2, 1 ); 293 gridLayout->addWidget( tempButton, 2, 1 );
294 294
295 return tab; 295 return tab;
296} 296}
297 297
298QWidget *Appearance::createGuiTab ( QWidget *parent ) 298QWidget *Appearance::createGuiTab ( QWidget *parent )
299{ 299{
300 Config config ( "qpe" ); 300 Config config ( "qpe" );
301 config. setGroup ( "Appearance" ); 301 config. setGroup ( "Appearance" );
302 302
303 QWidget *tab = new QWidget( parent, "AdvancedTab" ); 303 QWidget *tab = new QWidget( parent, "AdvancedTab" );
304 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); 304 QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 );
305 305
306 QGridLayout* gridLayout = new QGridLayout ( vertLayout ); 306 QGridLayout* gridLayout = new QGridLayout ( vertLayout );
307 307
308 int style = config. readNumEntry ( "TabStyle", 2 ) - 1; 308 int style = config. readNumEntry ( "TabStyle", 2 ) - 1;
309 bool tabtop = ( config. readEntry ( "TabPosition", "Top" ) == "Top" ); 309 bool tabtop = ( config. readEntry ( "TabPosition", "Top" ) == "Top" );
310 310
311 QLabel* label = new QLabel( tr( "Tab style:" ), tab ); 311 QLabel* label = new QLabel( tr( "Tab style:" ), tab );
312 gridLayout-> addWidget ( label, 0, 0 ); 312 gridLayout-> addWidget ( label, 0, 0 );
313 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); 313 QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" );
314 btngrp-> hide ( ); 314 btngrp-> hide ( );
315 btngrp-> setExclusive ( true ); 315 btngrp-> setExclusive ( true );
316 316
317 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); 317 m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" );
318 m_tabstyle_list-> insertItem ( tr( "Tabs" )); 318 m_tabstyle_list-> insertItem ( tr( "Tabs" ));
319 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); 319 m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" ));
320 m_tabstyle_list-> insertItem ( tr( "Drop down list" )); 320 m_tabstyle_list-> insertItem ( tr( "Drop down list" ));
321 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); 321 m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" ));
322 m_tabstyle_list-> setCurrentItem ( style ); 322 m_tabstyle_list-> setCurrentItem ( style );
323 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); 323 gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 );
324 324
325 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); 325 m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" );
326 btngrp-> insert ( m_tabstyle_top ); 326 btngrp-> insert ( m_tabstyle_top );
327 gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); 327 gridLayout-> addWidget( m_tabstyle_top, 1, 1 );
328 328
329 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); 329 m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" );
330 btngrp-> insert ( m_tabstyle_bottom ); 330 btngrp-> insert ( m_tabstyle_bottom );
331 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); 331 gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 );
332 332
333 m_tabstyle_top-> setChecked ( tabtop ); 333 m_tabstyle_top-> setChecked ( tabtop );
334 m_tabstyle_bottom-> setChecked ( !tabtop ); 334 m_tabstyle_bottom-> setChecked ( !tabtop );
335 335
336 m_original_tabstyle = style; 336 m_original_tabstyle = style;
337 m_original_tabpos = tabtop; 337 m_original_tabpos = tabtop;
338 338
339 return tab; 339 return tab;
340} 340}
341 341
342 342
343Appearance::Appearance( QWidget* parent, const char* name, WFlags ) 343Appearance::Appearance( QWidget* parent, const char* name, WFlags )
344 : QDialog ( parent, name, true ) 344 : QDialog ( parent, name, true )
345{ 345{
346 setCaption( tr( "Appearance" ) ); 346 setCaption( tr( "Appearance" ) );
347 347
348 Config config( "qpe" ); 348 Config config( "qpe" );
349 config.setGroup( "Appearance" ); 349 config.setGroup( "Appearance" );
350 350