summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/modulesinfo.cpp
authordrw <drw>2002-12-20 01:36:55 (UTC)
committer drw <drw>2002-12-20 01:36:55 (UTC)
commit3e556ed5f8c8b1236b9c6155b609930103d17b21 (patch) (side-by-side diff)
tree859cc1e4f3097276ab77cac4cff5b24fde26ba11 /noncore/settings/sysinfo/modulesinfo.cpp
parent876e1a4724a7bd75dc642e295de354241096e028 (diff)
downloadopie-3e556ed5f8c8b1236b9c6155b609930103d17b21.zip
opie-3e556ed5f8c8b1236b9c6155b609930103d17b21.tar.gz
opie-3e556ed5f8c8b1236b9c6155b609930103d17b21.tar.bz2
1. Added check for /sbin/modinfo, and if exists will display module details again. 2. Combined process and module detail viewers into one common class. 3. Move process signal sending to main process tab.
Diffstat (limited to 'noncore/settings/sysinfo/modulesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp53
1 files changed, 47 insertions, 6 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index c558fad..8b58fe9 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -35,2 +35,3 @@
#include "modulesinfo.h"
+#include "detail.h"
@@ -53,2 +54,10 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
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." ) );
+
+ // Test if we have /sbin/modinfo, and if so, allow module detail window
+ if ( QFile::exists( "/sbin/modinfo" ) )
+ {
+ QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
+ connect( ModulesView, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ),
+ this, SLOT( viewModules( QListViewItem * ) ) );
+ }
@@ -72,4 +81,7 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
t->start( 5000 );
-
+
updateData();
+
+ ModulesDtl = new Detail();
+ QWhatsThis::add( ModulesDtl->detailView, tr( "This area shows detailed information about this module." ) );
}
@@ -116,3 +128,5 @@ void ModulesInfo::slotSendClicked()
- if ( QMessageBox::warning( this, caption(), capstr,
+ QString modname = ModulesView->currentItem()->text( 0 );
+
+ if ( QMessageBox::warning( this, modname, capstr,
QMessageBox::Yes | QMessageBox::Default, QMessageBox::No | QMessageBox::Escape ) == QMessageBox::Yes )
@@ -122,3 +136,3 @@ void ModulesInfo::slotSendClicked()
command.append( " " );
- command.append( ModulesView->currentItem()->text( 0 ) );
+ command.append( modname );
@@ -127,5 +141,2 @@ void ModulesInfo::slotSendClicked()
pclose( stream );
- //{
- // hide();
- //}
}
@@ -133 +144,31 @@ void ModulesInfo::slotSendClicked()
}
+
+void ModulesInfo::viewModules( QListViewItem *modules )
+{
+ QString modname = modules->text( 0 );
+ QString capstr = "Module: ";
+ capstr.append( modname );
+ ModulesDtl->setCaption( capstr );
+ QString command = "/sbin/modinfo -nad ";
+ command.append( modname );
+ FILE* modinfo = popen( command, "r" );
+
+ if ( modinfo )
+ {
+ char line[200];
+ ModulesDtl->detailView->setText( " Details:\n------------\n" );
+
+ while( true )
+ {
+ int success = fscanf( modinfo, "%[^\n]\n", line );
+ if ( success == EOF )
+ break;
+ ModulesDtl->detailView->append( line );
+ }
+
+ pclose( modinfo );
+ }
+
+ ModulesDtl->showMaximized();
+}
+