summaryrefslogtreecommitdiff
path: root/noncore/applets/zkbapplet/zkbwidget.cpp
Unidiff
Diffstat (limited to 'noncore/applets/zkbapplet/zkbwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp
index 0083e9b..3acff1e 100644
--- a/noncore/applets/zkbapplet/zkbwidget.cpp
+++ b/noncore/applets/zkbapplet/zkbwidget.cpp
@@ -5,17 +5,18 @@
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
11using namespace Opie::Ui;
11ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), 12ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0),
12 disabled(Resource::loadPixmap("zkb-disabled")) { 13 disabled(Resource::loadPixmap("zkb-disabled")) {
13 14
14 labels = new QPopupMenu(); 15 labels = new QPopupMenu();
15 connect(labels, SIGNAL(activated(int)), this, 16 connect(labels, SIGNAL(activated(int)), this,
16 SLOT(labelChanged(int))); 17 SLOT(labelChanged(int)));
17 18
18 loadKeymap(); 19 loadKeymap();
19 20
20 channel = new QCopChannel("QPE/zkb", this); 21 channel = new QCopChannel("QPE/zkb", this);
21 connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), 22 connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
@@ -65,13 +66,13 @@ bool ZkbWidget::loadKeymap() {
65 66
66 labels->clear(); 67 labels->clear();
67 QStringList l = keymap->listLabels(); 68 QStringList l = keymap->listLabels();
68 labels->insertItem(disabled, 0, 0); 69 labels->insertItem(disabled, 0, 0);
69 int n = 1; 70 int n = 1;
70 w = 0; 71 w = 0;
71 for(QStringList::Iterator it = l.begin(); it != l.end(); 72 for(QStringList::Iterator it = l.begin(); it != l.end();
72 ++it, n++) { 73 ++it, n++) {
73 74
74 // printf("label: %s\n", (const char*) (*it).utf8()); 75 // printf("label: %s\n", (const char*) (*it).utf8());
75 76
76 labels->insertItem(*it, n, n); 77 labels->insertItem(*it, n, n);
77 int lw = fm.width(*it); 78 int lw = fm.width(*it);
@@ -152,11 +153,9 @@ void ZkbWidget::signalReceived(const QCString& msg, const QByteArray& data) {
152 153
153void ZkbWidget::reload() { 154void ZkbWidget::reload() {
154 loadKeymap(); 155 loadKeymap();
155 QCopEnvelope("QPE/System", "notBusy()"); 156 QCopEnvelope("QPE/System", "notBusy()");
156} 157}
157 158
158Q_EXPORT_INTERFACE() 159EXPORT_OPIE_APPLET_v1( ZkbWidget )
159{ 160
160 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ZkbWidget> );
161}
162 161