author | llornkcor <llornkcor> | 2002-11-10 01:03:50 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 01:03:50 (UTC) |
commit | 12aa2d36cdd22cbde571716db4da302159c718fd (patch) (unidiff) | |
tree | eda27fb33bf0ca3491e8194cd56153ac74957314 | |
parent | dc4e5e557d8a506eb1461ff97e1fdcc7a9a91264 (diff) | |
download | opie-12aa2d36cdd22cbde571716db4da302159c718fd.zip opie-12aa2d36cdd22cbde571716db4da302159c718fd.tar.gz opie-12aa2d36cdd22cbde571716db4da302159c718fd.tar.bz2 |
added system,system version,model,and vendor strings
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 43 |
1 files changed, 35 insertions, 8 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index 1f5739a..e92b36c 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -8,60 +8,64 @@ | |||
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 <qlabel.h> | 25 | #include <qlabel.h> |
25 | #include <qpixmap.h> | 26 | #include <qpixmap.h> |
26 | #include <qpainter.h> | 27 | #include <qpainter.h> |
27 | #include <qimage.h> | 28 | #include <qimage.h> |
28 | #include <qtimer.h> | 29 | #include <qtimer.h> |
29 | #include <qfile.h> | 30 | #include <qfile.h> |
30 | #include <qtextstream.h> | 31 | #include <qtextstream.h> |
31 | #include <qlayout.h> | 32 | #include <qlayout.h> |
32 | #include "versioninfo.h" | 33 | #include "versioninfo.h" |
33 | 34 | ||
35 | #include <opie/odevice.h> | ||
36 | using namespace Opie; | ||
37 | |||
34 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 38 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) |
35 | : QWidget( parent, name, f ) | 39 | : QWidget( parent, name, f ) |
36 | { | 40 | { |
37 | setMinimumSize( 200, 150 ); | 41 | setMinimumSize( 200, 150 ); |
38 | 42 | ||
39 | QVBoxLayout *vb = new QVBoxLayout( this, 4 ); | 43 | QVBoxLayout *vb = new QVBoxLayout( this, 4 ); |
40 | 44 | ||
41 | QString kernelVersionString; | 45 | QString kernelVersionString; |
42 | QFile file( "/proc/version" ); | 46 | QFile file( "/proc/version" ); |
43 | if ( file.open( IO_ReadOnly ) ) { | 47 | if ( file.open( IO_ReadOnly ) ) { |
44 | QTextStream t( &file ); | 48 | QTextStream t( &file ); |
45 | QString v; | 49 | QString v; |
46 | t >> v; t >> v; t >> v; | 50 | t >> v; t >> v; t >> v; |
47 | v = v.left( 20 ); | 51 | v = v.left( 20 ); |
48 | kernelVersionString = tr( "<b>Linux Kernel</b><p>Version: " ) + v + "<p>"; | 52 | kernelVersionString = tr( "<b>Linux Kernel</b><p>Version: " ) + v + "<p>"; |
49 | t >> v; | 53 | t >> v; |
50 | kernelVersionString += tr( "Compiled by: " ) + v; | 54 | kernelVersionString += tr( "Compiled by: " ) + v; |
51 | file.close(); | 55 | file.close(); |
52 | } | 56 | } |
53 | 57 | ||
54 | QString palmtopVersionString; | 58 | QString palmtopVersionString; |
55 | palmtopVersionString = tr( "<b>Opie</b><p>Version: " ) + QPE_VERSION + "<p>"; | 59 | palmtopVersionString = tr( "<b>Opie</b><p>Version: " ) + QPE_VERSION + "<p>"; |
56 | #ifdef QPE_VENDOR | 60 | #ifdef QPE_VENDOR |
57 | QString builder = QPE_VENDOR; | 61 | QString builder = QPE_VENDOR; |
58 | #else | 62 | #else |
59 | QString builder = "Unknown"; | 63 | QString builder = "Unknown"; |
60 | #endif | 64 | #endif |
61 | palmtopVersionString += tr( "Compiled by: " ) + builder + "<p>"; | 65 | palmtopVersionString += tr( "Compiled by: " ) + builder + "<p>"; |
62 | palmtopVersionString += tr( "Built on: " ) + __DATE__; | 66 | palmtopVersionString += tr( "Built on: " ) + __DATE__; |
63 | 67 | ||
64 | 68 | ||
65 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); | 69 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); |
66 | hb1->setSpacing( 2 ); | 70 | hb1->setSpacing( 2 ); |
67 | 71 | ||
@@ -81,22 +85,45 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | |||
81 | 85 | ||
82 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); | 86 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); |
83 | hb1->setSpacing( 2 ); | 87 | hb1->setSpacing( 2 ); |
84 | 88 | ||
85 | QLabel *linuxLogo = new QLabel( this ); | 89 | QLabel *linuxLogo = new QLabel( this ); |
86 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); | 90 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); |
87 | logo2 = logo2.smoothScale( 55, 60 ); | 91 | logo2 = logo2.smoothScale( 55, 60 ); |
88 | QPixmap logo2Pixmap; | 92 | QPixmap logo2Pixmap; |
89 | logo2Pixmap.convertFromImage( logo2 ); | 93 | logo2Pixmap.convertFromImage( logo2 ); |
90 | linuxLogo->setPixmap( logo2Pixmap ); | 94 | linuxLogo->setPixmap( logo2Pixmap ); |
91 | linuxLogo->setFixedSize( 60, 60 ); | 95 | linuxLogo->setFixedSize( 60, 60 ); |
92 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 96 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
93 | 97 | ||
94 | QLabel *kernelVersion = new QLabel( this ); | 98 | QLabel *kernelVersion = new QLabel( this ); |
95 | kernelVersion->setText( kernelVersionString ); | 99 | kernelVersion->setText( kernelVersionString ); |
96 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 100 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
101 | |||
102 | |||
103 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); | ||
104 | hb3->setSpacing( 2 ); | ||
105 | |||
106 | QLabel *palmtopLogo3 = new QLabel( this ); | ||
107 | QImage logo3 = Resource::loadImage( "SystemInfo" ); | ||
108 | logo3 = logo3.smoothScale( 50, 55 ); | ||
109 | QPixmap logo3Pixmap; | ||
110 | logo3Pixmap.convertFromImage( logo3 ); | ||
111 | palmtopLogo3->setPixmap( logo3Pixmap ); | ||
112 | palmtopLogo3->setFixedSize( 60, 60 ); | ||
113 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); | ||
114 | |||
115 | systemString = tr( "<b>System</b><p>System: ") + ODevice::inst()->modelString() | ||
116 | +tr("<p>Version: " ) + ODevice::inst()->vendorString() | ||
117 | +tr("<p>Model: ") + ODevice::inst()->systemString() | ||
118 | +tr("<p>Vendor: ") + ODevice::inst()->systemVersionString(); | ||
119 | |||
120 | QLabel *systemVersion = new QLabel( this ); | ||
121 | systemVersion->setText( systemString ); | ||
122 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | ||
123 | |||
97 | } | 124 | } |
98 | 125 | ||
99 | VersionInfo::~VersionInfo() | 126 | VersionInfo::~VersionInfo() |
100 | { | 127 | { |
101 | } | 128 | } |
102 | 129 | ||