summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2003-12-06 03:03:59 (UTC)
committer mickeyl <mickeyl>2003-12-06 03:03:59 (UTC)
commit65ae9068fd4e489ecd7ac4d44d312951894f240a (patch) (unidiff)
tree334a0e44168a307c2926586a4a0ca281a51869ce
parent650d6e3ec023759f1c6566d7562857d8dd0e8028 (diff)
downloadopie-65ae9068fd4e489ecd7ac4d44d312951894f240a.zip
opie-65ae9068fd4e489ecd7ac4d44d312951894f240a.tar.gz
opie-65ae9068fd4e489ecd7ac4d44d312951894f240a.tar.bz2
fix 5x00 detection *yawn*
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index b3462f5..abb8d7f 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -1,175 +1,175 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/version.h> 22#include <qpe/version.h>
23 23
24#include <qfile.h> 24#include <qfile.h>
25#include <qimage.h> 25#include <qimage.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpixmap.h> 28#include <qpixmap.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qscrollview.h> 30#include <qscrollview.h>
31#include <qtextstream.h> 31#include <qtextstream.h>
32#include <qtimer.h> 32#include <qtimer.h>
33#include <qwhatsthis.h> 33#include <qwhatsthis.h>
34 34
35#include "versioninfo.h" 35#include "versioninfo.h"
36 36
37#include <opie/odevice.h> 37#include <opie/odevice.h>
38 38
39using namespace Opie; 39using namespace Opie;
40 40
41VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) 41VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
42 : QWidget( parent, name, f ) 42 : QWidget( parent, name, f )
43{ 43{
44 setMinimumSize( 200, 150 ); 44 setMinimumSize( 200, 150 );
45 45
46 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 46 QVBoxLayout *tmpvb = new QVBoxLayout( this );
47 QScrollView *sv = new QScrollView( this ); 47 QScrollView *sv = new QScrollView( this );
48 tmpvb->addWidget( sv, 0, 0 ); 48 tmpvb->addWidget( sv, 0, 0 );
49 sv->setResizePolicy( QScrollView::AutoOneFit ); 49 sv->setResizePolicy( QScrollView::AutoOneFit );
50 sv->setFrameStyle( QFrame::NoFrame ); 50 sv->setFrameStyle( QFrame::NoFrame );
51 QWidget *container = new QWidget( sv->viewport() ); 51 QWidget *container = new QWidget( sv->viewport() );
52 sv->addChild( container ); 52 sv->addChild( container );
53 53
54 QVBoxLayout *vb = new QVBoxLayout( container, 4 ); 54 QVBoxLayout *vb = new QVBoxLayout( container, 4 );
55 55
56 QString kernelVersionString; 56 QString kernelVersionString;
57 QFile file( "/proc/version" ); 57 QFile file( "/proc/version" );
58 if ( file.open( IO_ReadOnly ) ) 58 if ( file.open( IO_ReadOnly ) )
59 { 59 {
60 QTextStream t( &file ); 60 QTextStream t( &file );
61 QString v; 61 QString v;
62 t >> v; t >> v; t >> v; 62 t >> v; t >> v; t >> v;
63 v = v.left( 20 ); 63 v = v.left( 20 );
64 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " ); 64 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " );
65 kernelVersionString.append( v ); 65 kernelVersionString.append( v );
66 kernelVersionString.append( "<br>" ); 66 kernelVersionString.append( "<br>" );
67 t >> v; 67 t >> v;
68 kernelVersionString.append( tr( "Compiled by: " ) ); 68 kernelVersionString.append( tr( "Compiled by: " ) );
69 kernelVersionString.append( v ); 69 kernelVersionString.append( v );
70 kernelVersionString.append("</qt>"); 70 kernelVersionString.append("</qt>");
71 file.close(); 71 file.close();
72 } 72 }
73 73
74 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " ); 74 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " );
75 palmtopVersionString.append( QPE_VERSION ); 75 palmtopVersionString.append( QPE_VERSION );
76 palmtopVersionString.append( "<br>" ); 76 palmtopVersionString.append( "<br>" );
77#ifdef QPE_VENDOR 77#ifdef QPE_VENDOR
78 QString builder = QPE_VENDOR; 78 QString builder = QPE_VENDOR;
79#else 79#else
80 QString builder = "Unknown"; 80 QString builder = "Unknown";
81#endif 81#endif
82 palmtopVersionString.append( tr( "Compiled by: " ) ); 82 palmtopVersionString.append( tr( "Compiled by: " ) );
83 palmtopVersionString.append( builder ); 83 palmtopVersionString.append( builder );
84 palmtopVersionString.append( "<br>" ); 84 palmtopVersionString.append( "<br>" );
85 palmtopVersionString.append( tr( "Built on: " ) ); 85 palmtopVersionString.append( tr( "Built on: " ) );
86 palmtopVersionString.append( __DATE__ ); 86 palmtopVersionString.append( __DATE__ );
87 palmtopVersionString.append( "</qt>" ); 87 palmtopVersionString.append( "</qt>" );
88 88
89 QHBoxLayout *hb1 = new QHBoxLayout( vb ); 89 QHBoxLayout *hb1 = new QHBoxLayout( vb );
90 hb1->setSpacing( 2 ); 90 hb1->setSpacing( 2 );
91 91
92 QLabel *palmtopLogo = new QLabel( container ); 92 QLabel *palmtopLogo = new QLabel( container );
93 QImage logo1 = Resource::loadImage( "logo/opielogo" ); 93 QImage logo1 = Resource::loadImage( "logo/opielogo" );
94 logo1 = logo1.smoothScale( 50, 55 ); 94 logo1 = logo1.smoothScale( 50, 55 );
95 QPixmap logo1Pixmap; 95 QPixmap logo1Pixmap;
96 logo1Pixmap.convertFromImage( logo1 ); 96 logo1Pixmap.convertFromImage( logo1 );
97 palmtopLogo->setPixmap( logo1Pixmap ); 97 palmtopLogo->setPixmap( logo1Pixmap );
98 palmtopLogo->setFixedSize( 60, 60 ); 98 palmtopLogo->setFixedSize( 60, 60 );
99 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); 99 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft );
100 100
101 QLabel *palmtopVersion = new QLabel( container ); 101 QLabel *palmtopVersion = new QLabel( container );
102 palmtopVersion->setText( palmtopVersionString ); 102 palmtopVersion->setText( palmtopVersionString );
103 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 103 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft );
104 104
105 105
106 QHBoxLayout *hb2 = new QHBoxLayout( vb ); 106 QHBoxLayout *hb2 = new QHBoxLayout( vb );
107 hb1->setSpacing( 2 ); 107 hb1->setSpacing( 2 );
108 108
109 QLabel *linuxLogo = new QLabel( container ); 109 QLabel *linuxLogo = new QLabel( container );
110 QImage logo2 = Resource::loadImage( "logo/tux-logo" ); 110 QImage logo2 = Resource::loadImage( "logo/tux-logo" );
111 logo2 = logo2.smoothScale( 55, 60 ); 111 logo2 = logo2.smoothScale( 55, 60 );
112 QPixmap logo2Pixmap; 112 QPixmap logo2Pixmap;
113 logo2Pixmap.convertFromImage( logo2 ); 113 logo2Pixmap.convertFromImage( logo2 );
114 linuxLogo->setPixmap( logo2Pixmap ); 114 linuxLogo->setPixmap( logo2Pixmap );
115 linuxLogo->setFixedSize( 60, 60 ); 115 linuxLogo->setFixedSize( 60, 60 );
116 hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); 116 hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft );
117 117
118 QLabel *kernelVersion = new QLabel( container ); 118 QLabel *kernelVersion = new QLabel( container );
119 kernelVersion->setText( kernelVersionString ); 119 kernelVersion->setText( kernelVersionString );
120 hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 120 hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft );
121 121
122 122
123 QHBoxLayout *hb3 = new QHBoxLayout( vb ); 123 QHBoxLayout *hb3 = new QHBoxLayout( vb );
124 hb3->setSpacing( 2 ); 124 hb3->setSpacing( 2 );
125 125
126 QLabel *palmtopLogo3 = new QLabel( container ); 126 QLabel *palmtopLogo3 = new QLabel( container );
127 127
128 OModel model = ODevice::inst()->model(); 128 OModel model = ODevice::inst()->model();
129 QString modelPixmap = "sysinfo/"; 129 QString modelPixmap = "sysinfo/";
130 if ( model == Model_Zaurus_SLC7x0 ) 130 if ( model == Model_Zaurus_SLC7x0 )
131 modelPixmap += "zaurusc700"; 131 modelPixmap += "zaurusc700";
132 else if ( model >= Model_Zaurus_SLC7x0 && model <= Model_Zaurus_SLC7x0 ) 132 else if ( model >= Model_Zaurus_SL5000 && model <= Model_Zaurus_SLB600 )
133 modelPixmap += "zaurus5500"; 133 modelPixmap += "zaurus5500";
134 else if ( model >= Model_iPAQ_H31xx && model <= Model_iPAQ_H5xxx ) 134 else if ( model >= Model_iPAQ_H31xx && model <= Model_iPAQ_H5xxx )
135 modelPixmap += "ipaq3600"; 135 modelPixmap += "ipaq3600";
136 else if ( model >= Model_SIMpad_CL4 && model <= Model_SIMpad_TSinus ) 136 else if ( model >= Model_SIMpad_CL4 && model <= Model_SIMpad_TSinus )
137 modelPixmap += "simpad"; 137 modelPixmap += "simpad";
138 else 138 else
139 modelPixmap += "pda"; 139 modelPixmap += "pda";
140 140
141 QImage logo3 = Resource::loadImage( modelPixmap ); 141 QImage logo3 = Resource::loadImage( modelPixmap );
142 142
143 int width = logo3.width(); 143 int width = logo3.width();
144 int height = logo3.height(); 144 int height = logo3.height();
145 float aspect = float( height ) / width; 145 float aspect = float( height ) / width;
146 logo3 = logo3.smoothScale( 50, 50.0 * aspect ); 146 logo3 = logo3.smoothScale( 50, 50.0 * aspect );
147 147
148 QPixmap logo3Pixmap; 148 QPixmap logo3Pixmap;
149 logo3Pixmap.convertFromImage( logo3 ); 149 logo3Pixmap.convertFromImage( logo3 );
150 palmtopLogo3->setPixmap( logo3Pixmap ); 150 palmtopLogo3->setPixmap( logo3Pixmap );
151 palmtopLogo3->setFixedSize( 60, 100 ); 151 palmtopLogo3->setFixedSize( 60, 100 );
152 hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); 152 hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft );
153 153
154 QString systemString = "<qt><b>"; 154 QString systemString = "<qt><b>";
155 systemString.append( ODevice::inst()->systemString() ); 155 systemString.append( ODevice::inst()->systemString() );
156 systemString.append( "</b>" ); 156 systemString.append( "</b>" );
157 systemString.append( tr( "<p>Version: " ) ); 157 systemString.append( tr( "<p>Version: " ) );
158 systemString.append( ODevice::inst()->systemVersionString() ); 158 systemString.append( ODevice::inst()->systemVersionString() );
159 systemString.append( tr( "<br>Model: " ) ); 159 systemString.append( tr( "<br>Model: " ) );
160 systemString.append( ODevice::inst()->modelString() ); 160 systemString.append( ODevice::inst()->modelString() );
161 systemString.append( tr( "<br>Vendor: " ) ); 161 systemString.append( tr( "<br>Vendor: " ) );
162 systemString.append( ODevice::inst()->vendorString() ); 162 systemString.append( ODevice::inst()->vendorString() );
163 systemString.append("</qt>"); 163 systemString.append("</qt>");
164 164
165 QLabel *systemVersion = new QLabel( container ); 165 QLabel *systemVersion = new QLabel( container );
166 systemVersion->setText( systemString ); 166 systemVersion->setText( systemString );
167 hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 167 hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft );
168 168
169 QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); 169 QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) );
170} 170}
171 171
172VersionInfo::~VersionInfo() 172VersionInfo::~VersionInfo()
173{ 173{
174} 174}
175 175