summaryrefslogtreecommitdiff
authorzecke <zecke>2003-08-23 09:04:41 (UTC)
committer zecke <zecke>2003-08-23 09:04:41 (UTC)
commit3dff9b4751fa9b63ddfd2527ec68add7fafb599d (patch) (unidiff)
treec55f593f50f2949ae8ce6e1e374579a238487f8b
parenta8859fac97c0b3255a261221d2b31ebedb56075c (diff)
downloadopie-3dff9b4751fa9b63ddfd2527ec68add7fafb599d.zip
opie-3dff9b4751fa9b63ddfd2527ec68add7fafb599d.tar.gz
opie-3dff9b4751fa9b63ddfd2527ec68add7fafb599d.tar.bz2
Forward port of the label fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index 801af29..be24baa 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -1,153 +1,156 @@
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 QTextStream t( &file ); 59 QTextStream t( &file );
60 QString v; 60 QString v;
61 t >> v; t >> v; t >> v; 61 t >> v; t >> v; t >> v;
62 v = v.left( 20 ); 62 v = v.left( 20 );
63 kernelVersionString = tr( "<b>Linux Kernel</b><p>Version: " ); 63 kernelVersionString = "<qt>"+tr( "<b>Linux Kernel</b><p>Version: " );
64 kernelVersionString.append( v ); 64 kernelVersionString.append( v );
65 kernelVersionString.append( "<p>" ); 65 kernelVersionString.append( "<p>" );
66 t >> v; 66 t >> v;
67 kernelVersionString.append( tr( "Compiled by: " ) ); 67 kernelVersionString.append( tr( "Compiled by: " ) );
68 kernelVersionString.append( v ); 68 kernelVersionString.append( v );
69 kernelVersionString.append("</qt>");
69 file.close(); 70 file.close();
70 } 71 }
71 72
72 QString palmtopVersionString = tr( "<b>Opie</b><p>Version: " ); 73 QString palmtopVersionString = tr( "<b>Opie</b><p>Version: " );
73 palmtopVersionString.append( QPE_VERSION ); 74 palmtopVersionString.append( QPE_VERSION );
74 palmtopVersionString.append( "<p>" ); 75 palmtopVersionString.append( "<p>" );
75#ifdef QPE_VENDOR 76#ifdef QPE_VENDOR
76 QString builder = QPE_VENDOR; 77 QString builder = QPE_VENDOR;
77#else 78#else
78 QString builder = "Unknown"; 79 QString builder = "Unknown";
79#endif 80#endif
80 palmtopVersionString.append( tr( "Compiled by: " ) ); 81 palmtopVersionString.append( "<qt>"+ tr( "Compiled by: " ) );
81 palmtopVersionString.append( builder ); 82 palmtopVersionString.append( builder );
82 palmtopVersionString.append( "<p>" ); 83 palmtopVersionString.append( "<p>" );
83 palmtopVersionString.append( tr( "Built on: " ) ); 84 palmtopVersionString.append( tr( "Built on: " ) );
84 palmtopVersionString.append( __DATE__ ); 85 palmtopVersionString.append( __DATE__ );
85 86 palmtopVersionString.append( "</qt>" );
87
86 88
87 QHBoxLayout *hb1 = new QHBoxLayout( vb ); 89 QHBoxLayout *hb1 = new QHBoxLayout( vb );
88 hb1->setSpacing( 2 ); 90 hb1->setSpacing( 2 );
89 91
90 QLabel *palmtopLogo = new QLabel( container ); 92 QLabel *palmtopLogo = new QLabel( container );
91 QImage logo1 = Resource::loadImage( "logo/opielogo" ); 93 QImage logo1 = Resource::loadImage( "logo/opielogo" );
92 logo1 = logo1.smoothScale( 50, 55 ); 94 logo1 = logo1.smoothScale( 50, 55 );
93 QPixmap logo1Pixmap; 95 QPixmap logo1Pixmap;
94 logo1Pixmap.convertFromImage( logo1 ); 96 logo1Pixmap.convertFromImage( logo1 );
95 palmtopLogo->setPixmap( logo1Pixmap ); 97 palmtopLogo->setPixmap( logo1Pixmap );
96 palmtopLogo->setFixedSize( 60, 60 ); 98 palmtopLogo->setFixedSize( 60, 60 );
97 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); 99 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft );
98 100
99 QLabel *palmtopVersion = new QLabel( container ); 101 QLabel *palmtopVersion = new QLabel( container );
100 palmtopVersion->setText( palmtopVersionString ); 102 palmtopVersion->setText( palmtopVersionString );
101 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 103 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft );
102 104
103 105
104 QHBoxLayout *hb2 = new QHBoxLayout( vb ); 106 QHBoxLayout *hb2 = new QHBoxLayout( vb );
105 hb1->setSpacing( 2 ); 107 hb1->setSpacing( 2 );
106 108
107 QLabel *linuxLogo = new QLabel( container ); 109 QLabel *linuxLogo = new QLabel( container );
108 QImage logo2 = Resource::loadImage( "logo/tux-logo" ); 110 QImage logo2 = Resource::loadImage( "logo/tux-logo" );
109 logo2 = logo2.smoothScale( 55, 60 ); 111 logo2 = logo2.smoothScale( 55, 60 );
110 QPixmap logo2Pixmap; 112 QPixmap logo2Pixmap;
111 logo2Pixmap.convertFromImage( logo2 ); 113 logo2Pixmap.convertFromImage( logo2 );
112 linuxLogo->setPixmap( logo2Pixmap ); 114 linuxLogo->setPixmap( logo2Pixmap );
113 linuxLogo->setFixedSize( 60, 60 ); 115 linuxLogo->setFixedSize( 60, 60 );
114 hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); 116 hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft );
115 117
116 QLabel *kernelVersion = new QLabel( container ); 118 QLabel *kernelVersion = new QLabel( container );
117 kernelVersion->setText( kernelVersionString ); 119 kernelVersion->setText( kernelVersionString );
118 hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 120 hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft );
119 121
120 122
121 QHBoxLayout *hb3 = new QHBoxLayout( vb ); 123 QHBoxLayout *hb3 = new QHBoxLayout( vb );
122 hb3->setSpacing( 2 ); 124 hb3->setSpacing( 2 );
123 125
124 QLabel *palmtopLogo3 = new QLabel( container ); 126 QLabel *palmtopLogo3 = new QLabel( container );
125 QImage logo3 = Resource::loadImage( "sysinfo/pda" ); 127 QImage logo3 = Resource::loadImage( "sysinfo/pda" );
126 logo3 = logo3.smoothScale( 50, 55 ); 128 logo3 = logo3.smoothScale( 50, 55 );
127 QPixmap logo3Pixmap; 129 QPixmap logo3Pixmap;
128 logo3Pixmap.convertFromImage( logo3 ); 130 logo3Pixmap.convertFromImage( logo3 );
129 palmtopLogo3->setPixmap( logo3Pixmap ); 131 palmtopLogo3->setPixmap( logo3Pixmap );
130 palmtopLogo3->setFixedSize( 60, 60 ); 132 palmtopLogo3->setFixedSize( 60, 60 );
131 hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); 133 hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft );
132 134
133 QString systemString = "<b>"; 135 QString systemString = "<qt><b>";
134 systemString.append( ODevice::inst()->systemString() ); 136 systemString.append( ODevice::inst()->systemString() );
135 systemString.append( "</b>" ); 137 systemString.append( "</b>" );
136 systemString.append( tr( "<p>Version: " ) ); 138 systemString.append( tr( "<p>Version: " ) );
137 systemString.append( ODevice::inst()->systemVersionString() ); 139 systemString.append( ODevice::inst()->systemVersionString() );
138 systemString.append( tr( "<p>Model: " ) ); 140 systemString.append( tr( "<p>Model: " ) );
139 systemString.append( ODevice::inst()->modelString() ); 141 systemString.append( ODevice::inst()->modelString() );
140 systemString.append( tr( "<p>Vendor: " ) ); 142 systemString.append( tr( "<p>Vendor: " ) );
141 systemString.append( ODevice::inst()->vendorString() ); 143 systemString.append( ODevice::inst()->vendorString() );
144 systemString.append("</qt>");
142 145
143 QLabel *systemVersion = new QLabel( container ); 146 QLabel *systemVersion = new QLabel( container );
144 systemVersion->setText( systemString ); 147 systemVersion->setText( systemString );
145 hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 148 hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft );
146 149
147 QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); 150 QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) );
148} 151}
149 152
150VersionInfo::~VersionInfo() 153VersionInfo::~VersionInfo()
151{ 154{
152} 155}
153 156