Diffstat (limited to 'noncore/settings/sysinfo/versioninfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index a8db207..79e7fea 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -1,130 +1,133 @@ | |||
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 | 24 | #include <qfile.h> | |
25 | #include <qimage.h> | ||
25 | #include <qlabel.h> | 26 | #include <qlabel.h> |
27 | #include <qlayout.h> | ||
26 | #include <qpixmap.h> | 28 | #include <qpixmap.h> |
27 | #include <qpainter.h> | 29 | #include <qpainter.h> |
28 | #include <qimage.h> | ||
29 | #include <qtimer.h> | ||
30 | #include <qfile.h> | ||
31 | #include <qtextstream.h> | 30 | #include <qtextstream.h> |
32 | #include <qlayout.h> | 31 | #include <qtimer.h> |
32 | #include <qwhatsthis.h> | ||
33 | |||
33 | #include "versioninfo.h" | 34 | #include "versioninfo.h" |
34 | 35 | ||
35 | #include <opie/odevice.h> | 36 | #include <opie/odevice.h> |
37 | |||
36 | using namespace Opie; | 38 | using namespace Opie; |
37 | 39 | ||
38 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 40 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) |
39 | : QWidget( parent, name, f ) | 41 | : QWidget( parent, name, f ) |
40 | { | 42 | { |
41 | setMinimumSize( 200, 150 ); | 43 | setMinimumSize( 200, 150 ); |
42 | 44 | ||
43 | QVBoxLayout *vb = new QVBoxLayout( this, 4 ); | 45 | QVBoxLayout *vb = new QVBoxLayout( this, 4 ); |
44 | 46 | ||
45 | QString kernelVersionString; | 47 | QString kernelVersionString; |
46 | QFile file( "/proc/version" ); | 48 | QFile file( "/proc/version" ); |
47 | if ( file.open( IO_ReadOnly ) ) { | 49 | if ( file.open( IO_ReadOnly ) ) { |
48 | QTextStream t( &file ); | 50 | QTextStream t( &file ); |
49 | QString v; | 51 | QString v; |
50 | t >> v; t >> v; t >> v; | 52 | t >> v; t >> v; t >> v; |
51 | v = v.left( 20 ); | 53 | v = v.left( 20 ); |
52 | kernelVersionString = tr( "<b>Linux Kernel</b><p>Version: " ) + v + "<p>"; | 54 | kernelVersionString = tr( "<b>Linux Kernel</b><p>Version: " ) + v + "<p>"; |
53 | t >> v; | 55 | t >> v; |
54 | kernelVersionString += tr( "Compiled by: " ) + v; | 56 | kernelVersionString += tr( "Compiled by: " ) + v; |
55 | file.close(); | 57 | file.close(); |
56 | } | 58 | } |
57 | 59 | ||
58 | QString palmtopVersionString; | 60 | QString palmtopVersionString; |
59 | palmtopVersionString = tr( "<b>Opie</b><p>Version: " ) + QPE_VERSION + "<p>"; | 61 | palmtopVersionString = tr( "<b>Opie</b><p>Version: " ) + QPE_VERSION + "<p>"; |
60 | #ifdef QPE_VENDOR | 62 | #ifdef QPE_VENDOR |
61 | QString builder = QPE_VENDOR; | 63 | QString builder = QPE_VENDOR; |
62 | #else | 64 | #else |
63 | QString builder = "Unknown"; | 65 | QString builder = "Unknown"; |
64 | #endif | 66 | #endif |
65 | palmtopVersionString += tr( "Compiled by: " ) + builder + "<p>"; | 67 | palmtopVersionString += tr( "Compiled by: " ) + builder + "<p>"; |
66 | palmtopVersionString += tr( "Built on: " ) + __DATE__; | 68 | palmtopVersionString += tr( "Built on: " ) + __DATE__; |
67 | 69 | ||
68 | 70 | ||
69 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); | 71 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); |
70 | hb1->setSpacing( 2 ); | 72 | hb1->setSpacing( 2 ); |
71 | 73 | ||
72 | QLabel *palmtopLogo = new QLabel( this ); | 74 | QLabel *palmtopLogo = new QLabel( this ); |
73 | QImage logo1 = Resource::loadImage( "logo/opielogo" ); | 75 | QImage logo1 = Resource::loadImage( "logo/opielogo" ); |
74 | logo1 = logo1.smoothScale( 50, 55 ); | 76 | logo1 = logo1.smoothScale( 50, 55 ); |
75 | QPixmap logo1Pixmap; | 77 | QPixmap logo1Pixmap; |
76 | logo1Pixmap.convertFromImage( logo1 ); | 78 | logo1Pixmap.convertFromImage( logo1 ); |
77 | palmtopLogo->setPixmap( logo1Pixmap ); | 79 | palmtopLogo->setPixmap( logo1Pixmap ); |
78 | palmtopLogo->setFixedSize( 60, 60 ); | 80 | palmtopLogo->setFixedSize( 60, 60 ); |
79 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 81 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
80 | 82 | ||
81 | QLabel *palmtopVersion = new QLabel( this ); | 83 | QLabel *palmtopVersion = new QLabel( this ); |
82 | palmtopVersion->setText( palmtopVersionString ); | 84 | palmtopVersion->setText( palmtopVersionString ); |
83 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 85 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
84 | 86 | ||
85 | 87 | ||
86 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); | 88 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); |
87 | hb1->setSpacing( 2 ); | 89 | hb1->setSpacing( 2 ); |
88 | 90 | ||
89 | QLabel *linuxLogo = new QLabel( this ); | 91 | QLabel *linuxLogo = new QLabel( this ); |
90 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); | 92 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); |
91 | logo2 = logo2.smoothScale( 55, 60 ); | 93 | logo2 = logo2.smoothScale( 55, 60 ); |
92 | QPixmap logo2Pixmap; | 94 | QPixmap logo2Pixmap; |
93 | logo2Pixmap.convertFromImage( logo2 ); | 95 | logo2Pixmap.convertFromImage( logo2 ); |
94 | linuxLogo->setPixmap( logo2Pixmap ); | 96 | linuxLogo->setPixmap( logo2Pixmap ); |
95 | linuxLogo->setFixedSize( 60, 60 ); | 97 | linuxLogo->setFixedSize( 60, 60 ); |
96 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 98 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
97 | 99 | ||
98 | QLabel *kernelVersion = new QLabel( this ); | 100 | QLabel *kernelVersion = new QLabel( this ); |
99 | kernelVersion->setText( kernelVersionString ); | 101 | kernelVersion->setText( kernelVersionString ); |
100 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 102 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
101 | 103 | ||
102 | 104 | ||
103 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); | 105 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); |
104 | hb3->setSpacing( 2 ); | 106 | hb3->setSpacing( 2 ); |
105 | 107 | ||
106 | QLabel *palmtopLogo3 = new QLabel( this ); | 108 | QLabel *palmtopLogo3 = new QLabel( this ); |
107 | QImage logo3 = Resource::loadImage( "SystemInfo" ); | 109 | QImage logo3 = Resource::loadImage( "SystemInfo" ); |
108 | logo3 = logo3.smoothScale( 50, 55 ); | 110 | logo3 = logo3.smoothScale( 50, 55 ); |
109 | QPixmap logo3Pixmap; | 111 | QPixmap logo3Pixmap; |
110 | logo3Pixmap.convertFromImage( logo3 ); | 112 | logo3Pixmap.convertFromImage( logo3 ); |
111 | palmtopLogo3->setPixmap( logo3Pixmap ); | 113 | palmtopLogo3->setPixmap( logo3Pixmap ); |
112 | palmtopLogo3->setFixedSize( 60, 60 ); | 114 | palmtopLogo3->setFixedSize( 60, 60 ); |
113 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); | 115 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); |
114 | 116 | ||
115 | // QString systemString = tr( "<b>System</b><p>System: ") + ODevice::inst()->systemString() | 117 | // QString systemString = tr( "<b>System</b><p>System: ") + ODevice::inst()->systemString() |
116 | QString systemString = "<b>"+ ODevice::inst()->systemString()+"</b>" | 118 | QString systemString = "<b>"+ ODevice::inst()->systemString()+"</b>" |
117 | +tr("<p>Version: " ) + ODevice::inst()->systemVersionString() | 119 | +tr("<p>Version: " ) + ODevice::inst()->systemVersionString() |
118 | +tr("<p>Model: ") + ODevice::inst()->modelString() | 120 | +tr("<p>Model: ") + ODevice::inst()->modelString() |
119 | +tr("<p>Vendor: ") + ODevice::inst()->vendorString(); | 121 | +tr("<p>Vendor: ") + ODevice::inst()->vendorString(); |
120 | 122 | ||
121 | QLabel *systemVersion = new QLabel( this ); | 123 | QLabel *systemVersion = new QLabel( this ); |
122 | systemVersion->setText( systemString ); | 124 | systemVersion->setText( systemString ); |
123 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 125 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
124 | 126 | ||
127 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); | ||
125 | } | 128 | } |
126 | 129 | ||
127 | VersionInfo::~VersionInfo() | 130 | VersionInfo::~VersionInfo() |
128 | { | 131 | { |
129 | } | 132 | } |
130 | 133 | ||