summaryrefslogtreecommitdiff
path: root/core/applets/multikeyapplet/multikey.cpp
Side-by-side diff
Diffstat (limited to 'core/applets/multikeyapplet/multikey.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/applets/multikeyapplet/multikey.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/applets/multikeyapplet/multikey.cpp b/core/applets/multikeyapplet/multikey.cpp
index fc5f093..195ada5 100644
--- a/core/applets/multikeyapplet/multikey.cpp
+++ b/core/applets/multikeyapplet/multikey.cpp
@@ -1,47 +1,49 @@
/**********************************************************************
** Copyright (C) 2004 Anton Kachalov mouse@altlinux.ru
** All rights reserved.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
**********************************************************************/
#include "multikey.h"
/* OPIE */
#include <opie2/otaskbarapplet.h>
#include <qpe/qcopenvelope_qws.h>
+#include <qpe/qpeapplication.h>
/* QT */
#include <qdir.h>
+using namespace Opie::Ui;
Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("EN")
{
QCopChannel* swChannel = new QCopChannel("MultiKey/Switcher", this);
connect( swChannel, SIGNAL(received(const QCString&,const QByteArray&)),
this, SLOT(message(const QCString&,const QByteArray&)));
setFont( QFont( "Helvetica", 10, QFont::Normal ) );
QPEApplication::setStylusOperation(this, QPEApplication::RightOnHold);
lang = 0;
QCopEnvelope e("MultiKey/Keyboard", "getmultikey()");
setText("EN");
popupMenu.insertItem("EN", 0);
show();
}
void Multikey::mousePressEvent(QMouseEvent *ev)
{
if (!sw_maps.count())
return;
if (ev->button() == RightButton) {
QPoint p = mapToGlobal(QPoint(0, 0));
QSize s = popupMenu.sizeHint();
@@ -116,28 +118,25 @@ void Multikey::message(const QCString &message, const QByteArray &data)
}
sw_maps.append(keymap_map);
labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
popupMenu.insertItem(labels[labels.count()-1], labels.count()-1);
} else {
current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace();
}
break;
}
map.readLine(line, 1024);
}
map.close();
}
}
setText(current);
}
}
int Multikey::position()
{
return 10;
}
-Q_EXPORT_INTERFACE()
-{
- Q_CREATE_INSTANCE( OTaskbarAppletWrapper<Multikey> );
-}
+EXPORT_OPIE_APPLET_v1( Multikey )