-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 @@ -48,13 +48,16 @@ #include <stdlib.h> #include <math.h> #if defined (__GNUC__) && (__GNUC__ < 3) extern double round(double); #endif +using namespace Opie::Ui; +using namespace Opie::Core; extern "C" + { void BenchFFT( void ); double dhry_main( int ); } #define DHRYSTONE_RUNS 20000000 @@ -172,18 +175,18 @@ void BenchmarkInfo::machineActivated( int index ) { qDebug( "sysinfo: no results available." ); return; } 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++) ); } void BenchmarkInfo::run() { startButton->setText( "> Don't touch! Running Tests! Don't touch! <" ); @@ -256,23 +259,23 @@ int BenchmarkInfo::textRendering( int seconds ) srand( time( NULL ) ); BenchmarkPaintWidget bpw; int loops = 0; - + while ( t.elapsed() < stop ) { int k = rand() % 9; int s = rand() % 100; bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); bpw.p.setFont( QFont( "Vera", s ) ); bpw.p.drawText( rand() % w, rand() % h, text, text.length() ); ++loops; } - + return loops * text.length(); } int BenchmarkInfo::gfxRendering( int seconds ) { int rr[] = { 255, 255, 255, 0, 0, 0, 0, 128, 128 }; @@ -287,57 +290,57 @@ int BenchmarkInfo::gfxRendering( int seconds ) BenchmarkPaintWidget bpw; QTime t; t.start(); int stop = t.elapsed() + seconds*1000; int loops = 0; - + while ( t.elapsed() < stop ) { int k = rand() % 9; bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); bpw.p.drawLine( rand()%w, rand()%h, rand()%w, rand()%h ); ++loops; } t.restart(); stop = t.elapsed() + seconds*1000; - + while ( t.elapsed() < stop ) { int k = rand() % 9; bpw.p.setPen( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); bpw.p.drawArc( rand()%w, rand()%h, rand()%w, rand()%h, 360 * 16, 360 * 16 ); ++loops; } QBrush br1; br1.setStyle( SolidPattern ); t.restart(); stop = t.elapsed() + seconds*1000; - + while ( t.elapsed() < stop ) { int k = rand() % 9; br1.setColor( QColor( rr[ k ], gg[ k ], bb[ k ] ) ); bpw.p.fillRect( rand()%w, rand()%h, rand()%w, rand()%h, br1 ); ++loops; } 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 ); ++loops; } return loops; - + } void BenchmarkInfo::performFileTest( const QString& fname, OCheckListItem* item ) { QTime time; time.start(); 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 @@ -20,48 +20,48 @@ #include <qdialog.h> #include <qdict.h> #include <qstringlist.h> 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 { Q_OBJECT 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; bool sd_rd; bool sd_wt; bool cf_rd; bool cf_wt; 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& ); bool readFile( const QString& ); void run(); void machineActivated( int ); 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 @@ -20,7 +20,8 @@ #include "sysinfo.h" #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 @@ -33,12 +33,13 @@ #include <qmessagebox.h> #include <qpushbutton.h> #include <qtextview.h> #include <qtimer.h> #include <qwhatsthis.h> +using namespace Opie::Ui; ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 4 ); layout->setMargin( 4 ); @@ -55,14 +56,14 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 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." ) ); // Test if we have /sbin/modinfo, and if so, allow module detail window 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 ); CommandCB->insertItem( "modprobe -r" ); CommandCB->insertItem( "rmmod" ); // I can't think of other useful commands yet. Anyone? @@ -160,12 +161,17 @@ void ModulesInfo::slotSendClicked() if ( stream ) pclose( stream ); } } +void ModulesInfo::viewModules( QListViewItem *module ) { + if ( !module ) + return; + viewModules( static_cast<OListViewItem*>( module ) ); +} void ModulesInfo::viewModules( OListViewItem *modules ) { QString modname = modules->text( 0 ); QString capstr = "Module: "; capstr.append( modname ); ModulesDtl->setCaption( capstr ); 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 @@ -23,29 +23,31 @@ #define MODULESINFO_H #include <qwidget.h> 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 { Q_OBJECT public: ModulesInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~ModulesInfo(); private: - OListView* ModulesView; + Opie::Ui::OListView* ModulesView; QComboBox* CommandCB; Detail* ModulesDtl; 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 @@ -35,12 +35,13 @@ #include <qwhatsthis.h> /* STD */ #include <sys/types.h> #include <signal.h> +using namespace Opie::Ui; ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ) { QGridLayout *layout = new QGridLayout( this ); layout->setSpacing( 4 ); layout->setMargin( 4 ); @@ -52,14 +53,14 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) colnum = ProcessView->addColumn( tr( "Command" ),96 ); colnum = ProcessView->addColumn( tr( "Status" ) ); colnum = ProcessView->addColumn( tr( "Time" ) ); 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." ) ); SignalCB = new QComboBox( FALSE, this, "SignalCB" ); SignalCB->insertItem( " 1: SIGHUP" ); SignalCB->insertItem( " 2: SIGINT" ); @@ -182,12 +183,18 @@ void ProcessInfo::slotSendClicked() kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid ); } } } +void ProcessInfo::viewProcess( QListViewItem* process ) { + if ( !process ) + return; + viewProcess( static_cast<OListViewItem*>( process ) ); +} + void ProcessInfo::viewProcess( OListViewItem *process ) { QString pid= process->text( 0 ).stripWhiteSpace(); QString command = process->text( 1 ); ProcessDtl->setCaption( pid + " - " + command ); FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r"); 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 @@ -21,30 +21,32 @@ #define PROCESSINFO_H #include <qwidget.h> 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 { Q_OBJECT public: ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~ProcessInfo(); private: - OListView* ProcessView; + Opie::Ui::OListView* ProcessView; QComboBox* SignalCB; QPushButton* SendButton; Detail *ProcessDtl; 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 @@ -35,12 +35,13 @@ #include <qpe/config.h> #include <qpe/resource.h> #include <qlayout.h> +using namespace Opie::Ui; SystemInfo::SystemInfo( QWidget *parent, const char *name, WFlags ) : QWidget( parent, name, WStyle_ContextHelp ) { setIcon( Resource::loadPixmap( "system_icon" ) ); setCaption( tr("System Info") ); 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 @@ -30,13 +30,13 @@ #include <qlabel.h> #include <qlayout.h> #include <qscrollview.h> #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 ) { setMinimumSize( 200, 150 ); |