author | drw <drw> | 2002-03-15 16:25:53 (UTC) |
---|---|---|
committer | drw <drw> | 2002-03-15 16:25:53 (UTC) |
commit | eb338502c03edbfc8b9b9f00bd95c0c0d4317003 (patch) (side-by-side diff) | |
tree | 36a0a6fb3a193a526bc0f7f748c404b621ea2224 | |
parent | a0d6c8fdac4e8644c31d1b2e2a321131be4b57c2 (diff) | |
download | opie-eb338502c03edbfc8b9b9f00bd95c0c0d4317003.zip opie-eb338502c03edbfc8b9b9f00bd95c0c0d4317003.tar.gz opie-eb338502c03edbfc8b9b9f00bd95c0c0d4317003.tar.bz2 |
Click & hold, not double click, to bring up detail
-rw-r--r-- | noncore/settings/sysinfo/processinfo.cpp | 9 | ||||
-rw-r--r-- | noncore/settings/sysinfo/processinfo.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp index ad81d7b..0512141 100644 --- a/noncore/settings/sysinfo/processinfo.cpp +++ b/noncore/settings/sysinfo/processinfo.cpp @@ -12,16 +12,18 @@ ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** **********************************************************************/ +#include <qpe/qpeapplication.h> + #include <qheader.h> #include <qlistview.h> #include <qlayout.h> #include <qtimer.h> #include <qfile.h> #include <qdir.h> #include "processinfo.h" @@ -34,17 +36,19 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) ProcessView = new QListView( this, "ProcessView" ); int colnum = ProcessView->addColumn( tr( "PID" ) ); ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); colnum = ProcessView->addColumn( tr( "Command" ),96 ); colnum = ProcessView->addColumn( tr( "Status" ) ); colnum = ProcessView->addColumn( tr( "Time" ) ); ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); ProcessView->setAllColumnsShowFocus( TRUE ); - connect( ProcessView, SIGNAL( doubleClicked(QListViewItem *) ), this, SLOT( viewProcess(QListViewItem *) ) ); + QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); + connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), + this, SLOT( viewProcess( QListViewItem * ) ) ); layout->addWidget( ProcessView ); QTimer *t = new QTimer( this ); connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); t->start( 5000 ); updateData(); @@ -102,17 +106,17 @@ void ProcessInfo::updateData() } } } delete proclist; delete procdir; } -void ProcessInfo::viewProcess(QListViewItem *process) +void ProcessInfo::viewProcess( QListViewItem *process ) { QString pid= process->text( 0 ).stripWhiteSpace(); QString command = process->text( 1 ); ProcessDtl->setCaption( pid + " - " + command ); ProcessDtl->pid = pid.toUInt(); FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r"); if ( statfile ) { @@ -120,11 +124,10 @@ void ProcessInfo::viewProcess(QListViewItem *process) fgets( line, 81, statfile ); ProcessDtl->ProcessView->setText( line ); while ( fgets( line, 81, statfile ) ) { ProcessDtl->ProcessView->append( line ); } fclose( statfile ); } - ProcessDtl->showMaximized(); } diff --git a/noncore/settings/sysinfo/processinfo.h b/noncore/settings/sysinfo/processinfo.h index 89d1a93..24b190e 100644 --- a/noncore/settings/sysinfo/processinfo.h +++ b/noncore/settings/sysinfo/processinfo.h @@ -29,16 +29,16 @@ class ProcessInfo : public QWidget { Q_OBJECT public: ProcessInfo( QWidget *parent = 0, const char *name = 0, WFlags f = 0 ); ~ProcessInfo(); private slots: void updateData(); - void viewProcess(QListViewItem *); + void viewProcess( QListViewItem * ); private: QListView* ProcessView; ProcessDetail *ProcessDtl; }; #endif |