author | sandman <sandman> | 2002-10-01 20:59:06 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-01 20:59:06 (UTC) |
commit | 609b04531d5a1caae189397922eb0068aa0e2634 (patch) (unidiff) | |
tree | 170ae3b543b48cf2007de7dc0b580778efce9a2f | |
parent | 2906826d9ebc268bc233f97956ee1dc5b338c69b (diff) | |
download | opie-609b04531d5a1caae189397922eb0068aa0e2634.zip opie-609b04531d5a1caae189397922eb0068aa0e2634.tar.gz opie-609b04531d5a1caae189397922eb0068aa0e2634.tar.bz2 |
adjusted to new OFontSelector c'tor
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp index 75a3de5..6288f5f 100644 --- a/core/settings/launcher/tabdialog.cpp +++ b/core/settings/launcher/tabdialog.cpp | |||
@@ -1,498 +1,498 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> | 3 | .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This file is free software; you can | 5 | _;:, .> :=|. This file is free software; you can |
6 | .> <`_, > . <= redistribute it and/or modify it under | 6 | .> <`_, > . <= redistribute it and/or modify it under |
7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 7 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%`+i> _;_. | 11 | .%`+i> _;_. |
12 | .i_,=:_. -<s. This file is distributed in the hope that | 12 | .i_,=:_. -<s. This file is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 16 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
17 | ..}^=.= = ; Public License for more details. | 17 | ..}^=.= = ; Public License for more details. |
18 | ++= -. .` .: | 18 | ++= -. .` .: |
19 | : = ...= . :.=- You should have received a copy of the GNU | 19 | : = ...= . :.=- You should have received a copy of the GNU |
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
29 | #include <qpe/config.h> | 29 | #include <qpe/config.h> |
30 | #include <qpe/applnk.h> | 30 | #include <qpe/applnk.h> |
31 | 31 | ||
32 | #include <qlayout.h> | 32 | #include <qlayout.h> |
33 | #include <qvbox.h> | 33 | #include <qvbox.h> |
34 | #include <qtabbar.h> | 34 | #include <qtabbar.h> |
35 | #include <qiconview.h> | 35 | #include <qiconview.h> |
36 | #include <qapplication.h> | 36 | #include <qapplication.h> |
37 | #include <qlabel.h> | 37 | #include <qlabel.h> |
38 | #include <qradiobutton.h> | 38 | #include <qradiobutton.h> |
39 | #include <qbuttongroup.h> | 39 | #include <qbuttongroup.h> |
40 | #include <qpushbutton.h> | 40 | #include <qpushbutton.h> |
41 | 41 | ||
42 | #include <opie/ofontselector.h> | 42 | #include <opie/ofontselector.h> |
43 | #include <opie/otabwidget.h> | 43 | #include <opie/otabwidget.h> |
44 | #include <opie/ocolorbutton.h> | 44 | #include <opie/ocolorbutton.h> |
45 | #include <opie/ofiledialog.h> | 45 | #include <opie/ofiledialog.h> |
46 | 46 | ||
47 | #include "tabdialog.h" | 47 | #include "tabdialog.h" |
48 | 48 | ||
49 | 49 | ||
50 | class SampleItem : public QIconViewItem { | 50 | class SampleItem : public QIconViewItem { |
51 | public: | 51 | public: |
52 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) | 52 | SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) |
53 | { | 53 | { |
54 | m_large = pix; | 54 | m_large = pix; |
55 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); | 55 | m_small. convertFromImage ( pix. convertToImage ( ). smoothScale ( pix. width ( ) / 2, pix. height ( ) / 2 )); |
56 | } | 56 | } |
57 | 57 | ||
58 | void sizeChange ( ) | 58 | void sizeChange ( ) |
59 | { | 59 | { |
60 | calcRect ( ); | 60 | calcRect ( ); |
61 | repaint ( ); | 61 | repaint ( ); |
62 | } | 62 | } |
63 | 63 | ||
64 | QPixmap *pixmap ( ) const | 64 | QPixmap *pixmap ( ) const |
65 | { | 65 | { |
66 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) | 66 | if ( iconView ( )-> itemTextPos ( ) == QIconView::Right ) |
67 | return (QPixmap *) &m_small; | 67 | return (QPixmap *) &m_small; |
68 | else | 68 | else |
69 | return (QPixmap *) &m_large; | 69 | return (QPixmap *) &m_large; |
70 | } | 70 | } |
71 | 71 | ||
72 | private: | 72 | private: |
73 | QPixmap m_large, m_small; | 73 | QPixmap m_large, m_small; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | class SampleView : public QIconView { | 76 | class SampleView : public QIconView { |
77 | public: | 77 | public: |
78 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) | 78 | SampleView ( QWidget *parent = 0, const char *name = 0 ) : QIconView ( parent, name ) |
79 | { | 79 | { |
80 | setItemsMovable ( false ); | 80 | setItemsMovable ( false ); |
81 | setAutoArrange ( true ); | 81 | setAutoArrange ( true ); |
82 | setSorting ( true ); | 82 | setSorting ( true ); |
83 | setFrameStyle ( QFrame::NoFrame ); | 83 | setFrameStyle ( QFrame::NoFrame ); |
84 | setSpacing ( 4 ); | 84 | setSpacing ( 4 ); |
85 | setMargin ( 0 ); | 85 | setMargin ( 0 ); |
86 | setSelectionMode ( QIconView::NoSelection ); | 86 | setSelectionMode ( QIconView::NoSelection ); |
87 | setBackgroundMode ( PaletteBase ); | 87 | setBackgroundMode ( PaletteBase ); |
88 | setViewMode ( TabConfig::Icon ); | 88 | setViewMode ( TabConfig::Icon ); |
89 | calculateGrid ( Bottom ); | 89 | calculateGrid ( Bottom ); |
90 | 90 | ||
91 | 91 | ||
92 | new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "DateBook" )); | 92 | new SampleItem ( this, tr( "Sample 1" ), Resource::loadPixmap ( "DateBook" )); |
93 | new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); | 93 | new SampleItem ( this, tr( "Sample 2" ), Resource::loadPixmap ( "Calibrate" )); |
94 | new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); | 94 | new SampleItem ( this, tr( "Sample 3" ), Resource::loadPixmap ( "UnknownDocument" )); |
95 | 95 | ||
96 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 96 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
97 | 97 | ||
98 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); | 98 | setMaximumHeight ( firstItem ( )-> height ( ) + 16 ); |
99 | } | 99 | } |
100 | 100 | ||
101 | void setViewMode ( TabConfig::ViewMode m ) | 101 | void setViewMode ( TabConfig::ViewMode m ) |
102 | { | 102 | { |
103 | viewport ( )-> setUpdatesEnabled ( false ); | 103 | viewport ( )-> setUpdatesEnabled ( false ); |
104 | 104 | ||
105 | switch ( m ) { | 105 | switch ( m ) { |
106 | case TabConfig::List: | 106 | case TabConfig::List: |
107 | setItemTextPos( QIconView::Right ); | 107 | setItemTextPos( QIconView::Right ); |
108 | break; | 108 | break; |
109 | case TabConfig::Icon: | 109 | case TabConfig::Icon: |
110 | setItemTextPos( QIconView::Bottom ); | 110 | setItemTextPos( QIconView::Bottom ); |
111 | break; | 111 | break; |
112 | } | 112 | } |
113 | // hideOrShowItems ( false ); | 113 | // hideOrShowItems ( false ); |
114 | 114 | ||
115 | for ( QIconViewItem *it = firstItem ( ); it; it = it-> nextItem ( )) | 115 | for ( QIconViewItem *it = firstItem ( ); it; it = it-> nextItem ( )) |
116 | ((SampleItem *) it )-> sizeChange ( ); | 116 | ((SampleItem *) it )-> sizeChange ( ); |
117 | arrangeItemsInGrid ( true ); | 117 | arrangeItemsInGrid ( true ); |
118 | viewport ( )-> setUpdatesEnabled ( true ); | 118 | viewport ( )-> setUpdatesEnabled ( true ); |
119 | update ( ); | 119 | update ( ); |
120 | } | 120 | } |
121 | 121 | ||
122 | 122 | ||
123 | void setBackgroundType( TabConfig::BackgroundType t, const QString &val ) | 123 | void setBackgroundType( TabConfig::BackgroundType t, const QString &val ) |
124 | { | 124 | { |
125 | switch ( t ) { | 125 | switch ( t ) { |
126 | case TabConfig::Ruled: { | 126 | case TabConfig::Ruled: { |
127 | QPixmap bg ( width ( ), 9 ); | 127 | QPixmap bg ( width ( ), 9 ); |
128 | QPainter painter ( &bg ); | 128 | QPainter painter ( &bg ); |
129 | for ( int i = 0; i < 3; i++ ) { | 129 | for ( int i = 0; i < 3; i++ ) { |
130 | painter. setPen ( white ); | 130 | painter. setPen ( white ); |
131 | painter. drawLine ( 0, i*3, width()-1, i*3 ); | 131 | painter. drawLine ( 0, i*3, width()-1, i*3 ); |
132 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); | 132 | painter. drawLine ( 0, i*3+1, width()-1, i*3+1 ); |
133 | painter. setPen ( colorGroup().background().light(105) ); | 133 | painter. setPen ( colorGroup().background().light(105) ); |
134 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); | 134 | painter. drawLine ( 0, i*3+2, width()-1, i*3+2 ); |
135 | } | 135 | } |
136 | painter.end ( ); | 136 | painter.end ( ); |
137 | setBackgroundPixmap ( bg ); | 137 | setBackgroundPixmap ( bg ); |
138 | break; | 138 | break; |
139 | } | 139 | } |
140 | 140 | ||
141 | case TabConfig::SolidColor: { | 141 | case TabConfig::SolidColor: { |
142 | setBackgroundPixmap ( QPixmap ( )); | 142 | setBackgroundPixmap ( QPixmap ( )); |
143 | if ( val. isEmpty ( )) | 143 | if ( val. isEmpty ( )) |
144 | setBackgroundColor ( colorGroup ( ). base ( )); | 144 | setBackgroundColor ( colorGroup ( ). base ( )); |
145 | else | 145 | else |
146 | setBackgroundColor ( val ); | 146 | setBackgroundColor ( val ); |
147 | break; | 147 | break; |
148 | } | 148 | } |
149 | 149 | ||
150 | case TabConfig::Image: { | 150 | case TabConfig::Image: { |
151 | qDebug( "Loading image: %s", val.latin1() ); | 151 | qDebug( "Loading image: %s", val.latin1() ); |
152 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); | 152 | QPixmap bg ( Resource::loadPixmap ( "wallpaper/" + val )); |
153 | if ( bg. isNull ( )) { | 153 | if ( bg. isNull ( )) { |
154 | QImageIO imgio; | 154 | QImageIO imgio; |
155 | imgio. setFileName ( val ); | 155 | imgio. setFileName ( val ); |
156 | QSize ds = qApp-> desktop ( )-> size ( ); | 156 | QSize ds = qApp-> desktop ( )-> size ( ); |
157 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr | 157 | QString param ( "Scale( %1, %2, ScaleMin )" ); // No tr |
158 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); | 158 | imgio. setParameters ( param. arg ( ds. width ( )). arg ( ds. height ( )). latin1 ( )); |
159 | imgio. read ( ); | 159 | imgio. read ( ); |
160 | bg = imgio. image ( ); | 160 | bg = imgio. image ( ); |
161 | } | 161 | } |
162 | setBackgroundPixmap ( bg ); | 162 | setBackgroundPixmap ( bg ); |
163 | break; | 163 | break; |
164 | } | 164 | } |
165 | } | 165 | } |
166 | m_bgtype = t; | 166 | m_bgtype = t; |
167 | viewport ( )-> update ( ); | 167 | viewport ( )-> update ( ); |
168 | } | 168 | } |
169 | 169 | ||
170 | void setTextColor ( const QColor &tc ) | 170 | void setTextColor ( const QColor &tc ) |
171 | { | 171 | { |
172 | m_textcolor = tc; | 172 | m_textcolor = tc; |
173 | QColorGroup cg = colorGroup ( ); | 173 | QColorGroup cg = colorGroup ( ); |
174 | cg. setColor ( QColorGroup::Text, tc ); | 174 | cg. setColor ( QColorGroup::Text, tc ); |
175 | setPalette ( QPalette ( cg, cg, cg )); | 175 | setPalette ( QPalette ( cg, cg, cg )); |
176 | viewport ( )-> update ( ); | 176 | viewport ( )-> update ( ); |
177 | } | 177 | } |
178 | 178 | ||
179 | void setViewFont ( const QFont &f ) | 179 | void setViewFont ( const QFont &f ) |
180 | { | 180 | { |
181 | setFont ( f ); | 181 | setFont ( f ); |
182 | } | 182 | } |
183 | 183 | ||
184 | void setItemTextPos ( ItemTextPos pos ) | 184 | void setItemTextPos ( ItemTextPos pos ) |
185 | { | 185 | { |
186 | calculateGrid ( pos ); | 186 | calculateGrid ( pos ); |
187 | QIconView::setItemTextPos( pos ); | 187 | QIconView::setItemTextPos( pos ); |
188 | } | 188 | } |
189 | 189 | ||
190 | void calculateGrid ( ItemTextPos pos ) | 190 | void calculateGrid ( ItemTextPos pos ) |
191 | { | 191 | { |
192 | int dw = QApplication::desktop ( )-> width ( ); | 192 | int dw = QApplication::desktop ( )-> width ( ); |
193 | int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); | 193 | int viewerWidth = dw - style ( ).scrollBarExtent ( ). width ( ); |
194 | if ( pos == Bottom ) { | 194 | if ( pos == Bottom ) { |
195 | int cols = 3; | 195 | int cols = 3; |
196 | if ( viewerWidth <= 200 ) | 196 | if ( viewerWidth <= 200 ) |
197 | cols = 2; | 197 | cols = 2; |
198 | else if ( viewerWidth >= 400 ) | 198 | else if ( viewerWidth >= 400 ) |
199 | cols = viewerWidth/96; | 199 | cols = viewerWidth/96; |
200 | setSpacing ( 4 ); | 200 | setSpacing ( 4 ); |
201 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); | 201 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); |
202 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); | 202 | setGridY ( fontMetrics ( ). height ( ) * 2 + 24 ); |
203 | } | 203 | } |
204 | else { | 204 | else { |
205 | int cols = 2; | 205 | int cols = 2; |
206 | if ( viewerWidth < 150 ) | 206 | if ( viewerWidth < 150 ) |
207 | cols = 1; | 207 | cols = 1; |
208 | else if ( viewerWidth >= 400 ) | 208 | else if ( viewerWidth >= 400 ) |
209 | cols = viewerWidth / 150; | 209 | cols = viewerWidth / 150; |
210 | setSpacing ( 2 ); | 210 | setSpacing ( 2 ); |
211 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); | 211 | setGridX (( viewerWidth - ( cols + 1 ) * spacing ( )) / cols ); |
212 | setGridY ( fontMetrics ( ). height ( ) + 2 ); | 212 | setGridY ( fontMetrics ( ). height ( ) + 2 ); |
213 | } | 213 | } |
214 | } | 214 | } |
215 | 215 | ||
216 | void paletteChange( const QPalette &p ) | 216 | void paletteChange( const QPalette &p ) |
217 | { | 217 | { |
218 | static bool excllock = false; | 218 | static bool excllock = false; |
219 | 219 | ||
220 | if ( excllock ) | 220 | if ( excllock ) |
221 | return; | 221 | return; |
222 | excllock = true; | 222 | excllock = true; |
223 | 223 | ||
224 | unsetPalette ( ); | 224 | unsetPalette ( ); |
225 | QIconView::paletteChange ( p ); | 225 | QIconView::paletteChange ( p ); |
226 | if ( m_bgtype == TabConfig::Ruled ) | 226 | if ( m_bgtype == TabConfig::Ruled ) |
227 | setBackgroundType ( TabConfig::Ruled, QString::null ); | 227 | setBackgroundType ( TabConfig::Ruled, QString::null ); |
228 | QColorGroup cg = colorGroup ( ); | 228 | QColorGroup cg = colorGroup ( ); |
229 | cg.setColor ( QColorGroup::Text, m_textcolor ); | 229 | cg.setColor ( QColorGroup::Text, m_textcolor ); |
230 | setPalette ( QPalette ( cg, cg, cg )); | 230 | setPalette ( QPalette ( cg, cg, cg )); |
231 | 231 | ||
232 | excllock = false; | 232 | excllock = false; |
233 | } | 233 | } |
234 | 234 | ||
235 | void setBackgroundPixmap ( const QPixmap &pm ) | 235 | void setBackgroundPixmap ( const QPixmap &pm ) |
236 | { | 236 | { |
237 | m_bgpix = pm; | 237 | m_bgpix = pm; |
238 | } | 238 | } |
239 | 239 | ||
240 | void setBackgroundColor ( const QColor &c ) | 240 | void setBackgroundColor ( const QColor &c ) |
241 | { | 241 | { |
242 | m_bgcolor = c; | 242 | m_bgcolor = c; |
243 | } | 243 | } |
244 | 244 | ||
245 | void drawBackground ( QPainter *p, const QRect &r ) | 245 | void drawBackground ( QPainter *p, const QRect &r ) |
246 | { | 246 | { |
247 | if ( !m_bgpix. isNull ( )) { | 247 | if ( !m_bgpix. isNull ( )) { |
248 | p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ), | 248 | p-> drawTiledPixmap ( r, m_bgpix, QPoint (( r. x ( ) + contentsX ( )) % m_bgpix. width ( ), |
249 | ( r. y ( ) + contentsY ( )) % m_bgpix. height ( ))); | 249 | ( r. y ( ) + contentsY ( )) % m_bgpix. height ( ))); |
250 | } | 250 | } |
251 | else | 251 | else |
252 | p-> fillRect ( r, m_bgcolor ); | 252 | p-> fillRect ( r, m_bgcolor ); |
253 | } | 253 | } |
254 | 254 | ||
255 | private: | 255 | private: |
256 | QColor m_textcolor; | 256 | QColor m_textcolor; |
257 | QColor m_bgcolor; | 257 | QColor m_bgcolor; |
258 | QPixmap m_bgpix; | 258 | QPixmap m_bgpix; |
259 | TabConfig::BackgroundType m_bgtype; | 259 | TabConfig::BackgroundType m_bgtype; |
260 | }; | 260 | }; |
261 | 261 | ||
262 | 262 | ||
263 | 263 | ||
264 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) | 264 | TabDialog::TabDialog ( const QPixmap *tabicon, const QString &tabname, TabConfig &tc, QWidget *parent, const char *name, bool modal, WFlags fl ) |
265 | : QDialog ( parent, name, modal, fl ), m_tc ( tc ) | 265 | : QDialog ( parent, name, modal, fl ), m_tc ( tc ) |
266 | { | 266 | { |
267 | setCaption ( tr( "Edit Tab" )); | 267 | setCaption ( tr( "Edit Tab" )); |
268 | 268 | ||
269 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); | 269 | QVBoxLayout *lay = new QVBoxLayout ( this, 4, 4 ); |
270 | 270 | ||
271 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 271 | OTabWidget *tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
272 | QWidget *bgtab; | 272 | QWidget *bgtab; |
273 | 273 | ||
274 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); | 274 | tw-> addTab ( bgtab = createBgTab ( tw ), "appearance/backgroundtabicon.png", tr( "Background" )); |
275 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 275 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); |
276 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); | 276 | tw-> addTab ( createIconTab ( tw ), "appearance/colorstabicon.png", tr( "Icons" ) ); |
277 | 277 | ||
278 | tw-> setCurrentTab ( bgtab ); | 278 | tw-> setCurrentTab ( bgtab ); |
279 | 279 | ||
280 | QWidget *sample = new QVBox ( this ); | 280 | QWidget *sample = new QVBox ( this ); |
281 | QTabBar *tb = new QTabBar ( sample ); | 281 | QTabBar *tb = new QTabBar ( sample ); |
282 | QString name ( tr( "Previewing %1" ). arg ( tabname )); | 282 | QString name ( tr( "Previewing %1" ). arg ( tabname )); |
283 | 283 | ||
284 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); | 284 | tb-> addTab ( tabicon ? new QTab ( *tabicon, name ) : new QTab ( name )); |
285 | 285 | ||
286 | m_sample = new SampleView ( sample ); | 286 | m_sample = new SampleView ( sample ); |
287 | 287 | ||
288 | lay-> addWidget ( tw, 10 ); | 288 | lay-> addWidget ( tw, 10 ); |
289 | lay-> addWidget ( sample, 1 ); | 289 | lay-> addWidget ( sample, 1 ); |
290 | 290 | ||
291 | m_iconsize-> setButton ( tc. m_view ); | 291 | m_iconsize-> setButton ( tc. m_view ); |
292 | iconSizeClicked ( tc. m_view ); | 292 | iconSizeClicked ( tc. m_view ); |
293 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); | 293 | m_iconcolor-> setColor ( QColor ( m_tc. m_text_color )); |
294 | iconColorClicked ( m_iconcolor-> color ( )); | 294 | iconColorClicked ( m_iconcolor-> color ( )); |
295 | m_bgtype-> setButton ( tc. m_bg_type ); | 295 | m_bgtype-> setButton ( tc. m_bg_type ); |
296 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); | 296 | m_solidcolor-> setColor ( QColor ( tc. m_bg_color )); |
297 | m_bgimage = tc. m_bg_image; | 297 | m_bgimage = tc. m_bg_image; |
298 | bgTypeClicked ( tc. m_bg_type ); | 298 | bgTypeClicked ( tc. m_bg_type ); |
299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); | 299 | m_fontselect-> setSelectedFont ( QFont ( tc. m_font_family, tc. m_font_size, tc. m_font_weight, tc. m_font_italic )); |
300 | fontClicked ( m_fontselect-> selectedFont ( )); | 300 | fontClicked ( m_fontselect-> selectedFont ( )); |
301 | } | 301 | } |
302 | 302 | ||
303 | 303 | ||
304 | TabDialog::~TabDialog ( ) | 304 | TabDialog::~TabDialog ( ) |
305 | { | 305 | { |
306 | } | 306 | } |
307 | 307 | ||
308 | QWidget *TabDialog::createFontTab ( QWidget *parent ) | 308 | QWidget *TabDialog::createFontTab ( QWidget *parent ) |
309 | { | 309 | { |
310 | m_fontselect = new OFontSelector ( parent, "FontTab" ); | 310 | m_fontselect = new OFontSelector ( false, parent, "FontTab" ); |
311 | 311 | ||
312 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), | 312 | connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), |
313 | this, SLOT( fontClicked ( const QFont & ))); | 313 | this, SLOT( fontClicked ( const QFont & ))); |
314 | 314 | ||
315 | return m_fontselect; | 315 | return m_fontselect; |
316 | } | 316 | } |
317 | 317 | ||
318 | QWidget *TabDialog::createBgTab ( QWidget *parent ) | 318 | QWidget *TabDialog::createBgTab ( QWidget *parent ) |
319 | { | 319 | { |
320 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); | 320 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); |
321 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); | 321 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); |
322 | 322 | ||
323 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 323 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
324 | gridLayout-> setColStretch ( 1, 10 ); | 324 | gridLayout-> setColStretch ( 1, 10 ); |
325 | 325 | ||
326 | QLabel* label = new QLabel( tr( "Type:" ), tab ); | 326 | QLabel* label = new QLabel( tr( "Type:" ), tab ); |
327 | gridLayout-> addWidget ( label, 0, 0 ); | 327 | gridLayout-> addWidget ( label, 0, 0 ); |
328 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); | 328 | m_bgtype = new QButtonGroup( tab, "buttongroup" ); |
329 | m_bgtype-> hide ( ); | 329 | m_bgtype-> hide ( ); |
330 | m_bgtype-> setExclusive ( true ); | 330 | m_bgtype-> setExclusive ( true ); |
331 | 331 | ||
332 | QRadioButton *rb; | 332 | QRadioButton *rb; |
333 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); | 333 | rb = new QRadioButton( tr( "Ruled" ), tab, "ruled" ); |
334 | m_bgtype-> insert ( rb, TabConfig::Ruled ); | 334 | m_bgtype-> insert ( rb, TabConfig::Ruled ); |
335 | gridLayout-> addWidget( rb, 0, 1 ); | 335 | gridLayout-> addWidget( rb, 0, 1 ); |
336 | 336 | ||
337 | QHBoxLayout *hb = new QHBoxLayout ( ); | 337 | QHBoxLayout *hb = new QHBoxLayout ( ); |
338 | hb-> setSpacing ( 4 ); | 338 | hb-> setSpacing ( 4 ); |
339 | 339 | ||
340 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); | 340 | rb = new QRadioButton( tr( "Solid color" ), tab, "solid" ); |
341 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); | 341 | m_bgtype-> insert ( rb, TabConfig::SolidColor ); |
342 | hb-> addWidget ( rb ); | 342 | hb-> addWidget ( rb ); |
343 | hb-> addSpacing ( 10 ); | 343 | hb-> addSpacing ( 10 ); |
344 | 344 | ||
345 | m_solidcolor = new OColorButton ( tab ); | 345 | m_solidcolor = new OColorButton ( tab ); |
346 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); | 346 | connect ( m_solidcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( bgColorClicked ( const QColor & ))); |
347 | hb-> addWidget ( m_solidcolor ); | 347 | hb-> addWidget ( m_solidcolor ); |
348 | hb-> addStretch ( 10 ); | 348 | hb-> addStretch ( 10 ); |
349 | 349 | ||
350 | gridLayout-> addLayout ( hb, 1, 1 ); | 350 | gridLayout-> addLayout ( hb, 1, 1 ); |
351 | 351 | ||
352 | hb = new QHBoxLayout ( ); | 352 | hb = new QHBoxLayout ( ); |
353 | hb-> setSpacing ( 4 ); | 353 | hb-> setSpacing ( 4 ); |
354 | 354 | ||
355 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); | 355 | rb = new QRadioButton( tr( "Image" ), tab, "image" ); |
356 | m_bgtype-> insert ( rb, TabConfig::Image ); | 356 | m_bgtype-> insert ( rb, TabConfig::Image ); |
357 | hb-> addWidget( rb ); | 357 | hb-> addWidget( rb ); |
358 | hb-> addSpacing ( 10 ); | 358 | hb-> addSpacing ( 10 ); |
359 | 359 | ||
360 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); | 360 | m_imagebrowse = new QPushButton ( tr( "Select..." ), tab ); |
361 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); | 361 | connect ( m_imagebrowse, SIGNAL( clicked ( )), this, SLOT( bgImageClicked ( ))); |
362 | hb-> addWidget ( m_imagebrowse ); | 362 | hb-> addWidget ( m_imagebrowse ); |
363 | hb-> addStretch ( 10 ); | 363 | hb-> addStretch ( 10 ); |
364 | 364 | ||
365 | gridLayout-> addLayout ( hb, 2, 1 ); | 365 | gridLayout-> addLayout ( hb, 2, 1 ); |
366 | 366 | ||
367 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); | 367 | QPushButton *p = new QPushButton ( tr( "Default" ), tab ); |
368 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); | 368 | connect ( p, SIGNAL( clicked ( )), this, SLOT( bgDefaultClicked ( ))); |
369 | gridLayout-> addWidget ( p, 3, 1 ); | 369 | gridLayout-> addWidget ( p, 3, 1 ); |
370 | 370 | ||
371 | connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int ))); | 371 | connect ( m_bgtype, SIGNAL( clicked ( int )), this, SLOT( bgTypeClicked ( int ))); |
372 | 372 | ||
373 | vertLayout-> addStretch ( 10 ); | 373 | vertLayout-> addStretch ( 10 ); |
374 | 374 | ||
375 | return tab; | 375 | return tab; |
376 | } | 376 | } |
377 | 377 | ||
378 | QWidget *TabDialog::createIconTab ( QWidget *parent ) | 378 | QWidget *TabDialog::createIconTab ( QWidget *parent ) |
379 | { | 379 | { |
380 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); | 380 | QWidget *tab = new QWidget( parent, "AdvancedTab" ); |
381 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); | 381 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 4, 4 ); |
382 | 382 | ||
383 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); | 383 | QGridLayout* gridLayout = new QGridLayout ( vertLayout ); |
384 | gridLayout-> setColStretch ( 1, 10 ); | 384 | gridLayout-> setColStretch ( 1, 10 ); |
385 | 385 | ||
386 | QLabel* label = new QLabel( tr( "Size:" ), tab ); | 386 | QLabel* label = new QLabel( tr( "Size:" ), tab ); |
387 | gridLayout-> addWidget ( label, 0, 0 ); | 387 | gridLayout-> addWidget ( label, 0, 0 ); |
388 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); | 388 | m_iconsize = new QButtonGroup( tab, "buttongroup" ); |
389 | m_iconsize-> hide ( ); | 389 | m_iconsize-> hide ( ); |
390 | m_iconsize-> setExclusive ( true ); | 390 | m_iconsize-> setExclusive ( true ); |
391 | 391 | ||
392 | QRadioButton *rb; | 392 | QRadioButton *rb; |
393 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); | 393 | rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); |
394 | m_iconsize-> insert ( rb, TabConfig::List ); | 394 | m_iconsize-> insert ( rb, TabConfig::List ); |
395 | gridLayout-> addWidget( rb, 0, 1 ); | 395 | gridLayout-> addWidget( rb, 0, 1 ); |
396 | 396 | ||
397 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); | 397 | rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); |
398 | m_iconsize-> insert ( rb, TabConfig::Icon ); | 398 | m_iconsize-> insert ( rb, TabConfig::Icon ); |
399 | gridLayout-> addWidget( rb, 1, 1 ); | 399 | gridLayout-> addWidget( rb, 1, 1 ); |
400 | 400 | ||
401 | connect ( m_iconsize, SIGNAL( clicked ( int )), this, SLOT( iconSizeClicked ( int ))); | 401 | connect ( m_iconsize, SIGNAL( clicked ( int )), this, SLOT( iconSizeClicked ( int ))); |
402 | 402 | ||
403 | //vertLayout-> addSpacing ( 8 ); | 403 | //vertLayout-> addSpacing ( 8 ); |
404 | 404 | ||
405 | //gridLayout = new QGridLayout ( vertLayout ); | 405 | //gridLayout = new QGridLayout ( vertLayout ); |
406 | gridLayout-> addRowSpacing ( 2, 8 ); | 406 | gridLayout-> addRowSpacing ( 2, 8 ); |
407 | 407 | ||
408 | label = new QLabel ( tr( "Color:" ), tab ); | 408 | label = new QLabel ( tr( "Color:" ), tab ); |
409 | gridLayout-> addWidget ( label, 3, 0 ); | 409 | gridLayout-> addWidget ( label, 3, 0 ); |
410 | 410 | ||
411 | m_iconcolor = new OColorButton ( tab ); | 411 | m_iconcolor = new OColorButton ( tab ); |
412 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); | 412 | connect ( m_iconcolor, SIGNAL( colorSelected ( const QColor & )), this, SLOT( iconColorClicked ( const QColor & ))); |
413 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); | 413 | gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); |
414 | 414 | ||
415 | vertLayout-> addStretch ( 10 ); | 415 | vertLayout-> addStretch ( 10 ); |
416 | 416 | ||
417 | return tab; | 417 | return tab; |
418 | } | 418 | } |
419 | 419 | ||
420 | 420 | ||
421 | void TabDialog::iconSizeClicked ( int s ) | 421 | void TabDialog::iconSizeClicked ( int s ) |
422 | { | 422 | { |
423 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); | 423 | m_sample-> setViewMode ((TabConfig::ViewMode) s ); |
424 | } | 424 | } |
425 | 425 | ||
426 | void TabDialog::fontClicked ( const QFont &f ) | 426 | void TabDialog::fontClicked ( const QFont &f ) |
427 | { | 427 | { |
428 | m_sample-> setViewFont ( f ); | 428 | m_sample-> setViewFont ( f ); |
429 | } | 429 | } |
430 | 430 | ||
431 | void TabDialog::bgTypeClicked ( int t ) | 431 | void TabDialog::bgTypeClicked ( int t ) |
432 | { | 432 | { |
433 | QString s; | 433 | QString s; |
434 | 434 | ||
435 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) | 435 | if ( m_bgtype-> id ( m_bgtype-> selected ( )) != t ) |
436 | m_bgtype-> setButton ( t ); | 436 | m_bgtype-> setButton ( t ); |
437 | 437 | ||
438 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); | 438 | m_solidcolor-> setEnabled ( t == TabConfig::SolidColor ); |
439 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); | 439 | m_imagebrowse-> setEnabled ( t == TabConfig::Image ); |
440 | 440 | ||
441 | if ( t == TabConfig::SolidColor ) | 441 | if ( t == TabConfig::SolidColor ) |
442 | s = m_solidcolor-> color ( ). name ( ); | 442 | s = m_solidcolor-> color ( ). name ( ); |
443 | else if ( t == TabConfig::Image ) | 443 | else if ( t == TabConfig::Image ) |
444 | s = Resource::findPixmap ( m_bgimage ); | 444 | s = Resource::findPixmap ( m_bgimage ); |
445 | 445 | ||
446 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); | 446 | m_sample-> setBackgroundType ((TabConfig::BackgroundType) t, s ); |
447 | } | 447 | } |
448 | 448 | ||
449 | void TabDialog::bgColorClicked ( const QColor & ) | 449 | void TabDialog::bgColorClicked ( const QColor & ) |
450 | { | 450 | { |
451 | bgTypeClicked ( TabConfig::SolidColor ); | 451 | bgTypeClicked ( TabConfig::SolidColor ); |
452 | } | 452 | } |
453 | 453 | ||
454 | void TabDialog::iconColorClicked ( const QColor &col ) | 454 | void TabDialog::iconColorClicked ( const QColor &col ) |
455 | { | 455 | { |
456 | m_sample-> setTextColor ( col ); | 456 | m_sample-> setTextColor ( col ); |
457 | } | 457 | } |
458 | 458 | ||
459 | void TabDialog::bgImageClicked ( ) | 459 | void TabDialog::bgImageClicked ( ) |
460 | { | 460 | { |
461 | // ### use OFileSelector here ### | 461 | // ### use OFileSelector here ### |
462 | // this is just a quick c&p from the old appearance app | 462 | // this is just a quick c&p from the old appearance app |
463 | 463 | ||
464 | MimeTypes types; | 464 | MimeTypes types; |
465 | QStringList list; | 465 | QStringList list; |
466 | list << "image/*"; | 466 | list << "image/*"; |
467 | types. insert ( "Images", list ); | 467 | types. insert ( "Images", list ); |
468 | 468 | ||
469 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); | 469 | QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); |
470 | if ( !file. isEmpty ( )) { | 470 | if ( !file. isEmpty ( )) { |
471 | m_bgimage = DocLnk ( file ). file ( ); | 471 | m_bgimage = DocLnk ( file ). file ( ); |
472 | bgTypeClicked ( TabConfig::Image ); | 472 | bgTypeClicked ( TabConfig::Image ); |
473 | } | 473 | } |
474 | } | 474 | } |
475 | 475 | ||
476 | void TabDialog::bgDefaultClicked ( ) | 476 | void TabDialog::bgDefaultClicked ( ) |
477 | { | 477 | { |
478 | m_bgimage = "launcher/opie-background"; | 478 | m_bgimage = "launcher/opie-background"; |
479 | bgTypeClicked ( TabConfig::Image ); | 479 | bgTypeClicked ( TabConfig::Image ); |
480 | } | 480 | } |
481 | 481 | ||
482 | void TabDialog::accept ( ) | 482 | void TabDialog::accept ( ) |
483 | { | 483 | { |
484 | m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); | 484 | m_tc. m_view = (TabConfig::ViewMode) m_iconsize-> id ( m_iconsize-> selected ( )); |
485 | m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); | 485 | m_tc. m_bg_type = (TabConfig::BackgroundType) m_bgtype-> id ( m_bgtype-> selected ( )); |
486 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); | 486 | m_tc. m_bg_color = m_solidcolor-> color ( ). name ( ); |
487 | m_tc. m_bg_image = m_bgimage; | 487 | m_tc. m_bg_image = m_bgimage; |
488 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); | 488 | m_tc. m_text_color = m_iconcolor-> color ( ). name ( ); |
489 | 489 | ||
490 | QFont f = m_fontselect-> selectedFont ( ); | 490 | QFont f = m_fontselect-> selectedFont ( ); |
491 | 491 | ||
492 | m_tc. m_font_family = f. family ( ); | 492 | m_tc. m_font_family = f. family ( ); |
493 | m_tc. m_font_size = f. pointSize ( ); | 493 | m_tc. m_font_size = f. pointSize ( ); |
494 | m_tc. m_font_weight = f. weight ( ); | 494 | m_tc. m_font_weight = f. weight ( ); |
495 | m_tc. m_font_italic = f. italic ( ); | 495 | m_tc. m_font_italic = f. italic ( ); |
496 | 496 | ||
497 | QDialog::accept ( ); | 497 | QDialog::accept ( ); |
498 | } | 498 | } |
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 | |||
@@ -1,589 +1,589 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the OPIE Project | 2 | This file is part of the OPIE Project |
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> |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This file is free software; you can | 7 | _;:, .> :=|. This file is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This file is distributed in the hope that | 14 | .i_,=:_. -<s. This file is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
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 |
22 | -. .:....=;==+<; General Public License along with this file; | 22 | -. .:....=;==+<; General Public License along with this file; |
23 | -_. . . )=. = see the file COPYING. If not, write to the | 23 | -_. . . )=. = see the file COPYING. If not, write to the |
24 | -- :-=` Free Software Foundation, Inc., | 24 | -- :-=` Free Software Foundation, Inc., |
25 | 59 Temple Place - Suite 330, | 25 | 59 Temple Place - Suite 330, |
26 | Boston, MA 02111-1307, USA. | 26 | Boston, MA 02111-1307, USA. |
27 | 27 | ||
28 | */ | 28 | */ |
29 | 29 | ||
30 | #include "appearance.h" | 30 | #include "appearance.h" |
31 | #include "editScheme.h" | 31 | #include "editScheme.h" |
32 | 32 | ||
33 | #include <opie/ofiledialog.h> | 33 | #include <opie/ofiledialog.h> |
34 | #include <opie/otabwidget.h> | 34 | #include <opie/otabwidget.h> |
35 | 35 | ||
36 | #include <qpe/applnk.h> | 36 | #include <qpe/applnk.h> |
37 | #include <qpe/config.h> | 37 | #include <qpe/config.h> |
38 | #include <qpe/global.h> | 38 | #include <qpe/global.h> |
39 | #include <qpe/resource.h> | 39 | #include <qpe/resource.h> |
40 | #include <qpe/qpeapplication.h> | 40 | #include <qpe/qpeapplication.h> |
41 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 41 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
42 | #include <qpe/qcopenvelope_qws.h> | 42 | #include <qpe/qcopenvelope_qws.h> |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | #include <qaction.h> | 45 | #include <qaction.h> |
46 | #include <qbuttongroup.h> | 46 | #include <qbuttongroup.h> |
47 | #include <qcheckbox.h> | 47 | #include <qcheckbox.h> |
48 | #include <qcombobox.h> | 48 | #include <qcombobox.h> |
49 | #include <qdialog.h> | 49 | #include <qdialog.h> |
50 | #include <qdir.h> | 50 | #include <qdir.h> |
51 | #include <qlabel.h> | 51 | #include <qlabel.h> |
52 | #include <qlayout.h> | 52 | #include <qlayout.h> |
53 | #include <qlineedit.h> | 53 | #include <qlineedit.h> |
54 | #include <qlistbox.h> | 54 | #include <qlistbox.h> |
55 | #include <qmessagebox.h> | 55 | #include <qmessagebox.h> |
56 | #include <qmultilineedit.h> | 56 | #include <qmultilineedit.h> |
57 | #include <qpopupmenu.h> | 57 | #include <qpopupmenu.h> |
58 | #include <qpushbutton.h> | 58 | #include <qpushbutton.h> |
59 | #include <qradiobutton.h> | 59 | #include <qradiobutton.h> |
60 | #if QT_VERSION >= 300 | 60 | #if QT_VERSION >= 300 |
61 | #include <qstylefactory.h> | 61 | #include <qstylefactory.h> |
62 | #else | 62 | #else |
63 | #include <qwindowsstyle.h> | 63 | #include <qwindowsstyle.h> |
64 | #include <qpe/qpestyle.h> | 64 | #include <qpe/qpestyle.h> |
65 | #include <qpe/lightstyle.h> | 65 | #include <qpe/lightstyle.h> |
66 | #include <qpe/qlibrary.h> | 66 | #include <qpe/qlibrary.h> |
67 | #include <qpe/styleinterface.h> | 67 | #include <qpe/styleinterface.h> |
68 | #endif | 68 | #endif |
69 | #include <qtabwidget.h> | 69 | #include <qtabwidget.h> |
70 | #include <qtoolbutton.h> | 70 | #include <qtoolbutton.h> |
71 | #include <qvgroupbox.h> | 71 | #include <qvgroupbox.h> |
72 | #include <qwidget.h> | 72 | #include <qwidget.h> |
73 | 73 | ||
74 | #include "stylelistitem.h" | 74 | #include "stylelistitem.h" |
75 | #include "decolistitem.h" | 75 | #include "decolistitem.h" |
76 | #include "colorlistitem.h" | 76 | #include "colorlistitem.h" |
77 | 77 | ||
78 | #include "sample.h" | 78 | #include "sample.h" |
79 | 79 | ||
80 | #include <opie/ofontselector.h> | 80 | #include <opie/ofontselector.h> |
81 | 81 | ||
82 | 82 | ||
83 | class DefaultWindowDecoration : public WindowDecorationInterface | 83 | class DefaultWindowDecoration : public WindowDecorationInterface |
84 | { | 84 | { |
85 | public: | 85 | public: |
86 | DefaultWindowDecoration() : ref(0) {} | 86 | DefaultWindowDecoration() : ref(0) {} |
87 | QString name() const { | 87 | QString name() const { |
88 | return "Default"; | 88 | return "Default"; |
89 | } | 89 | } |
90 | QPixmap icon() const { | 90 | QPixmap icon() const { |
91 | return QPixmap(); | 91 | return QPixmap(); |
92 | } | 92 | } |
93 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { | 93 | QRESULT queryInterface( const QUuid &uuid, QUnknownInterface **iface ) { |
94 | *iface = 0; | 94 | *iface = 0; |
95 | if ( uuid == IID_QUnknown ) | 95 | if ( uuid == IID_QUnknown ) |
96 | *iface = this; | 96 | *iface = this; |
97 | else if ( uuid == IID_WindowDecoration ) | 97 | else if ( uuid == IID_WindowDecoration ) |
98 | *iface = this; | 98 | *iface = this; |
99 | 99 | ||
100 | if ( *iface ) | 100 | if ( *iface ) |
101 | (*iface)->addRef(); | 101 | (*iface)->addRef(); |
102 | return QS_OK; | 102 | return QS_OK; |
103 | } | 103 | } |
104 | Q_REFCOUNT | 104 | Q_REFCOUNT |
105 | 105 | ||
106 | private: | 106 | private: |
107 | ulong ref; | 107 | ulong ref; |
108 | }; | 108 | }; |
109 | 109 | ||
110 | 110 | ||
111 | 111 | ||
112 | void Appearance::loadStyles ( QListBox *list ) | 112 | void Appearance::loadStyles ( QListBox *list ) |
113 | { | 113 | { |
114 | #if QT_VERSION >= 300 | 114 | #if QT_VERSION >= 300 |
115 | list->insertStringList(QStyleFactory::styles()); | 115 | list->insertStringList(QStyleFactory::styles()); |
116 | #else | 116 | #else |
117 | list->insertItem( new StyleListItem ( "Windows", new QWindowsStyle ( ))); | 117 | list->insertItem( new StyleListItem ( "Windows", new QWindowsStyle ( ))); |
118 | list->insertItem( new StyleListItem ( "Light", new LightStyle ( ))); | 118 | list->insertItem( new StyleListItem ( "Light", new LightStyle ( ))); |
119 | #ifndef QT_NO_STYLE_MOTIF | 119 | #ifndef QT_NO_STYLE_MOTIF |
120 | list->insertItem( new StyleListItem ( "Motif", new QMotifStyle ( ))); | 120 | list->insertItem( new StyleListItem ( "Motif", new QMotifStyle ( ))); |
121 | #endif | 121 | #endif |
122 | #ifndef QT_NO_STYLE_MOTIFPLUS | 122 | #ifndef QT_NO_STYLE_MOTIFPLUS |
123 | list->insertItem( new StyleListItem ( "MotifPlus", new QMotifPlusStyle ( ))); | 123 | list->insertItem( new StyleListItem ( "MotifPlus", new QMotifPlusStyle ( ))); |
124 | #endif | 124 | #endif |
125 | #ifndef QT_NO_STYLE_PLATINUM | 125 | #ifndef QT_NO_STYLE_PLATINUM |
126 | list->insertItem( new StyleListItem ( "Platinum", new QPlatinumStyle ( ))); | 126 | list->insertItem( new StyleListItem ( "Platinum", new QPlatinumStyle ( ))); |
127 | #endif | 127 | #endif |
128 | #endif | 128 | #endif |
129 | list->insertItem( new StyleListItem ( "QPE", new QPEStyle ( ))); | 129 | list->insertItem( new StyleListItem ( "QPE", new QPEStyle ( ))); |
130 | 130 | ||
131 | #if QT_VERSION < 300 | 131 | #if QT_VERSION < 300 |
132 | { | 132 | { |
133 | QString path = QPEApplication::qpeDir() + "/plugins/styles/"; | 133 | QString path = QPEApplication::qpeDir() + "/plugins/styles/"; |
134 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 134 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
135 | 135 | ||
136 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { | 136 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) { |
137 | QLibrary *lib = new QLibrary ( path + "/" + *it ); | 137 | QLibrary *lib = new QLibrary ( path + "/" + *it ); |
138 | StyleInterface *iface; | 138 | StyleInterface *iface; |
139 | 139 | ||
140 | if ( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) | 140 | if ( lib-> queryInterface ( IID_Style, (QUnknownInterface **) &iface ) == QS_OK ) |
141 | list-> insertItem ( new StyleListItem ( lib, iface )); | 141 | list-> insertItem ( new StyleListItem ( lib, iface )); |
142 | else | 142 | else |
143 | delete lib; | 143 | delete lib; |
144 | } | 144 | } |
145 | } | 145 | } |
146 | 146 | ||
147 | #endif | 147 | #endif |
148 | } | 148 | } |
149 | 149 | ||
150 | void Appearance::loadDecos ( QListBox *list ) | 150 | void Appearance::loadDecos ( QListBox *list ) |
151 | { | 151 | { |
152 | list-> insertItem ( new DecoListItem ( tr( "Default" ))); | 152 | list-> insertItem ( new DecoListItem ( tr( "Default" ))); |
153 | 153 | ||
154 | { | 154 | { |
155 | QString path = QPEApplication::qpeDir() + "/plugins/decorations/"; | 155 | QString path = QPEApplication::qpeDir() + "/plugins/decorations/"; |
156 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); | 156 | QStringList sl = QDir ( path, "lib*.so" ). entryList ( ); |
157 | 157 | ||
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 | ||
170 | void Appearance::loadColors ( QListBox *list ) | 170 | void 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 | ||
193 | QWidget *Appearance::createStyleTab ( QWidget *parent ) | 193 | QWidget *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 | ||
220 | QWidget *Appearance::createDecoTab ( QWidget *parent ) | 220 | QWidget *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 | ||
245 | QWidget *Appearance::createFontTab ( QWidget *parent ) | 245 | QWidget *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 | ||
263 | QWidget *Appearance::createColorTab ( QWidget *parent ) | 263 | QWidget *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 | ||
298 | QWidget *Appearance::createGuiTab ( QWidget *parent ) | 298 | QWidget *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 | ||
343 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 343 | Appearance::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 | ||
351 | QVBoxLayout *top = new QVBoxLayout ( this, 4, 4 ); | 351 | QVBoxLayout *top = new QVBoxLayout ( this, 4, 4 ); |
352 | 352 | ||
353 | m_sample = new SampleWindow ( this ); | 353 | m_sample = new SampleWindow ( this ); |
354 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 354 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
355 | 355 | ||
356 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 356 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
357 | QWidget *styletab; | 357 | QWidget *styletab; |
358 | 358 | ||
359 | tw-> addTab ( styletab = createStyleTab ( tw ), "appearance/styletabicon.png", tr( "Style" )); | 359 | tw-> addTab ( styletab = createStyleTab ( tw ), "appearance/styletabicon.png", tr( "Style" )); |
360 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); | 360 | tw-> addTab ( createFontTab ( tw ), "appearance/fonttabicon.png", tr( "Font" )); |
361 | tw-> addTab ( createColorTab ( tw ), "appearance/colorstabicon.png", tr( "Colors" ) ); | 361 | tw-> addTab ( createColorTab ( tw ), "appearance/colorstabicon.png", tr( "Colors" ) ); |
362 | tw-> addTab ( createDecoTab ( tw ), "appearance/styletabicon.png", tr( "Windows" ) ); | 362 | tw-> addTab ( createDecoTab ( tw ), "appearance/styletabicon.png", tr( "Windows" ) ); |
363 | tw-> addTab ( createGuiTab ( tw ), "appearance/backgroundtabicon.png", tr( "Gui" ) ); | 363 | tw-> addTab ( createGuiTab ( tw ), "appearance/backgroundtabicon.png", tr( "Gui" ) ); |
364 | 364 | ||
365 | top-> addWidget ( tw, 10 ); | 365 | top-> addWidget ( tw, 10 ); |
366 | top-> addWidget ( m_sample, 1 ); | 366 | top-> addWidget ( m_sample, 1 ); |
367 | 367 | ||
368 | tw-> setCurrentTab ( styletab ); | 368 | tw-> setCurrentTab ( styletab ); |
369 | } | 369 | } |
370 | 370 | ||
371 | Appearance::~Appearance() | 371 | Appearance::~Appearance() |
372 | { | 372 | { |
373 | } | 373 | } |
374 | 374 | ||
375 | void Appearance::accept ( ) | 375 | void Appearance::accept ( ) |
376 | { | 376 | { |
377 | Config config("qpe"); | 377 | Config config("qpe"); |
378 | config.setGroup( "Appearance" ); | 378 | config.setGroup( "Appearance" ); |
379 | 379 | ||
380 | int newtabstyle = m_tabstyle_list-> currentItem ( ); | 380 | int newtabstyle = m_tabstyle_list-> currentItem ( ); |
381 | bool newtabpos = m_tabstyle_top-> isChecked ( ); | 381 | bool newtabpos = m_tabstyle_top-> isChecked ( ); |
382 | 382 | ||
383 | 383 | ||
384 | if ( m_style_changed ) { | 384 | if ( m_style_changed ) { |
385 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 385 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
386 | if ( item ) | 386 | if ( item ) |
387 | config.writeEntry( "Style", item-> key ( )); | 387 | config.writeEntry( "Style", item-> key ( )); |
388 | } | 388 | } |
389 | 389 | ||
390 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { | 390 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) { |
391 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); | 391 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); |
392 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); | 392 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); |
393 | } | 393 | } |
394 | 394 | ||
395 | if ( m_font_changed ) { | 395 | if ( m_font_changed ) { |
396 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); | 396 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); |
397 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); | 397 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); |
398 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); | 398 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); |
399 | } | 399 | } |
400 | 400 | ||
401 | 401 | ||
402 | if ( m_color_changed ) | 402 | if ( m_color_changed ) |
403 | { | 403 | { |
404 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 404 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
405 | 405 | ||
406 | if ( item ) | 406 | if ( item ) |
407 | item-> save ( config ); | 407 | item-> save ( config ); |
408 | } | 408 | } |
409 | 409 | ||
410 | config. write ( ); // need to flush the config info first | 410 | config. write ( ); // need to flush the config info first |
411 | Global::applyStyle ( ); | 411 | Global::applyStyle ( ); |
412 | 412 | ||
413 | if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart Opie now?" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { | 413 | if ( QMessageBox::warning ( this, tr( "Restart" ), tr( "Do you want to restart Opie now?" ), tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { |
414 | QCopEnvelope e( "QPE/System", "restart()" ); | 414 | QCopEnvelope e( "QPE/System", "restart()" ); |
415 | } | 415 | } |
416 | 416 | ||
417 | QDialog::accept ( ); | 417 | QDialog::accept ( ); |
418 | } | 418 | } |
419 | 419 | ||
420 | void Appearance::done ( int r ) | 420 | void Appearance::done ( int r ) |
421 | { | 421 | { |
422 | QDialog::done ( r ); | 422 | QDialog::done ( r ); |
423 | close ( ); | 423 | close ( ); |
424 | } | 424 | } |
425 | 425 | ||
426 | 426 | ||
427 | void Appearance::styleClicked ( int index ) | 427 | void Appearance::styleClicked ( int index ) |
428 | { | 428 | { |
429 | StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index ); | 429 | StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index ); |
430 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); | 430 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); |
431 | 431 | ||
432 | if ( m_sample && sli && sli-> style ( )) | 432 | if ( m_sample && sli && sli-> style ( )) |
433 | m_sample-> setStyle2 ( sli-> style ( )); | 433 | m_sample-> setStyle2 ( sli-> style ( )); |
434 | 434 | ||
435 | m_style_changed |= ( index != m_original_style ); | 435 | m_style_changed |= ( index != m_original_style ); |
436 | } | 436 | } |
437 | 437 | ||
438 | void Appearance::styleSettingsClicked ( ) | 438 | void Appearance::styleSettingsClicked ( ) |
439 | { | 439 | { |
440 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 440 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
441 | 441 | ||
442 | if ( item && item-> hasSettings ( )) { | 442 | if ( item && item-> hasSettings ( )) { |
443 | QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); | 443 | QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); |
444 | QVBoxLayout *vbox = new QVBoxLayout ( d, 4, 0 ); | 444 | QVBoxLayout *vbox = new QVBoxLayout ( d, 4, 0 ); |
445 | 445 | ||
446 | QWidget *w = item-> settings ( d ); | 446 | QWidget *w = item-> settings ( d ); |
447 | 447 | ||
448 | if ( w ) { | 448 | if ( w ) { |
449 | vbox-> addWidget ( w ); | 449 | vbox-> addWidget ( w ); |
450 | 450 | ||
451 | d-> setCaption ( w-> caption ( )); | 451 | d-> setCaption ( w-> caption ( )); |
452 | 452 | ||
453 | d-> showMaximized ( ); | 453 | d-> showMaximized ( ); |
454 | bool accepted = ( d-> exec ( ) == QDialog::Accepted ); | 454 | bool accepted = ( d-> exec ( ) == QDialog::Accepted ); |
455 | 455 | ||
456 | if ( item-> setSettings ( accepted )) | 456 | if ( item-> setSettings ( accepted )) |
457 | m_style_changed = true; | 457 | m_style_changed = true; |
458 | } | 458 | } |
459 | delete d; | 459 | delete d; |
460 | } | 460 | } |
461 | } | 461 | } |
462 | 462 | ||
463 | void Appearance::decoClicked ( int index ) | 463 | void Appearance::decoClicked ( int index ) |
464 | { | 464 | { |
465 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); | 465 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); |
466 | 466 | ||
467 | if ( m_sample ) { | 467 | if ( m_sample ) { |
468 | if ( dli && dli-> interface ( )) | 468 | if ( dli && dli-> interface ( )) |
469 | m_sample-> setDecoration ( dli-> interface ( )); | 469 | m_sample-> setDecoration ( dli-> interface ( )); |
470 | else | 470 | else |
471 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 471 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
472 | } | 472 | } |
473 | m_deco_changed |= ( index != m_original_deco ); | 473 | m_deco_changed |= ( index != m_original_deco ); |
474 | } | 474 | } |
475 | 475 | ||
476 | void Appearance::fontClicked ( const QFont &f ) | 476 | void Appearance::fontClicked ( const QFont &f ) |
477 | { | 477 | { |
478 | m_font_changed |= ( f != m_sample-> font ( )); | 478 | m_font_changed |= ( f != m_sample-> font ( )); |
479 | m_sample-> setFont ( f ); | 479 | m_sample-> setFont ( f ); |
480 | } | 480 | } |
481 | 481 | ||
482 | void Appearance::colorClicked ( int index ) | 482 | void Appearance::colorClicked ( int index ) |
483 | { | 483 | { |
484 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( index ); | 484 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( index ); |
485 | 485 | ||
486 | if ( item ) | 486 | if ( item ) |
487 | m_sample-> setPalette ( item-> palette ( )); | 487 | m_sample-> setPalette ( item-> palette ( )); |
488 | 488 | ||
489 | m_color_changed |= ( item-> palette ( ) != qApp-> palette ( )); | 489 | m_color_changed |= ( item-> palette ( ) != qApp-> palette ( )); |
490 | } | 490 | } |
491 | 491 | ||
492 | 492 | ||
493 | void Appearance::editSchemeClicked ( ) | 493 | void Appearance::editSchemeClicked ( ) |
494 | { | 494 | { |
495 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 495 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
496 | 496 | ||
497 | int cnt = 0; | 497 | int cnt = 0; |
498 | QString labels [QColorGroup::NColorRoles]; | 498 | QString labels [QColorGroup::NColorRoles]; |
499 | QColor colors [QColorGroup::NColorRoles]; | 499 | QColor colors [QColorGroup::NColorRoles]; |
500 | 500 | ||
501 | for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { | 501 | for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { |
502 | QColor col = item-> color ( role ); | 502 | QColor col = item-> color ( role ); |
503 | 503 | ||
504 | if ( col. isValid ( )) { | 504 | if ( col. isValid ( )) { |
505 | labels [cnt] = item-> label ( role ); | 505 | labels [cnt] = item-> label ( role ); |
506 | colors [cnt] = col; | 506 | colors [cnt] = col; |
507 | 507 | ||
508 | cnt++; | 508 | cnt++; |
509 | } | 509 | } |
510 | } | 510 | } |
511 | 511 | ||
512 | EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true ); | 512 | EditScheme* editdlg = new EditScheme( cnt, labels, colors, this, "editScheme", true ); |
513 | editdlg-> showMaximized ( ); | 513 | editdlg-> showMaximized ( ); |
514 | if ( editdlg-> exec ( ) == QDialog::Accepted ) { | 514 | if ( editdlg-> exec ( ) == QDialog::Accepted ) { |
515 | ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 ); | 515 | ColorListItem *citem = (ColorListItem *) m_color_list-> item ( 0 ); |
516 | cnt = 0; | 516 | cnt = 0; |
517 | 517 | ||
518 | for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { | 518 | for ( QColorGroup::ColorRole role = (QColorGroup::ColorRole) 0; role != QColorGroup::NColorRoles; ((int) role )++ ) { |
519 | if ( item-> color ( role ). isValid ( )) { | 519 | if ( item-> color ( role ). isValid ( )) { |
520 | citem-> setColor ( role, colors [cnt] ); | 520 | citem-> setColor ( role, colors [cnt] ); |
521 | cnt++; | 521 | cnt++; |
522 | } | 522 | } |
523 | } | 523 | } |
524 | 524 | ||
525 | m_color_list-> setCurrentItem ( 0 ); | 525 | m_color_list-> setCurrentItem ( 0 ); |
526 | colorClicked ( 0 ); | 526 | colorClicked ( 0 ); |
527 | 527 | ||
528 | m_color_changed = true; | 528 | m_color_changed = true; |
529 | } | 529 | } |
530 | delete editdlg; | 530 | delete editdlg; |
531 | } | 531 | } |
532 | 532 | ||
533 | 533 | ||
534 | void Appearance::saveSchemeClicked() | 534 | void Appearance::saveSchemeClicked() |
535 | { | 535 | { |
536 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 536 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
537 | 537 | ||
538 | if ( !item ) | 538 | if ( !item ) |
539 | return; | 539 | return; |
540 | 540 | ||
541 | QDialog *d = new QDialog ( this, 0, true ); | 541 | QDialog *d = new QDialog ( this, 0, true ); |
542 | d-> setCaption ( tr( "Save Scheme" )); | 542 | d-> setCaption ( tr( "Save Scheme" )); |
543 | QLineEdit *ed = new QLineEdit ( this ); | 543 | QLineEdit *ed = new QLineEdit ( this ); |
544 | ( new QVBoxLayout ( d, 4, 4 ))-> addWidget ( ed ); | 544 | ( new QVBoxLayout ( d, 4, 4 ))-> addWidget ( ed ); |
545 | 545 | ||
546 | if ( d-> exec ( ) == QDialog::Accepted ) { | 546 | if ( d-> exec ( ) == QDialog::Accepted ) { |
547 | QString schemename = ed-> text ( ); | 547 | QString schemename = ed-> text ( ); |
548 | QFile file ( QPEApplication::qpeDir() + "/etc/colors/" + schemename + ".scheme" ); | 548 | QFile file ( QPEApplication::qpeDir() + "/etc/colors/" + schemename + ".scheme" ); |
549 | if ( !file. exists ( )) | 549 | if ( !file. exists ( )) |
550 | { | 550 | { |
551 | QPalette p = item-> palette ( ); | 551 | QPalette p = item-> palette ( ); |
552 | 552 | ||
553 | Config config ( file.name(), Config::File ); | 553 | Config config ( file.name(), Config::File ); |
554 | config. setGroup( "Colors" ); | 554 | config. setGroup( "Colors" ); |
555 | 555 | ||
556 | item-> save ( config ); | 556 | item-> save ( config ); |
557 | 557 | ||
558 | config. write ( ); // need to flush the config info first | 558 | config. write ( ); // need to flush the config info first |
559 | loadColors ( m_color_list ); | 559 | loadColors ( m_color_list ); |
560 | } | 560 | } |
561 | else | 561 | else |
562 | { | 562 | { |
563 | QMessageBox::information ( this, tr( "Save scheme" ), tr( "Scheme does already exist." )); | 563 | QMessageBox::information ( this, tr( "Save scheme" ), tr( "Scheme does already exist." )); |
564 | } | 564 | } |
565 | } | 565 | } |
566 | delete d; | 566 | delete d; |
567 | } | 567 | } |
568 | 568 | ||
569 | void Appearance::deleteSchemeClicked() | 569 | void Appearance::deleteSchemeClicked() |
570 | { | 570 | { |
571 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 571 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
572 | 572 | ||
573 | if ( !item ) | 573 | if ( !item ) |
574 | return; | 574 | return; |
575 | 575 | ||
576 | if ( m_color_list-> currentItem ( ) > 0 ) | 576 | if ( m_color_list-> currentItem ( ) > 0 ) |
577 | { | 577 | { |
578 | if ( QMessageBox::warning ( this, tr( "Delete scheme" ), tr( "Do you really want to delete\n" ) + item-> text ( ) + "?", | 578 | if ( QMessageBox::warning ( this, tr( "Delete scheme" ), tr( "Do you really want to delete\n" ) + item-> text ( ) + "?", |
579 | tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { | 579 | tr( "Yes" ), tr( "No" ), 0, 0, 1 ) == 0 ) { |
580 | QFile::remove ( QPEApplication::qpeDir ( ) + "/etc/colors/" + item-> text ( ) + ".scheme" ); | 580 | QFile::remove ( QPEApplication::qpeDir ( ) + "/etc/colors/" + item-> text ( ) + ".scheme" ); |
581 | loadColors ( m_color_list ); | 581 | loadColors ( m_color_list ); |
582 | } | 582 | } |
583 | } | 583 | } |
584 | else | 584 | else |
585 | { | 585 | { |
586 | QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." )); | 586 | QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." )); |
587 | } | 587 | } |
588 | } | 588 | } |
589 | 589 | ||