Diffstat (limited to 'core/applets/cardmon/cardmon.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/applets/cardmon/cardmon.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index f3f9044..b8c4553 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp | |||
@@ -14,66 +14,71 @@ | |||
14 | * the Free Software Foundation; either version 2 of the License, or * | 14 | * the Free Software Foundation; either version 2 of the License, or * |
15 | * (at your option) any later version. * | 15 | * (at your option) any later version. * |
16 | * * | 16 | * * |
17 | ***************************************************************************/ | 17 | ***************************************************************************/ |
18 | 18 | ||
19 | 19 | ||
20 | #include "cardmon.h" | 20 | #include "cardmon.h" |
21 | 21 | ||
22 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | 23 | ||
24 | #include <opie/odevice.h> | 24 | #include <opie/odevice.h> |
25 | 25 | ||
26 | #include <qpe/applnk.h> | ||
27 | |||
26 | #include <qcopchannel_qws.h> | 28 | #include <qcopchannel_qws.h> |
27 | #include <qpainter.h> | 29 | #include <qpainter.h> |
28 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
29 | #include <qfile.h> | 31 | #include <qfile.h> |
30 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
31 | #include <qtimer.h> | 33 | #include <qtimer.h> |
32 | #include <qapplication.h> | 34 | #include <qapplication.h> |
33 | 35 | ||
34 | #include <stdio.h> | 36 | #include <stdio.h> |
35 | #include <unistd.h> | 37 | #include <unistd.h> |
36 | #include <stdlib.h> | 38 | #include <stdlib.h> |
37 | #include <string.h> | 39 | #include <string.h> |
38 | #include <fcntl.h> | 40 | #include <fcntl.h> |
39 | #include <qsound.h> | 41 | #include <qsound.h> |
40 | 42 | ||
41 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 43 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
42 | #include <sys/vfs.h> | 44 | #include <sys/vfs.h> |
43 | #include <mntent.h> | 45 | #include <mntent.h> |
44 | #endif | 46 | #endif |
45 | 47 | ||
46 | using namespace Opie; | 48 | using namespace Opie; |
47 | 49 | ||
48 | CardMonitor::CardMonitor(QWidget * parent):QWidget(parent), | 50 | CardMonitor::CardMonitor(QWidget * parent):QWidget(parent), |
49 | pm(Resource:: | 51 | pm( Resource::loadPixmap("cardmon/pcmcia") ) |
50 | loadPixmap("cardmon/pcmcia")) | ||
51 | { | 52 | { |
52 | 53 | ||
53 | QCopChannel *pcmciaChannel = new QCopChannel("QPE/Card", this); | 54 | QCopChannel *pcmciaChannel = new QCopChannel("QPE/Card", this); |
54 | connect(pcmciaChannel, | 55 | connect(pcmciaChannel, |
55 | SIGNAL(received(const QCString &, const QByteArray &)), this, | 56 | SIGNAL(received(const QCString &, const QByteArray &)), this, |
56 | SLOT(cardMessage(const QCString &, const QByteArray &))); | 57 | SLOT(cardMessage(const QCString &, const QByteArray &))); |
57 | 58 | ||
58 | QCopChannel *sdChannel = new QCopChannel("QPE/Card", this); | 59 | QCopChannel *sdChannel = new QCopChannel("QPE/Card", this); |
59 | connect(sdChannel, | 60 | connect(sdChannel, |
60 | SIGNAL(received(const QCString &, const QByteArray &)), this, | 61 | SIGNAL(received(const QCString &, const QByteArray &)), this, |
61 | SLOT(cardMessage(const QCString &, const QByteArray &))); | 62 | SLOT(cardMessage(const QCString &, const QByteArray &))); |
62 | 63 | ||
63 | cardInPcmcia0 = FALSE; | 64 | cardInPcmcia0 = FALSE; |
64 | cardInPcmcia1 = FALSE; | 65 | cardInPcmcia1 = FALSE; |
65 | cardInSd = FALSE; | 66 | cardInSd = FALSE; |
66 | 67 | ||
67 | setFixedSize(pm.size()); | 68 | setFocusPolicy( NoFocus ); |
69 | |||
70 | setFixedWidth ( AppLnk::smallIconSize() ); | ||
71 | setFixedHeight ( AppLnk::smallIconSize() ); | ||
72 | |||
68 | getStatusPcmcia(TRUE); | 73 | getStatusPcmcia(TRUE); |
69 | getStatusSd(TRUE); | 74 | getStatusSd(TRUE); |
70 | repaint(FALSE); | 75 | repaint(FALSE); |
71 | popupMenu = 0; | 76 | popupMenu = 0; |
72 | } | 77 | } |
73 | 78 | ||
74 | CardMonitor::~CardMonitor() | 79 | CardMonitor::~CardMonitor() |
75 | { | 80 | { |
76 | if (popupMenu) { | 81 | if (popupMenu) { |
77 | delete popupMenu; | 82 | delete popupMenu; |
78 | } | 83 | } |
79 | } | 84 | } |