summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/memoryapplet/config.in2
-rw-r--r--noncore/applets/memoryapplet/memoryapplet.pro2
-rw-r--r--noncore/applets/memoryapplet/memorystatus.cpp31
-rw-r--r--noncore/applets/memoryapplet/memorystatus.h10
-rw-r--r--noncore/applets/memoryapplet/opie-memoryapplet.control2
5 files changed, 24 insertions, 23 deletions
diff --git a/noncore/applets/memoryapplet/config.in b/noncore/applets/memoryapplet/config.in
index 578aaf9..4fc13ba 100644
--- a/noncore/applets/memoryapplet/config.in
+++ b/noncore/applets/memoryapplet/config.in
@@ -1,6 +1,6 @@
1 config MEMORYAPPLET 1 config MEMORYAPPLET
2 boolean "opie-memoryapplet (view memory status and manage a swap file)" 2 boolean "opie-memoryapplet (view memory status and manage a swap file)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && SYSINFO 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && SYSINFO
5 comment "opie-memoryapplet needs a libqpe, libopie and sysinfo" 5 comment "opie-memoryapplet needs a libqpe, libopie and sysinfo"
6 depends ! ( LIBOPIE && SYSINFO ) 6 depends ! ( LIBOPIE && SYSINFO )
diff --git a/noncore/applets/memoryapplet/memoryapplet.pro b/noncore/applets/memoryapplet/memoryapplet.pro
index cd3f4a5..6031386 100644
--- a/noncore/applets/memoryapplet/memoryapplet.pro
+++ b/noncore/applets/memoryapplet/memoryapplet.pro
@@ -19,6 +19,6 @@ DESTDIR = $(OPIEDIR)/plugins/applets
19INCLUDEPATH += $(OPIEDIR)/include 19INCLUDEPATH += $(OPIEDIR)/include
20DEPENDPATH += ../$(OPIEDIR)/include 20DEPENDPATH += ../$(OPIEDIR)/include
21VERSION = 1.0.0 21VERSION = 1.0.0
22LIBS += -lqpe -lopie 22LIBS += -lqpe -lopieui2
23 23
24include ( $(OPIEDIR)/include.pro ) 24include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/memoryapplet/memorystatus.cpp b/noncore/applets/memoryapplet/memorystatus.cpp
index b738312..c01ba28 100644
--- a/noncore/applets/memoryapplet/memorystatus.cpp
+++ b/noncore/applets/memoryapplet/memorystatus.cpp
@@ -26,7 +26,6 @@
26#include <qdrawutil.h> 26#include <qdrawutil.h>
27#include <qlabel.h> 27#include <qlabel.h>
28 28
29#include <opie/otabwidget.h>
30#include <qlayout.h> 29#include <qlayout.h>
31 30
32MemoryStatus::MemoryStatus(QWidget *parent, WFlags f ) 31MemoryStatus::MemoryStatus(QWidget *parent, WFlags f )
@@ -41,12 +40,12 @@ MemoryStatus::MemoryStatus(QWidget *parent, WFlags f )
41 tab->addTab( mi = new MemoryInfo( tab ), "memory/memorytabicon", tr("Memory") ); 40 tab->addTab( mi = new MemoryInfo( tab ), "memory/memorytabicon", tr("Memory") );
42 tab->addTab( sf = new Swapfile( tab ), "memory/storagetabicon", tr("Swapfile") ); 41 tab->addTab( sf = new Swapfile( tab ), "memory/storagetabicon", tr("Swapfile") );
43 42
44 QLabel* about = new QLabel(tr("<center><b>Memory Monitor Plugin</b><br>" 43 QLabel* about = new QLabel(tr("<center><b>Memory Monitor Plugin</b><br>"
45 "Copyright (C) 2003 Anton Maslovsky<br>" 44 "Copyright (C) 2003 Anton Maslovsky<br>"
46 "&lt;<a href=\"mailto:my-zaurus@narod.ru\">my-zaurus@narod.ru</a>&gt;<br>" 45 "&lt;<a href=\"mailto:my-zaurus@narod.ru\">my-zaurus@narod.ru</a>&gt;<br>"
47 "<a href=\"http://my-zaurus.narod.ru\">http://my-zaurus.narod.ru</a><br>" 46 "<a href=\"http://my-zaurus.narod.ru\">http://my-zaurus.narod.ru</a><br>"
48 "Based on source code from:<br> qswap (udoseidel@gmx.de) <br> Battery Applet (trolltech.com) <br> SysInfo (OPIE)<br><br>" 47 "Based on source code from:<br> qswap (udoseidel@gmx.de) <br> Battery Applet (trolltech.com) <br> SysInfo (OPIE)<br><br>"
49 "This program is licensed under GNU GPL.</center>"), tab); 48 "This program is licensed under GNU GPL.</center>"), tab);
50 49
51 tab->addTab( about, "memory/info", tr("About") ); 50 tab->addTab( about, "memory/info", tr("About") );
52 51
@@ -55,25 +54,25 @@ MemoryStatus::MemoryStatus(QWidget *parent, WFlags f )
55 54
56int MemoryStatus::percent() 55int MemoryStatus::percent()
57{ 56{
58 if (mi == 0) 57 if (mi == 0)
59 return 100; 58 return 100;
60 59
61 int total = mi->total; 60 int total = mi->total;
62 if (mi->swaptotal > 0) 61 if (mi->swaptotal > 0)
63 total += mi->swaptotal; 62 total += mi->swaptotal;
64 63
65 int used = mi->realUsed; 64 int used = mi->realUsed;
66 if (mi->swapused > 0) 65 if (mi->swapused > 0)
67 total += mi->swapused; 66 total += mi->swapused;
68 67
69 return ((total - used) * 100)/total; 68 return ((total - used) * 100)/total;
70} 69}
71 70
72QSize MemoryStatus::sizeHint() const 71QSize MemoryStatus::sizeHint() const
73{ 72{
74 QSize s = tab->size(); 73 QSize s = tab->size();
75 s.setWidth(200); 74 s.setWidth(200);
76 s.setHeight((mi->swaptotal > 0) ? 220 : 200); 75 s.setHeight((mi->swaptotal > 0) ? 220 : 200);
77 return s; 76 return s;
78} 77}
79 78
diff --git a/noncore/applets/memoryapplet/memorystatus.h b/noncore/applets/memoryapplet/memorystatus.h
index 5c73833..c3926db 100644
--- a/noncore/applets/memoryapplet/memorystatus.h
+++ b/noncore/applets/memoryapplet/memorystatus.h
@@ -22,9 +22,11 @@
22 22
23#include <qframe.h> 23#include <qframe.h>
24 24
25#include <opie2/otabwidget.h>
26
25class MemoryInfo; 27class MemoryInfo;
26class Swapfile; 28class Swapfile;
27class OTabWidget; 29using Opie::OTabWidget;
28 30
29class MemoryStatus : public QFrame 31class MemoryStatus : public QFrame
30{ 32{
@@ -35,12 +37,12 @@ public:
35 37
36 QSize sizeHint() const; 38 QSize sizeHint() const;
37 MemoryInfo* mi; 39 MemoryInfo* mi;
38 Swapfile* sf; 40 Swapfile* sf;
39 41
40 int percent(); 42 int percent();
41 43
42private: 44private:
43 OTabWidget *tab; 45 OTabWidget *tab;
44}; 46};
45 47
46#endif 48#endif
diff --git a/noncore/applets/memoryapplet/opie-memoryapplet.control b/noncore/applets/memoryapplet/opie-memoryapplet.control
index 12026a4..c01a93f 100644
--- a/noncore/applets/memoryapplet/opie-memoryapplet.control
+++ b/noncore/applets/memoryapplet/opie-memoryapplet.control
@@ -4,7 +4,7 @@ Priority: optional
4Section: opie/applets 4Section: opie/applets
5Maintainer: Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de> 5Maintainer: Michael 'Mickey' Lauer <mickey@tm.informatik.uni-frankfurt.de>
6Architecture: arm 6Architecture: arm
7Depends: task-opie-minimal 7Depends: task-opie-minimal, libopieui2
8Description: Memory Applet 8Description: Memory Applet
9 This applet displays the amount of free memory and manages the swap partition 9 This applet displays the amount of free memory and manages the swap partition
10Version: $QPE_VERSION$EXTRAVERSION 10Version: $QPE_VERSION$EXTRAVERSION