author | llornkcor <llornkcor> | 2002-06-28 12:33:08 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-06-28 12:33:08 (UTC) |
commit | 9607d7d0953b0fbb128d23d3cb2effa9fe0657c4 (patch) (unidiff) | |
tree | 92b1e09bf904c2f845da04cc0f39b4a8d90b822e | |
parent | 9838944f977a53dc3f9d3c138b507695bc6e238f (diff) | |
download | opie-9607d7d0953b0fbb128d23d3cb2effa9fe0657c4.zip opie-9607d7d0953b0fbb128d23d3cb2effa9fe0657c4.tar.gz opie-9607d7d0953b0fbb128d23d3cb2effa9fe0657c4.tar.bz2 |
patch for more signales by Michael Lauer <mickey@tm.informatik.uni-frankfurt.de>
-rw-r--r-- | noncore/settings/sysinfo/processdetail.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/settings/sysinfo/processdetail.cpp b/noncore/settings/sysinfo/processdetail.cpp index ef612e6..5c0d335 100644 --- a/noncore/settings/sysinfo/processdetail.cpp +++ b/noncore/settings/sysinfo/processdetail.cpp | |||
@@ -1,84 +1,88 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** ProcessDetail | 2 | ** ProcessDetail |
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 "processdetail.h" | 20 | #include "processdetail.h" |
21 | 21 | ||
22 | #include <sys/types.h> | 22 | #include <sys/types.h> |
23 | #include <signal.h> | 23 | #include <signal.h> |
24 | 24 | ||
25 | #include <qcombobox.h> | 25 | #include <qcombobox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qtextview.h> | 27 | #include <qtextview.h> |
28 | #include <qlayout.h> | 28 | #include <qlayout.h> |
29 | #include <qlistview.h> | 29 | #include <qlistview.h> |
30 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
31 | 31 | ||
32 | ProcessDetail::ProcessDetail( QWidget* parent, const char* name, WFlags fl ) | 32 | ProcessDetail::ProcessDetail( QWidget* parent, const char* name, WFlags fl ) |
33 | : QWidget( parent, name, fl ) | 33 | : QWidget( parent, name, fl ) |
34 | { | 34 | { |
35 | pid = 0; | 35 | pid = 0; |
36 | 36 | ||
37 | QGridLayout *layout = new QGridLayout( this ); | 37 | QGridLayout *layout = new QGridLayout( this ); |
38 | layout->setSpacing( 4 ); | 38 | layout->setSpacing( 4 ); |
39 | layout->setMargin( 4 ); | 39 | layout->setMargin( 4 ); |
40 | 40 | ||
41 | SignalCB = new QComboBox( FALSE, this, "SignalCB" ); | 41 | SignalCB = new QComboBox( FALSE, this, "SignalCB" ); |
42 | SignalCB->insertItem( " 1: SIGHUP" ); | 42 | SignalCB->insertItem( " 1: SIGHUP" ); |
43 | SignalCB->insertItem( " 2: SIGINT" ); | 43 | SignalCB->insertItem( " 2: SIGINT" ); |
44 | SignalCB->insertItem( " 3: SIGQUIT" ); | ||
45 | SignalCB->insertItem( " 5: SIGTRAP" ); | ||
46 | SignalCB->insertItem( " 6: SIGABRT" ); | ||
44 | SignalCB->insertItem( " 9: SIGKILL" ); | 47 | SignalCB->insertItem( " 9: SIGKILL" ); |
48 | SignalCB->insertItem( "14: SIGALRM" ); | ||
45 | SignalCB->insertItem( "15: SIGTERM" ); | 49 | SignalCB->insertItem( "15: SIGTERM" ); |
46 | SignalCB->insertItem( "18: SIGCONT" ); | 50 | SignalCB->insertItem( "18: SIGCONT" ); |
47 | SignalCB->insertItem( "19: SIGSTOP" ); | 51 | SignalCB->insertItem( "19: SIGSTOP" ); |
48 | layout->addWidget( SignalCB, 1, 0 ); | 52 | layout->addWidget( SignalCB, 1, 0 ); |
49 | 53 | ||
50 | ProcessView = new QTextView( this, "ProcessView" ); | 54 | ProcessView = new QTextView( this, "ProcessView" ); |
51 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); | 55 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); |
52 | 56 | ||
53 | SendButton = new QPushButton( this, "SendButton" ); | 57 | SendButton = new QPushButton( this, "SendButton" ); |
54 | SendButton->setMinimumSize( QSize( 50, 24 ) ); | 58 | SendButton->setMinimumSize( QSize( 50, 24 ) ); |
55 | SendButton->setMaximumSize( QSize( 50, 24 ) ); | 59 | SendButton->setMaximumSize( QSize( 50, 24 ) ); |
56 | SendButton->setText( tr( "Send" ) ); | 60 | SendButton->setText( tr( "Send" ) ); |
57 | connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); | 61 | connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); |
58 | layout->addWidget( SendButton, 1, 1 ); | 62 | layout->addWidget( SendButton, 1, 1 ); |
59 | } | 63 | } |
60 | 64 | ||
61 | ProcessDetail::~ProcessDetail() | 65 | ProcessDetail::~ProcessDetail() |
62 | { | 66 | { |
63 | } | 67 | } |
64 | 68 | ||
65 | void ProcessDetail::slotSendClicked() | 69 | void ProcessDetail::slotSendClicked() |
66 | { | 70 | { |
67 | QString sigstr = SignalCB->currentText(); | 71 | QString sigstr = SignalCB->currentText(); |
68 | sigstr.truncate(2); | 72 | sigstr.truncate(2); |
69 | int sigid = sigstr.toUInt(); | 73 | int sigid = sigstr.toUInt(); |
70 | 74 | ||
71 | if ( QMessageBox::warning( this, caption(), | 75 | if ( QMessageBox::warning( this, caption(), |
72 | tr( "You really want to send\n" + SignalCB->currentText() + "\nto this process?"), | 76 | tr( "You really want to send\n" + SignalCB->currentText() + "\nto this process?"), |
73 | QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) | 77 | QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) |
74 | == QMessageBox::Yes ) | 78 | == QMessageBox::Yes ) |
75 | { | 79 | { |
76 | if ( kill( pid, sigid ) == 0 ) | 80 | if ( kill( pid, sigid ) == 0 ) |
77 | { | 81 | { |
78 | hide(); | 82 | hide(); |
79 | } | 83 | } |
80 | } | 84 | } |
81 | 85 | ||
82 | } | 86 | } |
83 | 87 | ||
84 | 88 | ||