Diffstat (limited to 'noncore/settings/sysinfo/versioninfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index 9a444df..801af29 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -24,12 +24,13 @@ | |||
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 <qtextstream.h> | 31 | #include <qtextstream.h> |
31 | #include <qtimer.h> | 32 | #include <qtimer.h> |
32 | #include <qwhatsthis.h> | 33 | #include <qwhatsthis.h> |
33 | 34 | ||
34 | #include "versioninfo.h" | 35 | #include "versioninfo.h" |
35 | 36 | ||
@@ -39,13 +40,21 @@ using namespace Opie; | |||
39 | 40 | ||
40 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 41 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) |
41 | : QWidget( parent, name, f ) | 42 | : QWidget( parent, name, f ) |
42 | { | 43 | { |
43 | setMinimumSize( 200, 150 ); | 44 | setMinimumSize( 200, 150 ); |
44 | 45 | ||
45 | QVBoxLayout *vb = new QVBoxLayout( this, 4 ); | 46 | QVBoxLayout *tmpvb = new QVBoxLayout( this ); |
47 | QScrollView *sv = new QScrollView( this ); | ||
48 | tmpvb->addWidget( sv, 0, 0 ); | ||
49 | sv->setResizePolicy( QScrollView::AutoOneFit ); | ||
50 | sv->setFrameStyle( QFrame::NoFrame ); | ||
51 | QWidget *container = new QWidget( sv->viewport() ); | ||
52 | sv->addChild( container ); | ||
53 | |||
54 | QVBoxLayout *vb = new QVBoxLayout( container, 4 ); | ||
46 | 55 | ||
47 | QString kernelVersionString; | 56 | QString kernelVersionString; |
48 | QFile file( "/proc/version" ); | 57 | QFile file( "/proc/version" ); |
49 | if ( file.open( IO_ReadOnly ) ) { | 58 | if ( file.open( IO_ReadOnly ) ) { |
50 | QTextStream t( &file ); | 59 | QTextStream t( &file ); |
51 | QString v; | 60 | QString v; |
@@ -75,47 +84,47 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | |||
75 | palmtopVersionString.append( __DATE__ ); | 84 | palmtopVersionString.append( __DATE__ ); |
76 | 85 | ||
77 | 86 | ||
78 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); | 87 | QHBoxLayout *hb1 = new QHBoxLayout( vb ); |
79 | hb1->setSpacing( 2 ); | 88 | hb1->setSpacing( 2 ); |
80 | 89 | ||
81 | QLabel *palmtopLogo = new QLabel( this ); | 90 | QLabel *palmtopLogo = new QLabel( container ); |
82 | QImage logo1 = Resource::loadImage( "logo/opielogo" ); | 91 | QImage logo1 = Resource::loadImage( "logo/opielogo" ); |
83 | logo1 = logo1.smoothScale( 50, 55 ); | 92 | logo1 = logo1.smoothScale( 50, 55 ); |
84 | QPixmap logo1Pixmap; | 93 | QPixmap logo1Pixmap; |
85 | logo1Pixmap.convertFromImage( logo1 ); | 94 | logo1Pixmap.convertFromImage( logo1 ); |
86 | palmtopLogo->setPixmap( logo1Pixmap ); | 95 | palmtopLogo->setPixmap( logo1Pixmap ); |
87 | palmtopLogo->setFixedSize( 60, 60 ); | 96 | palmtopLogo->setFixedSize( 60, 60 ); |
88 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 97 | hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
89 | 98 | ||
90 | QLabel *palmtopVersion = new QLabel( this ); | 99 | QLabel *palmtopVersion = new QLabel( container ); |
91 | palmtopVersion->setText( palmtopVersionString ); | 100 | palmtopVersion->setText( palmtopVersionString ); |
92 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 101 | hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
93 | 102 | ||
94 | 103 | ||
95 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); | 104 | QHBoxLayout *hb2 = new QHBoxLayout( vb ); |
96 | hb1->setSpacing( 2 ); | 105 | hb1->setSpacing( 2 ); |
97 | 106 | ||
98 | QLabel *linuxLogo = new QLabel( this ); | 107 | QLabel *linuxLogo = new QLabel( container ); |
99 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); | 108 | QImage logo2 = Resource::loadImage( "logo/tux-logo" ); |
100 | logo2 = logo2.smoothScale( 55, 60 ); | 109 | logo2 = logo2.smoothScale( 55, 60 ); |
101 | QPixmap logo2Pixmap; | 110 | QPixmap logo2Pixmap; |
102 | logo2Pixmap.convertFromImage( logo2 ); | 111 | logo2Pixmap.convertFromImage( logo2 ); |
103 | linuxLogo->setPixmap( logo2Pixmap ); | 112 | linuxLogo->setPixmap( logo2Pixmap ); |
104 | linuxLogo->setFixedSize( 60, 60 ); | 113 | linuxLogo->setFixedSize( 60, 60 ); |
105 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); | 114 | hb2->addWidget( linuxLogo, 0, Qt::AlignTop + Qt::AlignLeft ); |
106 | 115 | ||
107 | QLabel *kernelVersion = new QLabel( this ); | 116 | QLabel *kernelVersion = new QLabel( container ); |
108 | kernelVersion->setText( kernelVersionString ); | 117 | kernelVersion->setText( kernelVersionString ); |
109 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 118 | hb2->addWidget( kernelVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
110 | 119 | ||
111 | 120 | ||
112 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); | 121 | QHBoxLayout *hb3 = new QHBoxLayout( vb ); |
113 | hb3->setSpacing( 2 ); | 122 | hb3->setSpacing( 2 ); |
114 | 123 | ||
115 | QLabel *palmtopLogo3 = new QLabel( this ); | 124 | QLabel *palmtopLogo3 = new QLabel( container ); |
116 | QImage logo3 = Resource::loadImage( "sysinfo/pda" ); | 125 | QImage logo3 = Resource::loadImage( "sysinfo/pda" ); |
117 | logo3 = logo3.smoothScale( 50, 55 ); | 126 | logo3 = logo3.smoothScale( 50, 55 ); |
118 | QPixmap logo3Pixmap; | 127 | QPixmap logo3Pixmap; |
119 | logo3Pixmap.convertFromImage( logo3 ); | 128 | logo3Pixmap.convertFromImage( logo3 ); |
120 | palmtopLogo3->setPixmap( logo3Pixmap ); | 129 | palmtopLogo3->setPixmap( logo3Pixmap ); |
121 | palmtopLogo3->setFixedSize( 60, 60 ); | 130 | palmtopLogo3->setFixedSize( 60, 60 ); |
@@ -128,13 +137,13 @@ VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | |||
128 | systemString.append( ODevice::inst()->systemVersionString() ); | 137 | systemString.append( ODevice::inst()->systemVersionString() ); |
129 | systemString.append( tr( "<p>Model: " ) ); | 138 | systemString.append( tr( "<p>Model: " ) ); |
130 | systemString.append( ODevice::inst()->modelString() ); | 139 | systemString.append( ODevice::inst()->modelString() ); |
131 | systemString.append( tr( "<p>Vendor: " ) ); | 140 | systemString.append( tr( "<p>Vendor: " ) ); |
132 | systemString.append( ODevice::inst()->vendorString() ); | 141 | systemString.append( ODevice::inst()->vendorString() ); |
133 | 142 | ||
134 | QLabel *systemVersion = new QLabel( this ); | 143 | QLabel *systemVersion = new QLabel( container ); |
135 | systemVersion->setText( systemString ); | 144 | systemVersion->setText( systemString ); |
136 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); | 145 | hb3->addWidget( systemVersion, 1, Qt::AlignTop + Qt::AlignLeft ); |
137 | 146 | ||
138 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); | 147 | QWhatsThis::add( this, tr( "This page shows the current versions of Opie, the Linux kernel and distribution running on this handheld device." ) ); |
139 | } | 148 | } |
140 | 149 | ||