author | zecke <zecke> | 2004-03-14 16:01:52 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-03-14 16:01:52 (UTC) |
commit | f12af18557c8f376f0c6c30e80a85737ff6c592e (patch) (side-by-side diff) | |
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 @@ extern double round(double); #endif +using namespace Opie::Ui; +using namespace Opie::Core; extern "C" + { void BenchFFT( void ); double dhry_main( int ); @@ -175,12 +178,12 @@ void BenchmarkInfo::machineActivated( int index ) } QStringList::Iterator it = results->begin(); test_alu->setText( 2, *(it++) ); - test_fpu->setText( 2, *(it++) ); + test_fpu->setText( 2, *(it++) ); test_txt->setText( 2, *(it++) ); test_gfx->setText( 2, *(it++) ); test_ram->setText( 2, *(it++) ); test_sd->setText( 2, *(it++) ); - test_cf->setText( 2, *(it++) ); + test_cf->setText( 2, *(it++) ); } @@ -259,7 +262,7 @@ int BenchmarkInfo::textRendering( int seconds ) BenchmarkPaintWidget bpw; int loops = 0; - + while ( t.elapsed() < stop ) { int k = rand() % 9; @@ -269,7 +272,7 @@ int BenchmarkInfo::textRendering( int seconds ) bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); ++loops; } - + return loops * text.length(); } @@ -290,7 +293,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) t.start(); int stop = t.elapsed() + seconds*1000; int loops = 0; - + while ( t.elapsed() < stop ) { int k = rand() % 9; @@ -301,7 +304,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) t.restart(); stop = t.elapsed() + seconds*1000; - + while ( t.elapsed() < stop ) { int k = rand() % 9; @@ -314,7 +317,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) br1.setStyle( SolidPattern ); t.restart(); stop = t.elapsed() + seconds*1000; - + while ( t.elapsed() < stop ) { int k = rand() % 9; @@ -326,7 +329,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) QPixmap p = Resource::loadPixmap( "sysinfo/pattern" ); t.restart(); stop = t.elapsed() + seconds*1000; - + while ( t.elapsed() < stop ) { bpw.p.drawPixmap( rand()%w, rand()%h, p ); @@ -334,7 +337,7 @@ int BenchmarkInfo::gfxRendering( int seconds ) } return loops; - + } 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 @@ class QClipboard; class QComboBox; -class OCheckListItem; +namespace Opie {namespace Ui {class OCheckListItem;}} class QPushButton; -class OListView; +namespace Opie {namespace Ui {class OListView;}} class BenchmarkInfo : public QWidget { @@ -35,13 +35,13 @@ public: BenchmarkInfo( QWidget *parent = 0, const char *name = 0, int wFlags = 0 ); ~BenchmarkInfo(); - OCheckListItem* test_alu; - OCheckListItem* test_fpu; - OCheckListItem* test_txt; - OCheckListItem* test_gfx; - OCheckListItem* test_ram; - OCheckListItem* test_sd; - OCheckListItem* test_cf; + Opie::Ui::OCheckListItem* test_alu; + Opie::Ui::OCheckListItem* test_fpu; + Opie::Ui::OCheckListItem* test_txt; + Opie::Ui::OCheckListItem* test_gfx; + Opie::Ui::OCheckListItem* test_ram; + Opie::Ui::OCheckListItem* test_sd; + Opie::Ui::OCheckListItem* test_cf; bool main_rd; bool main_wt; @@ -52,13 +52,13 @@ public: QClipboard* clb; QComboBox* machineCombo; - OListView* tests; + Opie::Ui::OListView* tests; QPushButton* startButton; QDict <QStringList> machines; int textRendering( int ); int gfxRendering( int ); - void performFileTest( const QString& fname, OCheckListItem* item ); + void performFileTest( const QString& fname, Opie::Ui::OCheckListItem* item ); private slots: 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 @@ #include <opie2/oapplicationfactory.h> +using namespace Opie::Core; 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 @@ #include <qtimer.h> #include <qwhatsthis.h> +using namespace Opie::Ui; ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { @@ -58,8 +59,8 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) if ( QFile::exists( "/sbin/modinfo" ) ) { QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); - connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), - this, SLOT( viewModules(OListViewItem*) ) ); + connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), + this, SLOT( viewModules(QListViewItem*) ) ); } CommandCB = new QComboBox( FALSE, this ); @@ -163,6 +164,11 @@ void ModulesInfo::slotSendClicked() } +void ModulesInfo::viewModules( QListViewItem *module ) { + if ( !module ) + return; + viewModules( static_cast<OListViewItem*>( module ) ); +} void ModulesInfo::viewModules( OListViewItem *modules ) { 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 @@ class Detail; class QComboBox; -class OListView; -class OListViewItem; +class QListViewItem; +namespace Opie {namespace Ui {class OListView;}} +namespace Opie {namespace Ui {class OListViewItem;}} class ModulesInfo : public QWidget { @@ -37,7 +38,7 @@ public: ~ModulesInfo(); private: - OListView* ModulesView; + Opie::Ui::OListView* ModulesView; QComboBox* CommandCB; Detail* ModulesDtl; @@ -45,7 +46,8 @@ private: private slots: void updateData(); void slotSendClicked(); - void viewModules( OListViewItem * ); + void viewModules( QListViewItem* ); + void viewModules( Opie::Ui::OListViewItem * ); }; #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 @@ #include <sys/types.h> #include <signal.h> +using namespace Opie::Ui; ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { @@ -55,8 +56,8 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); ProcessView->setAllColumnsShowFocus( TRUE ); QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); - connect( ProcessView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), - this, SLOT( viewProcess(OListViewItem*) ) ); + connect( ProcessView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), + this, SLOT( viewProcess(QListViewItem*) ) ); layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); 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." ) ); @@ -185,6 +186,12 @@ void ProcessInfo::slotSendClicked() } +void ProcessInfo::viewProcess( QListViewItem* process ) { + if ( !process ) + return; + viewProcess( static_cast<OListViewItem*>( process ) ); +} + void ProcessInfo::viewProcess( OListViewItem *process ) { 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 @@ class Detail; class QComboBox; -class OListView; -class OListViewItem; +class QListViewItem; +namespace Opie {namespace Ui {class OListView;}} +namespace Opie {namespace Ui {class OListViewItem;}} class ProcessInfo : public QWidget { @@ -35,7 +36,7 @@ public: ~ProcessInfo(); private: - OListView* ProcessView; + Opie::Ui::OListView* ProcessView; QComboBox* SignalCB; QPushButton* SendButton; @@ -44,7 +45,8 @@ private: private slots: void updateData(); void slotSendClicked(); - void viewProcess( OListViewItem * ); + void viewProcess( QListViewItem* ); + void viewProcess( Opie::Ui::OListViewItem * ); }; #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 @@ #include <qlayout.h> +using namespace Opie::Ui; SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags ) : QWidget( parent, name, WStyle_ContextHelp ) { 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 @@ #include <qtextstream.h> #include <qwhatsthis.h> -using namespace Opie; +using namespace Opie::Core; VersionInfo::VersionInfo( QWidget *parent, const char *name, WFlags f ) : QWidget( parent, name, f ) |