author | zecke <zecke> | 2004-03-14 16:01:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 16:01:52 (UTC) |
commit | f12af18557c8f376f0c6c30e80a85737ff6c592e (patch) (unidiff) | |
tree | d60806f34f4ff6af82491579e80c9ef72cd4071e /noncore/settings/sysinfo | |
parent | 13aeeabab5f2a6262b33de83cc9559a49365e325 (diff) | |
download | opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.zip opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.gz opie-f12af18557c8f376f0c6c30e80a85737ff6c592e.tar.bz2 |
Make use of ODP
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.cpp | 21 | ||||
-rw-r--r-- | noncore/settings/sysinfo/benchmarkinfo.h | 22 | ||||
-rw-r--r-- | noncore/settings/sysinfo/main.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/modulesinfo.cpp | 10 | ||||
-rw-r--r-- | noncore/settings/sysinfo/modulesinfo.h | 10 | ||||
-rw-r--r-- | noncore/settings/sysinfo/processinfo.cpp | 11 | ||||
-rw-r--r-- | noncore/settings/sysinfo/processinfo.h | 10 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.cpp | 1 | ||||
-rw-r--r-- | noncore/settings/sysinfo/versioninfo.cpp | 2 |
9 files changed, 55 insertions, 33 deletions
diff --git a/noncore/settings/sysinfo/benchmarkinfo.cpp b/noncore/settings/sysinfo/benchmarkinfo.cpp index 3c2c15f..2a52b00 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.cpp +++ b/noncore/settings/sysinfo/benchmarkinfo.cpp | |||
@@ -51,7 +51,10 @@ | |||
51 | extern double round(double); | 51 | extern double round(double); |
52 | #endif | 52 | #endif |
53 | 53 | ||
54 | using namespace Opie::Ui; | ||
55 | using namespace Opie::Core; | ||
54 | extern "C" | 56 | extern "C" |
57 | |||
55 | { | 58 | { |
56 | void BenchFFT( void ); | 59 | void BenchFFT( void ); |
57 | double dhry_main( int ); | 60 | double dhry_main( int ); |
@@ -175,12 +178,12 @@ void BenchmarkInfo::machineActivated( int index ) | |||
175 | } | 178 | } |
176 | QStringList::Iterator it = results->begin(); | 179 | QStringList::Iterator it = results->begin(); |
177 | test_alu->setText( 2, *(it++) ); | 180 | test_alu->setText( 2, *(it++) ); |
178 | test_fpu->setText( 2, *(it++) ); | 181 | test_fpu->setText( 2, *(it++) ); |
179 | test_txt->setText( 2, *(it++) ); | 182 | test_txt->setText( 2, *(it++) ); |
180 | test_gfx->setText( 2, *(it++) ); | 183 | test_gfx->setText( 2, *(it++) ); |
181 | test_ram->setText( 2, *(it++) ); | 184 | test_ram->setText( 2, *(it++) ); |
182 | test_sd->setText( 2, *(it++) ); | 185 | test_sd->setText( 2, *(it++) ); |
183 | test_cf->setText( 2, *(it++) ); | 186 | test_cf->setText( 2, *(it++) ); |
184 | } | 187 | } |
185 | 188 | ||
186 | 189 | ||
@@ -259,7 +262,7 @@ int BenchmarkInfo::textRendering( int seconds ) | |||
259 | BenchmarkPaintWidget bpw; | 262 | BenchmarkPaintWidget bpw; |
260 | 263 | ||
261 | int loops = 0; | 264 | int loops = 0; |
262 | 265 | ||
263 | while ( t.elapsed() < stop ) | 266 | while ( t.elapsed() < stop ) |
264 | { | 267 | { |
265 | int k = rand() % 9; | 268 | int k = rand() % 9; |
@@ -269,7 +272,7 @@ int BenchmarkInfo::textRendering( int seconds ) | |||
269 | bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); | 272 | bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); |
270 | ++loops; | 273 | ++loops; |
271 | } | 274 | } |
272 | 275 | ||
273 | return loops * text.length(); | 276 | return loops * text.length(); |
274 | } | 277 | } |
275 | 278 | ||
@@ -290,7 +293,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) | |||
290 | t.start(); | 293 | t.start(); |
291 | int stop = t.elapsed() + seconds*1000; | 294 | int stop = t.elapsed() + seconds*1000; |
292 | int loops = 0; | 295 | int loops = 0; |
293 | 296 | ||
294 | while ( t.elapsed() < stop ) | 297 | while ( t.elapsed() < stop ) |
295 | { | 298 | { |
296 | int k = rand() % 9; | 299 | int k = rand() % 9; |
@@ -301,7 +304,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) | |||
301 | 304 | ||
302 | t.restart(); | 305 | t.restart(); |
303 | stop = t.elapsed() + seconds*1000; | 306 | stop = t.elapsed() + seconds*1000; |
304 | 307 | ||
305 | while ( t.elapsed() < stop ) | 308 | while ( t.elapsed() < stop ) |
306 | { | 309 | { |
307 | int k = rand() % 9; | 310 | int k = rand() % 9; |
@@ -314,7 +317,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) | |||
314 | br1.setStyle( SolidPattern ); | 317 | br1.setStyle( SolidPattern ); |
315 | t.restart(); | 318 | t.restart(); |
316 | stop = t.elapsed() + seconds*1000; | 319 | stop = t.elapsed() + seconds*1000; |
317 | 320 | ||
318 | while ( t.elapsed() < stop ) | 321 | while ( t.elapsed() < stop ) |
319 | { | 322 | { |
320 | int k = rand() % 9; | 323 | int k = rand() % 9; |
@@ -326,7 +329,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) | |||
326 | QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); | 329 | QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); |
327 | t.restart(); | 330 | t.restart(); |
328 | stop = t.elapsed() + seconds*1000; | 331 | stop = t.elapsed() + seconds*1000; |
329 | 332 | ||
330 | while ( t.elapsed() < stop ) | 333 | while ( t.elapsed() < stop ) |
331 | { | 334 | { |
332 | bpw.p.drawPixmap( rand()%w, rand()%h, p ); | 335 | bpw.p.drawPixmap( rand()%w, rand()%h, p ); |
@@ -334,7 +337,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) | |||
334 | } | 337 | } |
335 | 338 | ||
336 | return loops; | 339 | return loops; |
337 | 340 | ||
338 | } | 341 | } |
339 | 342 | ||
340 | void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) | 343 | void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) |
diff --git a/noncore/settings/sysinfo/benchmarkinfo.h b/noncore/settings/sysinfo/benchmarkinfo.h index c3d44ec..0a61134 100644 --- a/noncore/settings/sysinfo/benchmarkinfo.h +++ b/noncore/settings/sysinfo/benchmarkinfo.h | |||
@@ -23,9 +23,9 @@ | |||
23 | 23 | ||
24 | class QClipboard; | 24 | class QClipboard; |
25 | class QComboBox; | 25 | class QComboBox; |
26 | class OCheckListItem; | 26 | namespace Opie {namespace Ui {class OCheckListItem;}} |
27 | class QPushButton; | 27 | class QPushButton; |
28 | class OListView; | 28 | namespace Opie {namespace Ui {class OListView;}} |
29 | 29 | ||
30 | class BenchmarkInfo : public QWidget | 30 | class BenchmarkInfo : public QWidget |
31 | { | 31 | { |
@@ -35,13 +35,13 @@ public: | |||
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 | OCheckListItem* test_alu; | 38 | Opie::Ui::OCheckListItem* test_alu; |
39 | OCheckListItem* test_fpu; | 39 | Opie::Ui::OCheckListItem* test_fpu; |
40 | OCheckListItem* test_txt; | 40 | Opie::Ui::OCheckListItem* test_txt; |
41 | OCheckListItem* test_gfx; | 41 | Opie::Ui::OCheckListItem* test_gfx; |
42 | OCheckListItem* test_ram; | 42 | Opie::Ui::OCheckListItem* test_ram; |
43 | OCheckListItem* test_sd; | 43 | Opie::Ui::OCheckListItem* test_sd; |
44 | OCheckListItem* test_cf; | 44 | Opie::Ui::OCheckListItem* test_cf; |
45 | 45 | ||
46 | bool main_rd; | 46 | bool main_rd; |
47 | bool main_wt; | 47 | bool main_wt; |
@@ -52,13 +52,13 @@ public: | |||
52 | 52 | ||
53 | QClipboard* clb; | 53 | QClipboard* clb; |
54 | QComboBox* machineCombo; | 54 | QComboBox* machineCombo; |
55 | OListView* tests; | 55 | Opie::Ui::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, OCheckListItem* item ); | 61 | void performFileTest( const QString& fname, Opie::Ui::OCheckListItem* item ); |
62 | 62 | ||
63 | private slots: | 63 | private slots: |
64 | bool writeFile( const QString& ); | 64 | bool writeFile( const QString& ); |
diff --git a/noncore/settings/sysinfo/main.cpp b/noncore/settings/sysinfo/main.cpp index 3a7b1b1..8ebac20 100644 --- a/noncore/settings/sysinfo/main.cpp +++ b/noncore/settings/sysinfo/main.cpp | |||
@@ -23,4 +23,5 @@ | |||
23 | #include <opie2/oapplicationfactory.h> | 23 | #include <opie2/oapplicationfactory.h> |
24 | 24 | ||
25 | 25 | ||
26 | using namespace Opie::Core; | ||
26 | OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> ) | 27 | OPIE_EXPORT_APP( OApplicationFactory<SystemInfo> ) |
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp index dfe48e1..71cefcb 100644 --- a/noncore/settings/sysinfo/modulesinfo.cpp +++ b/noncore/settings/sysinfo/modulesinfo.cpp | |||
@@ -36,6 +36,7 @@ | |||
36 | #include <qtimer.h> | 36 | #include <qtimer.h> |
37 | #include <qwhatsthis.h> | 37 | #include <qwhatsthis.h> |
38 | 38 | ||
39 | using namespace Opie::Ui; | ||
39 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | 40 | ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) |
40 | : QWidget( parent, name, fl ) | 41 | : QWidget( parent, name, fl ) |
41 | { | 42 | { |
@@ -58,8 +59,8 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) | |||
58 | if ( QFile::exists( "/sbin/modinfo" ) ) | 59 | if ( QFile::exists( "/sbin/modinfo" ) ) |
59 | { | 60 | { |
60 | QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); | 61 | QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); |
61 | connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), | 62 | connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), |
62 | this, SLOT( viewModules(OListViewItem*) ) ); | 63 | this, SLOT( viewModules(QListViewItem*) ) ); |
63 | } | 64 | } |
64 | 65 | ||
65 | CommandCB = new QComboBox( FALSE, this ); | 66 | CommandCB = new QComboBox( FALSE, this ); |
@@ -163,6 +164,11 @@ void ModulesInfo::slotSendClicked() | |||
163 | 164 | ||
164 | } | 165 | } |
165 | 166 | ||
167 | void ModulesInfo::viewModules( QListViewItem *module ) { | ||
168 | if ( !module ) | ||
169 | return; | ||
170 | viewModules( static_cast<OListViewItem*>( module ) ); | ||
171 | } | ||
166 | void ModulesInfo::viewModules( OListViewItem *modules ) | 172 | void ModulesInfo::viewModules( OListViewItem *modules ) |
167 | { | 173 | { |
168 | QString modname = modules->text( 0 ); | 174 | QString modname = modules->text( 0 ); |
diff --git a/noncore/settings/sysinfo/modulesinfo.h b/noncore/settings/sysinfo/modulesinfo.h index 78dce73..b816b41 100644 --- a/noncore/settings/sysinfo/modulesinfo.h +++ b/noncore/settings/sysinfo/modulesinfo.h | |||
@@ -26,8 +26,9 @@ | |||
26 | 26 | ||
27 | class Detail; | 27 | class Detail; |
28 | class QComboBox; | 28 | class QComboBox; |
29 | class OListView; | 29 | class QListViewItem; |
30 | class OListViewItem; | 30 | namespace Opie {namespace Ui {class OListView;}} |
31 | namespace Opie {namespace Ui {class OListViewItem;}} | ||
31 | 32 | ||
32 | class ModulesInfo : public QWidget | 33 | class ModulesInfo : public QWidget |
33 | { | 34 | { |
@@ -37,7 +38,7 @@ public: | |||
37 | ~ModulesInfo(); | 38 | ~ModulesInfo(); |
38 | 39 | ||
39 | private: | 40 | private: |
40 | OListView* ModulesView; | 41 | Opie::Ui::OListView* ModulesView; |
41 | QComboBox* CommandCB; | 42 | QComboBox* CommandCB; |
42 | 43 | ||
43 | Detail* ModulesDtl; | 44 | Detail* ModulesDtl; |
@@ -45,7 +46,8 @@ private: | |||
45 | private slots: | 46 | private slots: |
46 | void updateData(); | 47 | void updateData(); |
47 | void slotSendClicked(); | 48 | void slotSendClicked(); |
48 | void viewModules( OListViewItem * ); | 49 | void viewModules( QListViewItem* ); |
50 | void viewModules( Opie::Ui::OListViewItem * ); | ||
49 | }; | 51 | }; |
50 | 52 | ||
51 | #endif | 53 | #endif |
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp index dd9a05d..e887267 100644 --- a/noncore/settings/sysinfo/processinfo.cpp +++ b/noncore/settings/sysinfo/processinfo.cpp | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <sys/types.h> | 38 | #include <sys/types.h> |
39 | #include <signal.h> | 39 | #include <signal.h> |
40 | 40 | ||
41 | using namespace Opie::Ui; | ||
41 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | 42 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) |
42 | : QWidget( parent, name, fl ) | 43 | : QWidget( parent, name, fl ) |
43 | { | 44 | { |
@@ -55,8 +56,8 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | |||
55 | ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); | 56 | ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); |
56 | ProcessView->setAllColumnsShowFocus( TRUE ); | 57 | ProcessView->setAllColumnsShowFocus( TRUE ); |
57 | QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); | 58 | QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); |
58 | connect( ProcessView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), | 59 | connect( ProcessView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), |
59 | this, SLOT( viewProcess(OListViewItem*) ) ); | 60 | this, SLOT( viewProcess(QListViewItem*) ) ); |
60 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); | 61 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); |
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." ) ); | 62 | 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." ) ); |
62 | 63 | ||
@@ -185,6 +186,12 @@ void ProcessInfo::slotSendClicked() | |||
185 | 186 | ||
186 | } | 187 | } |
187 | 188 | ||
189 | void ProcessInfo::viewProcess( QListViewItem* process ) { | ||
190 | if ( !process ) | ||
191 | return; | ||
192 | viewProcess( static_cast<OListViewItem*>( process ) ); | ||
193 | } | ||
194 | |||
188 | void ProcessInfo::viewProcess( OListViewItem *process ) | 195 | void ProcessInfo::viewProcess( OListViewItem *process ) |
189 | { | 196 | { |
190 | QString pid= process->text( 0 ).stripWhiteSpace(); | 197 | QString pid= process->text( 0 ).stripWhiteSpace(); |
diff --git a/noncore/settings/sysinfo/processinfo.h b/noncore/settings/sysinfo/processinfo.h index 6e7acd5..0a1682b 100644 --- a/noncore/settings/sysinfo/processinfo.h +++ b/noncore/settings/sysinfo/processinfo.h | |||
@@ -24,8 +24,9 @@ | |||
24 | 24 | ||
25 | class Detail; | 25 | class Detail; |
26 | class QComboBox; | 26 | class QComboBox; |
27 | class OListView; | 27 | class QListViewItem; |
28 | class OListViewItem; | 28 | namespace Opie {namespace Ui {class OListView;}} |
29 | namespace Opie {namespace Ui {class OListViewItem;}} | ||
29 | 30 | ||
30 | class ProcessInfo : public QWidget | 31 | class ProcessInfo : public QWidget |
31 | { | 32 | { |
@@ -35,7 +36,7 @@ public: | |||
35 | ~ProcessInfo(); | 36 | ~ProcessInfo(); |
36 | 37 | ||
37 | private: | 38 | private: |
38 | OListView* ProcessView; | 39 | Opie::Ui::OListView* ProcessView; |
39 | QComboBox* SignalCB; | 40 | QComboBox* SignalCB; |
40 | QPushButton* SendButton; | 41 | QPushButton* SendButton; |
41 | 42 | ||
@@ -44,7 +45,8 @@ private: | |||
44 | private slots: | 45 | private slots: |
45 | void updateData(); | 46 | void updateData(); |
46 | void slotSendClicked(); | 47 | void slotSendClicked(); |
47 | void viewProcess( OListViewItem * ); | 48 | void viewProcess( QListViewItem* ); |
49 | void viewProcess( Opie::Ui::OListViewItem * ); | ||
48 | }; | 50 | }; |
49 | 51 | ||
50 | #endif | 52 | #endif |
diff --git a/noncore/settings/sysinfo/sysinfo.cpp b/noncore/settings/sysinfo/sysinfo.cpp index fda6352..4c58999 100644 --- a/noncore/settings/sysinfo/sysinfo.cpp +++ b/noncore/settings/sysinfo/sysinfo.cpp | |||
@@ -38,6 +38,7 @@ | |||
38 | 38 | ||
39 | #include <qlayout.h> | 39 | #include <qlayout.h> |
40 | 40 | ||
41 | using namespace Opie::Ui; | ||
41 | SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags ) | 42 | SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags ) |
42 | : QWidget( parent, name, WStyle_ContextHelp ) | 43 | : QWidget( parent, name, WStyle_ContextHelp ) |
43 | { | 44 | { |
diff --git a/noncore/settings/sysinfo/versioninfo.cpp b/noncore/settings/sysinfo/versioninfo.cpp index 4bebd06..6764aa6 100644 --- a/noncore/settings/sysinfo/versioninfo.cpp +++ b/noncore/settings/sysinfo/versioninfo.cpp | |||
@@ -33,7 +33,7 @@ | |||
33 | #include <qtextstream.h> | 33 | #include <qtextstream.h> |
34 | #include <qwhatsthis.h> | 34 | #include <qwhatsthis.h> |
35 | 35 | ||
36 | using namespace Opie; | 36 | using namespace Opie::Core; |
37 | 37 | ||
38 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) | 38 | VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) |
39 | : QWidget( parent, name, f ) | 39 | : QWidget( parent, name, f ) |