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.cpp76
1 files changed, 39 insertions, 37 deletions
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index af0fe26..2a90b0f 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -19,4 +19,9 @@
19 19
20#include "processinfo.h"
21#include "detail.h"
22
23/* OPIE */
20#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
21 25
26/* QT */
22#include <qdir.h> 27#include <qdir.h>
@@ -27,2 +32,3 @@
27 32
33/* STD */
28#include <sys/types.h> 34#include <sys/types.h>
@@ -30,7 +36,4 @@
30 36
31#include "processinfo.h"
32#include "detail.h"
33
34ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) 37ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
35 : QWidget( parent, name, fl ) 38 : QWidget( parent, name, fl )
36{ 39{
@@ -51,6 +54,6 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
51 connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 54 connect( ProcessView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
52 this, SLOT( viewProcess( QListViewItem * ) ) ); 55 this, SLOT( viewProcess( QListViewItem * ) ) );
53 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); 56 layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 );
54 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." ) ); 57 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." ) );
55 58
56 SignalCB = new QComboBox( FALSE, this, "SignalCB" ); 59 SignalCB = new QComboBox( FALSE, this, "SignalCB" );
@@ -88,4 +91,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
88ProcessInfo::~ProcessInfo() 91ProcessInfo::~ProcessInfo()
89{ 92{}
90}
91 93
@@ -94,5 +96,5 @@ void ProcessInfo::updateData()
94 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime, 96 int pid, ppid, pgrp, session, tty, tpgid, utime, stime, cutime, cstime, counter, priority, starttime,
95 signal, blocked, sigignore, sigcatch; 97 signal, blocked, sigignore, sigcatch;
96 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode, 98 uint flags, minflt, cminflt, majflt, cmajflt, timeout, itrealvalue, vsize, rss, rlim, startcode,
97 endcode, startstack, kstkesp, kstkeip, wchan; 99 endcode, startstack, kstkesp, kstkeip, wchan;
98 char state; 100 char state;
@@ -106,3 +108,3 @@ void ProcessInfo::updateData()
106 } 108 }
107 109
108 ProcessView->clear(); 110 ProcessView->clear();
@@ -128,7 +130,7 @@ void ProcessInfo::updateData()
128 fscanf( procfile, 130 fscanf( procfile,
129 "%d %s %c %d %d %d %d %d %u %u %u %u %u %d %d %d %d %d %d %u %u %d %u %u %u %u %u %u %u %u %d %d %d %d %u", 131 "%d %s %c %d %d %d %d %d %u %u %u %u %u %d %d %d %d %d %d %u %u %d %u %u %u %u %u %u %u %u %d %d %d %d %u",
130 &pid, comm, &state, &ppid, &pgrp, &session,&tty, &tpgid, &flags, &minflt, &cminflt, 132 &pid, comm, &state, &ppid, &pgrp, &session,&tty, &tpgid, &flags, &minflt, &cminflt,
131 &majflt, &cmajflt, &utime, &stime, &cutime, &cstime, &counter, &priority, &timeout, 133 &majflt, &cmajflt, &utime, &stime, &cutime, &cstime, &counter, &priority, &timeout,
132 &itrealvalue, &starttime, &vsize, &rss, &rlim, &startcode, &endcode, &startstack, 134 &itrealvalue, &starttime, &vsize, &rss, &rlim, &startcode, &endcode, &startstack,
133 &kstkesp, &kstkeip, &signal, &blocked, &sigignore, &sigcatch, &wchan ); 135 &kstkesp, &kstkeip, &signal, &blocked, &sigignore, &sigcatch, &wchan );
134 processnum = processnum.rightJustify( 5, ' ' ); 136 processnum = processnum.rightJustify( 5, ' ' );
@@ -157,22 +159,22 @@ void ProcessInfo::slotSendClicked()
157{ 159{
158 QListViewItem *currprocess = ProcessView->currentItem(); 160 QListViewItem *currprocess = ProcessView->currentItem();
159 if ( !currprocess ) 161 if ( !currprocess )
160 { 162 {
161 return; 163 return;
162 } 164 }
163 165
164 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() ); 166 QString capstr = tr( "Really want to send %1\nto this process?" ).arg( SignalCB->currentText() );
165 167
166 168
167 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr, 169 if ( QMessageBox::warning( this, currprocess->text( 1 ), capstr,
168 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes ) 170 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
169 { 171 {
170 currprocess = ProcessView->currentItem(); 172 currprocess = ProcessView->currentItem();
171 if ( currprocess ) 173 if ( currprocess )
172 { 174 {
173 QString sigstr = SignalCB->currentText(); 175 QString sigstr = SignalCB->currentText();
174 sigstr.truncate(2); 176 sigstr.truncate(2);
175 int sigid = sigstr.toUInt(); 177 int sigid = sigstr.toUInt();
176 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid ); 178 kill( currprocess->text( 0 ).stripWhiteSpace().toUInt(), sigid );
177 } 179 }
178 } 180 }
@@ -198,3 +200,3 @@ void ProcessInfo::viewProcess( QListViewItem *process )
198 } 200 }
199 ProcessDtl->showMaximized(); 201 QPEApplication::showWidget( ProcessDtl );
200} 202}