-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 43 | ||||
-rw-r--r-- | pics/sysinfo/ipaq3600.png | bin | 0 -> 63014 bytes | |||
-rw-r--r-- | pics/sysinfo/mounticon.png | bin | 0 -> 719 bytes | |||
-rw-r--r-- | pics/sysinfo/pda.png | bin | 4448 -> 14000 bytes | |||
-rw-r--r-- | pics/sysinfo/simpad.png | bin | 0 -> 6726 bytes | |||
-rw-r--r-- | pics/sysinfo/zaurus5500.png | bin | 0 -> 26255 bytes | |||
-rw-r--r-- | pics/sysinfo/zaurusc700.png | bin | 0 -> 47985 bytes |
7 files changed, 31 insertions, 12 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index be24baa..b3462f5 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -34,123 +34,142 @@ | |||
34 | 34 | ||
35 | #include "versioninfo.h" | 35 | #include "versioninfo.h" |
36 | 36 | ||
37 | #include <opie/odevice.h> | 37 | #include <opie/odevice.h> |
38 | 38 | ||
39 | using namespace Opie; | 39 | using namespace Opie; |
40 | 40 | ||
41 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 41 | VersionInfo::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 | QTextStream t( &file ); | 60 | QTextStream t( &file ); |
60 | QString v; | 61 | QString v; |
61 | t >> v; t >> v; t >> v; | 62 | t >> v; t >> v; t >> v; |
62 | v = v.left( 20 ); | 63 | v = v.left( 20 ); |
63 | kernelVersionString = "<qt>"+tr( "<b>Linux Kernel</b><p>Version: " ); | 64 | kernelVersionString = "<qt>"+tr( "<b>Linux Kernel</b><p>Version: " ); |
64 | kernelVersionString.append( v ); | 65 | kernelVersionString.append( v ); |
65 | kernelVersionString.append( "<p>" ); | 66 | kernelVersionString.append( "<br>" ); |
66 | t >> v; | 67 | t >> v; |
67 | kernelVersionString.append( tr( "Compiled by: " ) ); | 68 | kernelVersionString.append( tr( "Compiled by: " ) ); |
68 | kernelVersionString.append( v ); | 69 | kernelVersionString.append( v ); |
69 | kernelVersionString.append("</qt>"); | 70 | kernelVersionString.append("</qt>"); |
70 | file.close(); | 71 | file.close(); |
71 | } | 72 | } |
72 | 73 | ||
73 | QString palmtopVersionString = tr( "<b>Opie</b><p>Version: " ); | 74 | QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " ); |
74 | palmtopVersionString.append( QPE_VERSION ); | 75 | palmtopVersionString.append( QPE_VERSION ); |
75 | palmtopVersionString.append( "<p>" ); | 76 | palmtopVersionString.append( "<br>" ); |
76 | #ifdef QPE_VENDOR | 77 | #ifdef QPE_VENDOR |
77 | QString builder = QPE_VENDOR; | 78 | QString builder = QPE_VENDOR; |
78 | #else | 79 | #else |
79 | QString builder = "Unknown"; | 80 | QString builder = "Unknown"; |
80 | #endif | 81 | #endif |
81 | palmtopVersionString.append( "<qt>"+ tr( "Compiled by: " ) ); | 82 | palmtopVersionString.append( tr( "Compiled by: " ) ); |
82 | palmtopVersionString.append( builder ); | 83 | palmtopVersionString.append( builder ); |
83 | palmtopVersionString.append( "<p>" ); | 84 | palmtopVersionString.append( "<br>" ); |
84 | palmtopVersionString.append( tr( "Built on: " ) ); | 85 | palmtopVersionString.append( tr( "Built on: " ) ); |
85 | palmtopVersionString.append( __DATE__ ); | 86 | palmtopVersionString.append( __DATE__ ); |
86 | palmtopVersionString.append( "</qt>" ); | 87 | palmtopVersionString.append( "</qt>" ); |
87 | 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 | QImage logo3 = Resource::loadImage( "sysinfo/pda" ); | 127 | |
128 | logo3 = logo3.smoothScale( 50, 55 ); | 128 | OModel model = ODevice::inst()->model(); |
129 | QString modelPixmap = "sysinfo/"; | ||
130 | if ( model == Model_Zaurus_SLC7x0 ) | ||
131 | modelPixmap += "zaurusc700"; | ||
132 | else if ( model >= Model_Zaurus_SLC7x0 && model <= Model_Zaurus_SLC7x0 ) | ||
133 | modelPixmap += "zaurus5500"; | ||
134 | else if ( model >= Model_iPAQ_H31xx && model <= Model_iPAQ_H5xxx ) | ||
135 | modelPixmap += "ipaq3600"; | ||
136 | else if ( model >= Model_SIMpad_CL4 && model <= Model_SIMpad_TSinus ) | ||
137 | modelPixmap += "simpad"; | ||
138 | else | ||
139 | modelPixmap += "pda"; | ||
140 | |||
141 | QImage logo3 = Resource::loadImage( modelPixmap ); | ||
142 | |||
143 | int width = logo3.width(); | ||
144 | int height = logo3.height(); | ||
145 | float aspect = float( height ) / width; | ||
146 | logo3 = logo3.smoothScale( 50, 50.0 * aspect ); | ||
147 | |||
129 | QPixmap logo3Pixmap; | 148 | QPixmap logo3Pixmap; |
130 | logo3Pixmap.convertFromImage( logo3 ); | 149 | logo3Pixmap.convertFromImage( logo3 ); |
131 | palmtopLogo3->setPixmap( logo3Pixmap ); | 150 | palmtopLogo3->setPixmap( logo3Pixmap ); |
132 | palmtopLogo3->setFixedSize( 60, 60 ); | 151 | palmtopLogo3->setFixedSize( 60, 100 ); |
133 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); | 152 | hb3->addWidget( palmtopLogo3, 0, Qt::AlignTop + Qt::AlignLeft ); |
134 | 153 | ||
135 | QString systemString = "<qt><b>"; | 154 | QString systemString = "<qt><b>"; |
136 | systemString.append( ODevice::inst()->systemString() ); | 155 | systemString.append( ODevice::inst()->systemString() ); |
137 | systemString.append( "</b>" ); | 156 | systemString.append( "</b>" ); |
138 | systemString.append( tr( "<p>Version: " ) ); | 157 | systemString.append( tr( "<p>Version: " ) ); |
139 | systemString.append( ODevice::inst()->systemVersionString() ); | 158 | systemString.append( ODevice::inst()->systemVersionString() ); |
140 | systemString.append( tr( "<p>Model: " ) ); | 159 | systemString.append( tr( "<br>Model: " ) ); |
141 | systemString.append( ODevice::inst()->modelString() ); | 160 | systemString.append( ODevice::inst()->modelString() ); |
142 | systemString.append( tr( "<p>Vendor: " ) ); | 161 | systemString.append( tr( "<br>Vendor: " ) ); |
143 | systemString.append( ODevice::inst()->vendorString() ); | 162 | systemString.append( ODevice::inst()->vendorString() ); |
144 | systemString.append("</qt>"); | 163 | systemString.append("</qt>"); |
145 | 164 | ||
146 | QLabel *systemVersion = new QLabel( container ); | 165 | QLabel *systemVersion = new QLabel( container ); |
147 | systemVersion->setText( systemString ); | 166 | systemVersion->setText( systemString ); |
148 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 167 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
149 | 168 | ||
150 | 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." ) ); |
151 | } | 170 | } |
152 | 171 | ||
153 | VersionInfo::~VersionInfo() | 172 | VersionInfo::~VersionInfo() |
154 | { | 173 | { |
155 | } | 174 | } |
156 | 175 | ||
diff --git a/pics/sysinfo/ipaq3600.png b/pics/sysinfo/ipaq3600.png new file mode 100644 index 0000000..47b9beb --- a/dev/null +++ b/pics/sysinfo/ipaq3600.png | |||
Binary files differ | |||
diff --git a/pics/sysinfo/mounticon.png b/pics/sysinfo/mounticon.png new file mode 100644 index 0000000..1b73fd1 --- a/dev/null +++ b/pics/sysinfo/mounticon.png | |||
Binary files differ | |||
diff --git a/pics/sysinfo/pda.png b/pics/sysinfo/pda.png index a75579d..aae38bf 100644 --- a/pics/sysinfo/pda.png +++ b/pics/sysinfo/pda.png | |||
Binary files differ | |||
diff --git a/pics/sysinfo/simpad.png b/pics/sysinfo/simpad.png new file mode 100644 index 0000000..fd1eac8 --- a/dev/null +++ b/pics/sysinfo/simpad.png | |||
Binary files differ | |||
diff --git a/pics/sysinfo/zaurus5500.png b/pics/sysinfo/zaurus5500.png new file mode 100644 index 0000000..6f56b94 --- a/dev/null +++ b/pics/sysinfo/zaurus5500.png | |||
Binary files differ | |||
diff --git a/pics/sysinfo/zaurusc700.png b/pics/sysinfo/zaurusc700.png new file mode 100644 index 0000000..eb81114 --- a/dev/null +++ b/pics/sysinfo/zaurusc700.png | |||
Binary files differ | |||