summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/modulesdetail.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/modulesdetail.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/modulesdetail.cpp89
1 files changed, 0 insertions, 89 deletions
diff --git a/noncore/settings/sysinfo/modulesdetail.cpp b/noncore/settings/sysinfo/modulesdetail.cpp
deleted file mode 100644
index ea9cdfa..0000000
--- a/noncore/settings/sysinfo/modulesdetail.cpp
+++ b/dev/null
@@ -1,89 +0,0 @@
1/**********************************************************************
2** ModulesDetail
3**
4** Display module information
5**
6** Copyright (C) 2002, Michael Lauer
7** mickey@tm.informatik.uni-frankfurt.de
8** http://www.Vanille.de
9**
10** Based on ProcessDetail by Dan Williams <williamsdr@acm.org>
11**
12** This file may be distributed and/or modified under the terms of the
13** GNU General Public License version 2 as published by the Free Software
14** Foundation and appearing in the file LICENSE.GPL included in the
15** packaging of this file.
16**
17** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
18** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
19**
20**********************************************************************/
21
22#include "modulesdetail.h"
23
24#include <sys/types.h>
25#include <stdio.h>
26
27#include <qcombobox.h>
28#include <qlayout.h>
29#include <qlistview.h>
30#include <qmessagebox.h>
31#include <qpushbutton.h>
32#include <qtextview.h>
33#include <qwhatsthis.h>
34
35ModulesDetail::ModulesDetail( QWidget* parent, const char* name, WFlags )
36 : QWidget( parent, name, WStyle_ContextHelp )
37{
38 modname = "";
39
40 QGridLayout *layout = new QGridLayout( this );
41 layout->setSpacing( 4 );
42 layout->setMargin( 4 );
43
44 CommandCB = new QComboBox( FALSE, this, "CommandCB" );
45 CommandCB->insertItem( "modprobe -r" );
46 CommandCB->insertItem( "rmmod" );
47 // I can't think of other useful commands yet. Anyone?
48 layout->addWidget( CommandCB, 1, 0 );
49 QWhatsThis::add( CommandCB, tr( "Select a command here and then click the Send button to the right to send the command." ) );
50
51 ModulesView = new QTextView( this, "ModulesView" );
52 layout->addMultiCellWidget( ModulesView, 0, 0, 0, 1 );
53 QWhatsThis::add( ModulesView, tr( "This area shows detailed information about this module." ) );
54
55 SendButton = new QPushButton( this, "SendButton" );
56 SendButton->setMinimumSize( QSize( 50, 24 ) );
57 SendButton->setMaximumSize( QSize( 50, 24 ) );
58 SendButton->setText( tr( "Send" ) );
59 connect( SendButton, SIGNAL( clicked() ), this, SLOT( slotSendClicked() ) );
60 layout->addWidget( SendButton, 1, 1 );
61 QWhatsThis::add( SendButton, tr( "Click here to send the selected command to this module." ) );
62}
63
64ModulesDetail::~ModulesDetail()
65{
66}
67
68void ModulesDetail::slotSendClicked()
69{
70 QString command = QString( "/sbin/" )
71 + CommandCB->currentText()
72 + QString( " " ) + modname;
73
74 if ( QMessageBox::warning( this, caption(),
75 tr( "You really want to \n" + CommandCB->currentText() + "\nthis Module?"),
76 QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape )
77 == QMessageBox::Yes )
78 {
79 FILE* stream = popen( command, "r" );
80 if ( stream )
81 pclose( stream );
82 {
83 hide();
84 }
85 }
86
87}
88
89