summaryrefslogtreecommitdiff
path: root/noncore/settings
authormickeyl <mickeyl>2004-03-05 21:37:50 (UTC)
committer mickeyl <mickeyl>2004-03-05 21:37:50 (UTC)
commit8851dc992ab535bde6cb417cafc44658953f495d (patch) (unidiff)
tree0a70bd4a768880e61c5af1ab142508c2bb81ecd0 /noncore/settings
parentb9d58b616102970872129b5bc2f55569910f5c03 (diff)
downloadopie-8851dc992ab535bde6cb417cafc44658953f495d.zip
opie-8851dc992ab535bde6cb417cafc44658953f495d.tar.gz
opie-8851dc992ab535bde6cb417cafc44658953f495d.tar.bz2
use listview stuff from libopie2
miscellaneous cleanups
Diffstat (limited to 'noncore/settings') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.cpp53
-rw-r--r--noncore/settings/sysinfo/benchmarkinfo.h22
-rw-r--r--noncore/settings/sysinfo/detail.cpp4
-rw-r--r--noncore/settings/sysinfo/detail.h6
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp22
-rw-r--r--noncore/settings/sysinfo/modulesinfo.h8
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp24
-rw-r--r--noncore/settings/sysinfo/processinfo.h11
-rw-r--r--noncore/settings/sysinfo/versioninfo.cpp9
9 files changed, 84 insertions, 75 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp
index 2c68fd5..3c2c15f 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.cpp
+++ b/noncore/settings/sysinfo/benchmarkinfo.cpp
@@ -13,14 +13,17 @@
13** 13**
14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 14** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 15** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
16** 16**
17**********************************************************************/ 17**********************************************************************/
18 18
19#include "benchmarkinfo.h"
20
19/* OPIE */ 21/* OPIE */
20#include <opie2/ostorageinfo.h> 22#include <opie2/ostorageinfo.h>
23#include <opie2/olistview.h>
21#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
22#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
23#include <qpe/qpedecoration_qws.h> 26#include <qpe/qpedecoration_qws.h>
24#include <qpe/resource.h> 27#include <qpe/resource.h>
25#include <qpe/config.h> 28#include <qpe/config.h>
26 29
@@ -34,25 +37,23 @@
34#include <qfiledialog.h> 37#include <qfiledialog.h>
35#include <qlabel.h> 38#include <qlabel.h>
36#include <qlayout.h> 39#include <qlayout.h>
37#include <qpainter.h> 40#include <qpainter.h>
38#include <qpushbutton.h> 41#include <qpushbutton.h>
39#include <qtimer.h> 42#include <qtimer.h>
43#include <qwhatsthis.h>
40 44
41/* STD */ 45/* STD */
42#include <time.h> 46#include <time.h>
43#include <stdio.h> 47#include <stdio.h>
44#include <stdlib.h> 48#include <stdlib.h>
45#include <math.h> 49#include <math.h>
46#if defined (__GNUC__) && (__GNUC__ < 3) 50#if defined (__GNUC__) && (__GNUC__ < 3)
47extern double round(double); 51extern double round(double);
48#endif 52#endif
49 53
50
51#include "benchmarkinfo.h"
52
53extern "C" 54extern "C"
54{ 55{
55 void BenchFFT( void ); 56 void BenchFFT( void );
56 double dhry_main( int ); 57 double dhry_main( int );
57} 58}
58 59
@@ -92,69 +93,73 @@ BenchmarkInfo::BenchmarkInfo( QWidget *parent, const char *name, int wFlags )
92 setMinimumSize( 200, 150 ); 93 setMinimumSize( 200, 150 );
93 94
94 QVBoxLayout* vb = new QVBoxLayout( this ); 95 QVBoxLayout* vb = new QVBoxLayout( this );
95 vb->setSpacing( 4 ); 96 vb->setSpacing( 4 );
96 vb->setMargin( 4 ); 97 vb->setMargin( 4 );
97 98
98 tests = new QListView( this ); 99 tests = new OListView( this );
100 QWhatsThis::add( tests->viewport(), tr( "This area shows the available tests, the results for which the tests "
101 "have been performed, and comparison values for one selected device. "
102 "Use the checkboxes to define which tests you want to perform." ) );
99 tests->setMargin( 0 ); 103 tests->setMargin( 0 );
100 tests->addColumn( tr( "Tests" ) ); 104 tests->addColumn( tr( "Tests" ) );
101 tests->addColumn( tr( "Results" ) ); 105 tests->addColumn( tr( "Results" ) );
102 tests->addColumn( tr( "Comparison" ) ); 106 tests->addColumn( tr( "Comparison" ) );
103 tests->setShowSortIndicator( true ); 107 tests->setShowSortIndicator( true );
104 108
105 test_alu = new QCheckListItem( tests, tr( "1. Integer Arithmetic " ), QCheckListItem::CheckBox ); 109 test_alu = new OCheckListItem( tests, tr( "1. Integer Arithmetic " ), OCheckListItem::CheckBox );
106 test_fpu = new QCheckListItem( tests, tr( "2. Floating Point Unit " ), QCheckListItem::CheckBox ); 110 test_fpu = new OCheckListItem( tests, tr( "2. Floating Point Unit " ), OCheckListItem::CheckBox );
107 test_txt = new QCheckListItem( tests, tr( "3. Text Rendering " ), QCheckListItem::CheckBox ); 111 test_txt = new OCheckListItem( tests, tr( "3. Text Rendering " ), OCheckListItem::CheckBox );
108 test_gfx = new QCheckListItem( tests, tr( "4. Gfx Rendering " ), QCheckListItem::CheckBox ); 112 test_gfx = new OCheckListItem( tests, tr( "4. Gfx Rendering " ), OCheckListItem::CheckBox );
109 test_ram = new QCheckListItem( tests, tr( "5. RAM Performance " ), QCheckListItem::CheckBox ); 113 test_ram = new OCheckListItem( tests, tr( "5. RAM Performance " ), OCheckListItem::CheckBox );
110 test_sd = new QCheckListItem( tests, tr( "6. SD Card Performance " ), QCheckListItem::CheckBox ); 114 test_sd = new OCheckListItem( tests, tr( "6. SD Card Performance " ), OCheckListItem::CheckBox );
111 test_cf = new QCheckListItem( tests, tr( "7. CF Card Performance " ), QCheckListItem::CheckBox ); 115 test_cf = new OCheckListItem( tests, tr( "7. CF Card Performance " ), OCheckListItem::CheckBox );
112 116
113 test_alu->setText( 1, "n/a" ); 117 test_alu->setText( 1, "n/a" );
114 test_fpu->setText( 1, "n/a" ); 118 test_fpu->setText( 1, "n/a" );
115 test_txt->setText( 1, "n/a" ); 119 test_txt->setText( 1, "n/a" );
116 test_gfx->setText( 1, "n/a" ); 120 test_gfx->setText( 1, "n/a" );
117 test_ram->setText( 1, "n/a" ); 121 test_ram->setText( 1, "n/a" );
118 test_sd->setText( 1, "n/a" ); 122 test_sd->setText( 1, "n/a" );
119 test_cf->setText( 1, "n/a" ); 123 test_cf->setText( 1, "n/a" );
120 124
121 test_alu->setText( 2, "n/a" ); 125 test_alu->setText( 2, "n/a" );
122 test_fpu->setText( 2, "n/a" ); 126 test_fpu->setText( 2, "n/a" );
123 test_txt->setText( 2, "n/a" ); 127 test_txt->setText( 2, "n/a" );
124 test_gfx->setText( 2, "n/a" ); 128 test_gfx->setText( 2, "n/a" );
125 test_ram->setText( 2, "n/a" ); 129 test_ram->setText( 2, "n/a" );
126 test_sd->setText( 2, "n/a" ); 130 test_sd->setText( 2, "n/a" );
127 test_cf->setText( 2, "n/a" ); 131 test_cf->setText( 2, "n/a" );
128 132
129 startButton = new QPushButton( tr( "&Start Tests!" ), this ); 133 startButton = new QPushButton( tr( "&Start Tests!" ), this );
134 QWhatsThis::add( startButton, tr( "Click here to perform the selected tests." ) );
130 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) ); 135 connect( startButton, SIGNAL( clicked() ), this, SLOT( run() ) );
131
132 vb->addWidget( tests, 2 ); 136 vb->addWidget( tests, 2 );
133 137
134 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" ); 138 QFile f( QPEApplication::qpeDir() + "/share/sysinfo/results" );
135 if ( f.open( IO_ReadOnly ) ) 139 if ( f.open( IO_ReadOnly ) )
136 { 140 {
137 machineCombo = new QComboBox( this ); 141 machineCombo = new QComboBox( this );
138 142 QWhatsThis::add( machineCombo, tr( "Choose a model to compare your results with." ) );
143
139 QTextStream ts( &f ); 144 QTextStream ts( &f );
140 while( !ts.eof() ) 145 while( !ts.eof() )
141 { 146 {
142 QString machline = ts.readLine(); 147 QString machline = ts.readLine();
143 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline ); 148 qDebug( "sysinfo: parsing benchmark results for '%s'", (const char*) machline );
144 QString resline = ts.readLine(); 149 QString resline = ts.readLine();
145 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) ); 150 machines.insert( machline, new QStringList( QStringList::split( ",", resline ) ) );
146 machineCombo->insertItem( machline ); 151 machineCombo->insertItem( machline );
147 } 152 }
148 153
149 QHBoxLayout* hb = new QHBoxLayout( vb ); 154 QHBoxLayout* hb = new QHBoxLayout( vb );
150 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) ); 155 hb->addWidget( new QLabel( tr( "Compare To:" ), this ) );
151 hb->addWidget( machineCombo, 2 ); 156 hb->addWidget( machineCombo, 2 );
152 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) ); 157 connect( machineCombo, SIGNAL( activated(int) ), this, SLOT( machineActivated(int) ) );
153 } 158 }
154 159
155 vb->addWidget( startButton, 2 ); 160 vb->addWidget( startButton, 2 );
156} 161}
157 162
158 163
159BenchmarkInfo::~BenchmarkInfo() 164BenchmarkInfo::~BenchmarkInfo()
160{} 165{}
@@ -329,13 +334,13 @@ int BenchmarkInfo::gfxRendering( int seconds )
329 } 334 }
330 335
331 return loops; 336 return loops;
332 337
333} 338}
334 339
335void BenchmarkInfo::performFileTest( const QString& fname, QCheckListItem* item ) 340void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item )
336{ 341{
337 QTime time; 342 QTime time;
338 time.start(); 343 time.start();
339 if ( writeFile( fname ) && 344 if ( writeFile( fname ) &&
340 readFile( fname ) ) 345 readFile( fname ) )
341 { 346 {
diff --git a/noncore/settings/sysinfo/benchmarkinfo.h b/noncore/settings/sysinfo/benchmarkinfo.h
index d143602..c3d44ec 100644
--- a/noncore/settings/sysinfo/benchmarkinfo.h
+++ b/noncore/settings/sysinfo/benchmarkinfo.h
@@ -20,48 +20,48 @@
20#include <qdialog.h> 20#include <qdialog.h>
21#include <qdict.h> 21#include <qdict.h>
22#include <qstringlist.h> 22#include <qstringlist.h>
23 23
24class QClipboard; 24class QClipboard;
25class QComboBox; 25class QComboBox;
26class QCheckListItem; 26class OCheckListItem;
27class QPushButton; 27class QPushButton;
28class QListView; 28class OListView;
29 29
30class BenchmarkInfo : public QWidget 30class BenchmarkInfo : public QWidget
31{ 31{
32 Q_OBJECT 32 Q_OBJECT
33 33
34public: 34public:
35 BenchmarkInfo( QWidget *parent = 0, const char *name = 0, int wFlags = 0 ); 35 BenchmarkInfo( QWidget *parent = 0, const char *name = 0, int wFlags = 0 );
36 ~BenchmarkInfo(); 36 ~BenchmarkInfo();
37 37
38 QCheckListItem* test_alu; 38 OCheckListItem* test_alu;
39 QCheckListItem* test_fpu; 39 OCheckListItem* test_fpu;
40 QCheckListItem* test_txt; 40 OCheckListItem* test_txt;
41 QCheckListItem* test_gfx; 41 OCheckListItem* test_gfx;
42 QCheckListItem* test_ram; 42 OCheckListItem* test_ram;
43 QCheckListItem* test_sd; 43 OCheckListItem* test_sd;
44 QCheckListItem* test_cf; 44 OCheckListItem* test_cf;
45 45
46 bool main_rd; 46 bool main_rd;
47 bool main_wt; 47 bool main_wt;
48 bool sd_rd; 48 bool sd_rd;
49 bool sd_wt; 49 bool sd_wt;
50 bool cf_rd; 50 bool cf_rd;
51 bool cf_wt; 51 bool cf_wt;
52 52
53 QClipboard* clb; 53 QClipboard* clb;
54 QComboBox* machineCombo; 54 QComboBox* machineCombo;
55 QListView* tests; 55 OListView* tests;
56 QPushButton* startButton; 56 QPushButton* startButton;
57 QDict <QStringList> machines; 57 QDict <QStringList> machines;
58 58
59 int textRendering( int ); 59 int textRendering( int );
60 int gfxRendering( int ); 60 int gfxRendering( int );
61 void performFileTest( const QString& fname, QCheckListItem* item ); 61 void performFileTest( const QString& fname, OCheckListItem* item );
62 62
63private slots: 63private slots:
64 bool writeFile( const QString& ); 64 bool writeFile( const QString& );
65 bool readFile( const QString& ); 65 bool readFile( const QString& );
66 void run(); 66 void run();
67 void machineActivated( int ); 67 void machineActivated( int );
diff --git a/noncore/settings/sysinfo/detail.cpp b/noncore/settings/sysinfo/detail.cpp
index 79daa2b..6645fdd 100644
--- a/noncore/settings/sysinfo/detail.cpp
+++ b/noncore/settings/sysinfo/detail.cpp
@@ -18,15 +18,13 @@
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19** 19**
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "detail.h" 22#include "detail.h"
23 23
24#include <sys/types.h> 24#include <qtextview.h>
25#include <stdio.h>
26
27#include <qlayout.h> 25#include <qlayout.h>
28 26
29Detail::Detail( QWidget* parent, const char* name, WFlags ) 27Detail::Detail( QWidget* parent, const char* name, WFlags )
30 : QWidget( parent, name, WStyle_ContextHelp ) 28 : QWidget( parent, name, WStyle_ContextHelp )
31{ 29{
32 QVBoxLayout *layout = new QVBoxLayout( this ); 30 QVBoxLayout *layout = new QVBoxLayout( this );
diff --git a/noncore/settings/sysinfo/detail.h b/noncore/settings/sysinfo/detail.h
index 7ca9d45..71d3e3a 100644
--- a/noncore/settings/sysinfo/detail.h
+++ b/noncore/settings/sysinfo/detail.h
@@ -20,16 +20,14 @@
20**********************************************************************/ 20**********************************************************************/
21 21
22#ifndef DETAIL_H 22#ifndef DETAIL_H
23#define DETAIL_H 23#define DETAIL_H
24 24
25#include <qwidget.h> 25#include <qwidget.h>
26#include <qcombo.h> 26
27#include <qtextview.h> 27class QTextView;
28#include <qpushbutton.h>
29#include <qlistview.h>
30 28
31class Detail : public QWidget 29class Detail : public QWidget
32{ 30{
33 Q_OBJECT 31 Q_OBJECT
34 32
35public: 33public:
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index e688a29..dfe48e1 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -20,29 +20,33 @@
20**********************************************************************/ 20**********************************************************************/
21 21
22#include "modulesinfo.h" 22#include "modulesinfo.h"
23#include "detail.h" 23#include "detail.h"
24 24
25/* OPIE */ 25/* OPIE */
26#include <opie2/olistview.h>
26#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
27 28
28/* QT */ 29/* QT */
30#include <qcombobox.h>
29#include <qfile.h> 31#include <qfile.h>
30#include <qlayout.h> 32#include <qlayout.h>
31#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qpushbutton.h>
35#include <qtextview.h>
32#include <qtimer.h> 36#include <qtimer.h>
33#include <qwhatsthis.h> 37#include <qwhatsthis.h>
34 38
35ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 39ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
36 : QWidget( parent, name, fl ) 40 : QWidget( parent, name, fl )
37{ 41{
38 QGridLayout *layout = new QGridLayout( this ); 42 QGridLayout *layout = new QGridLayout( this );
39 layout->setSpacing( 4 ); 43 layout->setSpacing( 4 );
40 layout->setMargin( 4 ); 44 layout->setMargin( 4 );
41 45
42 ModulesView = new QListView( this ); 46 ModulesView = new OListView( this );
43 int colnum = ModulesView->addColumn( tr( "Module" ) ); 47 int colnum = ModulesView->addColumn( tr( "Module" ) );
44 colnum = ModulesView->addColumn( tr( "Size" ) ); 48 colnum = ModulesView->addColumn( tr( "Size" ) );
45 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 49 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
46 colnum = ModulesView->addColumn( tr( "Use#" ) ); 50 colnum = ModulesView->addColumn( tr( "Use#" ) );
47 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 51 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
48 colnum = ModulesView->addColumn( tr( "Used by" ) ); 52 colnum = ModulesView->addColumn( tr( "Used by" ) );
@@ -51,14 +55,14 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
51 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) ); 55 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) );
52 56
53 // Test if we have /sbin/modinfo, and if so, allow module detail window 57 // Test if we have /sbin/modinfo, and if so, allow module detail window
54 if ( QFile::exists( "/sbin/modinfo" ) ) 58 if ( QFile::exists( "/sbin/modinfo" ) )
55 { 59 {
56 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); 60 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
57 connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), 61 connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ),
58 this, SLOT( viewModules(QListViewItem*) ) ); 62 this, SLOT( viewModules(OListViewItem*) ) );
59 } 63 }
60 64
61 CommandCB = new QComboBox( FALSE, this ); 65 CommandCB = new QComboBox( FALSE, this );
62 CommandCB->insertItem( "modprobe -r" ); 66 CommandCB->insertItem( "modprobe -r" );
63 CommandCB->insertItem( "rmmod" ); 67 CommandCB->insertItem( "rmmod" );
64 // I can't think of other useful commands yet. Anyone? 68 // I can't think of other useful commands yet. Anyone?
@@ -90,26 +94,26 @@ void ModulesInfo::updateData()
90{ 94{
91 char modname[64]; 95 char modname[64];
92 char usage[200]; 96 char usage[200];
93 int modsize, usecount; 97 int modsize, usecount;
94 98
95 QString selectedmod; 99 QString selectedmod;
96 QListViewItem *curritem = ModulesView->currentItem(); 100 OListViewItem *curritem = static_cast<OListViewItem*>( ModulesView->currentItem() );
97 if ( curritem ) 101 if ( curritem )
98 { 102 {
99 selectedmod = curritem->text( 0 ); 103 selectedmod = curritem->text( 0 );
100 } 104 }
101 105
102 ModulesView->clear(); 106 ModulesView->clear();
103 107
104 FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r"); 108 FILE *procfile = fopen( ( QString ) ( "/proc/modules"), "r");
105 109
106 if ( procfile ) 110 if ( procfile )
107 { 111 {
108 QListViewItem *newitem; 112 OListViewItem *newitem;
109 QListViewItem *selecteditem = 0x0; 113 OListViewItem *selecteditem = 0x0;
110 while ( true ) 114 while ( true )
111 { 115 {
112 modname[0] = '\0'; 116 modname[0] = '\0';
113 usage[0] = '\0'; 117 usage[0] = '\0';
114 int success = fscanf( procfile, "%s%d%d%[^\n]", modname, &modsize, &usecount, usage ); 118 int success = fscanf( procfile, "%s%d%d%[^\n]", modname, &modsize, &usecount, usage );
115 119
@@ -118,13 +122,13 @@ void ModulesInfo::updateData()
118 122
119 QString qmodname = QString( modname ); 123 QString qmodname = QString( modname );
120 QString qmodsize = QString::number( modsize ).rightJustify( 6, ' ' ); 124 QString qmodsize = QString::number( modsize ).rightJustify( 6, ' ' );
121 QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' ); 125 QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' );
122 QString qusage = QString( usage ); 126 QString qusage = QString( usage );
123 127
124 newitem = new QListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage ); 128 newitem = new OListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage );
125 if ( qmodname == selectedmod ) 129 if ( qmodname == selectedmod )
126 { 130 {
127 selecteditem = newitem; 131 selecteditem = newitem;
128 } 132 }
129 } 133 }
130 ModulesView->setCurrentItem( selecteditem ); 134 ModulesView->setCurrentItem( selecteditem );
@@ -137,13 +141,13 @@ void ModulesInfo::slotSendClicked()
137{ 141{
138 if ( !ModulesView->currentItem() ) 142 if ( !ModulesView->currentItem() )
139 { 143 {
140 return; 144 return;
141 } 145 }
142 146
143 QString capstr = tr( "You really want to execute %1 for this module?" ).arg( CommandCB->currentText() ); 147 QString capstr = tr( "You really want to execute\n%1 for this module?" ).arg( CommandCB->currentText() );
144 148
145 QString modname = ModulesView->currentItem()->text( 0 ); 149 QString modname = ModulesView->currentItem()->text( 0 );
146 150
147 if ( QMessageBox::warning( this, modname, capstr, 151 if ( QMessageBox::warning( this, modname, capstr,
148 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) 152 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
149 { 153 {
@@ -156,13 +160,13 @@ void ModulesInfo::slotSendClicked()
156 if ( stream ) 160 if ( stream )
157 pclose( stream ); 161 pclose( stream );
158 } 162 }
159 163
160} 164}
161 165
162void ModulesInfo::viewModules( QListViewItem *modules ) 166void ModulesInfo::viewModules( OListViewItem *modules )
163{ 167{
164 QString modname = modules->text( 0 ); 168 QString modname = modules->text( 0 );
165 QString capstr = "Module: "; 169 QString capstr = "Module: ";
166 capstr.append( modname ); 170 capstr.append( modname );
167 ModulesDtl->setCaption( capstr ); 171 ModulesDtl->setCaption( capstr );
168 QString command = "/sbin/modinfo "; 172 QString command = "/sbin/modinfo ";
diff --git a/noncore/settings/sysinfo/modulesinfo.h b/noncore/settings/sysinfo/modulesinfo.h
index e974610..78dce73 100644
--- a/noncore/settings/sysinfo/modulesinfo.h
+++ b/noncore/settings/sysinfo/modulesinfo.h
@@ -23,29 +23,29 @@
23#define MODULESINFO_H 23#define MODULESINFO_H
24 24
25#include <qwidget.h> 25#include <qwidget.h>
26 26
27class Detail; 27class Detail;
28class QComboBox; 28class QComboBox;
29class QListView; 29class OListView;
30class QListViewItem; 30class OListViewItem;
31 31
32class ModulesInfo : public QWidget 32class ModulesInfo : public QWidget
33{ 33{
34 Q_OBJECT 34 Q_OBJECT
35public: 35public:
36 ModulesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 36 ModulesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
37 ~ModulesInfo(); 37 ~ModulesInfo();
38 38
39private: 39private:
40 QListView* ModulesView; 40 OListView* ModulesView;
41 QComboBox* CommandCB; 41 QComboBox* CommandCB;
42 42
43 Detail* ModulesDtl; 43 Detail* ModulesDtl;
44 44
45private slots: 45private slots:
46 void updateData(); 46 void updateData();
47 void slotSendClicked(); 47 void slotSendClicked();
48 void viewModules( QListViewItem * ); 48 void viewModules( OListViewItem * );
49}; 49};
50 50
51#endif 51#endif
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 69b4ab5..dd9a05d 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -18,18 +18,22 @@
18**********************************************************************/ 18**********************************************************************/
19 19
20#include "processinfo.h" 20#include "processinfo.h"
21#include "detail.h" 21#include "detail.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/olistview.h>
24#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
25 26
26/* QT */ 27/* QT */
28#include <qcombobox.h>
27#include <qdir.h> 29#include <qdir.h>
28#include <qlayout.h> 30#include <qlayout.h>
29#include <qmessagebox.h> 31#include <qmessagebox.h>
32#include <qpushbutton.h>
33#include <qtextview.h>
30#include <qtimer.h> 34#include <qtimer.h>
31#include <qwhatsthis.h> 35#include <qwhatsthis.h>
32 36
33/* STD */ 37/* STD */
34#include <sys/types.h> 38#include <sys/types.h>
35#include <signal.h> 39#include <signal.h>
@@ -39,23 +43,23 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
39{ 43{
40 QGridLayout *layout = new QGridLayout( this ); 44 QGridLayout *layout = new QGridLayout( this );
41 layout->setSpacing( 4 ); 45 layout->setSpacing( 4 );
42 layout->setMargin( 4 ); 46 layout->setMargin( 4 );
43 47
44 48
45 ProcessView = new QListView( this, "ProcessView" ); 49 ProcessView = new OListView( this, "ProcessView" );
46 int colnum = ProcessView->addColumn( tr( "PID" ) ); 50 int colnum = ProcessView->addColumn( tr( "PID" ) );
47 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 51 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
48 colnum = ProcessView->addColumn( tr( "Command" ),96 ); 52 colnum = ProcessView->addColumn( tr( "Command" ),96 );
49 colnum = ProcessView->addColumn( tr( "Status" ) ); 53 colnum = ProcessView->addColumn( tr( "Status" ) );
50 colnum = ProcessView->addColumn( tr( "Time" ) ); 54 colnum = ProcessView->addColumn( tr( "Time" ) );
51 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 55 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
52 ProcessView->setAllColumnsShowFocus( TRUE ); 56 ProcessView->setAllColumnsShowFocus( TRUE );
53 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); 57 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold );
54 connect( ProcessView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), 58 connect( ProcessView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ),
55 this, SLOT( viewProcess(QListViewItem*) ) ); 59 this, SLOT( viewProcess(OListViewItem*) ) );
56 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); 60 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 );
57 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) ); 61 QWhatsThis::add( ProcessView, tr( "This is a list of all the processes on this handheld device.\n\nClick and hold on a process to see additional information about the process, or to send a signal to it." ) );
58 62
59 SignalCB = new QComboBox( FALSE, this, "SignalCB" ); 63 SignalCB = new QComboBox( FALSE, this, "SignalCB" );
60 SignalCB->insertItem( " 1: SIGHUP" ); 64 SignalCB->insertItem( " 1: SIGHUP" );
61 SignalCB->insertItem( " 2: SIGINT" ); 65 SignalCB->insertItem( " 2: SIGINT" );
@@ -98,22 +102,22 @@ void ProcessInfo::updateData()
98 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode, 102 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode,
99 endcode, startstack, kstkesp, kstkeip, wchan; 103 endcode, startstack, kstkesp, kstkeip, wchan;
100 char state; 104 char state;
101 char comm[64]; 105 char comm[64];
102 106
103 QString selectedpid; 107 QString selectedpid;
104 QListViewItem *curritem = ProcessView->currentItem(); 108 OListViewItem *curritem = static_cast<OListViewItem*>( ProcessView->currentItem() );
105 if ( curritem ) 109 if ( curritem )
106 { 110 {
107 selectedpid = curritem->text( 0 ); 111 selectedpid = curritem->text( 0 );
108 } 112 }
109 113
110 ProcessView->clear(); 114 ProcessView->clear();
111 115
112 QListViewItem *newitem; 116 OListViewItem *newitem;
113 QListViewItem *selecteditem = 0x0; 117 OListViewItem *selecteditem = 0x0;
114 QDir *procdir = new QDir("/proc", 0, QDir::Name, QDir::Dirs); 118 QDir *procdir = new QDir("/proc", 0, QDir::Name, QDir::Dirs);
115 QFileInfoList *proclist = new QFileInfoList(*(procdir->entryInfoList())); 119 QFileInfoList *proclist = new QFileInfoList(*(procdir->entryInfoList()));
116 if ( proclist ) 120 if ( proclist )
117 { 121 {
118 QFileInfoListIterator it(*proclist); 122 QFileInfoListIterator it(*proclist);
119 QFileInfo *f; 123 QFileInfo *f;
@@ -137,13 +141,13 @@ void ProcessInfo::updateData()
137 QString processcmd = QString( comm ).replace( QRegExp( "[()]" ), "" ); 141 QString processcmd = QString( comm ).replace( QRegExp( "[()]" ), "" );
138 QString processstatus = QChar(state); 142 QString processstatus = QChar(state);
139 QString processtime = QString::number( ( utime + stime ) / 100 ); 143 QString processtime = QString::number( ( utime + stime ) / 100 );
140 processtime = processtime.rightJustify( 9, ' ' ); 144 processtime = processtime.rightJustify( 9, ' ' );
141 fclose( procfile ); 145 fclose( procfile );
142 146
143 newitem = new QListViewItem( ProcessView, processnum, processcmd, processstatus, processtime ); 147 newitem = new OListViewItem( ProcessView, processnum, processcmd, processstatus, processtime );
144 if ( processnum == selectedpid ) 148 if ( processnum == selectedpid )
145 { 149 {
146 selecteditem = newitem; 150 selecteditem = newitem;
147 } 151 }
148 } 152 }
149 } 153 }
@@ -154,37 +158,37 @@ void ProcessInfo::updateData()
154 delete proclist; 158 delete proclist;
155 delete procdir; 159 delete procdir;
156} 160}
157 161
158void ProcessInfo::slotSendClicked() 162void ProcessInfo::slotSendClicked()
159{ 163{
160 QListViewItem *currprocess = ProcessView->currentItem(); 164 OListViewItem *currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() );
161 if ( !currprocess ) 165 if ( !currprocess )
162 { 166 {
163 return; 167 return;
164 } 168 }
165 169
166 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() ); 170 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() );
167 171
168 172
169 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr, 173 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr,
170 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) 174 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
171 { 175 {
172 currprocess = ProcessView->currentItem(); 176 currprocess = static_cast<OListViewItem*>( ProcessView->currentItem() );
173 if ( currprocess ) 177 if ( currprocess )
174 { 178 {
175 QString sigstr = SignalCB->currentText(); 179 QString sigstr = SignalCB->currentText();
176 sigstr.truncate(2); 180 sigstr.truncate(2);
177 int sigid = sigstr.toUInt(); 181 int sigid = sigstr.toUInt();
178 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid ); 182 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid );
179 } 183 }
180 } 184 }
181 185
182} 186}
183 187
184void ProcessInfo::viewProcess( QListViewItem *process ) 188void ProcessInfo::viewProcess( OListViewItem *process )
185{ 189{
186 QString pid= process->text( 0 ).stripWhiteSpace(); 190 QString pid= process->text( 0 ).stripWhiteSpace();
187 QString command = process->text( 1 ); 191 QString command = process->text( 1 );
188 ProcessDtl->setCaption( pid + " - " + command ); 192 ProcessDtl->setCaption( pid + " - " + command );
189 FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r"); 193 FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r");
190 if ( statfile ) 194 if ( statfile )
diff --git a/noncore/settings/sysinfo/processinfo.h b/noncore/settings/sysinfo/processinfo.h
index 687e080..6e7acd5 100644
--- a/noncore/settings/sysinfo/processinfo.h
+++ b/noncore/settings/sysinfo/processinfo.h
@@ -18,34 +18,33 @@
18**********************************************************************/ 18**********************************************************************/
19 19
20#ifndef PROCESSINFO_H 20#ifndef PROCESSINFO_H
21#define PROCESSINFO_H 21#define PROCESSINFO_H
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24#include <qlistview.h>
25 24
26class Detail; 25class Detail;
27class QComboBox; 26class QComboBox;
28class QListView; 27class OListView;
29class QListViewItem; 28class OListViewItem;
30 29
31class ProcessInfo : public QWidget 30class ProcessInfo : public QWidget
32{ 31{
33 Q_OBJECT 32 Q_OBJECT
34public: 33public:
35 ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); 34 ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 );
36 ~ProcessInfo(); 35 ~ProcessInfo();
37 36
38private: 37private:
39 QListView* ProcessView; 38 OListView* ProcessView;
40 QComboBox* SignalCB; 39 QComboBox* SignalCB;
41 QPushButton* SendButton; 40 QPushButton* SendButton;
42 41
43 Detail *ProcessDtl; 42 Detail *ProcessDtl;
44 43
45private slots: 44private slots:
46 void updateData(); 45 void updateData();
47 void slotSendClicked(); 46 void slotSendClicked();
48 void viewProcess( QListViewItem * ); 47 void viewProcess( OListViewItem * );
49}; 48};
50 49
51#endif 50#endif
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp
index 0ebcebe..4bebd06 100644
--- a/noncore/settings/sysinfo/versioninfo.cpp
+++ b/noncore/settings/sysinfo/versioninfo.cpp
@@ -15,26 +15,27 @@
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"
22
23/* OPIE */
24#include <opie2/odevice.h>
21#include <qpe/resource.h> 25#include <qpe/resource.h>
22#include <qpe/version.h> 26#include <qpe/version.h>
23 27
28/* QT */
24#include <qfile.h> 29#include <qfile.h>
25#include <qlabel.h> 30#include <qlabel.h>
26#include <qlayout.h> 31#include <qlayout.h>
27#include <qscrollview.h> 32#include <qscrollview.h>
28#include <qtextstream.h> 33#include <qtextstream.h>
29#include <qwhatsthis.h> 34#include <qwhatsthis.h>
30 35
31#include "versioninfo.h"
32
33#include <opie2/odevice.h>
34
35using namespace Opie; 36using namespace Opie;
36 37
37VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) 38VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f )
38 : QWidget( parent, name, f ) 39 : QWidget( parent, name, f )
39{ 40{
40 setMinimumSize( 200, 150 ); 41 setMinimumSize( 200, 150 );