summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/autorotateapplet/autorotate.cpp11
-rw-r--r--noncore/applets/autorotateapplet/autorotate.h3
-rw-r--r--noncore/applets/autorotateapplet/autorotateapplet.pro16
-rw-r--r--noncore/applets/autorotateapplet/autorotateimpl.cpp42
-rw-r--r--noncore/applets/autorotateapplet/autorotateimpl.h18
-rw-r--r--noncore/applets/memoryapplet/memoryapplet.pro4
-rw-r--r--noncore/applets/memoryapplet/memoryappletimpl.cpp65
-rw-r--r--noncore/applets/memoryapplet/memoryappletimpl.h43
-rw-r--r--noncore/applets/memoryapplet/memorymeter.cpp14
-rw-r--r--noncore/applets/memoryapplet/memorymeter.h1
-rw-r--r--noncore/applets/notesapplet/notes.cpp10
-rw-r--r--noncore/applets/notesapplet/notes.h1
-rw-r--r--noncore/applets/notesapplet/notesapplet.pro8
-rw-r--r--noncore/applets/notesapplet/notesappletimpl.cpp53
-rw-r--r--noncore/applets/notesapplet/notesappletimpl.h35
-rw-r--r--noncore/applets/zkbapplet/.cvsignore6
-rw-r--r--noncore/applets/zkbapplet/zkbapplet.cpp49
-rw-r--r--noncore/applets/zkbapplet/zkbapplet.h23
-rw-r--r--noncore/applets/zkbapplet/zkbapplet.pro6
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.cpp12
-rw-r--r--noncore/applets/zkbapplet/zkbwidget.h1
21 files changed, 67 insertions, 354 deletions
diff --git a/noncore/applets/autorotateapplet/autorotate.cpp b/noncore/applets/autorotateapplet/autorotate.cpp
index 5152904..94be0ae 100644
--- a/noncore/applets/autorotateapplet/autorotate.cpp
+++ b/noncore/applets/autorotateapplet/autorotate.cpp
@@ -1,90 +1,101 @@
1/* 1/*
2 * copyright : (c) 2003 by Greg Gilbert 2 * copyright : (c) 2003 by Greg Gilbert
3 * email : greg@treke.net 3 * email : greg@treke.net
4 * based on the cardmon applet by Max Reiss 4 * based on the cardmon applet by Max Reiss
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 * * 10 * *
11 *************************************************************************/ 11 *************************************************************************/
12 12
13#include "autorotate.h" 13#include "autorotate.h"
14 14
15/* OPIE */ 15/* OPIE */
16#include <opie2/odevice.h> 16#include <opie2/odevice.h>
17#include <opie2/otaskbarapplet.h>
17#include <qpe/applnk.h> 18#include <qpe/applnk.h>
18#include <qpe/config.h> 19#include <qpe/config.h>
19#include <qpe/resource.h> 20#include <qpe/resource.h>
20 21
21/* QT */ 22/* QT */
22#include <qpainter.h> 23#include <qpainter.h>
23 24
24using namespace Opie; 25using namespace Opie;
25 26
26AutoRotate::AutoRotate(QWidget * parent):QWidget(parent) 27AutoRotate::AutoRotate(QWidget * parent):QWidget(parent)
27{ 28{
28 setFixedWidth( AppLnk::smallIconSize() ); 29 setFixedWidth( AppLnk::smallIconSize() );
29 setFixedHeight( AppLnk::smallIconSize() ); 30 setFixedHeight( AppLnk::smallIconSize() );
30 31
31 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) ); 32 enabledPm.convertFromImage( Resource::loadImage("autorotate/rotate").smoothScale( height(), width() ) );
32 disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) ); 33 disabledPm.convertFromImage( Resource::loadImage("autorotate/norotate").smoothScale( height(), width() ) );
33 34
34 repaint(true); 35 repaint(true);
35 popupMenu = 0; 36 popupMenu = 0;
36 show(); 37 show();
37} 38}
38 39
39AutoRotate::~AutoRotate() 40AutoRotate::~AutoRotate()
40{ 41{
41 if (popupMenu) { 42 if (popupMenu) {
42 delete popupMenu; 43 delete popupMenu;
43 } 44 }
44} 45}
45 46
47int AutoRotate::position()
48{
49 return 7;
50}
51
46void AutoRotate::mousePressEvent(QMouseEvent *) 52void AutoRotate::mousePressEvent(QMouseEvent *)
47{ 53{
48 QPopupMenu *menu = new QPopupMenu(this); 54 QPopupMenu *menu = new QPopupMenu(this);
49 menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 ); 55 menu->insertItem( isRotateEnabled()? "Disable Rotation" : "Enable Rotation" ,1 );
50 56
51 QPoint p = mapToGlobal(QPoint(0, 0)); 57 QPoint p = mapToGlobal(QPoint(0, 0));
52 QSize s = menu->sizeHint(); 58 QSize s = menu->sizeHint();
53 int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0); 59 int opt = menu->exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), p.y() - s.height()), 0);
54 60
55 if (opt==1) 61 if (opt==1)
56 { 62 {
57 setRotateEnabled( !isRotateEnabled() ); 63 setRotateEnabled( !isRotateEnabled() );
58 repaint(true); 64 repaint(true);
59 } 65 }
60 66
61 delete menu; 67 delete menu;
62} 68}
63 69
64void AutoRotate::paintEvent(QPaintEvent *) 70void AutoRotate::paintEvent(QPaintEvent *)
65{ 71{
66 QPainter p(this); 72 QPainter p(this);
67 p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm ); 73 p.drawPixmap( 0, 0, isRotateEnabled()? enabledPm : disabledPm );
68} 74}
69 75
70void AutoRotate::setRotateEnabled(bool status) 76void AutoRotate::setRotateEnabled(bool status)
71{ 77{
72 Config cfg( "qpe" ); 78 Config cfg( "qpe" );
73 cfg.setGroup( "Appearance" ); 79 cfg.setGroup( "Appearance" );
74 cfg.writeEntry( "rotateEnabled", status ); 80 cfg.writeEntry( "rotateEnabled", status );
75 81
76} 82}
77bool AutoRotate::isRotateEnabled() 83bool AutoRotate::isRotateEnabled()
78{ 84{
79 Config cfg( "qpe" ); 85 Config cfg( "qpe" );
80 cfg.setGroup( "Appearance" ); 86 cfg.setGroup( "Appearance" );
81 87
82 bool res = cfg.readBoolEntry( "rotateEnabled" ); 88 bool res = cfg.readBoolEntry( "rotateEnabled" );
83 89
84 if (res ) 90 if (res )
85 qDebug("Enabled"); 91 qDebug("Enabled");
86 else 92 else
87 qDebug("Disabled"); 93 qDebug("Disabled");
88 return res; 94 return res;
89} 95}
90 96
97Q_EXPORT_INTERFACE()
98{
99 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<AutoRotate> );
100}
101
diff --git a/noncore/applets/autorotateapplet/autorotate.h b/noncore/applets/autorotateapplet/autorotate.h
index e05e7a0..ef322a6 100644
--- a/noncore/applets/autorotateapplet/autorotate.h
+++ b/noncore/applets/autorotateapplet/autorotate.h
@@ -1,41 +1,40 @@
1/* 1/*
2 * copyright : (c) 2003 by Greg Gilbert 2 * copyright : (c) 2003 by Greg Gilbert
3 * email : greg@treke.net 3 * email : greg@treke.net
4 * based on the cardmon applet by Max Reiss 4 * based on the cardmon applet by Max Reiss
5 * * 5 * *
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 * * 10 * *
11 *************************************************************************/ 11 *************************************************************************/
12 12
13#ifndef AUTOROTATE_H 13#ifndef AUTOROTATE_H
14#define AUTOROTATE_H 14#define AUTOROTATE_H
15 15
16#include <qwidget.h> 16#include <qwidget.h>
17#include <qpixmap.h> 17#include <qpixmap.h>
18#include <qpopupmenu.h> 18#include <qpopupmenu.h>
19 19
20class AutoRotate : public QWidget { 20class AutoRotate : public QWidget {
21 Q_OBJECT 21 Q_OBJECT
22public: 22public:
23 AutoRotate( QWidget *parent = 0 ); 23 AutoRotate( QWidget *parent = 0 );
24 ~AutoRotate(); 24 ~AutoRotate();
25 25 static int position();
26private slots:
27 26
28protected: 27protected:
29 void paintEvent( QPaintEvent* ); 28 void paintEvent( QPaintEvent* );
30 void mousePressEvent( QMouseEvent * ); 29 void mousePressEvent( QMouseEvent * );
31private: 30private:
32 bool isRotateEnabled(); 31 bool isRotateEnabled();
33 void setRotateEnabled(bool); 32 void setRotateEnabled(bool);
34 QPixmap enabledPm; 33 QPixmap enabledPm;
35 QPixmap disabledPm; 34 QPixmap disabledPm;
36 void iconShow(); 35 void iconShow();
37 QPopupMenu *popupMenu; 36 QPopupMenu *popupMenu;
38 }; 37 };
39 38
40#endif 39#endif
41 40
diff --git a/noncore/applets/autorotateapplet/autorotateapplet.pro b/noncore/applets/autorotateapplet/autorotateapplet.pro
index 0ccbeba..465b165 100644
--- a/noncore/applets/autorotateapplet/autorotateapplet.pro
+++ b/noncore/applets/autorotateapplet/autorotateapplet.pro
@@ -1,13 +1,13 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = autorotate.h autorotateimpl.h 3HEADERS = autorotate.h
4SOURCES = autorotate.cpp autorotateimpl.cpp 4SOURCES = autorotate.cpp
5TARGET = autorotateapplet 5TARGET = autorotateapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include ../launcher 8DEPENDPATH += $(OPIEDIR)/include ../launcher
9LIBS += -lqpe -lopiecore2 9LIBS += -lqpe -lopiecore2
10VERSION = 1.0.0 10VERSION = 1.0.0
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.path = $$prefix/plugins/applets
diff --git a/noncore/applets/autorotateapplet/autorotateimpl.cpp b/noncore/applets/autorotateapplet/autorotateimpl.cpp
deleted file mode 100644
index 305ac50..0000000
--- a/noncore/applets/autorotateapplet/autorotateimpl.cpp
+++ b/dev/null
@@ -1,42 +0,0 @@
1#include "autorotate.h"
2#include "autorotateimpl.h"
3
4
5AutoRotateImpl::AutoRotateImpl()
6 : autoRotate(0){
7 qDebug ("here");
8}
9
10AutoRotateImpl::~AutoRotateImpl() {
11 delete autoRotate;
12}
13
14QWidget *AutoRotateImpl::applet( QWidget *parent ) {
15 if ( !autoRotate ) {
16 autoRotate = new AutoRotate( parent );
17 }
18 return autoRotate;
19}
20
21int AutoRotateImpl::position() const {
22 return 7;
23}
24
25QRESULT AutoRotateImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
26 *iface = 0;
27 if ( uuid == IID_QUnknown ) {
28 *iface = this;
29 } else if ( uuid == IID_TaskbarApplet ) {
30 *iface = this;
31 } else
32 return QS_FALSE;
33
34 if ( *iface ) {
35 (*iface)->addRef();
36 }
37 return QS_OK;
38}
39
40Q_EXPORT_INTERFACE() {
41 Q_CREATE_INSTANCE( AutoRotateImpl )
42}
diff --git a/noncore/applets/autorotateapplet/autorotateimpl.h b/noncore/applets/autorotateapplet/autorotateimpl.h
deleted file mode 100644
index fde23a9..0000000
--- a/noncore/applets/autorotateapplet/autorotateimpl.h
+++ b/dev/null
@@ -1,18 +0,0 @@
1#include <qpe/taskbarappletinterface.h>
2
3class AutoRotate;
4
5class AutoRotateImpl : public TaskbarAppletInterface {
6public:
7 AutoRotateImpl();
8 virtual ~AutoRotateImpl();
9
10 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
11 Q_REFCOUNT
12
13 virtual QWidget *applet( QWidget *parent );
14 virtual int position() const;
15
16private:
17 AutoRotate *autoRotate;
18};
diff --git a/noncore/applets/memoryapplet/memoryapplet.pro b/noncore/applets/memoryapplet/memoryapplet.pro
index 6031386..3cd7839 100644
--- a/noncore/applets/memoryapplet/memoryapplet.pro
+++ b/noncore/applets/memoryapplet/memoryapplet.pro
@@ -1,24 +1,22 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = ../../settings/sysinfo/graph.h \ 3HEADERS = ../../settings/sysinfo/graph.h \
4 ../../settings/sysinfo/load.h \ 4 ../../settings/sysinfo/load.h \
5 ../../settings/sysinfo/memory.h \ 5 ../../settings/sysinfo/memory.h \
6 memoryappletimpl.h \
7 memorymeter.h \ 6 memorymeter.h \
8 memorystatus.h \ 7 memorystatus.h \
9 swapfile.h 8 swapfile.h
10SOURCES = ../../settings/sysinfo/graph.cpp \ 9SOURCES = ../../settings/sysinfo/graph.cpp \
11 ../../settings/sysinfo/load.cpp \ 10 ../../settings/sysinfo/load.cpp \
12 ../../settings/sysinfo/memory.cpp \ 11 ../../settings/sysinfo/memory.cpp \
13 memoryappletimpl.cpp \
14 memorymeter.cpp \ 12 memorymeter.cpp \
15 memorystatus.cpp \ 13 memorystatus.cpp \
16 swapfile.cpp 14 swapfile.cpp
17TARGET = memoryapplet 15TARGET = memoryapplet
18DESTDIR = $(OPIEDIR)/plugins/applets 16DESTDIR = $(OPIEDIR)/plugins/applets
19INCLUDEPATH += $(OPIEDIR)/include 17INCLUDEPATH += $(OPIEDIR)/include
20DEPENDPATH += ../$(OPIEDIR)/include 18DEPENDPATH += ../$(OPIEDIR)/include
21VERSION = 1.0.0 19VERSION = 1.0.0
22LIBS += -lqpe -lopieui2 20LIBS += -lqpe -lopiecore2 -lopieui2
23 21
24include ( $(OPIEDIR)/include.pro ) 22include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/memoryapplet/memoryappletimpl.cpp b/noncore/applets/memoryapplet/memoryappletimpl.cpp
deleted file mode 100644
index a117e7f..0000000
--- a/noncore/applets/memoryapplet/memoryappletimpl.cpp
+++ b/dev/null
@@ -1,65 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#include "memorymeter.h"
21#include "memoryappletimpl.h"
22
23MemoryAppletImpl::MemoryAppletImpl()
24 : memory(0)
25{
26}
27
28MemoryAppletImpl::~MemoryAppletImpl()
29{
30 delete memory;
31}
32
33QWidget *MemoryAppletImpl::applet( QWidget *parent )
34{
35 if ( !memory )
36 memory = new MemoryMeter( parent );
37
38 return memory;
39}
40
41int MemoryAppletImpl::position() const
42{
43 return 8;
44}
45
46QRESULT MemoryAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
47{
48 *iface = 0;
49 if ( uuid == IID_QUnknown )
50 *iface = this;
51 else if ( uuid == IID_TaskbarApplet )
52 *iface = this;
53 else
54 return QS_FALSE;
55
56 (*iface)->addRef();
57
58 return QS_OK;
59}
60
61Q_EXPORT_INTERFACE()
62{
63 Q_CREATE_INSTANCE( MemoryAppletImpl )
64}
65
diff --git a/noncore/applets/memoryapplet/memoryappletimpl.h b/noncore/applets/memoryapplet/memoryappletimpl.h
deleted file mode 100644
index 2db7dbe..0000000
--- a/noncore/applets/memoryapplet/memoryappletimpl.h
+++ b/dev/null
@@ -1,43 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3**
4** This file is part of the Qtopia Environment.
5**
6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file.
10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15**
16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you.
18**
19**********************************************************************/
20#ifndef MEMORYAPPLETIMPL_H
21#define MEMORYAPPLETIMPL_H
22
23#include <qtopia/taskbarappletinterface.h>
24
25class MemoryMeter;
26
27class /*QTOPIA_PLUGIN_EXPORT*/ MemoryAppletImpl : public TaskbarAppletInterface
28{
29public:
30 MemoryAppletImpl();
31 virtual ~MemoryAppletImpl();
32
33 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
34 Q_REFCOUNT
35
36 virtual QWidget *applet( QWidget *parent );
37 virtual int position() const;
38
39private:
40 MemoryMeter *memory;
41};
42
43#endif
diff --git a/noncore/applets/memoryapplet/memorymeter.cpp b/noncore/applets/memoryapplet/memorymeter.cpp
index 54b5c52..9299f49 100644
--- a/noncore/applets/memoryapplet/memorymeter.cpp
+++ b/noncore/applets/memoryapplet/memorymeter.cpp
@@ -1,92 +1,95 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of the Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "memorymeter.h" 20#include "memorymeter.h"
21#include "memorystatus.h" 21#include "memorystatus.h"
22 22
23#include <opie2/otaskbarapplet.h>
23#include <qtopia/power.h> 24#include <qtopia/power.h>
24#include <qtopia/config.h> 25#include <qtopia/config.h>
25
26#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
27#include <qtopia/qcopenvelope_qws.h> 26#include <qtopia/qcopenvelope_qws.h>
28#endif
29 27
30#include <qpainter.h> 28#include <qpainter.h>
31#include <qtimer.h> 29#include <qtimer.h>
32#include <qapplication.h> 30#include <qapplication.h>
33 31
34#include <qtopia/applnk.h> 32#include <qtopia/applnk.h>
35 33
36MemoryMeter::MemoryMeter( QWidget *parent ) 34MemoryMeter::MemoryMeter( QWidget *parent )
37 : QWidget( parent ), memoryView(0) 35 : QWidget( parent ), memoryView(0)
38{ 36{
39 bvsz = QSize(); 37 bvsz = QSize();
40 if ( qApp->desktop()->height() >= 300 ) 38 if ( qApp->desktop()->height() >= 300 )
41 { 39 {
42 memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup ); 40 memoryView = new MemoryStatus( 0, WStyle_StaysOnTop | WType_Popup );
43 memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised ); 41 memoryView->setFrameStyle( QFrame::Panel | QFrame::Raised );
44 } 42 }
45 else 43 else
46 { 44 {
47 memoryView = new MemoryStatus( 0 ); 45 memoryView = new MemoryStatus( 0 );
48 memoryView->showMaximized(); 46 memoryView->showMaximized();
49 } 47 }
50 48
51 Config config("MemoryPlugin"); 49 Config config("MemoryPlugin");
52 config.setGroup("Warning levels"); 50 config.setGroup("Warning levels");
53 low = config.readNumEntry("low", 40); 51 low = config.readNumEntry("low", 40);
54 critical = config.readNumEntry("critical", 20); 52 critical = config.readNumEntry("critical", 20);
55 53
56 startTimer( 10000 ); 54 startTimer( 10000 );
57 setFixedWidth(10); 55 setFixedWidth(10);
58 setFixedHeight(AppLnk::smallIconSize()); 56 setFixedHeight(AppLnk::smallIconSize());
59 usageTimer = new QTimer( this ); 57 usageTimer = new QTimer( this );
60 connect( usageTimer, SIGNAL(timeout()), this, SLOT(usageTimeout()) ); 58 connect( usageTimer, SIGNAL(timeout()), this, SLOT(usageTimeout()) );
61 timerEvent(0); 59 timerEvent(0);
62} 60}
63 61
64MemoryMeter::~MemoryMeter() 62MemoryMeter::~MemoryMeter()
65{ 63{
66 delete (QWidget *) memoryView; 64 delete (QWidget *) memoryView;
67} 65}
68 66
67int MemoryMeter::position()
68{
69 return 7;
70}
71
69QSize MemoryMeter::sizeHint() const 72QSize MemoryMeter::sizeHint() const
70{ 73{
71 return QSize(10, AppLnk::smallIconSize()); 74 return QSize(10, AppLnk::smallIconSize());
72} 75}
73 76
74bool MemoryMeter::updateMemoryViewGeometry() 77bool MemoryMeter::updateMemoryViewGeometry()
75{ 78{
76 if (memoryView != 0) 79 if (memoryView != 0)
77 { 80 {
78 QSize sz = memoryView->sizeHint(); 81 QSize sz = memoryView->sizeHint();
79 if ( sz != bvsz ) 82 if ( sz != bvsz )
80 { 83 {
81 bvsz = sz; 84 bvsz = sz;
82 QRect r(memoryView->pos(), memoryView->sizeHint()); 85 QRect r(memoryView->pos(), memoryView->sizeHint());
83 if ( qApp->desktop()->height() >= 300 ) 86 if ( qApp->desktop()->height() >= 300 )
84 { 87 {
85 QPoint curPos = mapToGlobal( rect().topLeft() ); 88 QPoint curPos = mapToGlobal( rect().topLeft() );
86 int lp = qApp->desktop()->width() - memoryView->sizeHint().width(); 89 int lp = qApp->desktop()->width() - memoryView->sizeHint().width();
87 r.moveTopLeft( QPoint(lp, curPos.y() - memoryView->sizeHint().height()-1) ); 90 r.moveTopLeft( QPoint(lp, curPos.y() - memoryView->sizeHint().height()-1) );
88 } 91 }
89 memoryView->setGeometry(r); 92 memoryView->setGeometry(r);
90 return TRUE; 93 return TRUE;
91 } 94 }
92 return FALSE; 95 return FALSE;
@@ -216,24 +219,29 @@ void MemoryMeter::paintEvent( QPaintEvent* )
216 p.setBrush(gray/*.dark(120)*/); 219 p.setBrush(gray/*.dark(120)*/);
217 p.drawRect(batt_xoffset + 3 * band_width, batt_yoffset, band_width, used_height); 220 p.drawRect(batt_xoffset + 3 * band_width, batt_yoffset, band_width, used_height);
218 } 221 }
219 222
220 // 223 //
221 // Unused section. 224 // Unused section.
222 // 225 //
223 if ( batt_height - used_height > 0 ) 226 if ( batt_height - used_height > 0 )
224 { 227 {
225 int unused_offset = used_height + batt_yoffset; 228 int unused_offset = used_height + batt_yoffset;
226 int unused_height = batt_height - used_height; 229 int unused_height = batt_height - used_height;
227 p.setPen(NoPen); 230 p.setPen(NoPen);
228 p.setBrush(c); 231 p.setBrush(c);
229 p.drawRect(batt_xoffset, unused_offset, band_width, unused_height); 232 p.drawRect(batt_xoffset, unused_offset, band_width, unused_height);
230 p.drawRect(batt_xoffset + 2 * band_width, unused_offset, band_width, unused_height); 233 p.drawRect(batt_xoffset + 2 * band_width, unused_offset, band_width, unused_height);
231 234
232 p.setBrush(lightc); 235 p.setBrush(lightc);
233 p.drawRect(batt_xoffset + band_width, unused_offset, band_width, unused_height); 236 p.drawRect(batt_xoffset + band_width, unused_offset, band_width, unused_height);
234 237
235 p.setBrush(darkc); 238 p.setBrush(darkc);
236 p.drawRect(batt_xoffset + 3 * band_width, unused_offset, band_width, unused_height); 239 p.drawRect(batt_xoffset + 3 * band_width, unused_offset, band_width, unused_height);
237 } 240 }
238} 241}
239 242
243Q_EXPORT_INTERFACE()
244{
245 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<MemoryMeter> );
246}
247
diff --git a/noncore/applets/memoryapplet/memorymeter.h b/noncore/applets/memoryapplet/memorymeter.h
index 0f3cb0b..ed541f0 100644
--- a/noncore/applets/memoryapplet/memorymeter.h
+++ b/noncore/applets/memoryapplet/memorymeter.h
@@ -10,44 +10,45 @@
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#ifndef MEMORY_H 20#ifndef MEMORY_H
21#define MEMORY_H 21#define MEMORY_H
22 22
23#include <qwidget.h> 23#include <qwidget.h>
24 24
25class MemoryStatus; 25class MemoryStatus;
26class QTimer; 26class QTimer;
27 27
28class MemoryMeter : public QWidget 28class MemoryMeter : public QWidget
29{ 29{
30 Q_OBJECT 30 Q_OBJECT
31public: 31public:
32 MemoryMeter( QWidget *parent = 0 ); 32 MemoryMeter( QWidget *parent = 0 );
33 ~MemoryMeter(); 33 ~MemoryMeter();
34 static int position();
34 35
35 QSize sizeHint() const; 36 QSize sizeHint() const;
36 MemoryStatus* memoryView; 37 MemoryStatus* memoryView;
37 38
38protected: 39protected:
39 void timerEvent( QTimerEvent * ); 40 void timerEvent( QTimerEvent * );
40 void paintEvent( QPaintEvent* ); 41 void paintEvent( QPaintEvent* );
41 void mousePressEvent( QMouseEvent * ); 42 void mousePressEvent( QMouseEvent * );
42 43
43protected slots: 44protected slots:
44 void usageTimeout(); 45 void usageTimeout();
45 46
46protected: 47protected:
47 QTimer *usageTimer; 48 QTimer *usageTimer;
48 int percent, low, critical; 49 int percent, low, critical;
49 QSize bvsz; 50 QSize bvsz;
50 bool updateMemoryViewGeometry(); 51 bool updateMemoryViewGeometry();
51}; 52};
52 53
53#endif 54#endif
diff --git a/noncore/applets/notesapplet/notes.cpp b/noncore/applets/notesapplet/notes.cpp
index 7b8bdd9..1142028 100644
--- a/noncore/applets/notesapplet/notes.cpp
+++ b/noncore/applets/notesapplet/notes.cpp
@@ -1,45 +1,46 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org> 2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3 3
4** All rights reserved. 4** All rights reserved.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14**********************************************************************/ 14**********************************************************************/
15 15
16#include "notes.h" 16#include "notes.h"
17 17
18#include <qapplication.h> 18#include <qapplication.h>
19#include <stdlib.h> 19#include <stdlib.h>
20#include <qstringlist.h> 20#include <qstringlist.h>
21 21
22#include <opie2/otaskbarapplet.h>
22#include <qpe/filemanager.h> 23#include <qpe/filemanager.h>
23#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
24#include <qpe/timestring.h> 25#include <qpe/timestring.h>
25#include <qpe/applnk.h> 26#include <qpe/applnk.h>
26#include <qpe/ir.h> 27#include <qpe/ir.h>
27#include <qpe/config.h> 28#include <qpe/config.h>
28 29
29// #include <qsocket.h> 30// #include <qsocket.h>
30// #include <qclipboard.h> 31// #include <qclipboard.h>
31#include <qmultilineedit.h> 32#include <qmultilineedit.h>
32#include <qlistbox.h> 33#include <qlistbox.h>
33#include <qpopupmenu.h> 34#include <qpopupmenu.h>
34#include <qmessagebox.h> 35#include <qmessagebox.h>
35 36
36#include <qdir.h> 37#include <qdir.h>
37#include <qfile.h> 38#include <qfile.h>
38#include <qpoint.h> 39#include <qpoint.h>
39#include <qpushbutton.h> 40#include <qpushbutton.h>
40#include <qpainter.h> 41#include <qpainter.h>
41#include <qlayout.h> 42#include <qlayout.h>
42#include <qframe.h> 43#include <qframe.h>
43#include <qpixmap.h> 44#include <qpixmap.h>
44#include <qstring.h> 45#include <qstring.h>
45#include <qtimer.h> 46#include <qtimer.h>
@@ -445,60 +446,69 @@ void NotesControl::slotSearch() {
445// if(e->key() == Key_V) { //paste 446// if(e->key() == Key_V) { //paste
446// QClipboard *cb = QApplication::clipboard(); 447// QClipboard *cb = QApplication::clipboard();
447// QString text; 448// QString text;
448// //view 449// //view
449// cb->setText(); 450// cb->setText();
450// } 451// }
451// break; 452// break;
452// }; 453// };
453// QWidget::keyReleaseEvent(e); 454// QWidget::keyReleaseEvent(e);
454// } 455// }
455 456
456//=========================================================================== 457//===========================================================================
457 458
458NotesApplet::NotesApplet( QWidget *parent, const char *name ) 459NotesApplet::NotesApplet( QWidget *parent, const char *name )
459 : QWidget( parent, name ) { 460 : QWidget( parent, name ) {
460 setFixedHeight( 18 ); 461 setFixedHeight( 18 );
461 setFixedWidth( 14 ); 462 setFixedWidth( 14 );
462 vc = new NotesControl; 463 vc = new NotesControl;
463} 464}
464 465
465NotesApplet::~NotesApplet() { 466NotesApplet::~NotesApplet() {
466 delete vc; 467 delete vc;
467} 468}
468 469
470int NotesApplet::position()
471{
472 return 6;
473}
474
469void NotesApplet::mousePressEvent( QMouseEvent *) { 475void NotesApplet::mousePressEvent( QMouseEvent *) {
470 if( !vc->isHidden()) { 476 if( !vc->isHidden()) {
471 vc->doPopulate=false; 477 vc->doPopulate=false;
472 vc->save(); 478 vc->save();
473 vc->close(); 479 vc->close();
474 } else { 480 } else {
475// vc = new NotesControl; 481// vc = new NotesControl;
476// QPoint curPos = mapToGlobal( rect().topLeft() ); 482// QPoint curPos = mapToGlobal( rect().topLeft() );
477 if(vc->showMax) { 483 if(vc->showMax) {
478 qDebug("show max"); 484 qDebug("show max");
479 vc->showMaximized(); 485 vc->showMaximized();
480 } else { 486 } else {
481 qDebug("no show max"); 487 qDebug("no show max");
482 QWidget *wid = QPEApplication::desktop(); 488 QWidget *wid = QPEApplication::desktop();
483 QRect rect = QApplication::desktop()->geometry(); 489 QRect rect = QApplication::desktop()->geometry();
484 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180); 490 vc->setGeometry( ( wid->width() / 2) - ( vc->width() / 2 ) , 28 , wid->width() -10 , 180);
485 vc->move ( (rect.center()/2) - (vc->rect().center()/2)); 491 vc->move ( (rect.center()/2) - (vc->rect().center()/2));
486// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28); 492// vc->move( (( wid->width() / 2) - ( vc->width() / 2 ))-4, 28);
487 } 493 }
488 vc->show(); 494 vc->show();
489 vc->doPopulate=true; 495 vc->doPopulate=true;
490 vc->populateBox(); 496 vc->populateBox();
491 vc->doPopulate=false; 497 vc->doPopulate=false;
492 vc->loaded=false; 498 vc->loaded=false;
493 499
494 vc->load(); 500 vc->load();
495// this->setFocus(); 501// this->setFocus();
496 vc->view->setFocus(); 502 vc->view->setFocus();
497 } 503 }
498} 504}
499 505
500void NotesApplet::paintEvent( QPaintEvent* ) { 506void NotesApplet::paintEvent( QPaintEvent* ) {
501 QPainter p(this); 507 QPainter p(this);
502 p.drawPixmap( 0, 1, ( const char** ) notes_xpm ); 508 p.drawPixmap( 0, 1, ( const char** ) notes_xpm );
503} 509}
504 510
511Q_EXPORT_INTERFACE()
512{
513 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<NotesApplet> );
514}
diff --git a/noncore/applets/notesapplet/notes.h b/noncore/applets/notesapplet/notes.h
index 08253cb..ed1f98c 100644
--- a/noncore/applets/notesapplet/notes.h
+++ b/noncore/applets/notesapplet/notes.h
@@ -55,39 +55,40 @@ private:
55 void load(const QString&); 55 void load(const QString&);
56private slots: 56private slots:
57 void slotSearch(); 57 void slotSearch();
58 void slotShowMax(); 58 void slotShowMax();
59 void slotBeamButton(); 59 void slotBeamButton();
60 void slotBeamFinished( Ir*); 60 void slotBeamFinished( Ir*);
61 void slotDeleteButton(); 61 void slotDeleteButton();
62 void slotSaveButton(); 62 void slotSaveButton();
63 void slotDeleteButtonClicked(); 63 void slotDeleteButtonClicked();
64 void slotNewButton(); 64 void slotNewButton();
65 void boxPressed(int, QListBoxItem *, const QPoint&); 65 void boxPressed(int, QListBoxItem *, const QPoint&);
66 void showMenu(); 66 void showMenu();
67 void loadDoc( const DocLnk &); 67 void loadDoc( const DocLnk &);
68 void slotViewEdited(); 68 void slotViewEdited();
69 void slotBoxSelected(const QString &); 69 void slotBoxSelected(const QString &);
70// void keyReleaseEvent( QKeyEvent *); 70// void keyReleaseEvent( QKeyEvent *);
71 71
72}; 72};
73 73
74class NotesApplet : public QWidget { 74class NotesApplet : public QWidget {
75 Q_OBJECT 75 Q_OBJECT
76public: 76public:
77 NotesApplet( QWidget *parent = 0, const char *name=0 ); 77 NotesApplet( QWidget *parent = 0, const char *name=0 );
78 ~NotesApplet(); 78 ~NotesApplet();
79 static int position();
79 NotesControl *vc; 80 NotesControl *vc;
80public slots: 81public slots:
81private: 82private:
82 void mousePressEvent( QMouseEvent * ); 83 void mousePressEvent( QMouseEvent * );
83 void paintEvent( QPaintEvent* ); 84 void paintEvent( QPaintEvent* );
84 85
85private: 86private:
86 QPixmap notesPixmap; 87 QPixmap notesPixmap;
87private slots: 88private slots:
88 89
89 90
90}; 91};
91 92
92#endif // __NOTES_APPLET_H__ 93#endif // __NOTES_APPLET_H__
93 94
diff --git a/noncore/applets/notesapplet/notesapplet.pro b/noncore/applets/notesapplet/notesapplet.pro
index 3075948..38ba184 100644
--- a/noncore/applets/notesapplet/notesapplet.pro
+++ b/noncore/applets/notesapplet/notesapplet.pro
@@ -1,16 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = notes.h notesappletimpl.h 3HEADERS = notes.h
4SOURCES = notes.cpp notesappletimpl.cpp 4SOURCES = notes.cpp
5TARGET = notesapplet 5TARGET = notesapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10VERSION = 1.0.0 10VERSION = 1.0.0
11MOC_DIR=opieobj
12OBJECTS_DIR=opieobj
13
14
15 11
16include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/notesapplet/notesappletimpl.cpp b/noncore/applets/notesapplet/notesappletimpl.cpp
deleted file mode 100644
index 8a9da7f..0000000
--- a/noncore/applets/notesapplet/notesappletimpl.cpp
+++ b/dev/null
@@ -1,53 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3**
4**
5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file.
9**
10**
11**********************************************************************/
12#include "notes.h"
13#include "notesappletimpl.h"
14
15
16NotesAppletImpl::NotesAppletImpl()
17 : notes(0){
18}
19
20NotesAppletImpl::~NotesAppletImpl() {
21 // not needed though cause we should have a valid parent
22 delete notes;
23}
24
25QWidget *NotesAppletImpl::applet( QWidget *parent ) {
26 if ( !notes )
27 notes = new NotesApplet( parent );
28 return notes;
29}
30
31int NotesAppletImpl::position() const {
32 return 6;
33}
34
35QRESULT NotesAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) {
36 *iface = 0;
37 if ( uuid == IID_QUnknown )
38 *iface = this;
39 else if ( uuid == IID_TaskbarApplet )
40 *iface = this;
41 else
42 return QS_FALSE;
43
44 if ( *iface )
45 (*iface)->addRef();
46 return QS_OK;
47}
48
49Q_EXPORT_INTERFACE() {
50 Q_CREATE_INSTANCE( NotesAppletImpl )
51}
52
53
diff --git a/noncore/applets/notesapplet/notesappletimpl.h b/noncore/applets/notesapplet/notesappletimpl.h
deleted file mode 100644
index a87118c..0000000
--- a/noncore/applets/notesapplet/notesappletimpl.h
+++ b/dev/null
@@ -1,35 +0,0 @@
1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter <llornkcor@handhelds.org>
3**
4**
5** This file may be distributed and/or modified under the terms of the
6** GNU General Public License version 2 as published by the Free Software
7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file.
9**
10**
11**********************************************************************/
12#ifndef NOTESAPPLETIMPL_H
13#define NOTESAPPLETIMPL_H
14
15#include <qpe/taskbarappletinterface.h>
16
17class NotesApplet;
18
19class NotesAppletImpl : public TaskbarAppletInterface
20{
21public:
22 NotesAppletImpl();
23 virtual ~NotesAppletImpl();
24
25 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
26 Q_REFCOUNT
27
28 virtual QWidget *applet( QWidget *parent );
29 virtual int position() const;
30
31private:
32 NotesApplet *notes;
33};
34
35#endif
diff --git a/noncore/applets/zkbapplet/.cvsignore b/noncore/applets/zkbapplet/.cvsignore
new file mode 100644
index 0000000..0f79c04
--- a/dev/null
+++ b/noncore/applets/zkbapplet/.cvsignore
@@ -0,0 +1,6 @@
1Makefile*
2advancedconfigbase.cpp
3advancedconfigbase.h
4moc_*
5.moc
6.obj
diff --git a/noncore/applets/zkbapplet/zkbapplet.cpp b/noncore/applets/zkbapplet/zkbapplet.cpp
deleted file mode 100644
index 6c71568..0000000
--- a/noncore/applets/zkbapplet/zkbapplet.cpp
+++ b/dev/null
@@ -1,49 +0,0 @@
1#include <stdio.h>
2#include <qlabel.h>
3#include <qbutton.h>
4#include <qwindowsystem_qws.h>
5#include "zkbapplet.h"
6#include "zkbwidget.h"
7
8
9ZkbApplet::ZkbApplet() : app(0){
10}
11
12ZkbApplet::~ZkbApplet()
13{
14 if (app) delete app;
15}
16
17QWidget* ZkbApplet::applet(QWidget* parent) {
18 if (app == 0) {
19 app = new ZkbWidget(parent);
20 }
21
22 return app;
23}
24
25int ZkbApplet::position() const {
26 return 8;
27}
28
29QRESULT ZkbApplet::queryInterface(const QUuid& uuid, QUnknownInterface** iface) {
30
31 *iface = 0;
32 if (uuid == IID_QUnknown) {
33 *iface = this;
34 } else if (uuid == IID_TaskbarApplet) {
35 *iface = this;
36 } else {
37 return QS_FALSE;
38 }
39
40 if (*iface) {
41 (*iface)->addRef();
42 }
43
44 return QS_OK;
45}
46
47Q_EXPORT_INTERFACE() {
48 Q_CREATE_INSTANCE(ZkbApplet)
49}
diff --git a/noncore/applets/zkbapplet/zkbapplet.h b/noncore/applets/zkbapplet/zkbapplet.h
deleted file mode 100644
index fcf03b5..0000000
--- a/noncore/applets/zkbapplet/zkbapplet.h
+++ b/dev/null
@@ -1,23 +0,0 @@
1#include "qpe/taskbarappletinterface.h"
2
3#ifndef ZKBAPPLET_H
4#define ZKBAPPLET_H
5
6class ZkbWidget;
7
8class ZkbApplet : public TaskbarAppletInterface {
9public:
10 ZkbApplet();
11 virtual ~ZkbApplet();
12
13 QRESULT queryInterface(const QUuid&, QUnknownInterface**);
14 Q_REFCOUNT
15
16 virtual QWidget* applet(QWidget*);
17 virtual int position() const;
18
19protected:
20 ZkbWidget* app;
21};
22
23#endif
diff --git a/noncore/applets/zkbapplet/zkbapplet.pro b/noncore/applets/zkbapplet/zkbapplet.pro
index 22615d0..8cc1b58 100644
--- a/noncore/applets/zkbapplet/zkbapplet.pro
+++ b/noncore/applets/zkbapplet/zkbapplet.pro
@@ -1,22 +1,20 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugin warn_on release 2CONFIG += qt plugin warn_on release
3HEADERS = zkbapplet.h\ 3HEADERS = zkbwidget.h \
4 zkbwidget.h \
5 ../../apps/keyz-cfg/zkbcfg.h \ 4 ../../apps/keyz-cfg/zkbcfg.h \
6 ../../apps/keyz-cfg/zkbnames.h \ 5 ../../apps/keyz-cfg/zkbnames.h \
7 ../../apps/keyz-cfg/zkbxml.h \ 6 ../../apps/keyz-cfg/zkbxml.h \
8 ../../apps/keyz-cfg/zkb.h 7 ../../apps/keyz-cfg/zkb.h
9SOURCES = zkbapplet.cpp \ 8SOURCES = zkbwidget.cpp \
10 zkbwidget.cpp \
11 ../../apps/keyz-cfg/zkbcfg.cpp \ 9 ../../apps/keyz-cfg/zkbcfg.cpp \
12 ../../apps/keyz-cfg/zkbnames.cpp \ 10 ../../apps/keyz-cfg/zkbnames.cpp \
13 ../../apps/keyz-cfg/zkbxml.cpp \ 11 ../../apps/keyz-cfg/zkbxml.cpp \
14 ../../apps/keyz-cfg/zkb.cpp 12 ../../apps/keyz-cfg/zkb.cpp
15TARGET = zkbapplet 13TARGET = zkbapplet
16DESTDIR = $(OPIEDIR)/plugins/applets 14DESTDIR = $(OPIEDIR)/plugins/applets
17INCLUDEPATH += $(OPIEDIR)/include ../../apps/keyz-cfg 15INCLUDEPATH += $(OPIEDIR)/include ../../apps/keyz-cfg
18DEPENDPATH += ../$(OPIEDIR)/include 16DEPENDPATH += ../$(OPIEDIR)/include
19VERSION = 0.6.0 17VERSION = 0.6.0
20LIBS += -lqpe 18LIBS += -lqpe
21 19
22include ( $(OPIEDIR)/include.pro ) 20include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/applets/zkbapplet/zkbwidget.cpp b/noncore/applets/zkbapplet/zkbwidget.cpp
index 05a76e7..0b5ab78 100644
--- a/noncore/applets/zkbapplet/zkbwidget.cpp
+++ b/noncore/applets/zkbapplet/zkbwidget.cpp
@@ -1,52 +1,58 @@
1#include <opie2/otaskbarapplet.h>
1#include <qpe/qcopenvelope_qws.h> 2#include <qpe/qcopenvelope_qws.h>
2#include <qpe/applnk.h> 3#include <qpe/applnk.h>
3#include <qpe/qpeapplication.h> 4#include <qpe/qpeapplication.h>
4#include <qpe/resource.h> 5#include <qpe/resource.h>
5#include <stdio.h> 6#include <stdio.h>
6#include <unistd.h> 7#include <unistd.h>
7#include "zkbwidget.h" 8#include "zkbwidget.h"
8#include "zkbcfg.h" 9#include "zkbcfg.h"
9 10
10ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0), 11ZkbWidget::ZkbWidget(QWidget* parent):QLabel(parent),keymap(0),
11 disabled(Resource::loadPixmap("zkb-disabled")) { 12 disabled(Resource::loadPixmap("zkb-disabled")) {
12 13
13 labels = new QPopupMenu(); 14 labels = new QPopupMenu();
14 connect(labels, SIGNAL(activated(int)), this, 15 connect(labels, SIGNAL(activated(int)), this,
15 SLOT(labelChanged(int))); 16 SLOT(labelChanged(int)));
16 17
17 loadKeymap(); 18 loadKeymap();
18 19
19 channel = new QCopChannel("QPE/zkb", this); 20 channel = new QCopChannel("QPE/zkb", this);
20 connect(channel, SIGNAL(received(const QCString&, const QByteArray&)), 21 connect(channel, SIGNAL(received(const QCString&, const QByteArray&)),
21 this, SLOT(signalReceived(const QCString&, const QByteArray&))); 22 this, SLOT(signalReceived(const QCString&, const QByteArray&)));
22 setFixedWidth ( AppLnk::smallIconSize() ); 23 setFixedWidth ( AppLnk::smallIconSize() );
23 setFixedHeight ( AppLnk::smallIconSize() ); 24 setFixedHeight ( AppLnk::smallIconSize() );
24} 25}
25 26
26ZkbWidget::~ZkbWidget() { 27ZkbWidget::~ZkbWidget() {
27} 28}
28 29
30int ZkbWidget::position()
31{
32 return 8;
33}
34
29bool ZkbWidget::loadKeymap() { 35bool ZkbWidget::loadKeymap() {
30 ZkbConfig c(QPEApplication::qpeDir()+"/share/zkb"); 36 ZkbConfig c(QPEApplication::qpeDir()+"/share/zkb");
31 QFontMetrics fm(font()); 37 QFontMetrics fm(font());
32 38
33 if (keymap != 0) { 39 if (keymap != 0) {
34 delete keymap; 40 delete keymap;
35 keymap = 0; 41 keymap = 0;
36 } 42 }
37 43
38 Keymap* km = new Keymap(); 44 Keymap* km = new Keymap();
39 45
40 if (!c.load("zkb.xml", *km, "")) { 46 if (!c.load("zkb.xml", *km, "")) {
41 delete km; 47 delete km;
42 setPixmap(disabled); 48 setPixmap(disabled);
43 return false; 49 return false;
44 } 50 }
45 51
46 connect(km, SIGNAL(stateChanged(const QString&)), 52 connect(km, SIGNAL(stateChanged(const QString&)),
47 this, SLOT(stateChanged(const QString&))); 53 this, SLOT(stateChanged(const QString&)));
48 54
49 qwsServer->setKeyboardFilter(km); 55 qwsServer->setKeyboardFilter(km);
50 56
51 Keymap* oldkm = keymap; 57 Keymap* oldkm = keymap;
52 keymap = km; 58 keymap = km;
@@ -127,24 +133,30 @@ void ZkbWidget::signalReceived(const QCString& msg, const QByteArray& data) {
127 } else if (msg == "reload()") { 133 } else if (msg == "reload()") {
128 QCopEnvelope("QPE/System", "busy()"); 134 QCopEnvelope("QPE/System", "busy()");
129 QTimer::singleShot(0, this, SLOT(reload())); 135 QTimer::singleShot(0, this, SLOT(reload()));
130 } else if (msg == "switch(QString)") { 136 } else if (msg == "switch(QString)") {
131 QString lbl; 137 QString lbl;
132 stream >> lbl; 138 stream >> lbl;
133 139
134 if (keymap != 0) { 140 if (keymap != 0) {
135 State* state = keymap->getStateByLabel(lbl); 141 State* state = keymap->getStateByLabel(lbl);
136 if (state != 0) { 142 if (state != 0) {
137 keymap->setCurrentState(state); 143 keymap->setCurrentState(state);
138 setText(lbl); 144 setText(lbl);
139 } 145 }
140 } 146 }
141 } else if (msg == "debug(QString)") { 147 } else if (msg == "debug(QString)") {
142 QString flag; 148 QString flag;
143 stream >> flag; 149 stream >> flag;
144 } 150 }
145} 151}
146 152
147void ZkbWidget::reload() { 153void ZkbWidget::reload() {
148 loadKeymap(); 154 loadKeymap();
149 QCopEnvelope("QPE/System", "notBusy()"); 155 QCopEnvelope("QPE/System", "notBusy()");
150} 156}
157
158Q_EXPORT_INTERFACE()
159{
160 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ZkbWidget> );
161}
162
diff --git a/noncore/applets/zkbapplet/zkbwidget.h b/noncore/applets/zkbapplet/zkbwidget.h
index a943563..7c67794 100644
--- a/noncore/applets/zkbapplet/zkbwidget.h
+++ b/noncore/applets/zkbapplet/zkbwidget.h
@@ -1,38 +1,39 @@
1#ifndef ZKBWIDGET_H 1#ifndef ZKBWIDGET_H
2#define ZKBWIDGET_H 2#define ZKBWIDGET_H
3 3
4#include <qwidget.h> 4#include <qwidget.h>
5#include <qlabel.h> 5#include <qlabel.h>
6#include <qpopupmenu.h> 6#include <qpopupmenu.h>
7#include <qpixmap.h> 7#include <qpixmap.h>
8#include <qcopchannel_qws.h> 8#include <qcopchannel_qws.h>
9 9
10#include "zkb.h" 10#include "zkb.h"
11 11
12class ZkbWidget : public QLabel { 12class ZkbWidget : public QLabel {
13Q_OBJECT 13Q_OBJECT
14 14
15public: 15public:
16 ZkbWidget(QWidget* parent); 16 ZkbWidget(QWidget* parent);
17 ~ZkbWidget(); 17 ~ZkbWidget();
18 static int position();
18 19
19 QSize sizeHint() const; 20 QSize sizeHint() const;
20 21
21protected: 22protected:
22 QLabel* label; 23 QLabel* label;
23 Keymap* keymap; 24 Keymap* keymap;
24 QPopupMenu* labels; 25 QPopupMenu* labels;
25 QCopChannel* channel; 26 QCopChannel* channel;
26 int w, h; 27 int w, h;
27 QPixmap disabled; 28 QPixmap disabled;
28 29
29 bool loadKeymap(); 30 bool loadKeymap();
30 void mouseReleaseEvent(QMouseEvent*); 31 void mouseReleaseEvent(QMouseEvent*);
31 32
32protected slots: 33protected slots:
33 void stateChanged(const QString&); 34 void stateChanged(const QString&);
34 void labelChanged(int id); 35 void labelChanged(int id);
35 void signalReceived(const QCString& msg, const QByteArray& data); 36 void signalReceived(const QCString& msg, const QByteArray& data);
36 void reload(); 37 void reload();
37}; 38};
38#endif 39#endif