-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 159 | ||||
-rw-r--r-- | noncore/settings/appearance2/editScheme.cpp | 9 |
2 files changed, 108 insertions, 60 deletions
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index f611799..2f3ba74 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -3,3 +3,3 @@ | |||
3 | Copyright (c) 2002 Trolltech AS <info@trolltech.com> | 3 | Copyright (c) 2002 Trolltech AS <info@trolltech.com> |
4 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 4 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
5 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 5 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
@@ -19,3 +19,3 @@ | |||
19 | ..}^=.= = ; Public License for more details. | 19 | ..}^=.= = ; Public License for more details. |
20 | ++= -. .` .: | 20 | ++= -. .` .: |
21 | : = ...= . :.=- You should have received a copy of the GNU | 21 | : = ...= . :.=- You should have received a copy of the GNU |
@@ -49,2 +49,3 @@ | |||
49 | #include <qvbox.h> | 49 | #include <qvbox.h> |
50 | #include <qwhatsthis.h> | ||
50 | 51 | ||
@@ -54,2 +55,3 @@ | |||
54 | #include <qpe/qpeapplication.h> | 55 | #include <qpe/qpeapplication.h> |
56 | #include <qpe/qpemessagebox.h> | ||
55 | #include <qpe/qcopenvelope_qws.h> | 57 | #include <qpe/qcopenvelope_qws.h> |
@@ -117,2 +119,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
117 | vertLayout->addWidget( m_style_list ); | 119 | vertLayout->addWidget( m_style_list ); |
120 | QWhatsThis::add( m_style_list, tr( "Styles control the way items such as buttons and scroll bars appear in all applications.\n\nClick here to select an available style." ) ); | ||
118 | 121 | ||
@@ -121,5 +124,6 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
121 | vertLayout-> addWidget ( m_style_settings ); | 124 | vertLayout-> addWidget ( m_style_settings ); |
125 | QWhatsThis::add( m_style_settings, tr( "Click here to configure the currently selected style.\n\nNote: This option is not available for all styles." ) ); | ||
122 | 126 | ||
123 | QString s = cfg. readEntry ( "Style", "Light" ); | 127 | QString s = cfg. readEntry ( "Style", "Light" ); |
124 | 128 | ||
125 | 129 | ||
@@ -133,3 +137,4 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
133 | { | 137 | { |
134 | QString path = QPEApplication::qpeDir ( ) + "/plugins/styles/"; | 138 | QString path = QPEApplication::qpeDir ( ); |
139 | path.append( "/plugins/styles/" ); | ||
135 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 140 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
@@ -137,3 +142,6 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
137 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { | 142 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { |
138 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 143 | QString libstr = path; |
144 | libstr.append( "/" ); | ||
145 | libstr.append( *it ); | ||
146 | QLibrary *lib = new QLibrary ( libstr ); | ||
139 | StyleInterface *iface; | 147 | StyleInterface *iface; |
@@ -143,3 +151,3 @@ QWidget *Appearance::createStyleTab ( QWidget *parent, Config &cfg ) | |||
143 | m_style_list-> insertItem ( slit ); | 151 | m_style_list-> insertItem ( slit ); |
144 | 152 | ||
145 | if ( slit-> key ( ) == s ) | 153 | if ( slit-> key ( ) == s ) |
@@ -167,2 +175,3 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
167 | vertLayout->addWidget( m_deco_list ); | 175 | vertLayout->addWidget( m_deco_list ); |
176 | QWhatsThis::add( m_deco_list, tr( "Window decorations control the way the application title bar and its buttons appear.\n\nClick here to select an available decoration." ) ); | ||
168 | 177 | ||
@@ -173,3 +182,4 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
173 | { | 182 | { |
174 | QString path = QPEApplication::qpeDir() + "/plugins/decorations/"; | 183 | QString path = QPEApplication::qpeDir(); |
184 | path.append( "/plugins/decorations/" ); | ||
175 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 185 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
@@ -177,3 +187,6 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
177 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { | 187 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { |
178 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 188 | QString libstr = path; |
189 | libstr.append( "/" ); | ||
190 | libstr.append( *it ); | ||
191 | QLibrary *lib = new QLibrary ( libstr ); | ||
179 | WindowDecorationInterface *iface; | 192 | WindowDecorationInterface *iface; |
@@ -181,5 +194,5 @@ QWidget *Appearance::createDecoTab ( QWidget *parent, Config &cfg ) | |||
181 | if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) { | 194 | if ( lib-> queryInterface ( IID_WindowDecoration, (QUnknownInterface **) &iface ) == QS_OK ) { |
182 | DecoListItem *dlit = new DecoListItem ( lib, iface ); | 195 | DecoListItem *dlit = new DecoListItem ( lib, iface ); |
183 | m_deco_list-> insertItem ( dlit ); | 196 | m_deco_list-> insertItem ( dlit ); |
184 | 197 | ||
185 | if ( dlit-> key ( ) == s ) | 198 | if ( dlit-> key ( ) == s ) |
@@ -208,5 +221,6 @@ QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) | |||
208 | 221 | ||
209 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); | 222 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); |
210 | m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); | 223 | m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); |
211 | 224 | QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); | |
225 | |||
212 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 226 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
@@ -214,3 +228,3 @@ QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) | |||
214 | 228 | ||
215 | return m_fontselect; | 229 | return m_fontselect; |
216 | } | 230 | } |
@@ -226,2 +240,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
226 | connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) ); | 240 | connect( m_color_list, SIGNAL( highlighted( int ) ), this, SLOT( colorClicked( int ) ) ); |
241 | QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) ); | ||
227 | 242 | ||
@@ -229,13 +244,16 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
229 | 244 | ||
230 | QString path = QPEApplication::qpeDir ( ) + "/etc/colors/"; | 245 | QString path = QPEApplication::qpeDir ( ); |
246 | path.append( "/etc/colors/" ); | ||
231 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); | 247 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); |
232 | 248 | ||
233 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { | 249 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { |
234 | QString name = (*it). left ((*it). find ( ".scheme" )); | 250 | QString name = (*it). left ((*it). find ( ".scheme" )); |
235 | Config config ( path + *it, Config::File ); | 251 | QString pathstr = path; |
252 | pathstr.append( *it ); | ||
253 | Config config ( pathstr, Config::File ); | ||
236 | config. setGroup ( "Colors" ); | 254 | config. setGroup ( "Colors" ); |
237 | 255 | ||
238 | m_color_list-> insertItem ( new ColorListItem ( name, config )); | 256 | m_color_list-> insertItem ( new ColorListItem ( name, config )); |
239 | } | 257 | } |
240 | 258 | ||
241 | m_color_list-> setCurrentItem ( 0 ); | 259 | m_color_list-> setCurrentItem ( 0 ); |
@@ -246,2 +264,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
246 | gridLayout->addWidget( tempButton, 0, 1 ); | 264 | gridLayout->addWidget( tempButton, 0, 1 ); |
265 | QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) ); | ||
247 | 266 | ||
@@ -251,2 +270,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
251 | gridLayout->addWidget( tempButton, 1, 1 ); | 270 | gridLayout->addWidget( tempButton, 1, 1 ); |
271 | QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) ); | ||
252 | 272 | ||
@@ -256,2 +276,3 @@ QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | |||
256 | gridLayout->addWidget( tempButton, 2, 1 ); | 276 | gridLayout->addWidget( tempButton, 2, 1 ); |
277 | QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) ); | ||
257 | 278 | ||
@@ -269,3 +290,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
269 | m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" )); | 290 | m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" )); |
270 | lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 ); | 291 | lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 ); |
292 | QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) ); | ||
271 | 293 | ||
@@ -274,3 +296,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
274 | lay-> addMultiCellWidget ( l, 1, 1, 0, 1 ); | 296 | lay-> addMultiCellWidget ( l, 1, 1, 0, 1 ); |
275 | 297 | QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); | |
298 | |||
276 | m_except = new QListView ( tab ); | 299 | m_except = new QListView ( tab ); |
@@ -287,8 +310,9 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
287 | m_except-> header ( )-> setResizeEnabled ( false ); | 310 | m_except-> header ( )-> setResizeEnabled ( false ); |
288 | m_except-> header ( )-> setMovingEnabled ( false ); | 311 | m_except-> header ( )-> setMovingEnabled ( false ); |
289 | m_except-> setSorting ( -1 ); | 312 | m_except-> setSorting ( -1 ); |
290 | lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 ); | 313 | lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 ); |
291 | 314 | QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); | |
315 | |||
292 | connect ( m_except, SIGNAL( clicked ( QListViewItem *, const QPoint &, int )), this, SLOT( clickedExcept ( QListViewItem *, const QPoint &, int ))); | 316 | connect ( m_except, SIGNAL( clicked ( QListViewItem *, const QPoint &, int )), this, SLOT( clickedExcept ( QListViewItem *, const QPoint &, int ))); |
293 | 317 | ||
294 | QToolButton *tb = new QToolButton ( tab ); | 318 | QToolButton *tb = new QToolButton ( tab ); |
@@ -296,4 +320,5 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
296 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | 320 | tb-> setFocusPolicy ( QWidget::StrongFocus ); |
297 | lay-> addWidget ( tb, 2, 1 ); | 321 | lay-> addWidget ( tb, 2, 1 ); |
298 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( addExcept ( ))); | 322 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( addExcept ( ))); |
323 | QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) ); | ||
299 | 324 | ||
@@ -302,5 +327,6 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
302 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | 327 | tb-> setFocusPolicy ( QWidget::StrongFocus ); |
303 | lay-> addWidget ( tb, 3, 1 ); | 328 | lay-> addWidget ( tb, 3, 1 ); |
304 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( delExcept ( ))); | 329 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( delExcept ( ))); |
305 | 330 | QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) ); | |
331 | |||
306 | tb = new QToolButton ( tab ); | 332 | tb = new QToolButton ( tab ); |
@@ -308,5 +334,6 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
308 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | 334 | tb-> setFocusPolicy ( QWidget::StrongFocus ); |
309 | lay-> addWidget ( tb, 4, 1 ); | 335 | lay-> addWidget ( tb, 4, 1 ); |
310 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( upExcept ( ))); | 336 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( upExcept ( ))); |
311 | 337 | QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) ); | |
338 | |||
312 | tb = new QToolButton ( tab ); | 339 | tb = new QToolButton ( tab ); |
@@ -314,5 +341,6 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
314 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | 341 | tb-> setFocusPolicy ( QWidget::StrongFocus ); |
315 | lay-> addWidget ( tb, 5, 1 ); | 342 | lay-> addWidget ( tb, 5, 1 ); |
316 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( ))); | 343 | connect ( tb, SIGNAL( clicked ( )), this, SLOT( downExcept ( ))); |
317 | 344 | QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) ); | |
345 | |||
318 | lay-> setRowStretch ( 6, 10 ); | 346 | lay-> setRowStretch ( 6, 10 ); |
@@ -324,3 +352,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
324 | int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); | 352 | int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); |
325 | 353 | ||
326 | lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 ); | 354 | lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 ); |
@@ -329,9 +357,9 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
329 | 357 | ||
330 | vertLayout-> addSpacing ( 3 ); | 358 | vertLayout-> addSpacing ( 3 ); |
331 | QFrame *f = new QFrame ( tab ); | 359 | QFrame *f = new QFrame ( tab ); |
332 | f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); | 360 | f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); |
333 | vertLayout-> addWidget ( f ); | 361 | vertLayout-> addWidget ( f ); |
334 | vertLayout-> addSpacing ( 3 ); | 362 | vertLayout-> addSpacing ( 3 ); |
335 | 363 | ||
336 | 364 | ||
337 | QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); | 365 | QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); |
@@ -343,2 +371,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
343 | gridLayout-> addWidget ( label, 0, 0 ); | 371 | gridLayout-> addWidget ( label, 0, 0 ); |
372 | QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); | ||
373 | |||
344 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); | 374 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); |
@@ -354,2 +384,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
354 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); | 384 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); |
385 | QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); | ||
355 | 386 | ||
@@ -358,3 +389,4 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
358 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); | 389 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); |
359 | 390 | QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); | |
391 | |||
360 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); | 392 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); |
@@ -362,2 +394,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
362 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); | 394 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); |
395 | QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); | ||
363 | 396 | ||
@@ -374,3 +407,3 @@ QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | |||
374 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 407 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
375 | : QDialog ( parent, name, true ) | 408 | : QDialog ( parent, name, true, WStyle_ContextHelp ) |
376 | { | 409 | { |
@@ -385,6 +418,7 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | |||
385 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 418 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
386 | 419 | QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); | |
420 | |||
387 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 421 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
388 | QWidget *styletab; | 422 | QWidget *styletab; |
389 | 423 | ||
390 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance/style.png", tr( "Style" )); | 424 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance/style.png", tr( "Style" )); |
@@ -395,3 +429,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | |||
395 | 429 | ||
396 | top-> addWidget ( tw, 10 ); | 430 | top-> addWidget ( tw, 10 ); |
397 | top-> addWidget ( m_sample, 1 ); | 431 | top-> addWidget ( m_sample, 1 ); |
@@ -400,3 +434,3 @@ Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | |||
400 | connect ( tw, SIGNAL( currentChanged ( QWidget * )), this, SLOT( tabChanged ( QWidget * ))); | 434 | connect ( tw, SIGNAL( currentChanged ( QWidget * )), this, SLOT( tabChanged ( QWidget * ))); |
401 | 435 | ||
402 | m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; | 436 | m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; |
@@ -426,3 +460,3 @@ void Appearance::accept ( ) | |||
426 | 460 | ||
427 | if ( m_style_changed ) { | 461 | if ( m_style_changed ) { |
428 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 462 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
@@ -431,4 +465,4 @@ void Appearance::accept ( ) | |||
431 | } | 465 | } |
432 | 466 | ||
433 | if ( m_deco_changed ) { | 467 | if ( m_deco_changed ) { |
434 | DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); | 468 | DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); |
@@ -436,3 +470,3 @@ void Appearance::accept ( ) | |||
436 | config.writeEntry( "Decoration", item-> key ( )); | 470 | config.writeEntry( "Decoration", item-> key ( )); |
437 | } | 471 | } |
438 | 472 | ||
@@ -453,4 +487,4 @@ void Appearance::accept ( ) | |||
453 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 487 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
454 | 488 | ||
455 | if ( item ) | 489 | if ( item ) |
456 | item-> save ( config ); | 490 | item-> save ( config ); |
@@ -462,2 +496,3 @@ void Appearance::accept ( ) | |||
462 | QStringList sl; | 496 | QStringList sl; |
497 | QString exceptstr; | ||
463 | for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { | 498 | for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) { |
@@ -467,3 +502,5 @@ void Appearance::accept ( ) | |||
467 | fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); | 502 | fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); |
468 | sl << ( QString::number ( fl, 32 ) + it-> pattern ( )); | 503 | exceptstr = QString::number ( fl, 32 ); |
504 | exceptstr.append( it-> pattern ( )); | ||
505 | sl << exceptstr; | ||
469 | } | 506 | } |
@@ -471,3 +508,3 @@ void Appearance::accept ( ) | |||
471 | config. writeEntry ( "ForceStyle", m_force-> isChecked ( )); | 508 | config. writeEntry ( "ForceStyle", m_force-> isChecked ( )); |
472 | 509 | ||
473 | config. write ( ); // need to flush the config info first | 510 | config. write ( ); // need to flush the config info first |
@@ -478,3 +515,3 @@ void Appearance::accept ( ) | |||
478 | } | 515 | } |
479 | 516 | ||
480 | QDialog::accept ( ); | 517 | QDialog::accept ( ); |
@@ -493,6 +530,6 @@ void Appearance::styleClicked ( int index ) | |||
493 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); | 530 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); |
494 | 531 | ||
495 | if ( m_sample && sli && sli-> style ( )) | 532 | if ( m_sample && sli && sli-> style ( )) |
496 | m_sample-> setStyle2 ( sli-> style ( )); | 533 | m_sample-> setStyle2 ( sli-> style ( )); |
497 | 534 | ||
498 | m_style_changed |= ( index != m_original_style ); | 535 | m_style_changed |= ( index != m_original_style ); |
@@ -612,3 +649,7 @@ void Appearance::saveSchemeClicked() | |||
612 | QString schemename = ed-> text ( ); | 649 | QString schemename = ed-> text ( ); |
613 | QFile file ( QPEApplication::qpeDir() + "/etc/colors/" + schemename + ".scheme" ); | 650 | QString filestr = QPEApplication::qpeDir(); |
651 | filestr.append( "/etc/colors/" ); | ||
652 | filestr.append( schemename ); | ||
653 | filestr.append( ".scheme" ); | ||
654 | QFile file ( filestr ); | ||
614 | if ( !file. exists ( )) | 655 | if ( !file. exists ( )) |
@@ -643,5 +684,9 @@ void Appearance::deleteSchemeClicked() | |||
643 | { | 684 | { |
644 | if ( QMessageBox::warning ( this, tr( "Delete scheme" ), tr( "Do you really want to delete\n" ) + item-> text ( ) + "?", | 685 | if ( QPEMessageBox::confirmDelete ( this, tr( "Delete scheme" ), item-> text ( ) ) ) |
645 | tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { | 686 | { |
646 | QFile::remove ( QPEApplication::qpeDir ( ) + "/etc/colors/" + item-> text ( ) + ".scheme" ); | 687 | QString filestr = QPEApplication::qpeDir ( ); |
688 | filestr.append( "/etc/colors/" ); | ||
689 | filestr.append( item-> text ( ) ); | ||
690 | filestr.append( ".scheme" ); | ||
691 | QFile::remove ( filestr ); | ||
647 | delete item; | 692 | delete item; |
diff --git a/noncore/settings/appearance2/editScheme.cpp b/noncore/settings/appearance2/editScheme.cpp index eefeccc..7e5225f 100644 --- a/noncore/settings/appearance2/editScheme.cpp +++ b/noncore/settings/appearance2/editScheme.cpp | |||
@@ -18,3 +18,3 @@ | |||
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
@@ -38,5 +38,6 @@ | |||
38 | #include <qtoolbutton.h> | 38 | #include <qtoolbutton.h> |
39 | #include <qwhatsthis.h> | ||
39 | 40 | ||
40 | EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags fl ) | 41 | EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget* parent, const char* name, bool modal, WFlags ) |
41 | : QDialog ( parent, name, modal, fl ) | 42 | : QDialog ( parent, name, modal, WStyle_ContextHelp ) |
42 | { | 43 | { |
@@ -53,2 +54,3 @@ EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget | |||
53 | layout-> addWidget ( l, i, 0 ); | 54 | layout-> addWidget ( l, i, 0 ); |
55 | QWhatsThis::add( l, tr( "Click here to select a color for: " ).arg( labels [i] ) ); | ||
54 | 56 | ||
@@ -56,2 +58,3 @@ EditScheme::EditScheme ( int cnt, const QString *labels, QColor *colors, QWidget | |||
56 | layout-> addWidget ( m_buttons [i], i, 1 ); | 58 | layout-> addWidget ( m_buttons [i], i, 1 ); |
59 | QWhatsThis::add( m_buttons [i], tr( "Click here to select a color for: " ).arg( labels [i] ) ); | ||
57 | } | 60 | } |