-rw-r--r-- | noncore/applets/zkbapplet/zkbwidget.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp index 0b5ab78..0083e9b 100644 --- a/noncore/applets/zkbapplet/zkbwidget.cpp +++ b/noncore/applets/zkbapplet/zkbwidget.cpp | |||
@@ -1,70 +1,70 @@ | |||
1 | #include <opie2/otaskbarapplet.h> | 1 | #include <opie2/otaskbarapplet.h> |
2 | #include <qpe/qcopenvelope_qws.h> | 2 | #include <qpe/qcopenvelope_qws.h> |
3 | #include <qpe/applnk.h> | 3 | #include <qpe/applnk.h> |
4 | #include <qpe/qpeapplication.h> | 4 | #include <qpe/qpeapplication.h> |
5 | #include <qpe/resource.h> | 5 | #include <qpe/resource.h> |
6 | #include <stdio.h> | 6 | #include <stdio.h> |
7 | #include <unistd.h> | 7 | #include <unistd.h> |
8 | #include "zkbwidget.h" | 8 | #include "zkbwidget.h" |
9 | #include "zkbcfg.h" | 9 | #include "zkbcfg.h" |
10 | 10 | ||
11 | ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), | 11 | ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), |
12 | disabled(Resource::loadPixmap("zkb-disabled")) { | 12 | disabled(Resource::loadPixmap("zkb-disabled")) { |
13 | 13 | ||
14 | labels = new QPopupMenu(); | 14 | labels = new QPopupMenu(); |
15 | connect(labels, SIGNAL(activated(int)), this, | 15 | connect(labels, SIGNAL(activated(int)), this, |
16 | SLOT(labelChanged(int))); | 16 | SLOT(labelChanged(int))); |
17 | 17 | ||
18 | loadKeymap(); | 18 | loadKeymap(); |
19 | 19 | ||
20 | channel = new QCopChannel("QPE/zkb", this); | 20 | channel = new QCopChannel("QPE/zkb", this); |
21 | connect(channel, SIGNAL(received(const QCString&, const QByteArray&)), | 21 | connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), |
22 | this, SLOT(signalReceived(const QCString&, const QByteArray&))); | 22 | this, SLOT(signalReceived(const QCString&,const QByteArray&))); |
23 | setFixedWidth ( AppLnk::smallIconSize() ); | 23 | setFixedWidth ( AppLnk::smallIconSize() ); |
24 | setFixedHeight ( AppLnk::smallIconSize() ); | 24 | setFixedHeight ( AppLnk::smallIconSize() ); |
25 | } | 25 | } |
26 | 26 | ||
27 | ZkbWidget::~ZkbWidget() { | 27 | ZkbWidget::~ZkbWidget() { |
28 | } | 28 | } |
29 | 29 | ||
30 | int ZkbWidget::position() | 30 | int ZkbWidget::position() |
31 | { | 31 | { |
32 | return 8; | 32 | return 8; |
33 | } | 33 | } |
34 | 34 | ||
35 | bool ZkbWidget::loadKeymap() { | 35 | bool ZkbWidget::loadKeymap() { |
36 | ZkbConfig c(QPEApplication::qpeDir()+"/share/zkb"); | 36 | ZkbConfig c(QPEApplication::qpeDir()+"/share/zkb"); |
37 | QFontMetrics fm(font()); | 37 | QFontMetrics fm(font()); |
38 | 38 | ||
39 | if (keymap != 0) { | 39 | if (keymap != 0) { |
40 | delete keymap; | 40 | delete keymap; |
41 | keymap = 0; | 41 | keymap = 0; |
42 | } | 42 | } |
43 | 43 | ||
44 | Keymap* km = new Keymap(); | 44 | Keymap* km = new Keymap(); |
45 | 45 | ||
46 | if (!c.load("zkb.xml", *km, "")) { | 46 | if (!c.load("zkb.xml", *km, "")) { |
47 | delete km; | 47 | delete km; |
48 | setPixmap(disabled); | 48 | setPixmap(disabled); |
49 | return false; | 49 | return false; |
50 | } | 50 | } |
51 | 51 | ||
52 | connect(km, SIGNAL(stateChanged(const QString&)), | 52 | connect(km, SIGNAL(stateChanged(const QString&)), |
53 | this, SLOT(stateChanged(const QString&))); | 53 | this, SLOT(stateChanged(const QString&))); |
54 | 54 | ||
55 | qwsServer->setKeyboardFilter(km); | 55 | qwsServer->setKeyboardFilter(km); |
56 | 56 | ||
57 | Keymap* oldkm = keymap; | 57 | Keymap* oldkm = keymap; |
58 | keymap = km; | 58 | keymap = km; |
59 | 59 | ||
60 | if (oldkm != 0) { | 60 | if (oldkm != 0) { |
61 | delete oldkm; | 61 | delete oldkm; |
62 | } | 62 | } |
63 | 63 | ||
64 | setText(keymap->getCurrentLabel()); | 64 | setText(keymap->getCurrentLabel()); |
65 | 65 | ||
66 | labels->clear(); | 66 | labels->clear(); |
67 | QStringList l = keymap->listLabels(); | 67 | QStringList l = keymap->listLabels(); |
68 | labels->insertItem(disabled, 0, 0); | 68 | labels->insertItem(disabled, 0, 0); |
69 | int n = 1; | 69 | int n = 1; |
70 | w = 0; | 70 | w = 0; |