author | paule <paule> | 2007-06-20 10:45:17 (UTC) |
---|---|---|
committer | paule <paule> | 2007-06-20 10:45:17 (UTC) |
commit | a5bdee12917db73cb6dbc64f3b53516e0d396007 (patch) (unidiff) | |
tree | 25ba65aee25963f05750e953ba3e9e2fed2269fd | |
parent | accbef5e0097a32847dfbaff9f2abfbf39f7595d (diff) | |
download | opie-a5bdee12917db73cb6dbc64f3b53516e0d396007.zip opie-a5bdee12917db73cb6dbc64f3b53516e0d396007.tar.gz opie-a5bdee12917db73cb6dbc64f3b53516e0d396007.tar.bz2 |
Fix incorrect device icons being shown for certain devices, and add new icons for various Palm models. Original patch by Marek Va?ut (Marex) <marek.vasut@gmail.com> (fixes bug #1857)
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 197 |
1 files changed, 169 insertions, 28 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index 5105b42..0b6883d 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -96,94 +96,235 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | |||
96 | palmtopLogo->setPixmap( logo1Pixmap ); | 96 | palmtopLogo->setPixmap( logo1Pixmap ); |
97 | palmtopLogo->setFixedSize( 60, 60 ); | 97 | palmtopLogo->setFixedSize( 60, 60 ); |
98 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 98 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
99 | 99 | ||
100 | QLabel *palmtopVersion = new QLabel( container ); | 100 | QLabel *palmtopVersion = new QLabel( container ); |
101 | palmtopVersion->setText( palmtopVersionString ); | 101 | palmtopVersion->setText( palmtopVersionString ); |
102 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 102 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
103 | 103 | ||
104 | 104 | ||
105 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); | 105 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); |
106 | hb1->setSpacing( 2 ); | 106 | hb1->setSpacing( 2 ); |
107 | 107 | ||
108 | QLabel *linuxLogo = new QLabel( container ); | 108 | QLabel *linuxLogo = new QLabel( container ); |
109 | QImage logo2 = Opie::Core::OResource::loadImage( "logo/tux-logo" ); | 109 | QImage logo2 = Opie::Core::OResource::loadImage( "logo/tux-logo" ); |
110 | logo2 = logo2.smoothScale( 55, 60 ); | 110 | logo2 = logo2.smoothScale( 55, 60 ); |
111 | QPixmap logo2Pixmap; | 111 | QPixmap logo2Pixmap; |
112 | logo2Pixmap.convertFromImage( logo2 ); | 112 | logo2Pixmap.convertFromImage( logo2 ); |
113 | linuxLogo->setPixmap( logo2Pixmap ); | 113 | linuxLogo->setPixmap( logo2Pixmap ); |
114 | linuxLogo->setFixedSize( 60, 60 ); | 114 | linuxLogo->setFixedSize( 60, 60 ); |
115 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 115 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
116 | 116 | ||
117 | QLabel *kernelVersion = new QLabel( container ); | 117 | QLabel *kernelVersion = new QLabel( container ); |
118 | kernelVersion->setText( kernelVersionString ); | 118 | kernelVersion->setText( kernelVersionString ); |
119 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 119 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
120 | 120 | ||
121 | 121 | ||
122 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); | 122 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); |
123 | hb3->setSpacing( 2 ); | 123 | hb3->setSpacing( 2 ); |
124 | 124 | ||
125 | QLabel *palmtopLogo3 = new QLabel( container ); | 125 | QLabel *palmtopLogo3 = new QLabel( container ); |
126 | 126 | ||
127 | OModel model = ODevice::inst()->model(); | 127 | OModel model = ODevice::inst()->model(); |
128 | OVendor vendor = ODevice::inst()->vendor(); | ||
128 | QString modelPixmap = "sysinfo/"; | 129 | QString modelPixmap = "sysinfo/"; |
129 | if ( model == Model_Zaurus_SLC7x0 ) | ||
130 | modelPixmap += "zaurusc700"; | ||
131 | else if ( model >= Model_Zaurus_SL5000 && model <= Model_Zaurus_SLB600 ) | ||
132 | modelPixmap += "zaurus5500"; | ||
133 | else if ( model >= Model_iPAQ_H31xx && model <= Model_iPAQ_H5xxx ) | ||
134 | modelPixmap += "ipaq3600"; | ||
135 | else if ( model >= Model_SIMpad_CL4 && model <= Model_SIMpad_TSinus ) | ||
136 | modelPixmap += "simpad"; | ||
137 | else if ( model == Model_Jornada_56x ) | ||
138 | modelPixmap += "jornada56x"; | ||
139 | else if ( model == Model_Jornada_720 ) | ||
140 | modelPixmap += "jornada720"; | ||
141 | else if ( model == Model_HTC_Universal ) | ||
142 | modelPixmap += "htcuniversal"; | ||
143 | else if ( model == Model_HTC_Blueangel ) | ||
144 | modelPixmap += "htcblueangel"; | ||
145 | else if ( model == Model_HTC_Apache ) | ||
146 | modelPixmap += "htcapache"; | ||
147 | else if ( model == Model_HTC_Magician ) | ||
148 | modelPixmap += "htcmagician"; | ||
149 | else if ( model == Model_HTC_Himalaya ) | ||
150 | modelPixmap += "htchimalaya"; | ||
151 | else if ( model == Model_HTC_Alpine ) | ||
152 | modelPixmap += "htcalpine"; | ||
153 | else if ( model == Model_HTC_Beetles ) | ||
154 | modelPixmap += "htcbeetles"; | ||
155 | else | ||
156 | modelPixmap += "pda"; | ||
157 | 130 | ||
131 | switch ( vendor ) { | ||
132 | /* SHARP */ | ||
133 | case Vendor_Sharp: | ||
134 | { | ||
135 | switch ( model ) { | ||
136 | /* ZAURUS */ | ||
137 | case Model_Zaurus_SLC7x0: | ||
138 | modelPixmap += "zaurusc700"; | ||
139 | break; | ||
140 | case Model_Zaurus_SL5000: | ||
141 | case Model_Zaurus_SL5500: | ||
142 | case Model_Zaurus_SLA300: | ||
143 | case Model_Zaurus_SLB600: | ||
144 | modelPixmap += "zaurus5500"; | ||
145 | break; | ||
146 | default: | ||
147 | modelPixmap += "pda"; | ||
148 | break; | ||
149 | } | ||
150 | break; | ||
151 | } | ||
152 | /* HP */ | ||
153 | case Vendor_HP: | ||
154 | { | ||
155 | switch ( model ) { | ||
156 | /* IPAQ */ | ||
157 | case Model_iPAQ_H31xx: | ||
158 | case Model_iPAQ_H36xx: | ||
159 | case Model_iPAQ_H37xx: | ||
160 | case Model_iPAQ_H38xx: | ||
161 | case Model_iPAQ_H39xx: | ||
162 | case Model_iPAQ_H5xxx: | ||
163 | modelPixmap += "ipaq3600"; | ||
164 | break; | ||
165 | /* JORNADA */ | ||
166 | case Model_Jornada_56x: | ||
167 | modelPixmap += "jornada56x"; | ||
168 | break; | ||
169 | case Model_Jornada_720: | ||
170 | modelPixmap += "jornada720"; | ||
171 | break; | ||
172 | default: | ||
173 | modelPixmap += "pda"; | ||
174 | break; | ||
175 | } | ||
176 | break; | ||
177 | } | ||
178 | /* SIEMENS */ | ||
179 | case Vendor_SIEMENS: | ||
180 | { | ||
181 | switch ( model ) | ||
182 | { | ||
183 | /* SIMPAD */ | ||
184 | case Model_SIMpad_CL4: | ||
185 | case Model_SIMpad_SL4: | ||
186 | case Model_SIMpad_SLC: | ||
187 | case Model_SIMpad_TSinus: | ||
188 | modelPixmap += "simpad"; | ||
189 | break; | ||
190 | default: | ||
191 | modelPixmap += "pda"; | ||
192 | break; | ||
193 | } | ||
194 | break; | ||
195 | } | ||
196 | /* HTC */ | ||
197 | case Vendor_HTC: | ||
198 | { | ||
199 | switch ( model ) { | ||
200 | case Model_HTC_Universal: | ||
201 | modelPixmap += "htcuniversal"; | ||
202 | break; | ||
203 | case Model_HTC_Blueangel: | ||
204 | modelPixmap += "htcblueangel"; | ||
205 | break; | ||
206 | case Model_HTC_Apache: | ||
207 | modelPixmap += "htcapache"; | ||
208 | break; | ||
209 | case Model_HTC_Magician: | ||
210 | modelPixmap += "htcmagician"; | ||
211 | break; | ||
212 | case Model_HTC_Himalaya: | ||
213 | modelPixmap += "htchimalaya"; | ||
214 | break; | ||
215 | case Model_HTC_Alpine: | ||
216 | modelPixmap += "htcalpine"; | ||
217 | break; | ||
218 | case Model_HTC_Beetles: | ||
219 | modelPixmap += "htcbeetles"; | ||
220 | break; | ||
221 | default: | ||
222 | modelPixmap += "pda"; | ||
223 | break; | ||
224 | } | ||
225 | break; | ||
226 | } | ||
227 | /* PALM */ | ||
228 | case Vendor_Palm: | ||
229 | { | ||
230 | switch ( model ) { | ||
231 | case Model_Palm_TT: | ||
232 | modelPixmap += "palmtt"; | ||
233 | break; | ||
234 | case Model_Palm_TT2: | ||
235 | modelPixmap += "palmtt2"; | ||
236 | break; | ||
237 | case Model_Palm_TT3: | ||
238 | modelPixmap += "palmtt3"; | ||
239 | break; | ||
240 | case Model_Palm_TT5: | ||
241 | modelPixmap += "palmtt5"; | ||
242 | break; | ||
243 | case Model_Palm_TE: | ||
244 | modelPixmap += "palmte"; | ||
245 | break; | ||
246 | case Model_Palm_TE2: | ||
247 | modelPixmap += "palmte2"; | ||
248 | break; | ||
249 | case Model_Palm_TC: | ||
250 | modelPixmap += "palmtc"; | ||
251 | break; | ||
252 | case Model_Palm_LD: | ||
253 | modelPixmap += "palmld"; | ||
254 | break; | ||
255 | case Model_Palm_TX: | ||
256 | modelPixmap += "palmtx"; | ||
257 | break; | ||
258 | case Model_Palm_Z71: | ||
259 | modelPixmap += "palmz71"; | ||
260 | break; | ||
261 | case Model_Palm_Z72: | ||
262 | modelPixmap += "palmz72"; | ||
263 | break; | ||
264 | case Model_Palm_T600: | ||
265 | modelPixmap += "palmt600"; | ||
266 | break; | ||
267 | case Model_Palm_T650: | ||
268 | modelPixmap += "palmt650"; | ||
269 | break; | ||
270 | case Model_Palm_T680: | ||
271 | modelPixmap += "palmt680"; | ||
272 | break; | ||
273 | case Model_Palm_T700W: | ||
274 | modelPixmap += "palmt700w"; | ||
275 | break; | ||
276 | case Model_Palm_T700P: | ||
277 | modelPixmap += "palmt700p"; | ||
278 | break; | ||
279 | case Model_Palm_T750: | ||
280 | modelPixmap += "palmt750"; | ||
281 | break; | ||
282 | case Model_Palm_T755P: | ||
283 | modelPixmap += "palmt755p"; | ||
284 | break; | ||
285 | case Model_Palm_FOLEO: | ||
286 | modelPixmap += "palmfoleo"; | ||
287 | break; | ||
288 | default: | ||
289 | modelPixmap += "pda"; | ||
290 | break; | ||
291 | } | ||
292 | break; | ||
293 | } | ||
294 | /* OTHER DEVICES */ | ||
295 | default: | ||
296 | modelPixmap += "pda"; | ||
297 | break; | ||
298 | } | ||
158 | QImage logo3 = Opie::Core::OResource::loadImage( modelPixmap ); | 299 | QImage logo3 = Opie::Core::OResource::loadImage( modelPixmap ); |
159 | 300 | ||
160 | int width = logo3.width(); | 301 | int width = logo3.width(); |
161 | int height = logo3.height(); | 302 | int height = logo3.height(); |
162 | float aspect = float( height ) / width; | 303 | float aspect = float( height ) / width; |
163 | logo3 = logo3.smoothScale( 50, 50.0 * aspect ); | 304 | logo3 = logo3.smoothScale( 50, 50.0 * aspect ); |
164 | 305 | ||
165 | QPixmap logo3Pixmap; | 306 | QPixmap logo3Pixmap; |
166 | logo3Pixmap.convertFromImage( logo3 ); | 307 | logo3Pixmap.convertFromImage( logo3 ); |
167 | palmtopLogo3->setPixmap( logo3Pixmap ); | 308 | palmtopLogo3->setPixmap( logo3Pixmap ); |
168 | palmtopLogo3->setFixedSize( 60, 100 ); | 309 | palmtopLogo3->setFixedSize( 60, 100 ); |
169 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); | 310 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); |
170 | 311 | ||
171 | QString systemString = "<qt><b>"; | 312 | QString systemString = "<qt><b>"; |
172 | systemString.append( ODevice::inst()->systemString() ); | 313 | systemString.append( ODevice::inst()->systemString() ); |
173 | systemString.append( "</b>" ); | 314 | systemString.append( "</b>" ); |
174 | systemString.append( tr( "<p>Version: " ) ); | 315 | systemString.append( tr( "<p>Version: " ) ); |
175 | systemString.append( ODevice::inst()->systemVersionString() ); | 316 | systemString.append( ODevice::inst()->systemVersionString() ); |
176 | systemString.append( tr( "<br>Model: " ) ); | 317 | systemString.append( tr( "<br>Model: " ) ); |
177 | systemString.append( ODevice::inst()->modelString() ); | 318 | systemString.append( ODevice::inst()->modelString() ); |
178 | systemString.append( tr( "<br>Vendor: " ) ); | 319 | systemString.append( tr( "<br>Vendor: " ) ); |
179 | systemString.append( ODevice::inst()->vendorString() ); | 320 | systemString.append( ODevice::inst()->vendorString() ); |
180 | systemString.append("</qt>"); | 321 | systemString.append("</qt>"); |
181 | 322 | ||
182 | QLabel *systemVersion = new QLabel( container ); | 323 | QLabel *systemVersion = new QLabel( container ); |
183 | systemVersion->setText( systemString ); | 324 | systemVersion->setText( systemString ); |
184 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 325 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
185 | 326 | ||
186 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); | 327 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); |
187 | } | 328 | } |
188 | 329 | ||
189 | VersionInfo::~VersionInfo() | 330 | VersionInfo::~VersionInfo() |