summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/processinfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/processinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 0512141..86133a9 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -1,72 +1,73 @@
1/********************************************************************** 1/**********************************************************************
2** ProcessInfo 2** ProcessInfo
3** 3**
4** Display process information 4** Display process information
5** 5**
6** Copyright (C) 2002, Dan Williams 6** Copyright (C) 2002, Dan Williams
7** williamsdr@acm.org 7** williamsdr@acm.org
8** http://draknor.net 8** http://draknor.net
9** 9**
10** This file may be distributed and/or modified under the terms of the 10** This file may be distributed and/or modified under the terms of the
11** GNU General Public License version 2 as published by the Free Software 11** GNU General Public License version 2 as published by the Free Software
12** Foundation and appearing in the file LICENSE.GPL included in the 12** Foundation and appearing in the file LICENSE.GPL included in the
13** packaging of this file. 13** packaging of this file.
14** 14**
15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 15** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 16** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
17** 17**
18**********************************************************************/ 18**********************************************************************/
19 19
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21 21
22#include <qdir.h>
23#include <qfile.h>
22#include <qheader.h> 24#include <qheader.h>
23#include <qlistview.h>
24#include <qlayout.h> 25#include <qlayout.h>
26#include <qlistview.h>
25#include <qtimer.h> 27#include <qtimer.h>
26#include <qfile.h> 28#include <qwhatsthis.h>
27#include <qdir.h>
28 29
29#include "processinfo.h" 30#include "processinfo.h"
30 31
31ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) 32ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
32 : QWidget( parent, name, fl ) 33 : QWidget( parent, name, fl )
33{ 34{
34 QVBoxLayout *layout = new QVBoxLayout( this, 5 ); 35 QVBoxLayout *layout = new QVBoxLayout( this, 5 );
35 36
36 ProcessView = new QListView( this, "ProcessView" ); 37 ProcessView = new QListView( this, "ProcessView" );
37 int colnum = ProcessView->addColumn( tr( "PID" ) ); 38 int colnum = ProcessView->addColumn( tr( "PID" ) );
38 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 39 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
39 colnum = ProcessView->addColumn( tr( "Command" ),96 ); 40 colnum = ProcessView->addColumn( tr( "Command" ),96 );
40 colnum = ProcessView->addColumn( tr( "Status" ) ); 41 colnum = ProcessView->addColumn( tr( "Status" ) );
41 colnum = ProcessView->addColumn( tr( "Time" ) ); 42 colnum = ProcessView->addColumn( tr( "Time" ) );
42 ProcessView->setColumnAlignment( colnum, Qt::AlignRight ); 43 ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
43 ProcessView->setAllColumnsShowFocus( TRUE ); 44 ProcessView->setAllColumnsShowFocus( TRUE );
44 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold ); 45 QPEApplication::setStylusOperation( ProcessView->viewport(), QPEApplication::RightOnHold );
45 connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 46 connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
46 this, SLOT( viewProcess( QListViewItem * ) ) ); 47 this, SLOT( viewProcess( QListViewItem * ) ) );
47
48 layout->addWidget( ProcessView ); 48 layout->addWidget( ProcessView );
49 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." ) );
49 50
50 QTimer *t = new QTimer( this ); 51 QTimer *t = new QTimer( this );
51 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) ); 52 connect( t, SIGNAL( timeout() ), this, SLOT( updateData() ) );
52 t->start( 5000 ); 53 t->start( 5000 );
53 54
54 updateData(); 55 updateData();
55 56
56 ProcessDtl = new ProcessDetail( 0, 0, 0 ); 57 ProcessDtl = new ProcessDetail( 0, 0, 0 );
57 ProcessDtl->ProcessView->setTextFormat( RichText ); 58 ProcessDtl->ProcessView->setTextFormat( RichText );
58} 59}
59 60
60ProcessInfo::~ProcessInfo() 61ProcessInfo::~ProcessInfo()
61{ 62{
62} 63}
63 64
64void ProcessInfo::updateData() 65void ProcessInfo::updateData()
65{ 66{
66 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime, 67 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime,
67 signal, blocked, sigignore, sigcatch; 68 signal, blocked, sigignore, sigcatch;
68 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode, 69 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode,
69 endcode, startstack, kstkesp, kstkeip, wchan; 70 endcode, startstack, kstkesp, kstkeip, wchan;
70 char state; 71 char state;
71 char comm[64]; 72 char comm[64];
72 73