summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/applets/batteryapplet/battery.cpp8
-rw-r--r--core/applets/batteryapplet/batterystatus.cpp2
-rw-r--r--core/applets/batteryapplet/config.in2
-rw-r--r--core/applets/cardmon/cardmon.cpp1
-rw-r--r--core/applets/cardmon/config.in2
-rw-r--r--core/applets/clipboardapplet/clipboard.cpp7
-rw-r--r--core/applets/clipboardapplet/config.in2
-rw-r--r--core/applets/clockapplet/clock.cpp7
-rw-r--r--core/applets/clockapplet/config.in2
-rw-r--r--core/applets/homeapplet/config.in2
-rw-r--r--core/applets/irdaapplet/config.in2
-rw-r--r--core/applets/irdaapplet/irda.cpp6
-rw-r--r--core/applets/logoutapplet/config.in2
-rw-r--r--core/applets/multikeyapplet/multikey.cpp7
-rw-r--r--core/applets/restartapplet/config.in2
-rw-r--r--core/applets/rotateapplet/config.in2
-rw-r--r--core/applets/rotateapplet/rotate.cpp4
-rw-r--r--core/applets/rotateapplet/rotateapplet.pro2
-rw-r--r--core/applets/screenshotapplet/config.in2
-rw-r--r--core/applets/screenshotapplet/inputDialog.cpp3
-rw-r--r--core/applets/screenshotapplet/screenshot.cpp7
-rw-r--r--core/applets/suspendapplet/config.in2
-rw-r--r--core/applets/vmemo/config.in2
-rw-r--r--core/applets/vmemo/vmemo.cpp7
-rw-r--r--core/applets/volumeapplet/config.in2
-rw-r--r--core/applets/volumeapplet/volume.cpp8
-rw-r--r--core/applets/volumeapplet/volumeapplet.pro2
-rw-r--r--core/applets/vtapplet/config.in2
-rw-r--r--core/obex/config.in2
-rw-r--r--core/obex/obex.cc19
-rw-r--r--core/obex/obex.h10
-rw-r--r--core/obex/obex.pro4
-rw-r--r--core/obex/obeximpl.cpp2
33 files changed, 66 insertions, 70 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp
index b2cef55..18e368e 100644
--- a/core/applets/batteryapplet/battery.cpp
+++ b/core/applets/batteryapplet/battery.cpp
@@ -1,81 +1,84 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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 "battery.h" 20#include "battery.h"
21#include "batterystatus.h" 21#include "batterystatus.h"
22 22
23/* OPIE */ 23/* OPIE */
24#include <opie2/otaskbarapplet.h> 24#include <opie2/otaskbarapplet.h>
25
26#include <qpe/qpeapplication.h>
25#include <qpe/applnk.h> 27#include <qpe/applnk.h>
26#include <qpe/config.h> 28#include <qpe/config.h>
27#include <qpe/power.h> 29#include <qpe/power.h>
28 30
29/* QT */ 31/* QT */
30#include <qpainter.h> 32#include <qpainter.h>
31#include <qtimer.h> 33#include <qtimer.h>
32 34
33 35
36using namespace Opie::Ui;
34BatteryMeter::BatteryMeter( QWidget *parent ) 37BatteryMeter::BatteryMeter( QWidget *parent )
35 : QWidget( parent ), charging(false) 38 : QWidget( parent ), charging(false)
36{ 39{
37 ps = new PowerStatus; 40 ps = new PowerStatus;
38 startTimer( 10000 ); 41 startTimer( 10000 );
39 42
40 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) ); 43 setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) );
41 setFixedHeight( AppLnk::smallIconSize() ); 44 setFixedHeight( AppLnk::smallIconSize() );
42 45
43 chargeTimer = new QTimer( this ); 46 chargeTimer = new QTimer( this );
44 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); 47 connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) );
45 timerEvent(0); 48 timerEvent(0);
46 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); 49 QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold );
47 Config c( "qpe" ); 50 Config c( "qpe" );
48 c.setGroup( "Battery" ); 51 c.setGroup( "Battery" );
49 style = c.readNumEntry( "Style", 0 ); 52 style = c.readNumEntry( "Style", 0 );
50} 53}
51 54
52BatteryMeter::~BatteryMeter() 55BatteryMeter::~BatteryMeter()
53{ 56{
54 delete ps; 57 delete ps;
55} 58}
56 59
57QSize BatteryMeter::sizeHint() const 60QSize BatteryMeter::sizeHint() const
58{ 61{
59 return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() ); 62 return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() );
60} 63}
61 64
62void BatteryMeter::mousePressEvent( QMouseEvent* e ) 65void BatteryMeter::mousePressEvent( QMouseEvent* e )
63{ 66{
64 if ( e->button() == RightButton ) 67 if ( e->button() == RightButton )
65 { 68 {
66 style = 1-style; 69 style = 1-style;
67 Config c( "qpe" ); 70 Config c( "qpe" );
68 c.setGroup( "Battery" ); 71 c.setGroup( "Battery" );
69 c.writeEntry( "Style", style ); 72 c.writeEntry( "Style", style );
70 repaint( true ); 73 repaint( true );
71 } 74 }
72 QWidget::mousePressEvent( e ); 75 QWidget::mousePressEvent( e );
73} 76}
74 77
75void BatteryMeter::mouseReleaseEvent( QMouseEvent* /*e*/ ) 78void BatteryMeter::mouseReleaseEvent( QMouseEvent* /*e*/ )
76{ 79{
77 if ( batteryView && batteryView->isVisible() ) { 80 if ( batteryView && batteryView->isVisible() ) {
78 delete (QWidget *) batteryView; 81 delete (QWidget *) batteryView;
79 } else { 82 } else {
80 if ( !batteryView ) batteryView = new BatteryStatus( ps ); 83 if ( !batteryView ) batteryView = new BatteryStatus( ps );
81 QPEApplication::showWidget( batteryView ); 84 QPEApplication::showWidget( batteryView );
@@ -130,53 +133,50 @@ void BatteryMeter::paintEvent( QPaintEvent* )
130 p.setFont( f ); 133 p.setFont( f );
131 p.drawText( 0, height()/2, QString::number( percent ) ); 134 p.drawText( 0, height()/2, QString::number( percent ) );
132 p.drawText( width()/4, height(), "%" ); 135 p.drawText( width()/4, height(), "%" );
133 return; 136 return;
134 } 137 }
135 138
136 QPainter p(this); 139 QPainter p(this);
137 QColor color; 140 QColor color;
138 QColor g = gray.light( 160 ); 141 QColor g = gray.light( 160 );
139 switch ( ps->acStatus() ) 142 switch ( ps->acStatus() )
140 { 143 {
141 case PowerStatus::Offline: color = blue.light( 150 ); break; 144 case PowerStatus::Offline: color = blue.light( 150 ); break;
142 case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; 145 case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break;
143 default: color = red.light( 160 ); 146 default: color = red.light( 160 );
144 } 147 }
145 148
146 int w = height() / 2; 149 int w = height() / 2;
147 if ( !(w%2) ) w--; // should have an odd value to get a real middle line 150 if ( !(w%2) ) w--; // should have an odd value to get a real middle line
148 int h = height() - 4; 151 int h = height() - 4;
149 int pix = (percent * h) / 100; 152 int pix = (percent * h) / 100;
150 int y2 = height() -2; 153 int y2 = height() -2;
151 int y = y2 - pix; 154 int y = y2 - pix;
152 int x1 = (width() - w ) / 2; 155 int x1 = (width() - w ) / 2;
153 156
154 p.setPen(QColor(80,80,80)); 157 p.setPen(QColor(80,80,80));
155 p.drawLine(x1+w/4,0,x1+w/4+w/2+1,0); // header 158 p.drawLine(x1+w/4,0,x1+w/4+w/2+1,0); // header
156 p.drawRect(x1,1,w,height()-1); // corpus 159 p.drawRect(x1,1,w,height()-1); // corpus
157 p.setBrush(color); 160 p.setBrush(color);
158 161
159 //int extra = ((percent * h) % 100)/(100/4); 162 //int extra = ((percent * h) % 100)/(100/4);
160 163
161 int middle = w/2; 164 int middle = w/2;
162 for ( int i = 0; i < middle; i++ ) 165 for ( int i = 0; i < middle; i++ )
163 { 166 {
164 p.setPen( gray.dark( 100+i*20 ) ); 167 p.setPen( gray.dark( 100+i*20 ) );
165 p.drawLine( x1+middle-i, 2, x1+middle-i, y-1 ); 168 p.drawLine( x1+middle-i, 2, x1+middle-i, y-1 );
166 p.drawLine( x1+middle+i, 2, x1+middle+i, y-1 ); 169 p.drawLine( x1+middle+i, 2, x1+middle+i, y-1 );
167 p.setPen( color.dark( 100+i*20 ) ); 170 p.setPen( color.dark( 100+i*20 ) );
168 p.drawLine( x1+middle-i, y, x1+middle-i, y2 ); 171 p.drawLine( x1+middle-i, y, x1+middle-i, y2 );
169 p.drawLine( x1+middle+i, y, x1+middle+i, y2 ); 172 p.drawLine( x1+middle+i, y, x1+middle+i, y2 );
170 } 173 }
171} 174}
172 175
173int BatteryMeter::position() 176int BatteryMeter::position()
174{ 177{
175 return 8; 178 return 8;
176} 179}
177 180
178Q_EXPORT_INTERFACE() 181EXPORT_OPIE_APPLET_v1( BatteryMeter )
179{
180 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<BatteryMeter> );
181}
182 182
diff --git a/core/applets/batteryapplet/batterystatus.cpp b/core/applets/batteryapplet/batterystatus.cpp
index ea11495..bd86f77 100644
--- a/core/applets/batteryapplet/batterystatus.cpp
+++ b/core/applets/batteryapplet/batterystatus.cpp
@@ -1,64 +1,64 @@
1 1
2#include "batterystatus.h" 2#include "batterystatus.h"
3 3
4/* OPIE */ 4/* OPIE */
5#include <opie2/odevice.h> 5#include <opie2/odevice.h>
6#include <qpe/power.h> 6#include <qpe/power.h>
7 7
8/* QT */ 8/* QT */
9#include <qpushbutton.h> 9#include <qpushbutton.h>
10#include <qdrawutil.h> 10#include <qdrawutil.h>
11#include <qfile.h> 11#include <qfile.h>
12#include <qlayout.h> 12#include <qlayout.h>
13#include <qtextstream.h> 13#include <qtextstream.h>
14#include <qmessagebox.h> 14#include <qmessagebox.h>
15 15
16using namespace Opie; 16using namespace Opie::Core;
17 17
18BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent ) 18BatteryStatus::BatteryStatus( const PowerStatus *p, QWidget *parent )
19 : QWidget( parent, 0, WDestructiveClose), ps(p), bat2(false) { 19 : QWidget( parent, 0, WDestructiveClose), ps(p), bat2(false) {
20 setCaption( tr("Battery status") ); 20 setCaption( tr("Battery status") );
21 setMinimumSize( 150, 200 ); 21 setMinimumSize( 150, 200 );
22 22
23 QPushButton *pb = new QPushButton( tr("Close"), this ); 23 QPushButton *pb = new QPushButton( tr("Close"), this );
24 QVBoxLayout *layout = new QVBoxLayout ( this ); 24 QVBoxLayout *layout = new QVBoxLayout ( this );
25 25
26 jackPercent = 0; 26 jackPercent = 0;
27 27
28 pb->setMaximumSize( 120, 40 ); 28 pb->setMaximumSize( 120, 40 );
29 29
30 pb->show(); 30 pb->show();
31 31
32 layout->addStretch(); 32 layout->addStretch();
33 layout->addWidget( pb ); 33 layout->addWidget( pb );
34 34
35 if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) { 35 if ( ODevice::inst ( )-> series ( ) == Model_iPAQ ) {
36 getProcApmStatusIpaq(); 36 getProcApmStatusIpaq();
37 } 37 }
38 connect( pb, SIGNAL( clicked() ), this, SLOT( close() ) ); 38 connect( pb, SIGNAL( clicked() ), this, SLOT( close() ) );
39 percent = ps->batteryPercentRemaining(); 39 percent = ps->batteryPercentRemaining();
40 show(); 40 show();
41} 41}
42 42
43BatteryStatus::~BatteryStatus() 43BatteryStatus::~BatteryStatus()
44{ 44{
45} 45}
46 46
47/* 47/*
48 * Make use of the advanced apm interface of the ipaq 48 * Make use of the advanced apm interface of the ipaq
49 */ 49 */
50bool BatteryStatus::getProcApmStatusIpaq() { 50bool BatteryStatus::getProcApmStatusIpaq() {
51 51
52 bat2 = false; 52 bat2 = false;
53 53
54 QFile procApmIpaq("/proc/hal/battery"); 54 QFile procApmIpaq("/proc/hal/battery");
55 55
56 if (procApmIpaq.open(IO_ReadOnly) ) { 56 if (procApmIpaq.open(IO_ReadOnly) ) {
57 QStringList list; 57 QStringList list;
58 // since it is /proc we _must_ use QTextStream 58 // since it is /proc we _must_ use QTextStream
59 QTextStream stream ( &procApmIpaq); 59 QTextStream stream ( &procApmIpaq);
60 QString streamIn; 60 QString streamIn;
61 streamIn = stream.read(); 61 streamIn = stream.read();
62 list = QStringList::split("\n", streamIn); 62 list = QStringList::split("\n", streamIn);
63 63
64 for(QStringList::Iterator line=list.begin(); line!=list.end(); line++) { 64 for(QStringList::Iterator line=list.begin(); line!=list.end(); line++) {
diff --git a/core/applets/batteryapplet/config.in b/core/applets/batteryapplet/config.in
index 3067317..eca07e3 100644
--- a/core/applets/batteryapplet/config.in
+++ b/core/applets/batteryapplet/config.in
@@ -1,4 +1,4 @@
1 config BATTERYAPPLET 1 config BATTERYAPPLET
2 boolean "opie-batteryapplet (Applet to monitor battery status)" 2 boolean "opie-batteryapplet (Applet to monitor battery status)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp
index 6090b68..ed4bfc7 100644
--- a/core/applets/cardmon/cardmon.cpp
+++ b/core/applets/cardmon/cardmon.cpp
@@ -2,96 +2,97 @@
2* cardmon.cpp 2* cardmon.cpp
3* 3*
4* --------------------- 4* ---------------------
5* 5*
6* copyright : (c) 2002 by Maximilian Reiss 6* copyright : (c) 2002 by Maximilian Reiss
7* email : max.reiss@gmx.de 7* email : max.reiss@gmx.de
8* based on two apps by Devin Butterfield 8* based on two apps by Devin Butterfield
9*/ 9*/
10/*************************************************************************** 10/***************************************************************************
11 * * 11 * *
12 * This program is free software; you can redistribute it and/or modify * 12 * This program is free software; you can redistribute it and/or modify *
13 * it under the terms of the GNU General Public License as published by * 13 * it under the terms of the GNU General Public License as published by *
14 * the Free Software Foundation; either version 2 of the License, or * 14 * the Free Software Foundation; either version 2 of the License, or *
15 * (at your option) any later version. * 15 * (at your option) any later version. *
16 * * 16 * *
17 ***************************************************************************/ 17 ***************************************************************************/
18 18
19#include "cardmon.h" 19#include "cardmon.h"
20 20
21/* OPIE */ 21/* OPIE */
22#include <opie2/odevice.h> 22#include <opie2/odevice.h>
23#include <opie2/otaskbarapplet.h> 23#include <opie2/otaskbarapplet.h>
24#include <qpe/applnk.h> 24#include <qpe/applnk.h>
25#include <qpe/resource.h> 25#include <qpe/resource.h>
26 26
27/* QT */ 27/* QT */
28#include <qcopchannel_qws.h> 28#include <qcopchannel_qws.h>
29#include <qpainter.h> 29#include <qpainter.h>
30#include <qfile.h> 30#include <qfile.h>
31#include <qtextstream.h> 31#include <qtextstream.h>
32#include <qsound.h> 32#include <qsound.h>
33#include <qtimer.h> 33#include <qtimer.h>
34 34
35/* STD */ 35/* STD */
36#include <stdio.h> 36#include <stdio.h>
37#include <unistd.h> 37#include <unistd.h>
38#include <stdlib.h> 38#include <stdlib.h>
39#include <string.h> 39#include <string.h>
40#include <fcntl.h> 40#include <fcntl.h>
41 41
42#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 42#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
43#include <sys/vfs.h> 43#include <sys/vfs.h>
44#include <mntent.h> 44#include <mntent.h>
45#endif 45#endif
46 46
47using namespace Opie; 47using namespace Opie;
48 48
49using namespace Opie::Ui; 49using namespace Opie::Ui;
50using namespace Opie::Ui;
50using namespace Opie::Core; 51using namespace Opie::Core;
51 52
52CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent ), 53CardMonitor::CardMonitor( QWidget * parent ) : QWidget( parent ),
53 pm( Resource::loadPixmap( "cardmon/pcmcia" ) ) 54 pm( Resource::loadPixmap( "cardmon/pcmcia" ) )
54{ 55{
55 56
56 QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this ); 57 QCopChannel * pcmciaChannel = new QCopChannel( "QPE/Card", this );
57 connect( pcmciaChannel, 58 connect( pcmciaChannel,
58 SIGNAL( received(const QCString&,const QByteArray&) ), this, 59 SIGNAL( received(const QCString&,const QByteArray&) ), this,
59 SLOT( cardMessage(const QCString&,const QByteArray&) ) ); 60 SLOT( cardMessage(const QCString&,const QByteArray&) ) );
60 61
61 QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this ); 62 QCopChannel *sdChannel = new QCopChannel( "QPE/Card", this );
62 connect( sdChannel, 63 connect( sdChannel,
63 SIGNAL( received(const QCString&,const QByteArray&) ), this, 64 SIGNAL( received(const QCString&,const QByteArray&) ), this,
64 SLOT( cardMessage(const QCString&,const QByteArray&) ) ); 65 SLOT( cardMessage(const QCString&,const QByteArray&) ) );
65 66
66 cardInPcmcia0 = FALSE; 67 cardInPcmcia0 = FALSE;
67 cardInPcmcia1 = FALSE; 68 cardInPcmcia1 = FALSE;
68 cardInSd = FALSE; 69 cardInSd = FALSE;
69 70
70 setFocusPolicy( NoFocus ); 71 setFocusPolicy( NoFocus );
71 72
72 setFixedWidth ( AppLnk::smallIconSize() ); 73 setFixedWidth ( AppLnk::smallIconSize() );
73 setFixedHeight ( AppLnk::smallIconSize() ); 74 setFixedHeight ( AppLnk::smallIconSize() );
74 75
75 getStatusPcmcia( TRUE ); 76 getStatusPcmcia( TRUE );
76 getStatusSd( TRUE ); 77 getStatusSd( TRUE );
77 repaint( FALSE ); 78 repaint( FALSE );
78 popupMenu = 0; 79 popupMenu = 0;
79} 80}
80 81
81CardMonitor::~CardMonitor() 82CardMonitor::~CardMonitor()
82{ 83{
83 if ( popupMenu ) 84 if ( popupMenu )
84 { 85 {
85 delete popupMenu; 86 delete popupMenu;
86 } 87 }
87} 88}
88 89
89void CardMonitor::popUp( QString message, QString icon ) 90void CardMonitor::popUp( QString message, QString icon )
90{ 91{
91 if ( !popupMenu ) 92 if ( !popupMenu )
92 { 93 {
93 popupMenu = new QPopupMenu( this ); 94 popupMenu = new QPopupMenu( this );
94 } 95 }
95 96
96 popupMenu->clear(); 97 popupMenu->clear();
97 if ( icon.isEmpty() ) 98 if ( icon.isEmpty() )
diff --git a/core/applets/cardmon/config.in b/core/applets/cardmon/config.in
index f3d57fd..8626c75 100644
--- a/core/applets/cardmon/config.in
+++ b/core/applets/cardmon/config.in
@@ -1,4 +1,4 @@
1 config CARDMON 1 config CARDMON
2 boolean "opie-cardmon (monitor cf/sd/mmc card status, and eject function)" 2 boolean "opie-cardmon (monitor cf/sd/mmc card status, and eject function)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp
index 4fc8076..57a4088 100644
--- a/core/applets/clipboardapplet/clipboard.cpp
+++ b/core/applets/clipboardapplet/clipboard.cpp
@@ -1,84 +1,85 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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 20
21#include "clipboard.h" 21#include "clipboard.h"
22 22
23#include <opie2/otaskbarapplet.h> 23#include <opie2/otaskbarapplet.h>
24#include <qpe/resource.h> 24#include <qpe/resource.h>
25#include <qpe/applnk.h> 25#include <qpe/applnk.h>
26 26
27#include <qpainter.h> 27#include <qpainter.h>
28#include <qpopupmenu.h> 28#include <qpopupmenu.h>
29#include <qwindowsystem_qws.h> 29#include <qwindowsystem_qws.h>
30#include <qapplication.h> 30#include <qapplication.h>
31#include <qclipboard.h> 31#include <qclipboard.h>
32#include <qtimer.h> 32#include <qtimer.h>
33 33
34//=========================================================================== 34//===========================================================================
35 35
36 36
37using namespace Opie::Ui;
37ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) 38ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name )
38{ 39{
39 setFixedWidth ( AppLnk::smallIconSize() ); 40 setFixedWidth ( AppLnk::smallIconSize() );
40 setFixedHeight ( AppLnk::smallIconSize() ); 41 setFixedHeight ( AppLnk::smallIconSize() );
41 42
42 QImage img = Resource::loadImage( "paste"); 43 QImage img = Resource::loadImage( "paste");
43 img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 44 img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
44 45
45 m_clipboardPixmap.convertFromImage( img ); 46 m_clipboardPixmap.convertFromImage( img );
46 47
47 m_timer = new QTimer ( this ); 48 m_timer = new QTimer ( this );
48 49
49 connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData())); 50 connect ( QApplication::clipboard ( ), SIGNAL( dataChanged()), this, SLOT( newData()));
50 connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData())); 51 connect ( m_timer, SIGNAL( timeout()), this, SLOT( newData()));
51 connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown())); 52 connect ( qApp, SIGNAL( aboutToQuit()), this, SLOT( shutdown()));
52 53
53 m_menu = 0; 54 m_menu = 0;
54 m_dirty = true; 55 m_dirty = true;
55 m_lasttext = QString::null; 56 m_lasttext = QString::null;
56 57
57 m_timer-> start ( 0, true ); 58 m_timer-> start ( 0, true );
58} 59}
59 60
60ClipboardApplet::~ClipboardApplet ( ) 61ClipboardApplet::~ClipboardApplet ( )
61{ 62{
62} 63}
63 64
64int ClipboardApplet::position() 65int ClipboardApplet::position()
65{ 66{
66 return 6; 67 return 6;
67} 68}
68 69
69void ClipboardApplet::shutdown ( ) 70void ClipboardApplet::shutdown ( )
70{ 71{
71 // the timer has to be stopped, or Qt/E will hang on quit() 72 // the timer has to be stopped, or Qt/E will hang on quit()
72 // see launcher/desktop.cpp 73 // see launcher/desktop.cpp
73 74
74 m_timer-> stop ( ); 75 m_timer-> stop ( );
75} 76}
76 77
77void ClipboardApplet::mousePressEvent ( QMouseEvent *) 78void ClipboardApplet::mousePressEvent ( QMouseEvent *)
78{ 79{
79 if ( m_dirty ) { 80 if ( m_dirty ) {
80 delete m_menu; 81 delete m_menu;
81 82
82 m_menu = new QPopupMenu ( this ); 83 m_menu = new QPopupMenu ( this );
83 m_menu-> setCheckable ( true ); 84 m_menu-> setCheckable ( true );
84 85
@@ -138,52 +139,50 @@ void ClipboardApplet::action(int id)
138 unicode = 'V' - '@'; 139 unicode = 'V' - '@';
139 scan = Key_V; 140 scan = Key_V;
140 } 141 }
141 break; 142 break;
142 } 143 }
143 144
144 if ( scan ) { 145 if ( scan ) {
145 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false ); 146 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false );
146 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false ); 147 qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false );
147 } 148 }
148} 149}
149 150
150void ClipboardApplet::paintEvent ( QPaintEvent* ) 151void ClipboardApplet::paintEvent ( QPaintEvent* )
151{ 152{
152 QPainter p ( this ); 153 QPainter p ( this );
153 /* center the height but our pixmap is as big as the height ;)*/ 154 /* center the height but our pixmap is as big as the height ;)*/
154 p. drawPixmap( 0, 0, 155 p. drawPixmap( 0, 0,
155 m_clipboardPixmap ); 156 m_clipboardPixmap );
156} 157}
157 158
158void ClipboardApplet::newData ( ) 159void ClipboardApplet::newData ( )
159{ 160{
160 static bool excllock = false; 161 static bool excllock = false;
161 162
162 if ( excllock ) 163 if ( excllock )
163 return; 164 return;
164 else 165 else
165 excllock = true; 166 excllock = true;
166 167
167 m_timer-> stop ( ); 168 m_timer-> stop ( );
168 169
169 QCString type = "plain"; 170 QCString type = "plain";
170 QString txt = QApplication::clipboard ( )-> text ( type ); 171 QString txt = QApplication::clipboard ( )-> text ( type );
171 172
172 if ( !txt. isEmpty ( ) && !m_history. contains ( txt )) { 173 if ( !txt. isEmpty ( ) && !m_history. contains ( txt )) {
173 m_history. append ( txt ); 174 m_history. append ( txt );
174 175
175 if ( m_history. count ( ) > 5 ) 176 if ( m_history. count ( ) > 5 )
176 m_history. remove ( m_history. begin ( )); 177 m_history. remove ( m_history. begin ( ));
177 178
178 m_dirty = true; 179 m_dirty = true;
179 } 180 }
180 181
181 m_timer-> start ( 1500, true ); 182 m_timer-> start ( 1500, true );
182 183
183 excllock = false; 184 excllock = false;
184} 185}
185 186
186Q_EXPORT_INTERFACE() 187EXPORT_OPIE_APPLET_v1( ClipboardApplet )
187{ 188
188 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ClipboardApplet> );
189}
diff --git a/core/applets/clipboardapplet/config.in b/core/applets/clipboardapplet/config.in
index 1205b26..e58d239 100644
--- a/core/applets/clipboardapplet/config.in
+++ b/core/applets/clipboardapplet/config.in
@@ -1,4 +1,4 @@
1 config CLIPBOARDAPPLET 1 config CLIPBOARDAPPLET
2 boolean "opie-clipboardapplet (copy/cut/paste applet)" 2 boolean "opie-clipboardapplet (copy/cut/paste applet)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/clockapplet/clock.cpp b/core/applets/clockapplet/clock.cpp
index 120a019..3b13d74 100644
--- a/core/applets/clockapplet/clock.cpp
+++ b/core/applets/clockapplet/clock.cpp
@@ -1,121 +1,120 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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 20
21#include "clock.h" 21#include "clock.h"
22 22
23#include <opie2/otaskbarapplet.h> 23#include <opie2/otaskbarapplet.h>
24#include <qpe/qpeapplication.h> 24#include <qpe/qpeapplication.h>
25#include <qpe/qcopenvelope_qws.h> 25#include <qpe/qcopenvelope_qws.h>
26#include <qpe/config.h> 26#include <qpe/config.h>
27 27
28using namespace Opie::Ui;
28LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent ) 29LauncherClock::LauncherClock( QWidget *parent ) : QLabel( parent )
29{ 30{
30 // If you want a sunken border around the clock do this: 31 // If you want a sunken border around the clock do this:
31 // setFrameStyle( QFrame::Panel | QFrame::Sunken ); 32 // setFrameStyle( QFrame::Panel | QFrame::Sunken );
32 //setFont( QFont( "Helvetica", , QFont::Normal ) ); 33 //setFont( QFont( "Helvetica", , QFont::Normal ) );
33 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) ); 34 connect( qApp, SIGNAL( timeChanged() ), this, SLOT( updateTime() ) );
34 connect( qApp, SIGNAL( clockChanged(bool) ), 35 connect( qApp, SIGNAL( clockChanged(bool) ),
35 this, SLOT( slotClockChanged(bool) ) ); 36 this, SLOT( slotClockChanged(bool) ) );
36 readConfig(); 37 readConfig();
37 timerId = 0; 38 timerId = 0;
38 timerEvent( 0 ); 39 timerEvent( 0 );
39 show(); 40 show();
40} 41}
41 42
42int LauncherClock::position() 43int LauncherClock::position()
43{ 44{
44 return 10; 45 return 10;
45} 46}
46 47
47void LauncherClock::readConfig() { 48void LauncherClock::readConfig() {
48 Config config( "qpe" ); 49 Config config( "qpe" );
49 config.setGroup( "Time" ); 50 config.setGroup( "Time" );
50 ampmFormat = config.readBoolEntry( "AMPM", TRUE ); 51 ampmFormat = config.readBoolEntry( "AMPM", TRUE );
51 config.setGroup( "Date" ); 52 config.setGroup( "Date" );
52 format = config.readNumEntry("ClockApplet",0); 53 format = config.readNumEntry("ClockApplet",0);
53} 54}
54 55
55void LauncherClock::mouseReleaseEvent( QMouseEvent * ) 56void LauncherClock::mouseReleaseEvent( QMouseEvent * )
56{ 57{
57 QCString setTimeApp; 58 QCString setTimeApp;
58 setTimeApp="systemtime"; 59 setTimeApp="systemtime";
59 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()"); 60 QCopEnvelope e("QPE/Application/"+setTimeApp, "raise()");
60} 61}
61 62
62 63
63void LauncherClock::timerEvent( QTimerEvent *e ) 64void LauncherClock::timerEvent( QTimerEvent *e )
64{ 65{
65 if ( !e || e->timerId() == timerId ) { 66 if ( !e || e->timerId() == timerId ) {
66 killTimer( timerId ); 67 killTimer( timerId );
67 changeTime(); 68 changeTime();
68 QTime t = QTime::currentTime(); 69 QTime t = QTime::currentTime();
69 int ms = (60 - t.second())*1000 - t.msec(); 70 int ms = (60 - t.second())*1000 - t.msec();
70 timerId = startTimer( ms ); 71 timerId = startTimer( ms );
71 } else { 72 } else {
72 QLabel::timerEvent( e ); 73 QLabel::timerEvent( e );
73 } 74 }
74} 75}
75 76
76void LauncherClock::updateTime( void ) 77void LauncherClock::updateTime( void )
77{ 78{
78 changeTime(); 79 changeTime();
79} 80}
80 81
81void LauncherClock::changeTime( void ) 82void LauncherClock::changeTime( void )
82{ 83{
83 QTime tm = QDateTime::currentDateTime().time(); 84 QTime tm = QDateTime::currentDateTime().time();
84 QString s; 85 QString s;
85 if( ampmFormat ) { 86 if( ampmFormat ) {
86 int hour = tm.hour(); 87 int hour = tm.hour();
87 if (hour == 0) 88 if (hour == 0)
88 hour = 12; 89 hour = 12;
89 if (hour > 12) 90 if (hour > 12)
90 hour -= 12; 91 hour -= 12;
91 s.sprintf( "%2d:%02d %s", hour, tm.minute(), 92 s.sprintf( "%2d:%02d %s", hour, tm.minute(),
92 (tm.hour() >= 12) ? "PM" : "AM" ); 93 (tm.hour() >= 12) ? "PM" : "AM" );
93 } else 94 } else
94 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() ); 95 s.sprintf( "%2d:%02d", tm.hour(), tm.minute() );
95 96
96 if (format==1) { 97 if (format==1) {
97 QDate dm = QDate::currentDate(); 98 QDate dm = QDate::currentDate();
98 QString d; 99 QString d;
99 d.sprintf("%d/%d ", dm.day(), dm.month()); 100 d.sprintf("%d/%d ", dm.day(), dm.month());
100 setText( d+s ); 101 setText( d+s );
101 } else if (format==2) { 102 } else if (format==2) {
102 QDate dm = QDate::currentDate(); 103 QDate dm = QDate::currentDate();
103 QString d; 104 QString d;
104 d.sprintf("%d/%d ", dm.month(), dm.day()); 105 d.sprintf("%d/%d ", dm.month(), dm.day());
105 setText( d+s ); 106 setText( d+s );
106 } else { 107 } else {
107 setText( s ); 108 setText( s );
108 } 109 }
109} 110}
110 111
111void LauncherClock::slotClockChanged( bool pm ) 112void LauncherClock::slotClockChanged( bool pm )
112{ 113{
113 readConfig(); 114 readConfig();
114 updateTime(); 115 updateTime();
115} 116}
116 117
117Q_EXPORT_INTERFACE() 118
118{ 119EXPORT_OPIE_APPLET_v1( LauncherClock )
119 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<LauncherClock> );
120}
121 120
diff --git a/core/applets/clockapplet/config.in b/core/applets/clockapplet/config.in
index 20bd39d..6c32f79 100644
--- a/core/applets/clockapplet/config.in
+++ b/core/applets/clockapplet/config.in
@@ -1,4 +1,4 @@
1 config CLOCKAPPLET 1 config CLOCKAPPLET
2 boolean "opie-clockapplet (Digital clock applet)" 2 boolean "opie-clockapplet (Digital clock applet)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/homeapplet/config.in b/core/applets/homeapplet/config.in
index 1828da0..53d7882 100644
--- a/core/applets/homeapplet/config.in
+++ b/core/applets/homeapplet/config.in
@@ -1,4 +1,4 @@
1 config HOMEAPPLET 1 config HOMEAPPLET
2 boolean "Home" 2 boolean "Home"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/irdaapplet/config.in b/core/applets/irdaapplet/config.in
index 56ec664..0976e8f 100644
--- a/core/applets/irdaapplet/config.in
+++ b/core/applets/irdaapplet/config.in
@@ -1,4 +1,4 @@
1 config IRDAAPPLET 1 config IRDAAPPLET
2 boolean "opie-irdaapplet (applet for IR beaming/discovery)" 2 boolean "opie-irdaapplet (applet for IR beaming/discovery)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp
index dde8050..2196d18 100644
--- a/core/applets/irdaapplet/irda.cpp
+++ b/core/applets/irdaapplet/irda.cpp
@@ -1,87 +1,88 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org> 2** Copyright (C) 2002 David Woodhouse <dwmw2@infradead.org>
3** Max Reiss <harlekin@handhelds.org> [trivial stuff] 3** Max Reiss <harlekin@handhelds.org> [trivial stuff]
4** Robert Griebl <sandman@handhelds.org> 4** Robert Griebl <sandman@handhelds.org>
5** Holger Freyther <zecke@handhelds.org> QCOP Interface 5** Holger Freyther <zecke@handhelds.org> QCOP Interface
6** 6**
7** This file may be distributed and/or modified under the terms of the 7** This file may be distributed and/or modified under the terms of the
8** GNU General Public License version 2 as published by the Free Software 8** GNU General Public License version 2 as published by the Free Software
9** Foundation and appearing in the file LICENSE.GPL included in the 9** Foundation and appearing in the file LICENSE.GPL included in the
10** packaging of this file. 10** packaging of this file.
11** 11**
12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 12** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 13** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
14** 14**
15**********************************************************************/ 15**********************************************************************/
16 16
17#include "irda.h" 17#include "irda.h"
18 18
19/* OPIE */ 19/* OPIE */
20#include <opie2/otaskbarapplet.h> 20#include <opie2/otaskbarapplet.h>
21#include <qpe/resource.h> 21#include <qpe/resource.h>
22#include <qpe/qcopenvelope_qws.h> 22#include <qpe/qcopenvelope_qws.h>
23 23
24/* QT */ 24/* QT */
25#include <qpainter.h> 25#include <qpainter.h>
26#include <qfile.h> 26#include <qfile.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qtextstream.h> 28#include <qtextstream.h>
29 29
30/* STD */ 30/* STD */
31#include <unistd.h> 31#include <unistd.h>
32#include <net/if.h> 32#include <net/if.h>
33#include <netinet/in.h> 33#include <netinet/in.h>
34#include <sys/types.h> 34#include <sys/types.h>
35#include <sys/socket.h> 35#include <sys/socket.h>
36#include <sys/ioctl.h> 36#include <sys/ioctl.h>
37 37
38//=========================================================================== 38//===========================================================================
39 39
40using namespace Opie::Ui;
40IrdaApplet::IrdaApplet ( QWidget *parent, const char *name ) 41IrdaApplet::IrdaApplet ( QWidget *parent, const char *name )
41 : QWidget ( parent, name ) 42 : QWidget ( parent, name )
42{ 43{
43 setFixedHeight ( 18 ); 44 setFixedHeight ( 18 );
44 setFixedWidth ( 14 ); 45 setFixedWidth ( 14 );
45 46
46 m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP ); 47 m_sockfd = ::socket ( PF_INET, SOCK_DGRAM, IPPROTO_IP );
47 48
48 m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" ); 49 m_irdaOnPixmap = Resource::loadPixmap( "irdaapplet/irdaon" );
49 m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" ); 50 m_irdaOffPixmap = Resource::loadPixmap( "irdaapplet/irdaoff" );
50 m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" ); 51 m_irdaDiscoveryOnPixmap = Resource::loadPixmap( "irdaapplet/magglass" );
51 m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" ); 52 m_receiveActivePixmap = Resource::loadPixmap( "irdaapplet/receive" );
52 53
53 m_irda_active = false; 54 m_irda_active = false;
54 m_irda_discovery_active = false; 55 m_irda_discovery_active = false;
55 m_receive_active = false; 56 m_receive_active = false;
56 m_receive_state_changed = false; 57 m_receive_state_changed = false;
57 m_popup = 0; 58 m_popup = 0;
58 m_wasOn = false; 59 m_wasOn = false;
59 m_wasDiscover = false; 60 m_wasDiscover = false;
60 61
61 QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this ); 62 QCopChannel* chan = new QCopChannel("QPE/IrDaApplet", this );
62 connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ), 63 connect(chan, SIGNAL(received(const QCString&,const QByteArray&) ),
63 this, SLOT(slotMessage(const QCString&,const QByteArray&) ) ); 64 this, SLOT(slotMessage(const QCString&,const QByteArray&) ) );
64} 65}
65 66
66int IrdaApplet::position() 67int IrdaApplet::position()
67{ 68{
68 return 6; 69 return 6;
69} 70}
70 71
71void IrdaApplet::show() 72void IrdaApplet::show()
72{ 73{
73 QWidget::show ( ); 74 QWidget::show ( );
74 startTimer ( 2000 ); 75 startTimer ( 2000 );
75} 76}
76 77
77IrdaApplet::~IrdaApplet() 78IrdaApplet::~IrdaApplet()
78{ 79{
79 if ( m_sockfd >= 0 ) 80 if ( m_sockfd >= 0 )
80 ::close ( m_sockfd ); 81 ::close ( m_sockfd );
81} 82}
82 83
83void IrdaApplet::popup ( QString message, QString icon ) 84void IrdaApplet::popup ( QString message, QString icon )
84{ 85{
85 if ( !m_popup ) 86 if ( !m_popup )
86 m_popup = new QPopupMenu ( this ); 87 m_popup = new QPopupMenu ( this );
87 88
@@ -314,52 +315,49 @@ void IrdaApplet::timerEvent ( QTimerEvent * )
314void IrdaApplet::paintEvent ( QPaintEvent * ) 315void IrdaApplet::paintEvent ( QPaintEvent * )
315{ 316{
316 QPainter p ( this ); 317 QPainter p ( this );
317 318
318 p. drawPixmap ( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap ); 319 p. drawPixmap ( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap );
319 320
320 if ( m_irda_discovery_active ) 321 if ( m_irda_discovery_active )
321 p. drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap ); 322 p. drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap );
322 323
323 if ( m_receive_active ) 324 if ( m_receive_active )
324 p. drawPixmap( 0, 1, m_receiveActivePixmap ); 325 p. drawPixmap( 0, 1, m_receiveActivePixmap );
325} 326}
326/* 327/*
327 * We know 3 calls 328 * We know 3 calls
328 * a) enable 329 * a) enable
329 * b) disable 330 * b) disable
330 * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on 331 * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on
331 * c) listDevices: We will return a list of known devices 332 * c) listDevices: We will return a list of known devices
332 */ 333 */
333void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { 334void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) {
334 if ( str == "enableIrda()") { 335 if ( str == "enableIrda()") {
335 m_wasOn = checkIrdaStatus(); 336 m_wasOn = checkIrdaStatus();
336 m_wasDiscover = checkIrdaDiscoveryStatus(); 337 m_wasDiscover = checkIrdaDiscoveryStatus();
337 if (!m_wasOn) { 338 if (!m_wasOn) {
338 setIrdaStatus( true ); 339 setIrdaStatus( true );
339 } 340 }
340 if ( !m_wasDiscover ) { 341 if ( !m_wasDiscover ) {
341 setIrdaDiscoveryStatus ( true ); 342 setIrdaDiscoveryStatus ( true );
342 } 343 }
343 } else if ( str == "disableIrda()") { 344 } else if ( str == "disableIrda()") {
344 if (!m_wasOn) { 345 if (!m_wasOn) {
345 setIrdaStatus( false ); 346 setIrdaStatus( false );
346 } 347 }
347 if ( !m_wasDiscover ) { 348 if ( !m_wasDiscover ) {
348 setIrdaDiscoveryStatus ( false ); 349 setIrdaDiscoveryStatus ( false );
349 } 350 }
350 } else if ( str == "listDevices()") { 351 } else if ( str == "listDevices()") {
351 QCopEnvelope e("QPE/IrDaAppletBack", "devices(QStringList)"); 352 QCopEnvelope e("QPE/IrDaAppletBack", "devices(QStringList)");
352 353
353 QStringList list; 354 QStringList list;
354 QMap<QString, QString>::Iterator it; 355 QMap<QString, QString>::Iterator it;
355 for (it = m_devices.begin(); it != m_devices.end(); ++it ) 356 for (it = m_devices.begin(); it != m_devices.end(); ++it )
356 list << (*it); 357 list << (*it);
357 358
358 e << list; 359 e << list;
359 } 360 }
360} 361}
361 362
362Q_EXPORT_INTERFACE() 363EXPORT_OPIE_APPLET_v1( IrdaApplet )
363{
364 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<IrdaApplet> );
365}
diff --git a/core/applets/logoutapplet/config.in b/core/applets/logoutapplet/config.in
index 385b02f..0d48c6a 100644
--- a/core/applets/logoutapplet/config.in
+++ b/core/applets/logoutapplet/config.in
@@ -1,4 +1,4 @@
1 config LOGOUTAPPLET 1 config LOGOUTAPPLET
2 boolean "Logout" 2 boolean "Logout"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
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,71 +1,73 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2004 Anton Kachalov mouse@altlinux.ru 2** Copyright (C) 2004 Anton Kachalov mouse@altlinux.ru
3** All rights reserved. 3** All rights reserved.
4** 4**
5** This file may be distributed and/or modified under the terms of the 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 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 7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file. 8** packaging of this file.
9** 9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12** 12**
13**********************************************************************/ 13**********************************************************************/
14 14
15#include "multikey.h" 15#include "multikey.h"
16 16
17/* OPIE */ 17/* OPIE */
18#include <opie2/otaskbarapplet.h> 18#include <opie2/otaskbarapplet.h>
19#include <qpe/qcopenvelope_qws.h> 19#include <qpe/qcopenvelope_qws.h>
20#include <qpe/qpeapplication.h>
20 21
21/* QT */ 22/* QT */
22#include <qdir.h> 23#include <qdir.h>
23 24
25using namespace Opie::Ui;
24Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("EN") 26Multikey::Multikey(QWidget *parent) : QLabel(parent), popupMenu(this), current("EN")
25{ 27{
26 QCopChannel* swChannel = new QCopChannel("MultiKey/Switcher", this); 28 QCopChannel* swChannel = new QCopChannel("MultiKey/Switcher", this);
27 connect( swChannel, SIGNAL(received(const QCString&,const QByteArray&)), 29 connect( swChannel, SIGNAL(received(const QCString&,const QByteArray&)),
28 this, SLOT(message(const QCString&,const QByteArray&))); 30 this, SLOT(message(const QCString&,const QByteArray&)));
29 31
30 setFont( QFont( "Helvetica", 10, QFont::Normal ) ); 32 setFont( QFont( "Helvetica", 10, QFont::Normal ) );
31 QPEApplication::setStylusOperation(this, QPEApplication::RightOnHold); 33 QPEApplication::setStylusOperation(this, QPEApplication::RightOnHold);
32 lang = 0; 34 lang = 0;
33 QCopEnvelope e("MultiKey/Keyboard", "getmultikey()"); 35 QCopEnvelope e("MultiKey/Keyboard", "getmultikey()");
34 setText("EN"); 36 setText("EN");
35 popupMenu.insertItem("EN", 0); 37 popupMenu.insertItem("EN", 0);
36 show(); 38 show();
37} 39}
38 40
39void Multikey::mousePressEvent(QMouseEvent *ev) 41void Multikey::mousePressEvent(QMouseEvent *ev)
40{ 42{
41 if (!sw_maps.count()) 43 if (!sw_maps.count())
42 return; 44 return;
43 45
44 if (ev->button() == RightButton) { 46 if (ev->button() == RightButton) {
45 47
46 QPoint p = mapToGlobal(QPoint(0, 0)); 48 QPoint p = mapToGlobal(QPoint(0, 0));
47 QSize s = popupMenu.sizeHint(); 49 QSize s = popupMenu.sizeHint();
48 int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2), 50 int opt = popupMenu.exec(QPoint(p.x() + (width() / 2) - (s.width() / 2),
49 p.y() - s.height()), 0); 51 p.y() - s.height()), 0);
50 52
51 if (opt == -1) 53 if (opt == -1)
52 return; 54 return;
53 lang = opt; 55 lang = opt;
54 56
55 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)"); 57 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
56 e << sw_maps[lang]; 58 e << sw_maps[lang];
57 setText(labels[lang]); 59 setText(labels[lang]);
58 } 60 }
59 QWidget::mousePressEvent(ev); 61 QWidget::mousePressEvent(ev);
60} 62}
61 63
62void Multikey::mouseReleaseEvent(QMouseEvent *ev) 64void Multikey::mouseReleaseEvent(QMouseEvent *ev)
63{ 65{
64 if (!sw_maps.count()) 66 if (!sw_maps.count())
65 return; 67 return;
66 68
67 lang = lang < sw_maps.count()-1 ? lang+1 : 0; 69 lang = lang < sw_maps.count()-1 ? lang+1 : 0;
68 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)"); 70 QCopEnvelope e("MultiKey/Keyboard", "setmultikey(QString)");
69 //qDebug("Lang=%d, count=%d, lab=%s", lang, sw_maps.count(), labels[lang].ascii()); 71 //qDebug("Lang=%d, count=%d, lab=%s", lang, sw_maps.count(), labels[lang].ascii());
70 e << sw_maps[lang]; 72 e << sw_maps[lang];
71 setText(labels[lang]); 73 setText(labels[lang]);
@@ -92,52 +94,49 @@ void Multikey::message(const QCString &message, const QByteArray &data)
92 if (sw[i][0] != '/') { 94 if (sw[i][0] != '/') {
93 95
94 keymap_map = map_dir.absPath() + "/" + sw[i]; 96 keymap_map = map_dir.absPath() + "/" + sw[i];
95 } else { 97 } else {
96 98
97 if ((map_dir.exists(QFileInfo(sw[i]).fileName(), false) 99 if ((map_dir.exists(QFileInfo(sw[i]).fileName(), false)
98 && i != sw.count()-1) || !QFile::exists(sw[i])) { 100 && i != sw.count()-1) || !QFile::exists(sw[i])) {
99 continue; 101 continue;
100 } 102 }
101 keymap_map = sw[i]; 103 keymap_map = sw[i];
102 } 104 }
103 105
104 QFile map(keymap_map); 106 QFile map(keymap_map);
105 if (map.open(IO_ReadOnly)) { 107 if (map.open(IO_ReadOnly)) {
106 QString line; 108 QString line;
107 109
108 map.readLine(line, 1024); 110 map.readLine(line, 1024);
109 while (!map.atEnd()) { 111 while (!map.atEnd()) {
110 112
111 if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) { 113 if (line.find(QRegExp("^sw\\s*=\\s*")) != -1) {
112 114
113 if (i != sw.count()-1) { 115 if (i != sw.count()-1) {
114 if (keymap_map == current_map) { 116 if (keymap_map == current_map) {
115 lang = i; 117 lang = i;
116 } 118 }
117 sw_maps.append(keymap_map); 119 sw_maps.append(keymap_map);
118 labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace()); 120 labels.append(line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace());
119 popupMenu.insertItem(labels[labels.count()-1], labels.count()-1); 121 popupMenu.insertItem(labels[labels.count()-1], labels.count()-1);
120 } else { 122 } else {
121 current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace(); 123 current = line.right(line.length() - line.find(QChar('=')) - 1).stripWhiteSpace();
122 } 124 }
123 break; 125 break;
124 } 126 }
125 map.readLine(line, 1024); 127 map.readLine(line, 1024);
126 } 128 }
127 map.close(); 129 map.close();
128 } 130 }
129 } 131 }
130 132
131 setText(current); 133 setText(current);
132 } 134 }
133} 135}
134 136
135int Multikey::position() 137int Multikey::position()
136{ 138{
137 return 10; 139 return 10;
138} 140}
139 141
140Q_EXPORT_INTERFACE() 142EXPORT_OPIE_APPLET_v1( Multikey )
141{
142 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<Multikey> );
143}
diff --git a/core/applets/restartapplet/config.in b/core/applets/restartapplet/config.in
index aa2580f..764ae58 100644
--- a/core/applets/restartapplet/config.in
+++ b/core/applets/restartapplet/config.in
@@ -1,4 +1,4 @@
1 config RESTARTAPPLET 1 config RESTARTAPPLET
2 boolean "opie-restartapplet (Restart Opie via taskbar)" 2 boolean "opie-restartapplet (Restart Opie via taskbar)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/rotateapplet/config.in b/core/applets/rotateapplet/config.in
index 1a0d923..d3de89a 100644
--- a/core/applets/rotateapplet/config.in
+++ b/core/applets/rotateapplet/config.in
@@ -1,4 +1,4 @@
1 config ROTATEAPPLET 1 config ROTATEAPPLET
2 boolean "Rotate" 2 boolean "Rotate"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp
index 0488c36..f621aa9 100644
--- a/core/applets/rotateapplet/rotate.cpp
+++ b/core/applets/rotateapplet/rotate.cpp
@@ -1,87 +1,87 @@
1/* 1/*
2 This file is part of the OPIE Project 2 This file is part of the OPIE Project
3 Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org> 3 Copyright (C) 2003 Maximilian Reiss <harlekin@handhelds.org>
4 Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net> 4 Copyright (C) 2003 Greg Gilbert <ggilbert@treke.net>
5               =. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de> 5               =. Copyright (C) 2004 Michael Lauer <mickey@Vanille.de>
6             .=l. 6             .=l.
7           .>+-= 7           .>+-=
8 _;:,     .>    :=|. This library is free software; you can 8 _;:,     .>    :=|. This library is free software; you can
9.> <,   >  .   <= redistribute it and/or modify it under 9.> <,   >  .   <= redistribute it and/or modify it under
10:=1 )Y*s>-.--   : the terms of the GNU Library General Public 10:=1 )Y*s>-.--   : the terms of the GNU Library General Public
11.="- .-=="i,     .._ License as published by the Free Software 11.="- .-=="i,     .._ License as published by the Free Software
12 - .   .-<_>     .<> Foundation; either version 2 of the License, 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
13     ._= =}       : or (at your option) any later version. 13     ._= =}       : or (at your option) any later version.
14    .%+i>       _;_. 14    .%+i>       _;_.
15    .i_,=:_.      -<s. This library is distributed in the hope that 15    .i_,=:_.      -<s. This library is distributed in the hope that
16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
17    : ..    .:,     . . . without even the implied warranty of 17    : ..    .:,     . . . without even the implied warranty of
18    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A 18    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A
19  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU 19  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU
20..}^=.=       =       ; Library General Public License for more 20..}^=.=       =       ; Library General Public License for more
21++=   -.     .     .: details. 21++=   -.     .     .: details.
22 :     =  ...= . :.=- 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU 23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with 24  -_. . .   )=.  = Library General Public License along with
25    --        :-= this library; see the file COPYING.LIB. 25    --        :-= this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include "rotate.h" 31#include "rotate.h"
32 32
33/* OPIE */ 33/* OPIE */
34#include <opie/odevice.h> 34#include <opie2/odevice.h>
35#include <qpe/config.h> 35#include <qpe/config.h>
36#include <qpe/power.h> 36#include <qpe/power.h>
37#include <qpe/qcopenvelope_qws.h> 37#include <qpe/qcopenvelope_qws.h>
38#include <qpe/resource.h> 38#include <qpe/resource.h>
39using namespace Opie; 39using namespace Opie::Core;
40 40
41/* QT */ 41/* QT */
42 42
43#include <time.h> 43#include <time.h>
44 44
45RotateApplet::RotateApplet() 45RotateApplet::RotateApplet()
46 :QObject( 0, "RotateApplet" ), m_flipped( false ) 46 :QObject( 0, "RotateApplet" ), m_flipped( false )
47{ 47{
48 48
49#if !defined(QT_NO_COP) 49#if !defined(QT_NO_COP)
50 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); 50 QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this );
51 connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ), 51 connect ( rotateChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
52 this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) ); 52 this, SLOT ( channelReceived(const QCString&,const QByteArray&) ) );
53#endif 53#endif
54 54
55} 55}
56 56
57RotateApplet::~RotateApplet ( ) 57RotateApplet::~RotateApplet ( )
58{} 58{}
59 59
60/** 60/**
61 * Qcop receive method. 61 * Qcop receive method.
62 */ 62 */
63void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) 63void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data )
64{ 64{
65 qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg ); 65 qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg );
66 66
67 if ( ODevice::inst()->hasHingeSensor() ) 67 if ( ODevice::inst()->hasHingeSensor() )
68 { 68 {
69 struct timespec interval; 69 struct timespec interval;
70 struct timespec remain; 70 struct timespec remain;
71 interval.tv_sec = 0; 71 interval.tv_sec = 0;
72 interval.tv_nsec = 600000; 72 interval.tv_nsec = 600000;
73 ::nanosleep( &interval, &remain ); 73 ::nanosleep( &interval, &remain );
74 OHingeStatus status = ODevice::inst()->readHingeSensor(); 74 OHingeStatus status = ODevice::inst()->readHingeSensor();
75 qDebug( "RotateApplet::readHingeSensor = %d", (int) status ); 75 qDebug( "RotateApplet::readHingeSensor = %d", (int) status );
76 76
77 Config cfg( "apm" ); 77 Config cfg( "apm" );
78 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); 78 cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" );
79 int action = cfg.readNumEntry( "CloseHingeAction", 0 ); 79 int action = cfg.readNumEntry( "CloseHingeAction", 0 );
80 80
81 if ( status == CASE_CLOSED ) 81 if ( status == CASE_CLOSED )
82 { 82 {
83 switch ( action ) 83 switch ( action )
84 { 84 {
85 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break; 85 case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break;
86 case 2: /* SUSPEND */ ODevice::inst()->suspend(); break; 86 case 2: /* SUSPEND */ ODevice::inst()->suspend(); break;
87 default: /* IGNORE */ break; 87 default: /* IGNORE */ break;
diff --git a/core/applets/rotateapplet/rotateapplet.pro b/core/applets/rotateapplet/rotateapplet.pro
index f24682c..7a4420f 100644
--- a/core/applets/rotateapplet/rotateapplet.pro
+++ b/core/applets/rotateapplet/rotateapplet.pro
@@ -1,13 +1,13 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt plugn warn_on release 2CONFIG += qt plugn warn_on release
3HEADERS = rotate.h 3HEADERS = rotate.h
4SOURCES = rotate.cpp 4SOURCES = rotate.cpp
5TARGET = rotateapplet 5TARGET = rotateapplet
6DESTDIR = $(OPIEDIR)/plugins/applets 6DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += $(OPIEDIR)/include 8DEPENDPATH += $(OPIEDIR)/include
9LIBS += -lqpe 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/core/applets/screenshotapplet/config.in b/core/applets/screenshotapplet/config.in
index cafd470..98f2b61 100644
--- a/core/applets/screenshotapplet/config.in
+++ b/core/applets/screenshotapplet/config.in
@@ -1,4 +1,4 @@
1 config SCREENSHOTAPPLET 1 config SCREENSHOTAPPLET
2 boolean "opie-screenshotapplet (create images from your current display)" 2 boolean "opie-screenshotapplet (create images from your current display)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/screenshotapplet/inputDialog.cpp b/core/applets/screenshotapplet/inputDialog.cpp
index 73ec773..ce03ec0 100644
--- a/core/applets/screenshotapplet/inputDialog.cpp
+++ b/core/applets/screenshotapplet/inputDialog.cpp
@@ -1,64 +1,65 @@
1/**************************************************************************** 1/****************************************************************************
2** Form implementation generated from reading ui file 'inputDialog.ui' 2** Form implementation generated from reading ui file 'inputDialog.ui'
3** 3**
4** Created: Sat Mar 2 07:55:03 2002 4** Created: Sat Mar 2 07:55:03 2002
5** by: The User Interface Compiler (uic) 5** by: The User Interface Compiler (uic)
6** 6**
7** WARNING! All changes made in this file will be lost! 7** WARNING! All changes made in this file will be lost!
8****************************************************************************/ 8****************************************************************************/
9#include "inputDialog.h" 9#include "inputDialog.h"
10 10
11#include <qpe/resource.h> 11#include <qpe/resource.h>
12 12
13#include <opie2/ofiledialog.h> 13#include <opie2/ofiledialog.h>
14 14
15#include <qlineedit.h> 15#include <qlineedit.h>
16#include <qpushbutton.h> 16#include <qpushbutton.h>
17 17
18using namespace Opie::Ui;
18InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 19InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
19 : QDialog( parent, name, modal, fl ) 20 : QDialog( parent, name, modal, fl )
20{ 21{
21 if ( !name ) 22 if ( !name )
22 setName( "InputDialog" ); 23 setName( "InputDialog" );
23 resize( 234, 115); 24 resize( 234, 115);
24 setMaximumSize( QSize( 240, 40)); 25 setMaximumSize( QSize( 240, 40));
25 setCaption( tr(name ) ); 26 setCaption( tr(name ) );
26 27
27 QPushButton *browserButton; 28 QPushButton *browserButton;
28 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); 29 browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton");
29 browserButton->setGeometry( QRect( 205, 10, 22, 22)); 30 browserButton->setGeometry( QRect( 205, 10, 22, 22));
30 connect( browserButton, SIGNAL(released()),this,SLOT(browse())); 31 connect( browserButton, SIGNAL(released()),this,SLOT(browse()));
31 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 32 LineEdit1 = new QLineEdit( this, "LineEdit1" );
32 LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); 33 LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) );
33} 34}
34 35
35/* 36/*
36 * Destroys the object and frees any allocated resources 37 * Destroys the object and frees any allocated resources
37 */ 38 */
38InputDialog::~InputDialog() 39InputDialog::~InputDialog()
39{ 40{
40 inputText= LineEdit1->text(); 41 inputText= LineEdit1->text();
41 42
42} 43}
43 44
44void InputDialog::browse() { 45void InputDialog::browse() {
45 46
46 MimeTypes types; 47 MimeTypes types;
47 QStringList audio, video, all; 48 QStringList audio, video, all;
48 audio << "audio/*"; 49 audio << "audio/*";
49 audio << "playlist/plain"; 50 audio << "playlist/plain";
50 audio << "audio/x-mpegurl"; 51 audio << "audio/x-mpegurl";
51 52
52 video << "video/*"; 53 video << "video/*";
53 video << "playlist/plain"; 54 video << "playlist/plain";
54 55
55 all += audio; 56 all += audio;
56 all += video; 57 all += video;
57 types.insert("All Media Files", all ); 58 types.insert("All Media Files", all );
58 types.insert("Audio", audio ); 59 types.insert("Audio", audio );
59 types.insert("Video", video ); 60 types.insert("Video", video );
60 61
61 QString str = Opie::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); 62 QString str = Opie::Ui::OFileDialog::getOpenFileName( 1,"/","", types, 0 );
62 LineEdit1->setText(str); 63 LineEdit1->setText(str);
63} 64}
64 65
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp
index 20e1c9b..9aa012a 100644
--- a/core/applets/screenshotapplet/screenshot.cpp
+++ b/core/applets/screenshotapplet/screenshot.cpp
@@ -1,89 +1,90 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com 2** Copyright (C) 2002 L.J. Potter ljp@llornkcor.com
3** All rights reserved. 3** All rights reserved.
4** 4**
5** This file may be distributed and/or modified under the terms of the 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 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 7** Foundation and appearing in the file LICENSE.GPL included in the
8** packaging of this file. 8** packaging of this file.
9** 9**
10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 10** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 11** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
12** 12**
13**********************************************************************/ 13**********************************************************************/
14 14
15#include "screenshot.h" 15#include "screenshot.h"
16#include "inputDialog.h" 16#include "inputDialog.h"
17 17
18/* OPIE */ 18/* OPIE */
19#include <opie2/otaskbarapplet.h> 19#include <opie2/otaskbarapplet.h>
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include <qpe/applnk.h> 21#include <qpe/applnk.h>
22 22
23/* QT */ 23/* QT */
24#include <qlineedit.h> 24#include <qlineedit.h>
25#include <qdir.h> 25#include <qdir.h>
26#include <qlabel.h> 26#include <qlabel.h>
27#include <qpushbutton.h> 27#include <qpushbutton.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qspinbox.h> 29#include <qspinbox.h>
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qcheckbox.h> 31#include <qcheckbox.h>
32#include <qmessagebox.h> 32#include <qmessagebox.h>
33 33
34/* STD */ 34/* STD */
35#include <stdlib.h> 35#include <stdlib.h>
36#include <sys/socket.h> 36#include <sys/socket.h>
37#include <netinet/in.h> 37#include <netinet/in.h>
38#include <netdb.h> 38#include <netdb.h>
39#include <unistd.h> 39#include <unistd.h>
40 40
41/* XPM */ 41/* XPM */
42using namespace Opie::Ui;
42static char * snapshot_xpm[] = { 43static char * snapshot_xpm[] = {
43"32 32 177 2", 44"32 32 177 2",
44 " c None", 45 " c None",
45 ". c #042045", 46 ". c #042045",
46 "+ c #0D2B47", 47 "+ c #0D2B47",
47 "@ c #0E325E", 48 "@ c #0E325E",
48 "# c #0D2E50", 49 "# c #0D2E50",
49 "$ c #0A1C32", 50 "$ c #0A1C32",
50 "% c #0F3A69", 51 "% c #0F3A69",
51 "& c #164680", 52 "& c #164680",
52 "* c #165EAE", 53 "* c #165EAE",
53 "= c #134D89", 54 "= c #134D89",
54 "- c #0A3A6E", 55 "- c #0A3A6E",
55 "; c #031024", 56 "; c #031024",
56 "> c #031B36", 57 "> c #031B36",
57 ", c #1A5EA3", 58 ", c #1A5EA3",
58 "' c #1862B1", 59 "' c #1862B1",
59 ") c #1866B9", 60 ") c #1866B9",
60 "! c #0F5AAC", 61 "! c #0F5AAC",
61 "~ c #0F56A8", 62 "~ c #0F56A8",
62 "{ c #0C4C96", 63 "{ c #0C4C96",
63 "] c #030918", 64 "] c #030918",
64 "^ c #060206", 65 "^ c #060206",
65 "/ c #20242C", 66 "/ c #20242C",
66 "( c #3E3B3B", 67 "( c #3E3B3B",
67 "_ c #186ABD", 68 "_ c #186ABD",
68 ": c #115EB3", 69 ": c #115EB3",
69 "< c #082644", 70 "< c #082644",
70 "[ c #222C38", 71 "[ c #222C38",
71 "} c #5A5859", 72 "} c #5A5859",
72 "| c #091921", 73 "| c #091921",
73 "1 c #1E7EDE", 74 "1 c #1E7EDE",
74 "2 c #1A7ADA", 75 "2 c #1A7ADA",
75 "3 c #1970CD", 76 "3 c #1970CD",
76 "4 c #1758A1", 77 "4 c #1758A1",
77 "5 c #0E529A", 78 "5 c #0E529A",
78 "6 c #094388", 79 "6 c #094388",
79 "7 c #22364E", 80 "7 c #22364E",
80 "8 c #384454", 81 "8 c #384454",
81 "9 c #04162C", 82 "9 c #04162C",
82 "0 c #123451", 83 "0 c #123451",
83 "a c #3296B4", 84 "a c #3296B4",
84 "b c #298AB1", 85 "b c #298AB1",
85 "c c #2484AC", 86 "c c #2484AC",
86 "d c #033D86", 87 "d c #033D86",
87 "e c #033677", 88 "e c #033677",
88 "f c #072C58", 89 "f c #072C58",
89 "g c #525862", 90 "g c #525862",
@@ -491,53 +492,51 @@ ScreenshotApplet::ScreenshotApplet( QWidget *parent, const char *name )
491{ 492{
492 setFixedWidth( AppLnk::smallIconSize()); 493 setFixedWidth( AppLnk::smallIconSize());
493 494
494 QImage img = (const char **)snapshot_xpm; 495 QImage img = (const char **)snapshot_xpm;
495 img = img.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize()); 496 img = img.smoothScale(AppLnk::smallIconSize(), AppLnk::smallIconSize());
496 m_icon.convertFromImage(img); 497 m_icon.convertFromImage(img);
497} 498}
498 499
499ScreenshotApplet::~ScreenshotApplet() 500ScreenshotApplet::~ScreenshotApplet()
500{ 501{
501} 502}
502 503
503int ScreenshotApplet::position() 504int ScreenshotApplet::position()
504{ 505{
505 return 6; 506 return 6;
506} 507}
507 508
508void ScreenshotApplet::mousePressEvent( QMouseEvent *) 509void ScreenshotApplet::mousePressEvent( QMouseEvent *)
509{ 510{
510 ScreenshotControl *sc = new ScreenshotControl ( ); 511 ScreenshotControl *sc = new ScreenshotControl ( );
511 QPoint curPos = mapToGlobal ( QPoint ( 0, 0 )); 512 QPoint curPos = mapToGlobal ( QPoint ( 0, 0 ));
512 513
513 // windowPosX is the windows position centered above the applets icon. 514 // windowPosX is the windows position centered above the applets icon.
514 // If the icon is near the edge of the screen, the window would leave the visible area 515 // If the icon is near the edge of the screen, the window would leave the visible area
515 // so we check the position against the screen width and correct the difference if needed 516 // so we check the position against the screen width and correct the difference if needed
516 517
517 int screenWidth = qApp->desktop()->width(); 518 int screenWidth = qApp->desktop()->width();
518 int windowPosX = curPos. x ( ) - ( sc-> sizeHint ( ). width ( ) - width ( )) / 2 ; 519 int windowPosX = curPos. x ( ) - ( sc-> sizeHint ( ). width ( ) - width ( )) / 2 ;
519 int ZwindowPosX, XwindowPosX; 520 int ZwindowPosX, XwindowPosX;
520 521
521 // the window would be placed beyond the screen wich doesn't look tooo good 522 // the window would be placed beyond the screen wich doesn't look tooo good
522 if ( (windowPosX + sc-> sizeHint ( ). width ( )) > screenWidth ) { 523 if ( (windowPosX + sc-> sizeHint ( ). width ( )) > screenWidth ) {
523 XwindowPosX = windowPosX + sc-> sizeHint ( ). width ( ) - screenWidth; 524 XwindowPosX = windowPosX + sc-> sizeHint ( ). width ( ) - screenWidth;
524 ZwindowPosX = windowPosX - XwindowPosX - 1; 525 ZwindowPosX = windowPosX - XwindowPosX - 1;
525 } else { 526 } else {
526 ZwindowPosX = windowPosX; 527 ZwindowPosX = windowPosX;
527 } 528 }
528 529
529 sc-> move ( ZwindowPosX, curPos. y ( ) - sc-> sizeHint ( ). height ( ) ); 530 sc-> move ( ZwindowPosX, curPos. y ( ) - sc-> sizeHint ( ). height ( ) );
530 sc-> show ( ); 531 sc-> show ( );
531} 532}
532 533
533void ScreenshotApplet::paintEvent( QPaintEvent* ) 534void ScreenshotApplet::paintEvent( QPaintEvent* )
534{ 535{
535 QPainter p ( this ); 536 QPainter p ( this );
536 p.drawPixmap( 0,0, m_icon ); 537 p.drawPixmap( 0,0, m_icon );
537} 538}
538 539
539Q_EXPORT_INTERFACE() 540
540{ 541EXPORT_OPIE_APPLET_v1( ScreenshotApplet )
541 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<ScreenshotApplet> );
542}
543 542
diff --git a/core/applets/suspendapplet/config.in b/core/applets/suspendapplet/config.in
index fdbe8b3..d75f581 100644
--- a/core/applets/suspendapplet/config.in
+++ b/core/applets/suspendapplet/config.in
@@ -1,4 +1,4 @@
1 config SUSPENDAPPLET 1 config SUSPENDAPPLET
2 boolean "Suspend" 2 boolean "Suspend"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/vmemo/config.in b/core/applets/vmemo/config.in
index d13492d..356ab16 100644
--- a/core/applets/vmemo/config.in
+++ b/core/applets/vmemo/config.in
@@ -1,4 +1,4 @@
1 config VMEMO 1 config VMEMO
2 boolean "opie-vmemo (take voice memos)" 2 boolean "opie-vmemo (take voice memos)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp
index 27f6015..7dd5b4b 100644
--- a/core/applets/vmemo/vmemo.cpp
+++ b/core/applets/vmemo/vmemo.cpp
@@ -148,96 +148,97 @@ static char * vmemo_xpm[] = {
148 "H c #5A5A5F", 148 "H c #5A5A5F",
149 "I c #BBBBC3", 149 "I c #BBBBC3",
150 "J c #C4C4CB", 150 "J c #C4C4CB",
151 "K c #909098", 151 "K c #909098",
152 "L c #737379", 152 "L c #737379",
153 "M c #343437", 153 "M c #343437",
154 "N c #8F8F98", 154 "N c #8F8F98",
155 "O c #000407", 155 "O c #000407",
156 "P c #2D3137", 156 "P c #2D3137",
157 "Q c #B0B1BC", 157 "Q c #B0B1BC",
158 "R c #3B3C40", 158 "R c #3B3C40",
159 "S c #6E6E74", 159 "S c #6E6E74",
160 "T c #95959C", 160 "T c #95959C",
161 "U c #74747A", 161 "U c #74747A",
162 "V c #1D1D1E", 162 "V c #1D1D1E",
163 "W c #91929A", 163 "W c #91929A",
164 "X c #42444A", 164 "X c #42444A",
165 "Y c #22282E", 165 "Y c #22282E",
166 "Z c #B0B2BC", 166 "Z c #B0B2BC",
167 "` c #898A90", 167 "` c #898A90",
168 " . c #65656A", 168 " . c #65656A",
169 ".. c #999AA2", 169 ".. c #999AA2",
170 "+. c #52535A", 170 "+. c #52535A",
171 "@. c #151B21", 171 "@. c #151B21",
172 "#. c #515257", 172 "#. c #515257",
173 "$. c #B5B5BE", 173 "$. c #B5B5BE",
174 "%. c #616167", 174 "%. c #616167",
175 "&. c #1A1D22", 175 "&. c #1A1D22",
176 "*. c #000713", 176 "*. c #000713",
177 "=. c #1F1F21", 177 "=. c #1F1F21",
178 " ", 178 " ",
179 " . + @ # ", 179 " . + @ # ",
180 " $ % & * = - ", 180 " $ % & * = - ",
181 " ; > , ' ) ! ~ ", 181 " ; > , ' ) ! ~ ",
182 " { ] ^ / ( _ : ", 182 " { ] ^ / ( _ : ",
183 " < [ } | 1 2 3 ", 183 " < [ } | 1 2 3 ",
184 " 4 5 6 7 8 9 0 a b c ", 184 " 4 5 6 7 8 9 0 a b c ",
185 " d e f g h i j 3 k l m n ", 185 " d e f g h i j 3 k l m n ",
186 " o p q r s t u v w n ", 186 " o p q r s t u v w n ",
187 " o x y z A B C D E n ", 187 " o x y z A B C D E n ",
188 " F G H I J K L M N O ", 188 " F G H I J K L M N O ",
189 " P Q R S T U V W X ", 189 " P Q R S T U V W X ",
190 " Y Z ` b ...+. ", 190 " Y Z ` b ...+. ",
191 " @.#.$.%.&. ", 191 " @.#.$.%.&. ",
192 " *.B =. ", 192 " *.B =. ",
193 " n n n n n n n n n "}; 193 " n n n n n n n n n "};
194 194
195 195
196using namespace Opie::Ui;
196VMemo::VMemo( QWidget *parent, const char *_name ) 197VMemo::VMemo( QWidget *parent, const char *_name )
197 : QWidget( parent, _name ) { 198 : QWidget( parent, _name ) {
198 setFixedHeight( 18 ); 199 setFixedHeight( 18 );
199 setFixedWidth( 14 ); 200 setFixedWidth( 14 );
200 201
201 t_timer = new QTimer( this ); 202 t_timer = new QTimer( this );
202 connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) ); 203 connect( t_timer, SIGNAL( timeout() ), SLOT( timerBreak() ) );
203 204
204 Config vmCfg("Vmemo"); 205 Config vmCfg("Vmemo");
205 vmCfg.setGroup("Defaults"); 206 vmCfg.setGroup("Defaults");
206 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1)); 207 int toggleKey = setToggleButton(vmCfg.readNumEntry("toggleKey", -1));
207 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0); 208 useADPCM = vmCfg.readBoolEntry("use_ADPCM", 0);
208 209
209 qDebug("toggleKey %d", toggleKey); 210 qDebug("toggleKey %d", toggleKey);
210 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) 211 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
211 systemZaurus=TRUE; 212 systemZaurus=TRUE;
212 else 213 else
213 systemZaurus=FALSE; 214 systemZaurus=FALSE;
214 215
215 myChannel = new QCopChannel( "QPE/VMemo", this ); 216 myChannel = new QCopChannel( "QPE/VMemo", this );
216 connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)), 217 connect( myChannel, SIGNAL(received(const QCString&,const QByteArray&)),
217 this, SLOT(receive(const QCString&,const QByteArray&)) ); 218 this, SLOT(receive(const QCString&,const QByteArray&)) );
218 219
219 if( toggleKey != -1 ) { 220 if( toggleKey != -1 ) {
220 // keyRegister(key, channel, message) 221 // keyRegister(key, channel, message)
221 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)"); 222 QCopEnvelope e("QPE/Launcher", "keyRegister(int,QCString,QCString)");
222 // e << 4096; // Key_Escape 223 // e << 4096; // Key_Escape
223 // e << Key_F5; //4148 224 // e << Key_F5; //4148
224 e << toggleKey; 225 e << toggleKey;
225 e << QString("QPE/VMemo"); 226 e << QString("QPE/VMemo");
226 e << QString("toggleRecord()"); 227 e << QString("toggleRecord()");
227 } 228 }
228 if(toggleKey == 1) 229 if(toggleKey == 1)
229 usingIcon=TRUE; 230 usingIcon=TRUE;
230 else 231 else
231 usingIcon=FALSE; 232 usingIcon=FALSE;
232 if( vmCfg.readNumEntry("hideIcon",0) == 1) 233 if( vmCfg.readNumEntry("hideIcon",0) == 1)
233 hide(); 234 hide();
234 recording = FALSE; 235 recording = FALSE;
235 // } 236 // }
236} 237}
237 238
238VMemo::~VMemo() { 239VMemo::~VMemo() {
239} 240}
240 241
241int VMemo::position() 242int VMemo::position()
242{ 243{
243 return 6; 244 return 6;
@@ -593,53 +594,51 @@ bool VMemo::record() {
593 QString foo = cfg.readEntry("Mute","TRUE"); 594 QString foo = cfg.readEntry("Mute","TRUE");
594 if(foo.find("TRUE",0,TRUE) != -1) 595 if(foo.find("TRUE",0,TRUE) != -1)
595 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute 596 QCopEnvelope( "QPE/System", "volumeChange(bool)" ) << TRUE; //mute
596return TRUE; 597return TRUE;
597} 598}
598 599
599int VMemo::setToggleButton(int tog) { 600int VMemo::setToggleButton(int tog) {
600 601
601 for( int i=0; i < 10;i++) { 602 for( int i=0; i < 10;i++) {
602 switch (tog) { 603 switch (tog) {
603 case 0: 604 case 0:
604 return -1; 605 return -1;
605 break; 606 break;
606 case 1: 607 case 1:
607 return 0; 608 return 0;
608 break; 609 break;
609 case 2: 610 case 2:
610 return Key_F24; //was Escape 611 return Key_F24; //was Escape
611 break; 612 break;
612 case 3: 613 case 3:
613 return Key_Space; 614 return Key_Space;
614 break; 615 break;
615 case 4: 616 case 4:
616 return Key_F12; 617 return Key_F12;
617 break; 618 break;
618 case 5: 619 case 5:
619 return Key_F9; 620 return Key_F9;
620 break; 621 break;
621 case 6: 622 case 6:
622 return Key_F10; 623 return Key_F10;
623 break; 624 break;
624 case 7: 625 case 7:
625 return Key_F11; 626 return Key_F11;
626 break; 627 break;
627 case 8: 628 case 8:
628 return Key_F13; 629 return Key_F13;
629 break; 630 break;
630 }; 631 };
631 } 632 }
632 return -1; 633 return -1;
633} 634}
634 635
635void VMemo::timerBreak() { 636void VMemo::timerBreak() {
636 //stop 637 //stop
637 stopRecording(); 638 stopRecording();
638 QMessageBox::message("Vmemo","Vmemo recording has ended"); 639 QMessageBox::message("Vmemo","Vmemo recording has ended");
639} 640}
640 641
641Q_EXPORT_INTERFACE() 642
642{ 643EXPORT_OPIE_APPLET_v1( VMemo )
643 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VMemo> );
644}
645 644
diff --git a/core/applets/volumeapplet/config.in b/core/applets/volumeapplet/config.in
index 1233d9f..f097591 100644
--- a/core/applets/volumeapplet/config.in
+++ b/core/applets/volumeapplet/config.in
@@ -1,4 +1,4 @@
1 config VOLUMEAPPLET 1 config VOLUMEAPPLET
2 boolean "opie-volumeapplet (set volume for microphone and speaker)" 2 boolean "opie-volumeapplet (set volume for microphone and speaker)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp
index 942cebb..276f47f 100644
--- a/core/applets/volumeapplet/volume.cpp
+++ b/core/applets/volumeapplet/volume.cpp
@@ -1,97 +1,98 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of 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 20
21#include "volume.h" 21#include "volume.h"
22#include "oledbox.h" 22#include "oledbox.h"
23 23
24#include <opie2/odevice.h> 24#include <opie2/odevice.h>
25#include <opie2/otaskbarapplet.h> 25#include <opie2/otaskbarapplet.h>
26#include <qpe/resource.h> 26#include <qpe/resource.h>
27#include <qpe/applnk.h> 27#include <qpe/applnk.h>
28#include <qpe/config.h> 28#include <qpe/config.h>
29#include <qpe/qcopenvelope_qws.h> 29#include <qpe/qcopenvelope_qws.h>
30 30
31#include <qpainter.h> 31#include <qpainter.h>
32#include <qcheckbox.h> 32#include <qcheckbox.h>
33#include <qslider.h> 33#include <qslider.h>
34#include <qlayout.h> 34#include <qlayout.h>
35#include <qvbox.h> 35#include <qvbox.h>
36#include <qlabel.h> 36#include <qlabel.h>
37#include <qpushbutton.h> 37#include <qpushbutton.h>
38#include <qtimer.h> 38#include <qtimer.h>
39 39
40#include <stdio.h> 40#include <stdio.h>
41 41
42using namespace Opie; 42using namespace Opie::Core;
43 43
44#define RATE_TIMER_INTERVAL 100 44#define RATE_TIMER_INTERVAL 100
45// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time 45// Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time
46// results in "hanging" buttons on the iPAQ due to quite high CPU consumption. 46// results in "hanging" buttons on the iPAQ due to quite high CPU consumption.
47 47
48 48
49/* XPM */ 49/* XPM */
50using namespace Opie::Ui;
50static const char * vol_xpm[] = { 51static const char * vol_xpm[] = {
51"20 20 3 1", 52"20 20 3 1",
52" c None", 53" c None",
53". c #0000FF", 54". c #0000FF",
54"+ c #000000", 55"+ c #000000",
55" ", 56" ",
56" . ", 57" . ",
57" . . . . ", 58" . . . . ",
58" . . . . . . ", 59" . . . . . . ",
59" . . . . . . . ", 60" . . . . . . . ",
60" . . ..... . . ", 61" . . ..... . . ",
61" . ... ..... ... ", 62" . ... ..... ... ",
62" ........... .... ", 63" ........... .... ",
63" ................. ", 64" ................. ",
64"++++++++++++++++++++", 65"++++++++++++++++++++",
65" .................. ", 66" .................. ",
66" . ............. . ", 67" . ............. . ",
67" . ..... ....... ", 68" . ..... ....... ",
68" . ... ..... . ", 69" . ... ..... . ",
69" . ... ..... . ", 70" . ... ..... . ",
70" . ... ..... ", 71" . ... ..... ",
71" . . . . . ", 72" . . . . . ",
72" . . . ", 73" . . . ",
73" . . . ", 74" . . . ",
74" "}; 75" "};
75/* XPM */ 76/* XPM */
76static const char * mic_xpm[] = { 77static const char * mic_xpm[] = {
77"20 20 21 1", 78"20 20 21 1",
78" c None", 79" c None",
79". c #000000", 80". c #000000",
80"+ c #EEEEEE", 81"+ c #EEEEEE",
81"@ c #B4B6B4", 82"@ c #B4B6B4",
82"# c #8B8D8B", 83"# c #8B8D8B",
83"$ c #D5D6D5", 84"$ c #D5D6D5",
84"% c #E6E6E6", 85"% c #E6E6E6",
85"& c #9C9D9C", 86"& c #9C9D9C",
86"* c #6A696A", 87"* c #6A696A",
87"= c #E6E2E6", 88"= c #E6E2E6",
88"- c #F6F2F6", 89"- c #F6F2F6",
89"; c #CDC6CD", 90"; c #CDC6CD",
90"> c #737573", 91"> c #737573",
91", c #4A484A", 92", c #4A484A",
92"' c #DEDEDE", 93"' c #DEDEDE",
93") c #F6EEF6", 94") c #F6EEF6",
94"! c #414041", 95"! c #414041",
95"~ c #202020", 96"~ c #202020",
96"{ c #ACAEAC", 97"{ c #ACAEAC",
97"] c #838583", 98"] c #838583",
@@ -732,52 +733,49 @@ VolumeApplet::~VolumeApplet()
732{ 733{
733 delete m_pixmap; 734 delete m_pixmap;
734} 735}
735 736
736int VolumeApplet::position() 737int VolumeApplet::position()
737{ 738{
738 return 6; 739 return 6;
739} 740}
740 741
741void VolumeApplet::mousePressEvent ( QMouseEvent * ) 742void VolumeApplet::mousePressEvent ( QMouseEvent * )
742{ 743{
743 if ( m_dialog-> isVisible ( )) 744 if ( m_dialog-> isVisible ( ))
744 m_dialog-> hide ( ); 745 m_dialog-> hide ( );
745 else 746 else
746 m_dialog-> show ( true ); 747 m_dialog-> show ( true );
747} 748}
748 749
749void VolumeApplet::redraw ( bool all ) 750void VolumeApplet::redraw ( bool all )
750{ 751{
751 if ( all ) 752 if ( all )
752 repaint ( true ); 753 repaint ( true );
753 else 754 else
754 repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false ); 755 repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false );
755} 756}
756 757
757 758
758void VolumeApplet::paintEvent ( QPaintEvent * ) 759void VolumeApplet::paintEvent ( QPaintEvent * )
759{ 760{
760 QPainter p ( this ); 761 QPainter p ( this );
761 762
762 p. drawPixmap ( (width()- m_pixmap->width())/2, QMAX( (height()-4-m_pixmap->height() )/2, 1), *m_pixmap ); 763 p. drawPixmap ( (width()- m_pixmap->width())/2, QMAX( (height()-4-m_pixmap->height() )/2, 1), *m_pixmap );
763 p. setPen ( darkGray ); 764 p. setPen ( darkGray );
764 p. drawRect ( 1, height() - 4, width() - 2, 4 ); 765 p. drawRect ( 1, height() - 4, width() - 2, 4 );
765 766
766 int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100; 767 int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100;
767 p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); 768 p. fillRect ( 2, height() - 3, pixelsWide, 2, red );
768 p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); 769 p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray );
769 770
770 if ( m_dialog-> volMuted ( )) { 771 if ( m_dialog-> volMuted ( )) {
771 p. setPen ( red ); 772 p. setPen ( red );
772 p. drawLine ( 1, 2, width() - 2, height() - 5 ); 773 p. drawLine ( 1, 2, width() - 2, height() - 5 );
773 p. drawLine ( 1, 3, width() - 2, height() - 4 ); 774 p. drawLine ( 1, 3, width() - 2, height() - 4 );
774 p. drawLine ( width() - 2, 2, 1, height() - 5 ); 775 p. drawLine ( width() - 2, 2, 1, height() - 5 );
775 p. drawLine ( width() - 2, 3, 1, height() - 4 ); 776 p. drawLine ( width() - 2, 3, 1, height() - 4 );
776 } 777 }
777} 778}
778 779
779 780
780Q_EXPORT_INTERFACE() 781EXPORT_OPIE_APPLET_v1( VolumeApplet )
781{
782 Q_CREATE_INSTANCE( OTaskbarAppletWrapper<VolumeApplet> );
783}
diff --git a/core/applets/volumeapplet/volumeapplet.pro b/core/applets/volumeapplet/volumeapplet.pro
index b14956e..b478ed1 100644
--- a/core/applets/volumeapplet/volumeapplet.pro
+++ b/core/applets/volumeapplet/volumeapplet.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt plugin warn_on release 2 CONFIG += qt plugin warn_on release
3 HEADERS = volume.h oledbox.h 3 HEADERS = volume.h oledbox.h
4 SOURCES = volume.cpp oledbox.cpp 4 SOURCES = volume.cpp oledbox.cpp
5 TARGET = volumeapplet 5 TARGET = volumeapplet
6 DESTDIR = $(OPIEDIR)/plugins/applets 6 DESTDIR = $(OPIEDIR)/plugins/applets
7INCLUDEPATH += $(OPIEDIR)/include 7INCLUDEPATH += $(OPIEDIR)/include
8DEPENDPATH += ../$(OPIEDIR)/include 8DEPENDPATH += ../$(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe -lopiecore2
10 VERSION = 1.0.0 10 VERSION = 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/core/applets/vtapplet/config.in b/core/applets/vtapplet/config.in
index 85692a5..8fe4200 100644
--- a/core/applets/vtapplet/config.in
+++ b/core/applets/vtapplet/config.in
@@ -1,4 +1,4 @@
1 config VTAPPLET 1 config VTAPPLET
2 boolean "VT (switch to another virtual terminal)" 2 boolean "VT (switch to another virtual terminal)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/core/obex/config.in b/core/obex/config.in
index ef09f7a..c0208d1 100644
--- a/core/obex/config.in
+++ b/core/obex/config.in
@@ -1,4 +1,4 @@
1 config OBEX 1 config OBEX
2 boolean "libopieobex0 (library needed for beaming in Opie)" 2 boolean "libopieobex0 (library needed for beaming in Opie)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/obex/obex.cc b/core/obex/obex.cc
index 50e5201..3c99af6 100644
--- a/core/obex/obex.cc
+++ b/core/obex/obex.cc
@@ -1,134 +1,135 @@
1 1
2#include <qfileinfo.h> 2#include <qfileinfo.h>
3 3
4 4
5#include <opie/oprocess.h> 5#include <opie2/oprocess.h>
6#include "obex.h" 6#include "obex.h"
7 7
8using namespace OpieObex; 8using namespace OpieObex;
9 9
10using namespace Opie::Core;
10/* TRANSLATOR OpieObex::Obex */ 11/* TRANSLATOR OpieObex::Obex */
11 12
12Obex::Obex( QObject *parent, const char* name ) 13Obex::Obex( QObject *parent, const char* name )
13 : QObject(parent, name ) 14 : QObject(parent, name )
14{ 15{
15 m_rec = 0; 16 m_rec = 0;
16 m_send=0; 17 m_send=0;
17 m_count = 0; 18 m_count = 0;
18 m_receive = false; 19 m_receive = false;
19 connect( this, SIGNAL(error(int) ), // for recovering to receive 20 connect( this, SIGNAL(error(int) ), // for recovering to receive
20 SLOT(slotError() ) ); 21 SLOT(slotError() ) );
21 connect( this, SIGNAL(sent(bool) ), 22 connect( this, SIGNAL(sent(bool) ),
22 SLOT(slotError() ) ); 23 SLOT(slotError() ) );
23}; 24};
24Obex::~Obex() { 25Obex::~Obex() {
25 delete m_rec; 26 delete m_rec;
26 delete m_send; 27 delete m_send;
27} 28}
28void Obex::receive() { 29void Obex::receive() {
29 m_receive = true; 30 m_receive = true;
30 m_outp = QString::null; 31 m_outp = QString::null;
31 qWarning("Receive" ); 32 qWarning("Receive" );
32 m_rec = new OProcess(); 33 m_rec = new OProcess();
33 *m_rec << "irobex_palm3"; 34 *m_rec << "irobex_palm3";
34 // connect to the necessary slots 35 // connect to the necessary slots
35 connect(m_rec, SIGNAL(processExited(OProcess*) ), 36 connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ),
36 this, SLOT(slotExited(OProcess*) ) ); 37 this, SLOT(slotExited(Opie::Core::OProcess*) ) );
37 38
38 connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ), 39 connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
39 this, SLOT(slotStdOut(OProcess*, char*, int) ) ); 40 this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
40 41
41 if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 42 if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
42 qWarning("could not start :("); 43 qWarning("could not start :(");
43 emit done( false ); 44 emit done( false );
44 delete m_rec; 45 delete m_rec;
45 m_rec = 0; 46 m_rec = 0;
46 } 47 }
47// emit currentTry(m_count ); 48// emit currentTry(m_count );
48 49
49} 50}
50void Obex::send( const QString& fileName) { // if currently receiving stop it send receive 51void Obex::send( const QString& fileName) { // if currently receiving stop it send receive
51 m_count = 0; 52 m_count = 0;
52 m_file = fileName; 53 m_file = fileName;
53 qWarning("send %s", fileName.latin1() ); 54 qWarning("send %s", fileName.latin1() );
54 if (m_rec != 0 ) { 55 if (m_rec != 0 ) {
55 qWarning("running"); 56 qWarning("running");
56 if (m_rec->isRunning() ) { 57 if (m_rec->isRunning() ) {
57 emit error(-1 ); 58 emit error(-1 );
58 qWarning("is running"); 59 qWarning("is running");
59 delete m_rec; 60 delete m_rec;
60 m_rec = 0; 61 m_rec = 0;
61 62
62 }else{ 63 }else{
63 qWarning("is not running"); 64 qWarning("is not running");
64 emit error( -1 ); // we did not delete yet but it's not running slotExited is pending 65 emit error( -1 ); // we did not delete yet but it's not running slotExited is pending
65 return; 66 return;
66 } 67 }
67 } 68 }
68 sendNow(); 69 sendNow();
69} 70}
70void Obex::sendNow(){ 71void Obex::sendNow(){
71 qWarning("sendNow"); 72 qWarning("sendNow");
72 if ( m_count >= 25 ) { // could not send 73 if ( m_count >= 25 ) { // could not send
73 emit error(-1 ); 74 emit error(-1 );
74 emit sent(false); 75 emit sent(false);
75 return; 76 return;
76 } 77 }
77 // OProcess inititialisation 78 // OProcess inititialisation
78 m_send = new OProcess(); 79 m_send = new OProcess();
79 *m_send << "irobex_palm3"; 80 *m_send << "irobex_palm3";
80 *m_send << QFile::encodeName(m_file); 81 *m_send << QFile::encodeName(m_file);
81 82
82 // connect to slots Exited and and StdOut 83 // connect to slots Exited and and StdOut
83 connect(m_send, SIGNAL(processExited(OProcess*) ), 84 connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ),
84 this, SLOT(slotExited(OProcess*)) ); 85 this, SLOT(slotExited(Opie::Core::OProcess*)) );
85 connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), 86 connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )),
86 this, SLOT(slotStdOut(OProcess*, char*, int) ) ); 87 this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
87 88
88 // now start it 89 // now start it
89 if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { 90 if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) {
90 qWarning("could not send" ); 91 qWarning("could not send" );
91 m_count = 25; 92 m_count = 25;
92 emit error(-1 ); 93 emit error(-1 );
93 delete m_send; 94 delete m_send;
94 m_send=0; 95 m_send=0;
95 } 96 }
96 // end 97 // end
97 m_count++; 98 m_count++;
98 emit currentTry( m_count ); 99 emit currentTry( m_count );
99} 100}
100 101
101void Obex::slotExited(OProcess* proc ){ 102void Obex::slotExited(OProcess* proc ){
102 if (proc == m_rec ) { // receive process 103 if (proc == m_rec ) { // receive process
103 received(); 104 received();
104 }else if ( proc == m_send ) { 105 }else if ( proc == m_send ) {
105 sendEnd(); 106 sendEnd();
106 } 107 }
107} 108}
108void Obex::slotStdOut(OProcess* proc, char* buf, int len){ 109void Obex::slotStdOut(OProcess* proc, char* buf, int len){
109 if ( proc == m_rec ) { // only receive 110 if ( proc == m_rec ) { // only receive
110 QByteArray ar( len ); 111 QByteArray ar( len );
111 memcpy( ar.data(), buf, len ); 112 memcpy( ar.data(), buf, len );
112 qWarning("parsed: %s", ar.data() ); 113 qWarning("parsed: %s", ar.data() );
113 m_outp.append( ar ); 114 m_outp.append( ar );
114 } 115 }
115} 116}
116 117
117void Obex::received() { 118void Obex::received() {
118 if (m_rec->normalExit() ) { 119 if (m_rec->normalExit() ) {
119 if ( m_rec->exitStatus() == 0 ) { // we got one 120 if ( m_rec->exitStatus() == 0 ) { // we got one
120 QString filename = parseOut(); 121 QString filename = parseOut();
121 qWarning("ACHTUNG %s", filename.latin1() ); 122 qWarning("ACHTUNG %s", filename.latin1() );
122 emit receivedFile( filename ); 123 emit receivedFile( filename );
123 } 124 }
124 }else{ 125 }else{
125 emit done(false); 126 emit done(false);
126 }; 127 };
127 delete m_rec; 128 delete m_rec;
128 m_rec = 0; 129 m_rec = 0;
129 receive(); 130 receive();
130} 131}
131 132
132void Obex::sendEnd() { 133void Obex::sendEnd() {
133 if (m_send->normalExit() ) { 134 if (m_send->normalExit() ) {
134 if ( m_send->exitStatus() == 0 ) { 135 if ( m_send->exitStatus() == 0 ) {
diff --git a/core/obex/obex.h b/core/obex/obex.h
index 60f5d28..284cb12 100644
--- a/core/obex/obex.h
+++ b/core/obex/obex.h
@@ -1,84 +1,84 @@
1 1
2 2
3#ifndef OpieObex_H 3#ifndef OpieObex_H
4#define OpieObex_H 4#define OpieObex_H
5 5
6#include <qobject.h> 6#include <qobject.h>
7 7
8class OProcess; 8namespace Opie {namespace Core {class OProcess;}}
9class QCopChannel; 9class QCopChannel;
10namespace OpieObex { 10namespace OpieObex {
11 class Obex : public QObject { 11 class Obex : public QObject {
12 Q_OBJECT 12 Q_OBJECT
13 public: 13 public:
14 /** 14 /**
15 * Obex c'tor look 15 * Obex c'tor look
16 */ 16 */
17 Obex( QObject *parent, const char* name); 17 Obex( QObject *parent, const char* name);
18 /** 18 /**
19 * d'tor 19 * d'tor
20 */ 20 */
21 ~Obex(); 21 ~Obex();
22 22
23 /** 23 /**
24 * Starting listening to irda after enabled by the applet 24 * Starting listening to irda after enabled by the applet
25 * a signal gets emitted when recieved a file 25 * a signal gets emitted when recieved a file
26 */ 26 */
27 void receive(); 27 void receive();
28 void send( const QString& ); 28 void send( const QString& );
29 void setReceiveEnabled( bool = false ); 29 void setReceiveEnabled( bool = false );
30 signals: 30 signals:
31 31
32 /** 32 /**
33 * a signal 33 * a signal
34 * @param path The path to the recieved file 34 * @param path The path to the recieved file
35 */ 35 */
36 void receivedFile( const QString& path); 36 void receivedFile( const QString& path);
37 /** 37 /**
38 * error signal if the program couldn't be started or the 38 * error signal if the program couldn't be started or the
39 * the connection timed out 39 * the connection timed out
40 */ 40 */
41 void error( int ); 41 void error( int );
42 /** 42 /**
43 * The current try to receive data 43 * The current try to receive data
44 */ 44 */
45 void currentTry(unsigned int); 45 void currentTry(unsigned int);
46 /** 46 /**
47 * signal sent The file got beamed to the remote location 47 * signal sent The file got beamed to the remote location
48 */ 48 */
49 void sent(bool); 49 void sent(bool);
50 void done(bool); 50 void done(bool);
51 51
52 private: 52 private:
53 uint m_count; 53 uint m_count;
54 QString m_file; 54 QString m_file;
55 QString m_outp; 55 QString m_outp;
56 OProcess *m_send; 56 Opie::Core::OProcess *m_send;
57 OProcess *m_rec; 57 Opie::Core::OProcess *m_rec;
58 bool m_receive : 1; 58 bool m_receive : 1;
59 void shutDownReceive(); 59 void shutDownReceive();
60 60
61private slots: 61private slots:
62 62
63 /** 63 /**
64 * send over palm obex 64 * send over palm obex
65 */ 65 */
66 66
67 //void send(const QString&); 67 //void send(const QString&);
68 68
69 // the process exited 69 // the process exited
70 void slotExited(OProcess* proc) ; 70 void slotExited(Opie::Core::OProcess* proc) ;
71 void slotStdOut(OProcess*, char*, int); 71 void slotStdOut(Opie::Core::OProcess*, char*, int);
72 void slotError(); 72 void slotError();
73 73
74 private: 74 private:
75 void sendNow(); 75 void sendNow();
76 QString parseOut(); 76 QString parseOut();
77 void received(); 77 void received();
78 void sendEnd(); 78 void sendEnd();
79 79
80 }; 80 };
81}; 81};
82 82
83 83
84#endif 84#endif
diff --git a/core/obex/obex.pro b/core/obex/obex.pro
index a296b2c..51fa300 100644
--- a/core/obex/obex.pro
+++ b/core/obex/obex.pro
@@ -1,13 +1,13 @@
1 TEMPLATE= lib 1 TEMPLATE= lib
2 CONFIG += qt warn_on release 2 CONFIG += qt warn_on release
3 HEADERS= obex.h obexhandler.h obexsend.h receiver.h 3 HEADERS= obex.h obexhandler.h obexsend.h receiver.h obeximpl.h
4 SOURCES= obex.cc obexsend.cpp obexhandler.cpp receiver.cpp 4 SOURCES= obex.cc obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp
5 TARGET = opieobex 5 TARGET = opieobex
6 DESTDIR = $(OPIEDIR)/plugins/obex 6 DESTDIR = $(OPIEDIR)/plugins/obex
7INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/core/launcher 7INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/core/launcher
8DEPENDPATH += ../$(OPIEDIR)/include 8DEPENDPATH += ../$(OPIEDIR)/include
9LIBS += -lqpe -lopiecore2 9LIBS += -lqpe -lopiecore2
10 VERSION = 0.0.2 10 VERSION = 0.0.2
11 11
12include ( $(OPIEDIR)/include.pro ) 12include ( $(OPIEDIR)/include.pro )
13target.path = $$prefix/plugins/applets 13target.path = $$prefix/plugins/applets
diff --git a/core/obex/obeximpl.cpp b/core/obex/obeximpl.cpp
index 5b53644..ca6ce7b 100644
--- a/core/obex/obeximpl.cpp
+++ b/core/obex/obeximpl.cpp
@@ -1,32 +1,34 @@
1#include "obexhandler.h" 1#include "obexhandler.h"
2#include "obeximpl.h" 2#include "obeximpl.h"
3 3
4
5
4using namespace OpieObex; 6using namespace OpieObex;
5 7
6/* TRANSLATOR OpieObex::ObexImpl */ 8/* TRANSLATOR OpieObex::ObexImpl */
7 9
8ObexImpl::ObexImpl() { 10ObexImpl::ObexImpl() {
9 m_handler = new ObexHandler; 11 m_handler = new ObexHandler;
10} 12}
11ObexImpl::~ObexImpl() { 13ObexImpl::~ObexImpl() {
12 delete m_handler; 14 delete m_handler;
13} 15}
14QRESULT ObexImpl::queryInterface( const QUuid& uuid, QUnknownInterface **iface ) { 16QRESULT ObexImpl::queryInterface( const QUuid& uuid, QUnknownInterface **iface ) {
15 *iface = 0; 17 *iface = 0;
16 if ( uuid == IID_QUnknown ) { 18 if ( uuid == IID_QUnknown ) {
17 *iface = this; 19 *iface = this;
18 }else if ( uuid == IID_ObexInterface ) 20 }else if ( uuid == IID_ObexInterface )
19 *iface = this; 21 *iface = this;
20 else 22 else
21 return QS_FALSE; 23 return QS_FALSE;
22 24
23 if (*iface) 25 if (*iface)
24 (*iface)->addRef(); 26 (*iface)->addRef();
25 27
26 return QS_OK; 28 return QS_OK;
27} 29}
28 30
29 31
30Q_EXPORT_INTERFACE() { 32Q_EXPORT_INTERFACE() {
31 Q_CREATE_INSTANCE( ObexImpl ) 33 Q_CREATE_INSTANCE( ObexImpl )
32} 34}