summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/processinfo.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/sysinfo/processinfo.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/sysinfo/processinfo.cpp42
1 files changed, 20 insertions, 22 deletions
diff --git a/noncore/settings/sysinfo/processinfo.cpp b/noncore/settings/sysinfo/processinfo.cpp
index 4ecb704..225da63 100644
--- a/noncore/settings/sysinfo/processinfo.cpp
+++ b/noncore/settings/sysinfo/processinfo.cpp
@@ -25,8 +25,5 @@
#include <qdir.h>
-#include <qmessagebox.h>
-
-#include <sys/types.h>
-#include <signal.h>
#include "processinfo.h"
+#include "processdetail.h"
@@ -35,3 +32,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
{
- QVBoxLayout *vb = new QVBoxLayout( this, 5 );
+ QVBoxLayout *layout = new QVBoxLayout( this, 5 );
@@ -41,5 +38,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
colnum = ProcessView->addColumn( tr( "Command" ),96 );
- ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
colnum = ProcessView->addColumn( tr( "Status" ) );
- ProcessView->setColumnAlignment( colnum, Qt::AlignRight );
colnum = ProcessView->addColumn( tr( "Time" ) );
@@ -49,3 +44,3 @@ ProcessInfo::ProcessInfo( QWidget* parent, const char* name, WFlags fl )
- vb->addWidget( ProcessView );
+ layout->addWidget( ProcessView );
@@ -121,19 +116,22 @@ void ProcessInfo::viewProcess(QListViewItem *process)
{
- QString pid= process->text(0);
+ QString pid= process->text(0).stripWhiteSpace();
QString command = process->text(1);
- switch( QMessageBox::information( this, (tr("Kill Process?")),
- (tr("You really want to kill\n"+command+" PID: "+pid+"?")),
- (tr("Yes")), (tr("No")), 0 )){
- case 0: // Yes clicked,
+ ProcessDetail *processdtl = new ProcessDetail( this, 0, TRUE, 0);
+ processdtl->setCaption( pid + " - " + command );
+ processdtl->pid = pid.toUInt();
+ processdtl->ProcessView->setTextFormat( RichText );
+ FILE *statfile = fopen( ( QString ) ( "/proc/" + pid + "/status"), "r");
+ if ( statfile )
{
- bool ok;
- pid_t child=pid.toInt(&ok,10);
- if((kill(child,SIGKILL)) < 0)
- perror("kill:SIGKILL");
+ char line[81];
+ fgets( line, 81, statfile );
+ processdtl->ProcessView->setText( line );
+ while ( fgets( line, 81, statfile ) )
+ {
+ processdtl->ProcessView->append( line );
+ }
+ fclose( statfile );
}
- break;
- case 1: // Cancel
- break;
- };
-//printf("Double click for PID: %s\n", process->text(0).stripWhiteSpace().latin1());
+
+ processdtl->showMaximized();
}