summaryrefslogtreecommitdiff
path: root/noncore/settings/sysinfo/devicesinfo.cpp
Unidiff
Diffstat (limited to 'noncore/settings/sysinfo/devicesinfo.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/sysinfo/devicesinfo.cpp79
1 files changed, 72 insertions, 7 deletions
diff --git a/noncore/settings/sysinfo/devicesinfo.cpp b/noncore/settings/sysinfo/devicesinfo.cpp
index 4940286..76c9b79 100644
--- a/noncore/settings/sysinfo/devicesinfo.cpp
+++ b/noncore/settings/sysinfo/devicesinfo.cpp
@@ -43,6 +43,7 @@ using namespace Opie::Ui;
43#include <qcombobox.h> 43#include <qcombobox.h>
44#include <qfile.h> 44#include <qfile.h>
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qstringlist.h>
46#include <qtextstream.h> 47#include <qtextstream.h>
47#include <qtextview.h> 48#include <qtextview.h>
48#include <qtimer.h> 49#include <qtimer.h>
@@ -96,7 +97,7 @@ DevicesInfo::DevicesInfo( QWidget* parent, const char* name, WFlags fl )
96 view = new DevicesView( this ); 97 view = new DevicesView( this );
97 layout->addWidget( view, 100 ); 98 layout->addWidget( view, 100 );
98 stack = new QWidgetStack( this ); 99 stack = new QWidgetStack( this );
99 layout->addWidget( stack, 70 ); 100 layout->addWidget( stack, 80 );
100} 101}
101 102
102 103
@@ -186,7 +187,8 @@ void InputCategory::populate()
186 OInputSystem::DeviceIterator it = sys->iterator(); 187 OInputSystem::DeviceIterator it = sys->iterator();
187 while ( it.current() ) 188 while ( it.current() )
188 { 189 {
189 new InputDevice( this, it.current()->identity() ); 190 InputDevice* dev = new InputDevice( this, it.current()->identity() );
191 dev->setInfo( it.current() );
190 ++it; 192 ++it;
191 } 193 }
192} 194}
@@ -208,7 +210,8 @@ void CardsCategory::populate()
208 OPcmciaSystem::CardIterator it = sys->iterator(); 210 OPcmciaSystem::CardIterator it = sys->iterator();
209 while ( it.current() ) 211 while ( it.current() )
210 { 212 {
211 new CardDevice( this, it.current()->identity() ); 213 CardDevice *dev = new CardDevice( this, it.current()->identity() );
214 dev->setInfo( it.current() );
212 ++it; 215 ++it;
213 } 216 }
214} 217}
@@ -326,8 +329,45 @@ void CpuDevice::addInfo( const QString& info )
326CardDevice::CardDevice( Category* parent, const QString& name ) 329CardDevice::CardDevice( Category* parent, const QString& name )
327 :Device( parent, name ) 330 :Device( parent, name )
328{ 331{
329 details = new QPushButton( name, devinfo ); 332 OListView* w = new OListView( devinfo );
330 details->hide(); 333 details = w;
334 w->addColumn( "Info" );
335 w->addColumn( "Value" );
336 w->hide();
337}
338
339void CardDevice::setInfo( const OPcmciaSocket* card )
340{
341 QStringList vendorlst = card->productIdentityVector();
342 for( QStringList::Iterator it = vendorlst.begin(); it != vendorlst.end(); ++it )
343 {
344 new OListViewItem( (OListView*) details, "VendorID", *it );
345 }
346 new OListViewItem( (OListView*) details, "Manufacturer", card->manufacturerIdentity() );
347 new OListViewItem( (OListView*) details, "Function", card->function() );
348
349 QStringList text;
350 OPcmciaSocket::OPcmciaSocketCardStatus status = card->status();
351 if ( status )
352 {
353 if ( status & OPcmciaSocket::Occupied ) text += "Occupied";
354 if ( status & OPcmciaSocket::OccupiedCardBus ) text += "CardBus";
355 if ( status & OPcmciaSocket::WriteProtected ) text += "WriteProtected";
356 if ( status & OPcmciaSocket::BatteryLow ) text += "BatteryLow";
357 if ( status & OPcmciaSocket::BatteryDead ) text += "BatteryDead";
358 if ( status & OPcmciaSocket::Ready ) text += "Ready";
359 if ( status & OPcmciaSocket::Suspended ) text += "Suspended";
360 if ( status & OPcmciaSocket::Attention ) text += "Attention";
361 if ( status & OPcmciaSocket::InsertionInProgress ) text += "InsertionInProgress";
362 if ( status & OPcmciaSocket::RemovalInProgress ) text += "RemovalInProgress";
363 if ( status & OPcmciaSocket::ThreeVolts ) text += "3V";
364 if ( status & OPcmciaSocket::SupportsVoltage ) text += "SupportsVoltage";
365 }
366 else
367 {
368 text += "<unknown>";
369 }
370 new OListViewItem( (OListView*) details, "Status", text.join( ", " ) );
331} 371}
332 372
333CardDevice::~CardDevice() 373CardDevice::~CardDevice()
@@ -338,8 +378,33 @@ CardDevice::~CardDevice()
338InputDevice::InputDevice( Category* parent, const QString& name ) 378InputDevice::InputDevice( Category* parent, const QString& name )
339 :Device( parent, name ) 379 :Device( parent, name )
340{ 380{
341 details = new QPushButton( name, devinfo ); 381 OListView* w = new OListView( devinfo );
342 details->hide(); 382 details = w;
383 w->addColumn( "Info" );
384 w->addColumn( "Value" );
385 w->hide();
386}
387
388void InputDevice::setInfo( const OInputDevice* dev )
389{
390 new OListViewItem( (OListView*) details, "Identity", dev->identity() );
391 new OListViewItem( (OListView*) details, "Path", dev->path() );
392 new OListViewItem( (OListView*) details, "Unique", dev->uniq() );
393
394 QStringList text;
395 if ( dev->hasFeature( OInputDevice::Synchronous ) ) text += "Synchronous";
396 if ( dev->hasFeature( OInputDevice::Keys ) ) text += "Keys";
397 if ( dev->hasFeature( OInputDevice::Relative ) ) text += "Relative";
398 if ( dev->hasFeature( OInputDevice::Absolute ) ) text += "Absolute";
399 if ( dev->hasFeature( OInputDevice::Miscellaneous ) ) text += "Miscellaneous";
400 if ( dev->hasFeature( OInputDevice::Leds ) ) text += "Leds";
401 if ( dev->hasFeature( OInputDevice::Sound ) ) text += "Sound";
402 if ( dev->hasFeature( OInputDevice::AutoRepeat ) ) text += "AutoRepeat";
403 if ( dev->hasFeature( OInputDevice::ForceFeedback ) ) text += "ForceFeedback";
404 if ( dev->hasFeature( OInputDevice::PowerManagement ) ) text += "PowerManagement";
405 if ( dev->hasFeature( OInputDevice::ForceFeedbackStatus ) ) text += "ForceFeedbackStatus";
406 new OListViewItem( (OListView*) details, "Features", text.join( ", " ) );
407
343} 408}
344 409
345InputDevice::~InputDevice() 410InputDevice::~InputDevice()