Diffstat (limited to 'noncore/settings/sysinfo/processdetail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/sysinfo/processdetail.cpp | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/noncore/settings/sysinfo/processdetail.cpp b/noncore/settings/sysinfo/processdetail.cpp index 06e5c0d..ef612e6 100644 --- a/noncore/settings/sysinfo/processdetail.cpp +++ b/noncore/settings/sysinfo/processdetail.cpp | |||
@@ -26,39 +26,34 @@ | |||
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, bool modal, WFlags fl ) | 32 | ProcessDetail::ProcessDetail( QWidget* parent, const char* name, WFlags fl ) |
33 | : QDialog( parent, name, modal, 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( 6 ); | 38 | layout->setSpacing( 4 ); |
39 | layout->setMargin( 11 ); | 39 | layout->setMargin( 4 ); |
40 | 40 | ||
41 | SignalCB = new QComboBox( FALSE, this, "SignalCB" ); | 41 | SignalCB = new QComboBox( FALSE, this, "SignalCB" ); |
42 | SignalCB->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)7, SignalCB->sizePolicy().hasHeightForWidth() ) ); | ||
43 | SignalCB->setMinimumSize( QSize( 50, 24 ) ); | ||
44 | SignalCB->setMaximumSize( QSize( 600, 24 ) ); | ||
45 | SignalCB->insertItem( " 1: SIGHUP" ); | 42 | SignalCB->insertItem( " 1: SIGHUP" ); |
46 | SignalCB->insertItem( " 2: SIGINT" ); | 43 | SignalCB->insertItem( " 2: SIGINT" ); |
47 | SignalCB->insertItem( " 9: SIGKILL" ); | 44 | SignalCB->insertItem( " 9: SIGKILL" ); |
48 | SignalCB->insertItem( "15: SIGTERM" ); | 45 | SignalCB->insertItem( "15: SIGTERM" ); |
49 | SignalCB->insertItem( "18: SIGCONT" ); | 46 | SignalCB->insertItem( "18: SIGCONT" ); |
50 | SignalCB->insertItem( "19: SIGSTOP" ); | 47 | SignalCB->insertItem( "19: SIGSTOP" ); |
51 | layout->addWidget( SignalCB, 1, 0 ); | 48 | layout->addWidget( SignalCB, 1, 0 ); |
52 | 49 | ||
53 | ProcessView = new QTextView( this, "ProcessView" ); | 50 | ProcessView = new QTextView( this, "ProcessView" ); |
54 | ProcessView->setFrameShadow( QTextView::Plain ); | ||
55 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); | 51 | layout->addMultiCellWidget( ProcessView, 0, 0, 0, 1 ); |
56 | 52 | ||
57 | SendButton = new QPushButton( this, "SendButton" ); | 53 | SendButton = new QPushButton( this, "SendButton" ); |
58 | SendButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, SendButton->sizePolicy().hasHeightForWidth() ) ); | ||
59 | SendButton->setMinimumSize( QSize( 50, 24 ) ); | 54 | SendButton->setMinimumSize( QSize( 50, 24 ) ); |
60 | SendButton->setMaximumSize( QSize( 50, 24 ) ); | 55 | SendButton->setMaximumSize( QSize( 50, 24 ) ); |
61 | SendButton->setText( tr( "Send" ) ); | 56 | SendButton->setText( tr( "Send" ) ); |
62 | connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); | 57 | connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) ); |
63 | layout->addWidget( SendButton, 1, 1 ); | 58 | layout->addWidget( SendButton, 1, 1 ); |
64 | } | 59 | } |
@@ -70,19 +65,20 @@ ProcessDetail::~ProcessDetail() | |||
70 | void ProcessDetail::slotSendClicked() | 65 | void ProcessDetail::slotSendClicked() |
71 | { | 66 | { |
72 | QString sigstr = SignalCB->currentText(); | 67 | QString sigstr = SignalCB->currentText(); |
73 | sigstr.truncate(2); | 68 | sigstr.truncate(2); |
74 | int sigid = sigstr.toUInt(); | 69 | int sigid = sigstr.toUInt(); |
75 | 70 | ||
76 | if ( !QMessageBox::information( this, caption(), | 71 | if ( QMessageBox::warning( this, caption(), |
77 | ( tr( "You really want to send\n" + SignalCB->currentText() + "\nto this process?") ), | 72 | tr( "You really want to send\n" + SignalCB->currentText() + "\nto this process?"), |
78 | ( tr( "Yes" ) ), ( tr( "No" ) ), 0 ) ) | 73 | QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) |
74 | == QMessageBox::Yes ) | ||
79 | { | 75 | { |
80 | if ( kill( pid, sigid ) == 0 ) | 76 | if ( kill( pid, sigid ) == 0 ) |
81 | { | 77 | { |
82 | accept(); | 78 | hide(); |
83 | } | 79 | } |
84 | } | 80 | } |
85 | 81 | ||
86 | } | 82 | } |
87 | 83 | ||
88 | 84 | ||