summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/modulesinfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/modulesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index dfe48e1..71cefcb 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -33,12 +33,13 @@
33#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35#include <qtextview.h> 35#include <qtextview.h>
36#include <qtimer.h> 36#include <qtimer.h>
37#include <qwhatsthis.h> 37#include <qwhatsthis.h>
38 38
39using namespace Opie::Ui;
39ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl ) 40ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
40 : QWidget( parent, name, fl ) 41 : QWidget( parent, name, fl )
41{ 42{
42 QGridLayout *layout = new QGridLayout( this ); 43 QGridLayout *layout = new QGridLayout( this );
43 layout->setSpacing( 4 ); 44 layout->setSpacing( 4 );
44 layout->setMargin( 4 ); 45 layout->setMargin( 4 );
@@ -55,14 +56,14 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
55 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) ); 56 QWhatsThis::add( ModulesView, tr( "This is a list of all the kernel modules currently loaded on this handheld device.\n\nClick and hold on a module to see additional information about the module, or to unload it." ) );
56 57
57 // Test if we have /sbin/modinfo, and if so, allow module detail window 58 // Test if we have /sbin/modinfo, and if so, allow module detail window
58 if ( QFile::exists( "/sbin/modinfo" ) ) 59 if ( QFile::exists( "/sbin/modinfo" ) )
59 { 60 {
60 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); 61 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
61 connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ), 62 connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
62 this, SLOT( viewModules(OListViewItem*) ) ); 63 this, SLOT( viewModules(QListViewItem*) ) );
63 } 64 }
64 65
65 CommandCB = new QComboBox( FALSE, this ); 66 CommandCB = new QComboBox( FALSE, this );
66 CommandCB->insertItem( "modprobe -r" ); 67 CommandCB->insertItem( "modprobe -r" );
67 CommandCB->insertItem( "rmmod" ); 68 CommandCB->insertItem( "rmmod" );
68 // I can't think of other useful commands yet. Anyone? 69 // I can't think of other useful commands yet. Anyone?
@@ -160,12 +161,17 @@ void ModulesInfo::slotSendClicked()
160 if ( stream ) 161 if ( stream )
161 pclose( stream ); 162 pclose( stream );
162 } 163 }
163 164
164} 165}
165 166
167void ModulesInfo::viewModules( QListViewItem *module ) {
168 if ( !module )
169 return;
170 viewModules( static_cast<OListViewItem*>( module ) );
171}
166void ModulesInfo::viewModules( OListViewItem *modules ) 172void ModulesInfo::viewModules( OListViewItem *modules )
167{ 173{
168 QString modname = modules->text( 0 ); 174 QString modname = modules->text( 0 );
169 QString capstr = "Module: "; 175 QString capstr = "Module: ";
170 capstr.append( modname ); 176 capstr.append( modname );
171 ModulesDtl->setCaption( capstr ); 177 ModulesDtl->setCaption( capstr );