author | mickeyl <mickeyl> | 2004-03-01 14:44:21 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-03-01 14:44:21 (UTC) |
commit | 7a819ad4bc09aa88521044bfbb06ab37a4c2ef66 (patch) (side-by-side diff) | |
tree | 30adbbdd3d1eedaadd3671a17d960d161ddbfbe0 | |
parent | dbf8c3e1fc4416f2fd719b7d278984591a2366de (diff) | |
download | opie-7a819ad4bc09aa88521044bfbb06ab37a4c2ef66.zip opie-7a819ad4bc09aa88521044bfbb06ab37a4c2ef66.tar.gz opie-7a819ad4bc09aa88521044bfbb06ab37a4c2ef66.tar.bz2 |
libopie1-->libopie2
-rw-r--r-- | core/applets/multikeyapplet/config.in | 2 | ||||
-rw-r--r-- | core/applets/multikeyapplet/multikey.cpp | 15 | ||||
-rw-r--r-- | core/applets/multikeyapplet/multikey.h | 1 | ||||
-rw-r--r-- | core/applets/multikeyapplet/multikeyapplet.pro | 6 |
4 files changed, 19 insertions, 5 deletions
diff --git a/core/applets/multikeyapplet/config.in b/core/applets/multikeyapplet/config.in index fc7affe..2e1a9e2 100644 --- a/core/applets/multikeyapplet/config.in +++ b/core/applets/multikeyapplet/config.in @@ -1,4 +1,4 @@ config MULTIKEYAPPLET boolean "opie-multikeyapplet (Applet to switch OnScreen keyboard layout)" default "y" - depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && MULTIKEY + depends ( LIBQPE || LIBQPE-X11 ) && MULTIKEY diff --git a/core/applets/multikeyapplet/multikey.cpp b/core/applets/multikeyapplet/multikey.cpp index d304f54..b36ee12 100644 --- a/core/applets/multikeyapplet/multikey.cpp +++ b/core/applets/multikeyapplet/multikey.cpp @@ -5,29 +5,32 @@ ** 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/global.h> #include <qpe/config.h> #include <qpe/qcopenvelope_qws.h> #include <qpe/qpeapplication.h> +/* QT */ #include <qlabel.h> #include <qdir.h> #include <qfileinfo.h> #include <qcopchannel_qws.h> 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 ) ); @@ -103,34 +106,44 @@ void Multikey::message(const QCString &message, const QByteArray &data) } keymap_map = sw[i]; } QFile map(keymap_map); if (map.open(IO_ReadOnly)) { QString line; map.readLine(line, 1024); while (!map.atEnd()) { if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) { - + if (i != sw.count()-1) { if (keymap_map == current_map) { lang = i; } 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> ); +} diff --git a/core/applets/multikeyapplet/multikey.h b/core/applets/multikeyapplet/multikey.h index 1c5aa0c..acddfc8 100644 --- a/core/applets/multikeyapplet/multikey.h +++ b/core/applets/multikeyapplet/multikey.h @@ -15,24 +15,25 @@ #define __MULTIKEY_H__ #include <qlabel.h> #include <qstringlist.h> #include <qpopupmenu.h> #include <qcopchannel_qws.h> class Multikey: public QLabel { Q_OBJECT public: Multikey(QWidget *parent); + static int position(); protected: void mousePressEvent(QMouseEvent *ev); void mouseReleaseEvent(QMouseEvent *ev); public slots: void message(const QCString &message, const QByteArray &data); protected: QStringList sw_maps; QStringList labels; QPopupMenu popupMenu; diff --git a/core/applets/multikeyapplet/multikeyapplet.pro b/core/applets/multikeyapplet/multikeyapplet.pro index 4be1f74..86e41c0 100644 --- a/core/applets/multikeyapplet/multikeyapplet.pro +++ b/core/applets/multikeyapplet/multikeyapplet.pro @@ -1,13 +1,13 @@ TEMPLATE = lib CONFIG += qt plugin warn_on release -HEADERS = multikey.h multikeyappletimpl.h -SOURCES = multikey.cpp multikeyappletimpl.cpp +HEADERS = multikey.h +SOURCES = multikey.cpp TARGET = multikeyapplet DESTDIR = $(OPIEDIR)/plugins/applets INCLUDEPATH += $(OPIEDIR)/include DEPENDPATH += ../$(OPIEDIR)/include .. -LIBS += -lqpe -lopie +LIBS += -lqpe VERSION = 1.0.0 include ( $(OPIEDIR)/include.pro ) target.path = $$prefix/plugins/applets |