Diffstat (limited to 'noncore/applets/memoryapplet') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/applets/memoryapplet/memorymeter.cpp | 26 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.cpp | 1 | ||||
-rw-r--r-- | noncore/applets/memoryapplet/memorystatus.h | 4 |
3 files changed, 15 insertions, 16 deletions
diff --git a/noncore/applets/memoryapplet/memorymeter.cpp b/noncore/applets/memoryapplet/memorymeter.cpp index 9299f49..9cdeaf4 100644 --- a/noncore/applets/memoryapplet/memorymeter.cpp +++ b/noncore/applets/memoryapplet/memorymeter.cpp | |||
@@ -32,14 +32,15 @@ | |||
32 | #include <qtopia/applnk.h> | 32 | #include <qtopia/applnk.h> |
33 | 33 | ||
34 | using namespace Opie::Ui; | ||
34 | MemoryMeter::MemoryMeter( QWidget *parent ) | 35 | MemoryMeter::MemoryMeter( QWidget *parent ) |
35 | : QWidget( parent ), memoryView(0) | 36 | : QWidget( parent ), memoryView(0) |
36 | { | 37 | { |
37 | bvsz = QSize(); | 38 | bvsz = QSize(); |
38 | if ( qApp->desktop()->height() >= 300 ) | 39 | if ( qApp->desktop()->height() >= 300 ) |
39 | { | 40 | { |
40 | memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup ); | 41 | memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup ); |
41 | memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised ); | 42 | memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised ); |
42 | } | 43 | } |
43 | else | 44 | else |
44 | { | 45 | { |
45 | memoryView = new MemoryStatus( 0 ); | 46 | memoryView = new MemoryStatus( 0 ); |
@@ -80,9 +81,9 @@ bool MemoryMeter::updateMemoryViewGeometry() | |||
80 | { | 81 | { |
81 | QSize sz = memoryView->sizeHint(); | 82 | QSize sz = memoryView->sizeHint(); |
82 | if ( sz != bvsz ) | 83 | if ( sz != bvsz ) |
83 | { | 84 | { |
84 | bvsz = sz; | 85 | bvsz = sz; |
85 | QRect r(memoryView->pos(), memoryView->sizeHint()); | 86 | QRect r(memoryView->pos(), memoryView->sizeHint()); |
86 | if ( qApp->desktop()->height() >= 300 ) | 87 | if ( qApp->desktop()->height() >= 300 ) |
87 | { | 88 | { |
88 | QPoint curPos = mapToGlobal( rect().topLeft() ); | 89 | QPoint curPos = mapToGlobal( rect().topLeft() ); |
@@ -101,9 +102,9 @@ bool MemoryMeter::updateMemoryViewGeometry() | |||
101 | void MemoryMeter::mousePressEvent( QMouseEvent *) | 102 | void MemoryMeter::mousePressEvent( QMouseEvent *) |
102 | { | 103 | { |
103 | if ( memoryView->isVisible() ) | 104 | if ( memoryView->isVisible() ) |
104 | { | 105 | { |
105 | memoryView->hide(); | 106 | memoryView->hide(); |
106 | } | 107 | } |
107 | else | 108 | else |
108 | { | 109 | { |
109 | bvsz = QSize(); | 110 | bvsz = QSize(); |
@@ -207,5 +208,5 @@ void MemoryMeter::paintEvent( QPaintEvent* ) | |||
207 | // Drained section. | 208 | // Drained section. |
208 | // | 209 | // |
209 | if (used_height != 0) | 210 | if (used_height != 0) |
210 | { | 211 | { |
211 | p.setPen(NoPen); | 212 | p.setPen(NoPen); |
@@ -224,5 +225,5 @@ void MemoryMeter::paintEvent( QPaintEvent* ) | |||
224 | // Unused section. | 225 | // Unused section. |
225 | // | 226 | // |
226 | if ( batt_height - used_height > 0 ) | 227 | if ( batt_height - used_height > 0 ) |
227 | { | 228 | { |
228 | int unused_offset = used_height + batt_yoffset; | 229 | int unused_offset = used_height + batt_yoffset; |
@@ -241,7 +242,4 @@ void MemoryMeter::paintEvent( QPaintEvent* ) | |||
241 | } | 242 | } |
242 | 243 | ||
243 | Q_EXPORT_INTERFACE() | 244 | EXPORT_OPIE_APPLET_v1( MemoryMeter ) |
244 | { | ||
245 | Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> ); | ||
246 | } | ||
247 | 245 | ||
diff --git a/noncore/applets/memoryapplet/memorystatus.cpp b/noncore/applets/memoryapplet/memorystatus.cpp index c01ba28..95ae06b 100644 --- a/noncore/applets/memoryapplet/memorystatus.cpp +++ b/noncore/applets/memoryapplet/memorystatus.cpp | |||
@@ -29,4 +29,5 @@ | |||
29 | #include <qlayout.h> | 29 | #include <qlayout.h> |
30 | 30 | ||
31 | using namespace Opie::Ui; | ||
31 | MemoryStatus::MemoryStatus(QWidget *parent, WFlags f ) | 32 | MemoryStatus::MemoryStatus(QWidget *parent, WFlags f ) |
32 | : QFrame(parent, 0, f), mi(0), sf(0) | 33 | : QFrame(parent, 0, f), mi(0), sf(0) |
diff --git a/noncore/applets/memoryapplet/memorystatus.h b/noncore/applets/memoryapplet/memorystatus.h index c3926db..d16787b 100644 --- a/noncore/applets/memoryapplet/memorystatus.h +++ b/noncore/applets/memoryapplet/memorystatus.h | |||
@@ -27,5 +27,5 @@ | |||
27 | class MemoryInfo; | 27 | class MemoryInfo; |
28 | class Swapfile; | 28 | class Swapfile; |
29 | using Opie::OTabWidget; | 29 | |
30 | 30 | ||
31 | class MemoryStatus : public QFrame | 31 | class MemoryStatus : public QFrame |
@@ -43,5 +43,5 @@ public: | |||
43 | 43 | ||
44 | private: | 44 | private: |
45 | OTabWidget *tab; | 45 | Opie::Ui::OTabWidget *tab; |
46 | }; | 46 | }; |
47 | 47 | ||