Diffstat (limited to 'noncore/settings/appearance2/editScheme.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/appearance2/editScheme.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
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 | |||
@@ -1,72 +1,75 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
3 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> | 3 | =. Copyright (c) 2002 Dan Williams <williamsdr@acm.org> |
4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 4 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
5 | .>+-= | 5 | .>+-= |
6 | _;:, .> :=|. This file is free software; you can | 6 | _;:, .> :=|. This file is free software; you can |
7 | .> <`_, > . <= redistribute it and/or modify it under | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 8 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
9 | .="- .-=="i, .._ License as published by the Free Software | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | - . .-<_> .<> Foundation; either version 2 of the License, | 10 | - . .-<_> .<> Foundation; either version 2 of the License, |
11 | ._= =} : or (at your option) any later version. | 11 | ._= =} : or (at your option) any later version. |
12 | .%`+i> _;_. | 12 | .%`+i> _;_. |
13 | .i_,=:_. -<s. This file is distributed in the hope that | 13 | .i_,=:_. -<s. This file is distributed in the hope that |
14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | : .. .:, . . . without even the implied warranty of | 15 | : .. .:, . . . without even the implied warranty of |
16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
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 |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "editScheme.h" | 29 | #include "editScheme.h" |
30 | 30 | ||
31 | #include <opie/ocolorbutton.h> | 31 | #include <opie/ocolorbutton.h> |
32 | 32 | ||
33 | #include <qaction.h> | 33 | #include <qaction.h> |
34 | #include <qlabel.h> | 34 | #include <qlabel.h> |
35 | #include <qlayout.h> | 35 | #include <qlayout.h> |
36 | #include <qpopupmenu.h> | 36 | #include <qpopupmenu.h> |
37 | #include <qscrollview.h> | 37 | #include <qscrollview.h> |
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 | { |
43 | setCaption ( tr( "Edit scheme" ) ); | 44 | setCaption ( tr( "Edit scheme" ) ); |
44 | QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 ); | 45 | QGridLayout *layout = new QGridLayout ( this, 0, 0, 4, 4 ); |
45 | 46 | ||
46 | m_count = cnt; | 47 | m_count = cnt; |
47 | m_buttons = new OColorButton * [cnt]; | 48 | m_buttons = new OColorButton * [cnt]; |
48 | m_colors = colors; | 49 | m_colors = colors; |
49 | 50 | ||
50 | for ( int i = 0; i < cnt; i++ ) | 51 | for ( int i = 0; i < cnt; i++ ) |
51 | { | 52 | { |
52 | QLabel *l = new QLabel ( labels [i], this ); | 53 | QLabel *l = new QLabel ( labels [i], this ); |
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 | ||
55 | m_buttons [i] = new OColorButton ( this, colors [i] ); | 57 | m_buttons [i] = new OColorButton ( this, colors [i] ); |
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 | } |
58 | } | 61 | } |
59 | 62 | ||
60 | EditScheme::~EditScheme ( ) | 63 | EditScheme::~EditScheme ( ) |
61 | { | 64 | { |
62 | delete [] m_buttons; | 65 | delete [] m_buttons; |
63 | } | 66 | } |
64 | 67 | ||
65 | void EditScheme::accept ( ) | 68 | void EditScheme::accept ( ) |
66 | { | 69 | { |
67 | for ( int i = 0; i < m_count; i++ ) | 70 | for ( int i = 0; i < m_count; i++ ) |
68 | m_colors [i] = m_buttons [i]-> color ( ); | 71 | m_colors [i] = m_buttons [i]-> color ( ); |
69 | 72 | ||
70 | QDialog::accept ( ); | 73 | QDialog::accept ( ); |
71 | } | 74 | } |
72 | 75 | ||