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