author | mickeyl <mickeyl> | 2005-07-02 12:59:06 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-07-02 12:59:06 (UTC) |
commit | 5d0de3e1d8815820cd6841e62c737b42f7fb5354 (patch) (unidiff) | |
tree | acfd3141cd487c068492ca254dce8f9e1b6ecf5b | |
parent | 094e14624d99d521af6cfc875abafcdc550a7378 (diff) | |
download | opie-5d0de3e1d8815820cd6841e62c737b42f7fb5354.zip opie-5d0de3e1d8815820cd6841e62c737b42f7fb5354.tar.gz opie-5d0de3e1d8815820cd6841e62c737b42f7fb5354.tar.bz2 |
SysInfo:
- add pcmcia device node detail view
- add input device node detail view
- grab preferred fixed font for syslog from qpe.conf
- slightly adjust tree/detail widget space ratio
-rw-r--r-- | noncore/settings/sysinfo/devicesinfo.cpp | 79 | ||||
-rw-r--r-- | noncore/settings/sysinfo/devicesinfo.h | 6 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysinfo.pro | 2 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysloginfo.cpp | 6 | ||||
-rw-r--r-- | noncore/settings/sysinfo/sysloginfo.h | 4 |
5 files changed, 81 insertions, 16 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 | |||
@@ -42,8 +42,9 @@ using namespace Opie::Ui; | |||
42 | #include <qlistview.h> | 42 | #include <qlistview.h> |
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> |
49 | #include <qwhatsthis.h> | 50 | #include <qwhatsthis.h> |
@@ -95,9 +96,9 @@ DevicesInfo::DevicesInfo( QWidget* parent, const char* name, WFlags fl ) | |||
95 | layout->setMargin( 2 ); | 96 | layout->setMargin( 2 ); |
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 | ||
103 | DevicesInfo::~DevicesInfo() | 104 | DevicesInfo::~DevicesInfo() |
@@ -185,9 +186,10 @@ void InputCategory::populate() | |||
185 | OInputSystem* sys = OInputSystem::instance(); | 186 | OInputSystem* sys = OInputSystem::instance(); |
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 | } |
193 | 195 | ||
@@ -207,9 +209,10 @@ void CardsCategory::populate() | |||
207 | OPcmciaSystem* sys = OPcmciaSystem::instance(); | 209 | OPcmciaSystem* sys = OPcmciaSystem::instance(); |
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 | } |
215 | 218 | ||
@@ -325,10 +328,47 @@ void CpuDevice::addInfo( const QString& info ) | |||
325 | //================================================================================================= | 328 | //================================================================================================= |
326 | CardDevice::CardDevice( Category* parent, const QString& name ) | 329 | CardDevice::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 | |||
339 | void 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 | ||
333 | CardDevice::~CardDevice() | 373 | CardDevice::~CardDevice() |
334 | { | 374 | { |
@@ -337,10 +377,35 @@ CardDevice::~CardDevice() | |||
337 | //================================================================================================= | 377 | //================================================================================================= |
338 | InputDevice::InputDevice( Category* parent, const QString& name ) | 378 | InputDevice::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 | |||
388 | void 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 | ||
345 | InputDevice::~InputDevice() | 410 | InputDevice::~InputDevice() |
346 | { | 411 | { |
diff --git a/noncore/settings/sysinfo/devicesinfo.h b/noncore/settings/sysinfo/devicesinfo.h index c601a96..c4e3637 100644 --- a/noncore/settings/sysinfo/devicesinfo.h +++ b/noncore/settings/sysinfo/devicesinfo.h | |||
@@ -36,8 +36,10 @@ _;:, .> :=|. This program is free software; you can | |||
36 | /* QT */ | 36 | /* QT */ |
37 | #include <qwidget.h> | 37 | #include <qwidget.h> |
38 | #include <qwidgetstack.h> | 38 | #include <qwidgetstack.h> |
39 | 39 | ||
40 | namespace Opie { namespace Core { class OPcmciaSocket; class OInputDevice; }; }; | ||
41 | |||
40 | //================================================================================================= | 42 | //================================================================================================= |
41 | class DevicesView : public Opie::Ui::OListView | 43 | class DevicesView : public Opie::Ui::OListView |
42 | { | 44 | { |
43 | Q_OBJECT | 45 | Q_OBJECT |
@@ -101,9 +103,8 @@ class CardsCategory : public Category | |||
101 | { | 103 | { |
102 | public: | 104 | public: |
103 | CardsCategory( DevicesView* parent ); | 105 | CardsCategory( DevicesView* parent ); |
104 | virtual ~CardsCategory(); | 106 | virtual ~CardsCategory(); |
105 | |||
106 | virtual void populate(); | 107 | virtual void populate(); |
107 | }; | 108 | }; |
108 | 109 | ||
109 | //================================================================================================= | 110 | //================================================================================================= |
@@ -148,8 +149,10 @@ class InputDevice : public Device | |||
148 | public: | 149 | public: |
149 | InputDevice( Category* parent, const QString& name ); | 150 | InputDevice( Category* parent, const QString& name ); |
150 | ~InputDevice(); | 151 | ~InputDevice(); |
151 | 152 | ||
153 | void setInfo( const Opie::Core::OInputDevice* dev ); | ||
154 | |||
152 | // virtual QWidget* detailsWidget(); | 155 | // virtual QWidget* detailsWidget(); |
153 | }; | 156 | }; |
154 | 157 | ||
155 | //================================================================================================= | 158 | //================================================================================================= |
@@ -157,8 +160,9 @@ class CardDevice : public Device | |||
157 | { | 160 | { |
158 | public: | 161 | public: |
159 | CardDevice( Category* parent, const QString& name ); | 162 | CardDevice( Category* parent, const QString& name ); |
160 | ~CardDevice(); | 163 | ~CardDevice(); |
164 | void setInfo( const Opie::Core::OPcmciaSocket* card ); | ||
161 | 165 | ||
162 | // virtual QWidget* detailsWidget(); | 166 | // virtual QWidget* detailsWidget(); |
163 | }; | 167 | }; |
164 | 168 | ||
diff --git a/noncore/settings/sysinfo/sysinfo.pro b/noncore/settings/sysinfo/sysinfo.pro index 8b23a57..ed9bc0e 100644 --- a/noncore/settings/sysinfo/sysinfo.pro +++ b/noncore/settings/sysinfo/sysinfo.pro | |||
@@ -33,7 +33,7 @@ INCLUDEPATH += $(OPIEDIR)/include | |||
33 | DEPENDPATH += $(OPIEDIR)/include | 33 | DEPENDPATH += $(OPIEDIR)/include |
34 | LIBS += -lqpe -lopiecore2 -lopieui2 | 34 | LIBS += -lqpe -lopiecore2 -lopieui2 |
35 | DEFINES += UNIX | 35 | DEFINES += UNIX |
36 | TARGET = sysinfo | 36 | TARGET = sysinfo |
37 | VERSION = 1.3.0 | 37 | VERSION = 1.3.1 |
38 | 38 | ||
39 | include( $(OPIEDIR)/include.pro ) | 39 | include( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/settings/sysinfo/sysloginfo.cpp b/noncore/settings/sysinfo/sysloginfo.cpp index 21427f4..279c335 100644 --- a/noncore/settings/sysinfo/sysloginfo.cpp +++ b/noncore/settings/sysinfo/sysloginfo.cpp | |||
@@ -2,11 +2,9 @@ | |||
2 | ** SyslogInfo | 2 | ** SyslogInfo |
3 | ** | 3 | ** |
4 | ** Display Syslog information | 4 | ** Display Syslog information |
5 | ** | 5 | ** |
6 | ** Copyright (C) 2004, Michael Lauer | 6 | ** Copyright (C) 2004-2005 Michael 'Mickey' Lauer <mickey@Vanille.de> |
7 | ** mickey@tm.informatik.uni-frankfurt.de | ||
8 | ** http://www.Vanille.de | ||
9 | ** | 7 | ** |
10 | ** This file may be distributed and/or modified under the terms of the | 8 | ** This file may be distributed and/or modified under the terms of the |
11 | ** GNU General Public License version 2 as published by the Free Software | 9 | ** GNU General Public License version 2 as published by the Free Software |
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | 10 | ** Foundation and appearing in the file LICENSE.GPL included in the |
@@ -68,9 +66,9 @@ SyslogInfo::SyslogInfo( QWidget* parent, const char* name, WFlags fl ) | |||
68 | syslogview = new QTextView( this ); | 66 | syslogview = new QTextView( this ); |
69 | syslogview->setTextFormat( PlainText ); | 67 | syslogview->setTextFormat( PlainText ); |
70 | OConfig cfg( "qpe" ); | 68 | OConfig cfg( "qpe" ); |
71 | cfg.setGroup( "Appearance" ); | 69 | cfg.setGroup( "Appearance" ); |
72 | syslogview->setFont( QFont( "Fixed", cfg.readNumEntry( "FontSize", 10 ) ) ); | 70 | syslogview->setFont( QFont( cfg.readEntry( "FixedFontFamily", "Fixed" ), cfg.readNumEntry( "FixedFontSize", 10 ) ) ); |
73 | layout->addWidget( syslogview, 0, 0 ); | 71 | layout->addWidget( syslogview, 0, 0 ); |
74 | syslogview->setText( "..." ); | 72 | syslogview->setText( "..." ); |
75 | 73 | ||
76 | memset( buf, 0, bufsize ); | 74 | memset( buf, 0, bufsize ); |
diff --git a/noncore/settings/sysinfo/sysloginfo.h b/noncore/settings/sysinfo/sysloginfo.h index 7bf8d17..f9e522a 100644 --- a/noncore/settings/sysinfo/sysloginfo.h +++ b/noncore/settings/sysinfo/sysloginfo.h | |||
@@ -2,11 +2,9 @@ | |||
2 | ** SyslogInfo | 2 | ** SyslogInfo |
3 | ** | 3 | ** |
4 | ** Display Syslog information | 4 | ** Display Syslog information |
5 | ** | 5 | ** |
6 | ** Copyright (C) 2004, Michael Lauer | 6 | ** Copyright (C) 2004-2005, Michael 'Mickey' Lauer <mickey@Vanille.de> |
7 | ** mickey@tm.informatik.uni-frankfurt.de | ||
8 | ** http://www.Vanille.de | ||
9 | ** | 7 | ** |
10 | ** This file may be distributed and/or modified under the terms of the | 8 | ** This file may be distributed and/or modified under the terms of the |
11 | ** GNU General Public License version 2 as published by the Free Software | 9 | ** GNU General Public License version 2 as published by the Free Software |
12 | ** Foundation and appearing in the file LICENSE.GPL included in the | 10 | ** Foundation and appearing in the file LICENSE.GPL included in the |