author | bipolar <bipolar> | 2002-03-04 03:35:25 (UTC) |
---|---|---|
committer | bipolar <bipolar> | 2002-03-04 03:35:25 (UTC) |
commit | 6f2ff65bfac36e80cd9e6c9977545a4b85d3b3af (patch) (unidiff) | |
tree | d145b32c25af017889032893e4a890ae965104ea /noncore | |
parent | b72d53b26a892c63d266180d87c3efad2369d1b8 (diff) | |
download | opie-6f2ff65bfac36e80cd9e6c9977545a4b85d3b3af.zip opie-6f2ff65bfac36e80cd9e6c9977545a4b85d3b3af.tar.gz opie-6f2ff65bfac36e80cd9e6c9977545a4b85d3b3af.tar.bz2 |
committed by ljp (llornkcor): added SIGTERM when double clicking a process.
-rw-r--r-- | noncore/settings/sysinfo/processinfo.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp index f95d9cc..8e992d5 100644 --- a/noncore/settings/sysinfo/processinfo.cpp +++ b/noncore/settings/sysinfo/processinfo.cpp | |||
@@ -18,16 +18,20 @@ | |||
18 | **********************************************************************/ | 18 | **********************************************************************/ |
19 | 19 | ||
20 | #include <qheader.h> | 20 | #include <qheader.h> |
21 | #include <qlistview.h> | 21 | #include <qlistview.h> |
22 | #include <qlayout.h> | 22 | #include <qlayout.h> |
23 | #include <qtimer.h> | 23 | #include <qtimer.h> |
24 | #include <qfile.h> | 24 | #include <qfile.h> |
25 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include <qmessagebox.h> | ||
27 | |||
28 | #include <sys/types.h> | ||
29 | #include <signal.h> | ||
26 | 30 | ||
27 | #include "processinfo.h" | 31 | #include "processinfo.h" |
28 | 32 | ||
29 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) | 33 | ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl ) |
30 | : QWidget( parent, name, fl ) | 34 | : QWidget( parent, name, fl ) |
31 | { | 35 | { |
32 | QVBoxLayout *vb = new QVBoxLayout( this, 5 ); | 36 | QVBoxLayout *vb = new QVBoxLayout( this, 5 ); |
33 | 37 | ||
@@ -110,10 +114,26 @@ void ProcessInfo::updateData() | |||
110 | } | 114 | } |
111 | 115 | ||
112 | delete proclist; | 116 | delete proclist; |
113 | delete procdir; | 117 | delete procdir; |
114 | } | 118 | } |
115 | 119 | ||
116 | void ProcessInfo::viewProcess(QListViewItem *process) | 120 | void ProcessInfo::viewProcess(QListViewItem *process) |
117 | { | 121 | { |
122 | QString pid= process->text(0); | ||
123 | QString command = process->text(1); | ||
124 | switch( QMessageBox::information( this, (tr("Kill Process?")), | ||
125 | (tr("You really want to kill\n"+command+" PID: "+pid+"?")), | ||
126 | (tr("Yes")), (tr("No")), 0 )){ | ||
127 | case 0: // Yes clicked, | ||
128 | { | ||
129 | bool ok; | ||
130 | pid_t child=pid.toInt(&ok,10); | ||
131 | if((kill(child,SIGTERM)) < 0) | ||
132 | perror("kill:SIGTERM"); | ||
133 | } | ||
134 | break; | ||
135 | case 1: // Cancel | ||
136 | break; | ||
137 | }; | ||
118 | //printf("Double click for PID: %s\n", process->text(0).stripWhiteSpace().latin1()); | 138 | //printf("Double click for PID: %s\n", process->text(0).stripWhiteSpace().latin1()); |
119 | } | 139 | } |