summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index 1b811df..2111298 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -1,110 +1,112 @@
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 "versioninfo.h" 21#include "versioninfo.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/odevice.h> 24#include <opie2/odevice.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26#include <qpe/version.h> 26#include <qpe/version.h>
27 27
28/* QT */ 28/* QT */
29#include <qfile.h> 29#include <qfile.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qscrollview.h> 32#include <qscrollview.h>
33#include <qtextstream.h> 33#include <qtextstream.h>
34#include <qwhatsthis.h> 34#include <qwhatsthis.h>
35 35
36using namespace Opie::Core; 36using namespace Opie::Core;
37 37
38VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) 38VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
39 : QWidget( parent, name, f ) 39 : QWidget( parent, name, f )
40{ 40{
41 setMinimumSize( 200, 150 ); 41 setMinimumSize( 200, 150 );
42 42
43 QVBoxLayout *tmpvb = new QVBoxLayout( this ); 43 QVBoxLayout *tmpvb = new QVBoxLayout( this );
44 QScrollView *sv = new QScrollView( this ); 44 QScrollView *sv = new QScrollView( this );
45 tmpvb->addWidget( sv, 0, 0 ); 45 tmpvb->addWidget( sv, 0, 0 );
46 sv->setResizePolicy( QScrollView::AutoOneFit ); 46 sv->setResizePolicy( QScrollView::AutoOneFit );
47 sv->setHScrollBarMode( QScrollView::AlwaysOff );
48 sv->setVScrollBarMode( QScrollView::AlwaysOff );
47 sv->setFrameStyle( QFrame::NoFrame ); 49 sv->setFrameStyle( QFrame::NoFrame );
48 QWidget *container = new QWidget( sv->viewport() ); 50 QWidget *container = new QWidget( sv->viewport() );
49 sv->addChild( container ); 51 sv->addChild( container );
50 52
51 QVBoxLayout *vb = new QVBoxLayout( container, 3 ); 53 QVBoxLayout *vb = new QVBoxLayout( container, 3 );
52 54
53 QString kernelVersionString; 55 QString kernelVersionString;
54 QFile file( "/proc/version" ); 56 QFile file( "/proc/version" );
55 if ( file.open( IO_ReadOnly ) ) 57 if ( file.open( IO_ReadOnly ) )
56 { 58 {
57 QTextStream t( &file ); 59 QTextStream t( &file );
58 QStringList strList; 60 QStringList strList;
59 61
60 strList = QStringList::split( " " , t.read(), false ); 62 strList = QStringList::split( " " , t.read(), false );
61 63
62 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " ); 64 kernelVersionString = "<qt>" + tr( "<b>Linux Kernel</b><p>Version: " );
63 kernelVersionString.append( strList[2] ); 65 kernelVersionString.append( strList[2] );
64 kernelVersionString.append( "<br>" ); 66 kernelVersionString.append( "<br>" );
65 kernelVersionString.append( tr( "Compiled by: " ) ); 67 kernelVersionString.append( tr( "Compiled by: " ) );
66 kernelVersionString.append( strList[3] ); 68 kernelVersionString.append( strList[3] );
67 kernelVersionString.append("</qt>"); 69 kernelVersionString.append("</qt>");
68 file.close(); 70 file.close();
69 } 71 }
70 72
71 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " ); 73 QString palmtopVersionString = "<qt>" + tr( "<b>Opie</b><p>Version: " );
72 palmtopVersionString.append( QPE_VERSION ); 74 palmtopVersionString.append( QPE_VERSION );
73 palmtopVersionString.append( "<br>" ); 75 palmtopVersionString.append( "<br>" );
74#ifdef QPE_VENDOR 76#ifdef QPE_VENDOR
75 QString builder = QPE_VENDOR; 77 QString builder = QPE_VENDOR;
76#else 78#else
77 QString builder = "Unknown"; 79 QString builder = "Unknown";
78#endif 80#endif
79 palmtopVersionString.append( tr( "Compiled by: " ) ); 81 palmtopVersionString.append( tr( "Compiled by: " ) );
80 palmtopVersionString.append( builder ); 82 palmtopVersionString.append( builder );
81 palmtopVersionString.append( "<br>" ); 83 palmtopVersionString.append( "<br>" );
82 palmtopVersionString.append( tr( "Built on: " ) ); 84 palmtopVersionString.append( tr( "Built on: " ) );
83 palmtopVersionString.append( __DATE__ ); 85 palmtopVersionString.append( __DATE__ );
84 palmtopVersionString.append( "</qt>" ); 86 palmtopVersionString.append( "</qt>" );
85 87
86 QHBoxLayout *hb1 = new QHBoxLayout( vb ); 88 QHBoxLayout *hb1 = new QHBoxLayout( vb );
87 hb1->setSpacing( 2 ); 89 hb1->setSpacing( 2 );
88 90
89 QLabel *palmtopLogo = new QLabel( container ); 91 QLabel *palmtopLogo = new QLabel( container );
90 QImage logo1 = Resource::loadImage( "logo/opielogo" ); 92 QImage logo1 = Resource::loadImage( "logo/opielogo" );
91 logo1 = logo1.smoothScale( 50, 55 ); 93 logo1 = logo1.smoothScale( 50, 55 );
92 QPixmap logo1Pixmap; 94 QPixmap logo1Pixmap;
93 logo1Pixmap.convertFromImage( logo1 ); 95 logo1Pixmap.convertFromImage( logo1 );
94 palmtopLogo->setPixmap( logo1Pixmap ); 96 palmtopLogo->setPixmap( logo1Pixmap );
95 palmtopLogo->setFixedSize( 60, 60 ); 97 palmtopLogo->setFixedSize( 60, 60 );
96 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft ); 98 hb1->addWidget( palmtopLogo, 0, Qt::AlignTop + Qt::AlignLeft );
97 99
98 QLabel *palmtopVersion = new QLabel( container ); 100 QLabel *palmtopVersion = new QLabel( container );
99 palmtopVersion->setText( palmtopVersionString ); 101 palmtopVersion->setText( palmtopVersionString );
100 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft ); 102 hb1->addWidget( palmtopVersion, 1, Qt::AlignTop + Qt::AlignLeft );
101 103
102 104
103 QHBoxLayout *hb2 = new QHBoxLayout( vb ); 105 QHBoxLayout *hb2 = new QHBoxLayout( vb );
104 hb1->setSpacing( 2 ); 106 hb1->setSpacing( 2 );
105 107
106 QLabel *linuxLogo = new QLabel( container ); 108 QLabel *linuxLogo = new QLabel( container );
107 QImage logo2 = Resource::loadImage( "logo/tux-logo" ); 109 QImage logo2 = Resource::loadImage( "logo/tux-logo" );
108 logo2 = logo2.smoothScale( 55, 60 ); 110 logo2 = logo2.smoothScale( 55, 60 );
109 QPixmap logo2Pixmap; 111 QPixmap logo2Pixmap;
110 logo2Pixmap.convertFromImage( logo2 ); 112 logo2Pixmap.convertFromImage( logo2 );