summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/modulesinfo.cpp
authormickeyl <mickeyl>2004-03-05 21:37:50 (UTC)
committer mickeyl <mickeyl>2004-03-05 21:37:50 (UTC)
commit8851dc992ab535bde6cb417cafc44658953f495d (patch) (unidiff)
tree0a70bd4a768880e61c5af1ab142508c2bb81ecd0 /noncore/settings/sysinfo/modulesinfo.cpp
parentb9d58b616102970872129b5bc2f55569910f5c03 (diff)
downloadopie-8851dc992ab535bde6cb417cafc44658953f495d.zip
opie-8851dc992ab535bde6cb417cafc44658953f495d.tar.gz
opie-8851dc992ab535bde6cb417cafc44658953f495d.tar.bz2
use listview stuff from libopie2
miscellaneous cleanups
Diffstat (limited to 'noncore/settings/sysinfo/modulesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/modulesinfo.cpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/noncore/settings/sysinfo/modulesinfo.cpp b/noncore/settings/sysinfo/modulesinfo.cpp
index e688a29..dfe48e1 100644
--- a/noncore/settings/sysinfo/modulesinfo.cpp
+++ b/noncore/settings/sysinfo/modulesinfo.cpp
@@ -23,12 +23,16 @@
23#include "detail.h" 23#include "detail.h"
24 24
25/* OPIE */ 25/* OPIE */
26#include <opie2/olistview.h>
26#include <qpe/qpeapplication.h> 27#include <qpe/qpeapplication.h>
27 28
28/* QT */ 29/* QT */
30#include <qcombobox.h>
29#include <qfile.h> 31#include <qfile.h>
30#include <qlayout.h> 32#include <qlayout.h>
31#include <qmessagebox.h> 33#include <qmessagebox.h>
34#include <qpushbutton.h>
35#include <qtextview.h>
32#include <qtimer.h> 36#include <qtimer.h>
33#include <qwhatsthis.h> 37#include <qwhatsthis.h>
34 38
@@ -39,7 +43,7 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
39 layout->setSpacing( 4 ); 43 layout->setSpacing( 4 );
40 layout->setMargin( 4 ); 44 layout->setMargin( 4 );
41 45
42 ModulesView = new QListView( this ); 46 ModulesView = new OListView( this );
43 int colnum = ModulesView->addColumn( tr( "Module" ) ); 47 int colnum = ModulesView->addColumn( tr( "Module" ) );
44 colnum = ModulesView->addColumn( tr( "Size" ) ); 48 colnum = ModulesView->addColumn( tr( "Size" ) );
45 ModulesView->setColumnAlignment( colnum, Qt::AlignRight ); 49 ModulesView->setColumnAlignment( colnum, Qt::AlignRight );
@@ -54,8 +58,8 @@ ModulesInfo::ModulesInfo( QWidget* parent, const char* name, WFlags fl )
54 if ( QFile::exists( "/sbin/modinfo" ) ) 58 if ( QFile::exists( "/sbin/modinfo" ) )
55 { 59 {
56 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold ); 60 QPEApplication::setStylusOperation( ModulesView->viewport(), QPEApplication::RightOnHold );
57 connect( ModulesView, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), 61 connect( ModulesView, SIGNAL( rightButtonPressed(OListViewItem*,const QPoint&,int) ),
58 this, SLOT( viewModules(QListViewItem*) ) ); 62 this, SLOT( viewModules(OListViewItem*) ) );
59 } 63 }
60 64
61 CommandCB = new QComboBox( FALSE, this ); 65 CommandCB = new QComboBox( FALSE, this );
@@ -93,7 +97,7 @@ void ModulesInfo::updateData()
93 int modsize, usecount; 97 int modsize, usecount;
94 98
95 QString selectedmod; 99 QString selectedmod;
96 QListViewItem *curritem = ModulesView->currentItem(); 100 OListViewItem *curritem = static_cast<OListViewItem*>( ModulesView->currentItem() );
97 if ( curritem ) 101 if ( curritem )
98 { 102 {
99 selectedmod = curritem->text( 0 ); 103 selectedmod = curritem->text( 0 );
@@ -105,8 +109,8 @@ void ModulesInfo::updateData()
105 109
106 if ( procfile ) 110 if ( procfile )
107 { 111 {
108 QListViewItem *newitem; 112 OListViewItem *newitem;
109 QListViewItem *selecteditem = 0x0; 113 OListViewItem *selecteditem = 0x0;
110 while ( true ) 114 while ( true )
111 { 115 {
112 modname[0] = '\0'; 116 modname[0] = '\0';
@@ -121,7 +125,7 @@ void ModulesInfo::updateData()
121 QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' ); 125 QString qusecount = QString::number( usecount ).rightJustify( 2, ' ' );
122 QString qusage = QString( usage ); 126 QString qusage = QString( usage );
123 127
124 newitem = new QListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage ); 128 newitem = new OListViewItem( ModulesView, qmodname, qmodsize, qusecount, qusage );
125 if ( qmodname == selectedmod ) 129 if ( qmodname == selectedmod )
126 { 130 {
127 selecteditem = newitem; 131 selecteditem = newitem;
@@ -140,7 +144,7 @@ void ModulesInfo::slotSendClicked()
140 return; 144 return;
141 } 145 }
142 146
143 QString capstr = tr( "You really want to execute %1 for this module?" ).arg( CommandCB->currentText() ); 147 QString capstr = tr( "You really want to execute\n%1 for this module?" ).arg( CommandCB->currentText() );
144 148
145 QString modname = ModulesView->currentItem()->text( 0 ); 149 QString modname = ModulesView->currentItem()->text( 0 );
146 150
@@ -159,7 +163,7 @@ void ModulesInfo::slotSendClicked()
159 163
160} 164}
161 165
162void ModulesInfo::viewModules( QListViewItem *modules ) 166void ModulesInfo::viewModules( OListViewItem *modules )
163{ 167{
164 QString modname = modules->text( 0 ); 168 QString modname = modules->text( 0 );
165 QString capstr = "Module: "; 169 QString capstr = "Module: ";