author | chicken <chicken> | 2004-03-01 16:23:00 (UTC) |
---|---|---|
committer | chicken <chicken> | 2004-03-01 16:23:00 (UTC) |
commit | 032f2d909293fb29e6c7e3cf9cce1a12484c80f7 (patch) (unidiff) | |
tree | 368c696aff4d167727aaa564176b6ab1eb0df5cd | |
parent | 9bc70bb8a0bdd3a7bc0013f2cacce7c039b88b38 (diff) | |
download | opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.zip opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.tar.gz opie-032f2d909293fb29e6c7e3cf9cce1a12484c80f7.tar.bz2 |
fix includes
-rw-r--r-- | core/applets/rotateapplet/rotate.cpp | 4 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 1 | ||||
-rw-r--r-- | core/applets/screenshotapplet/inputDialog.cpp | 3 | ||||
-rw-r--r-- | core/applets/screenshotapplet/screenshot.cpp | 1 | ||||
-rw-r--r-- | core/applets/suspendapplet/suspend.cpp | 2 | ||||
-rw-r--r-- | core/applets/volumeapplet/oledbox.cpp | 1 | ||||
-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 4 | ||||
-rw-r--r-- | core/applets/volumeapplet/volumeappletimpl.cpp | 2 | ||||
-rw-r--r-- | core/applets/vtapplet/vt.cpp | 3 | ||||
-rw-r--r-- | core/apps/calibrate/main.cpp | 1 | ||||
-rw-r--r-- | core/obex/obex.cc | 4 | ||||
-rw-r--r-- | core/obex/obexhandler.cpp | 1 | ||||
-rw-r--r-- | core/obex/obexsend.cpp | 4 | ||||
-rw-r--r-- | core/obex/receiver.cpp | 4 |
14 files changed, 0 insertions, 35 deletions
diff --git a/core/applets/rotateapplet/rotate.cpp b/core/applets/rotateapplet/rotate.cpp index cf3f28b..dcbf809 100644 --- a/core/applets/rotateapplet/rotate.cpp +++ b/core/applets/rotateapplet/rotate.cpp | |||
@@ -1,141 +1,137 @@ | |||
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 <opie/odevice.h> |
35 | #include <qpe/applnk.h> | ||
36 | #include <qpe/config.h> | 35 | #include <qpe/config.h> |
37 | #include <qpe/power.h> | 36 | #include <qpe/power.h> |
38 | #include <qpe/qpeapplication.h> | ||
39 | #include <qpe/qcopenvelope_qws.h> | 37 | #include <qpe/qcopenvelope_qws.h> |
40 | #include <qpe/resource.h> | 38 | #include <qpe/resource.h> |
41 | using namespace Opie; | 39 | using namespace Opie; |
42 | 40 | ||
43 | /* QT */ | 41 | /* QT */ |
44 | #include <qiconset.h> | ||
45 | #include <qpopupmenu.h> | ||
46 | 42 | ||
47 | #include <time.h> | 43 | #include <time.h> |
48 | 44 | ||
49 | RotateApplet::RotateApplet() | 45 | RotateApplet::RotateApplet() |
50 | :QObject( 0, "RotateApplet" ), m_flipped( false ) | 46 | :QObject( 0, "RotateApplet" ), m_flipped( false ) |
51 | { | 47 | { |
52 | 48 | ||
53 | #if !defined(QT_NO_COP) | 49 | #if !defined(QT_NO_COP) |
54 | QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); | 50 | QCopChannel *rotateChannel = new QCopChannel( "QPE/Rotation" , this ); |
55 | connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ), | 51 | connect ( rotateChannel, SIGNAL( received( const QCString &, const QByteArray &) ), |
56 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); | 52 | this, SLOT ( channelReceived( const QCString &, const QByteArray &) ) ); |
57 | #endif | 53 | #endif |
58 | 54 | ||
59 | } | 55 | } |
60 | 56 | ||
61 | RotateApplet::~RotateApplet ( ) | 57 | RotateApplet::~RotateApplet ( ) |
62 | {} | 58 | {} |
63 | 59 | ||
64 | /** | 60 | /** |
65 | * Qcop receive method. | 61 | * Qcop receive method. |
66 | */ | 62 | */ |
67 | void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) | 63 | void RotateApplet::channelReceived( const QCString &msg, const QByteArray & data ) |
68 | { | 64 | { |
69 | qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg ); | 65 | qDebug( "RotateApplet::channelReceived( '%s' )", (const char*) msg ); |
70 | 66 | ||
71 | if ( ODevice::inst()->hasHingeSensor() ) | 67 | if ( ODevice::inst()->hasHingeSensor() ) |
72 | { | 68 | { |
73 | struct timespec interval; | 69 | struct timespec interval; |
74 | struct timespec remain; | 70 | struct timespec remain; |
75 | interval.tv_sec = 0; | 71 | interval.tv_sec = 0; |
76 | interval.tv_nsec = 600000; | 72 | interval.tv_nsec = 600000; |
77 | ::nanosleep( &interval, &remain ); | 73 | ::nanosleep( &interval, &remain ); |
78 | OHingeStatus status = ODevice::inst()->readHingeSensor(); | 74 | OHingeStatus status = ODevice::inst()->readHingeSensor(); |
79 | qDebug( "RotateApplet::readHingeSensor = %d", (int) status ); | 75 | qDebug( "RotateApplet::readHingeSensor = %d", (int) status ); |
80 | 76 | ||
81 | Config cfg( "apm" ); | 77 | Config cfg( "apm" ); |
82 | cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); | 78 | cfg.setGroup( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ? "AC" : "Battery" ); |
83 | int action = cfg.readNumEntry( "CloseHingeAction", 0 ); | 79 | int action = cfg.readNumEntry( "CloseHingeAction", 0 ); |
84 | 80 | ||
85 | if ( status == CASE_CLOSED ) | 81 | if ( status == CASE_CLOSED ) |
86 | { | 82 | { |
87 | switch ( action ) | 83 | switch ( action ) |
88 | { | 84 | { |
89 | case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break; | 85 | case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 0 ); break; |
90 | case 2: /* SUSPEND */ ODevice::inst()->suspend(); break; | 86 | case 2: /* SUSPEND */ ODevice::inst()->suspend(); break; |
91 | default: /* IGNORE */ break; | 87 | default: /* IGNORE */ break; |
92 | } | 88 | } |
93 | } | 89 | } |
94 | else /* status != CASE_CLOSED */ | 90 | else /* status != CASE_CLOSED */ |
95 | { | 91 | { |
96 | switch ( action ) | 92 | switch ( action ) |
97 | { | 93 | { |
98 | case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break; | 94 | case 1: /* DISPLAY OFF */ ODevice::inst()->setDisplayBrightness( 127 ); break; |
99 | case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break; | 95 | case 2: /* SUSPEND */ /* How to wake up the device from kernel? */; break; |
100 | default: /* IGNORE */ break; | 96 | default: /* IGNORE */ break; |
101 | } | 97 | } |
102 | } | 98 | } |
103 | qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) ); | 99 | qDebug( "RotateApplet::switchAction %d performed.", cfg.readNumEntry( "CloseHingeAction", 0 ) ); |
104 | } | 100 | } |
105 | 101 | ||
106 | QDataStream stream( data, IO_ReadOnly ); | 102 | QDataStream stream( data, IO_ReadOnly ); |
107 | if ( msg == "flip()" ) | 103 | if ( msg == "flip()" ) |
108 | { | 104 | { |
109 | activated ( ); | 105 | activated ( ); |
110 | } | 106 | } |
111 | else if ( msg == "rotateDefault()") | 107 | else if ( msg == "rotateDefault()") |
112 | { | 108 | { |
113 | rotateDefault(); | 109 | rotateDefault(); |
114 | } | 110 | } |
115 | } | 111 | } |
116 | 112 | ||
117 | int RotateApplet::position() const | 113 | int RotateApplet::position() const |
118 | { | 114 | { |
119 | return 3; | 115 | return 3; |
120 | } | 116 | } |
121 | 117 | ||
122 | QString RotateApplet::name() const | 118 | QString RotateApplet::name() const |
123 | { | 119 | { |
124 | return tr( "Rotate shortcut" ); | 120 | return tr( "Rotate shortcut" ); |
125 | } | 121 | } |
126 | 122 | ||
127 | QString RotateApplet::text() const | 123 | QString RotateApplet::text() const |
128 | { | 124 | { |
129 | return tr( "Rotate" ); | 125 | return tr( "Rotate" ); |
130 | } | 126 | } |
131 | 127 | ||
132 | /*QString RotateApplet::tr( const char* s ) const | 128 | /*QString RotateApplet::tr( const char* s ) const |
133 | { | 129 | { |
134 | return qApp->translate( "RotateApplet", s, 0 ); | 130 | return qApp->translate( "RotateApplet", s, 0 ); |
135 | } | 131 | } |
136 | 132 | ||
137 | QString RotateApplet::tr( const char* s, const char* p ) const | 133 | QString RotateApplet::tr( const char* s, const char* p ) const |
138 | { | 134 | { |
139 | return qApp->translate( "RotateApplet", s, p ); | 135 | return qApp->translate( "RotateApplet", s, p ); |
140 | } | 136 | } |
141 | */ | 137 | */ |
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index 2396993..bdccea0 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h | |||
@@ -1,71 +1,70 @@ | |||
1 | /* | 1 | /* |
2 | =. This file is part of the OPIE Project | 2 | =. This file is part of the OPIE Project |
3 | .=l. Copyright (c) 2003 Maximilian Reiss <harlekin@handhelds.org> | 3 | .=l. Copyright (c) 2003 Maximilian Reiss <harlekin@handhelds.org> |
4 | .>+-= | 4 | .>+-= |
5 | _;:, .> :=|. This library is free software; you can | 5 | _;:, .> :=|. This library is free software; you can |
6 | .> <_, > . <= redistribute it and/or modify it under | 6 | .> <_, > . <= redistribute it and/or modify it under |
7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public | 7 | :=1 )Y*s>-.-- : the terms of the GNU Library General Public |
8 | .="- .-=="i, .._ License as published by the Free Software | 8 | .="- .-=="i, .._ License as published by the Free Software |
9 | - . .-<_> .<> Foundation; either version 2 of the License, | 9 | - . .-<_> .<> Foundation; either version 2 of the License, |
10 | ._= =} : or (at your option) any later version. | 10 | ._= =} : or (at your option) any later version. |
11 | .%+i> _;_. | 11 | .%+i> _;_. |
12 | .i_,=:_. -<s. This library is distributed in the hope that | 12 | .i_,=:_. -<s. This library is distributed in the hope that |
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. . .: details. | 18 | ++= -. . .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-= this library; see the file COPYING.LIB. | 22 | -- :-= this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | #ifndef __OPIE_ROTATE_APPLET_H__ | 31 | #ifndef __OPIE_ROTATE_APPLET_H__ |
32 | #define __OPIE_ROTATE_APPLET_H__ | 32 | #define __OPIE_ROTATE_APPLET_H__ |
33 | 33 | ||
34 | #include <qpe/menuappletinterface.h> | 34 | #include <qpe/menuappletinterface.h> |
35 | #include <qobject.h> | 35 | #include <qobject.h> |
36 | 36 | ||
37 | #include <qobject.h> | ||
38 | 37 | ||
39 | class RotateApplet : public QObject, public MenuAppletInterface | 38 | class RotateApplet : public QObject, public MenuAppletInterface |
40 | { | 39 | { |
41 | 40 | ||
42 | Q_OBJECT | 41 | Q_OBJECT |
43 | 42 | ||
44 | public: | 43 | public: |
45 | RotateApplet ( ); | 44 | RotateApplet ( ); |
46 | virtual ~RotateApplet ( ); | 45 | virtual ~RotateApplet ( ); |
47 | 46 | ||
48 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 47 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
49 | Q_REFCOUNT | 48 | Q_REFCOUNT |
50 | 49 | ||
51 | virtual int position() const; | 50 | virtual int position() const; |
52 | 51 | ||
53 | virtual QString name ( ) const; | 52 | virtual QString name ( ) const; |
54 | virtual QIconSet icon ( ) const; | 53 | virtual QIconSet icon ( ) const; |
55 | virtual QString text ( ) const; | 54 | virtual QString text ( ) const; |
56 | /* virtual QString tr( const char* ) const; | 55 | /* virtual QString tr( const char* ) const; |
57 | virtual QString tr( const char*, const char* ) const; | 56 | virtual QString tr( const char*, const char* ) const; |
58 | */ | 57 | */ |
59 | virtual QPopupMenu *popup ( QWidget *parent ) const; | 58 | virtual QPopupMenu *popup ( QWidget *parent ) const; |
60 | virtual void activated ( ); | 59 | virtual void activated ( ); |
61 | virtual void rotateDefault ( ); | 60 | virtual void rotateDefault ( ); |
62 | 61 | ||
63 | private slots: | 62 | private slots: |
64 | void channelReceived( const QCString &msg, const QByteArray & data ); | 63 | void channelReceived( const QCString &msg, const QByteArray & data ); |
65 | 64 | ||
66 | private: | 65 | private: |
67 | bool m_flipped : 1; | 66 | bool m_flipped : 1; |
68 | 67 | ||
69 | }; | 68 | }; |
70 | 69 | ||
71 | #endif | 70 | #endif |
diff --git a/core/applets/screenshotapplet/inputDialog.cpp b/core/applets/screenshotapplet/inputDialog.cpp index f506dfd..73ec773 100644 --- a/core/applets/screenshotapplet/inputDialog.cpp +++ b/core/applets/screenshotapplet/inputDialog.cpp | |||
@@ -1,67 +1,64 @@ | |||
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 <qlayout.h> | ||
17 | #include <qvariant.h> | ||
18 | #include <qpushbutton.h> | 16 | #include <qpushbutton.h> |
19 | #include <qwhatsthis.h> | ||
20 | 17 | ||
21 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 18 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
22 | : QDialog( parent, name, modal, fl ) | 19 | : QDialog( parent, name, modal, fl ) |
23 | { | 20 | { |
24 | if ( !name ) | 21 | if ( !name ) |
25 | setName( "InputDialog" ); | 22 | setName( "InputDialog" ); |
26 | resize( 234, 115); | 23 | resize( 234, 115); |
27 | setMaximumSize( QSize( 240, 40)); | 24 | setMaximumSize( QSize( 240, 40)); |
28 | setCaption( tr(name ) ); | 25 | setCaption( tr(name ) ); |
29 | 26 | ||
30 | QPushButton *browserButton; | 27 | QPushButton *browserButton; |
31 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); | 28 | browserButton = new QPushButton( Resource::loadIconSet("fileopen"),"",this,"BrowseButton"); |
32 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); | 29 | browserButton->setGeometry( QRect( 205, 10, 22, 22)); |
33 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); | 30 | connect( browserButton, SIGNAL(released()),this,SLOT(browse())); |
34 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); | 31 | LineEdit1 = new QLineEdit( this, "LineEdit1" ); |
35 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); | 32 | LineEdit1->setGeometry( QRect( 4, 10, 190, 22 ) ); |
36 | } | 33 | } |
37 | 34 | ||
38 | /* | 35 | /* |
39 | * Destroys the object and frees any allocated resources | 36 | * Destroys the object and frees any allocated resources |
40 | */ | 37 | */ |
41 | InputDialog::~InputDialog() | 38 | InputDialog::~InputDialog() |
42 | { | 39 | { |
43 | inputText= LineEdit1->text(); | 40 | inputText= LineEdit1->text(); |
44 | 41 | ||
45 | } | 42 | } |
46 | 43 | ||
47 | void InputDialog::browse() { | 44 | void InputDialog::browse() { |
48 | 45 | ||
49 | MimeTypes types; | 46 | MimeTypes types; |
50 | QStringList audio, video, all; | 47 | QStringList audio, video, all; |
51 | audio << "audio/*"; | 48 | audio << "audio/*"; |
52 | audio << "playlist/plain"; | 49 | audio << "playlist/plain"; |
53 | audio << "audio/x-mpegurl"; | 50 | audio << "audio/x-mpegurl"; |
54 | 51 | ||
55 | video << "video/*"; | 52 | video << "video/*"; |
56 | video << "playlist/plain"; | 53 | video << "playlist/plain"; |
57 | 54 | ||
58 | all += audio; | 55 | all += audio; |
59 | all += video; | 56 | all += video; |
60 | types.insert("All Media Files", all ); | 57 | types.insert("All Media Files", all ); |
61 | types.insert("Audio", audio ); | 58 | types.insert("Audio", audio ); |
62 | types.insert("Video", video ); | 59 | types.insert("Video", video ); |
63 | 60 | ||
64 | QString str = Opie::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); | 61 | QString str = Opie::OFileDialog::getOpenFileName( 1,"/","", types, 0 ); |
65 | LineEdit1->setText(str); | 62 | LineEdit1->setText(str); |
66 | } | 63 | } |
67 | 64 | ||
diff --git a/core/applets/screenshotapplet/screenshot.cpp b/core/applets/screenshotapplet/screenshot.cpp index 5f83539..56a031c 100644 --- a/core/applets/screenshotapplet/screenshot.cpp +++ b/core/applets/screenshotapplet/screenshot.cpp | |||
@@ -1,132 +1,131 @@ | |||
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 | #include <stdlib.h> | 18 | #include <stdlib.h> |
19 | #include <sys/socket.h> | 19 | #include <sys/socket.h> |
20 | #include <netinet/in.h> | 20 | #include <netinet/in.h> |
21 | #include <netdb.h> | 21 | #include <netdb.h> |
22 | #include <unistd.h> | 22 | #include <unistd.h> |
23 | 23 | ||
24 | #include <qpe/qpeapplication.h> | 24 | #include <qpe/qpeapplication.h> |
25 | #include <qpe/applnk.h> | 25 | #include <qpe/applnk.h> |
26 | 26 | ||
27 | #include <qlineedit.h> | 27 | #include <qlineedit.h> |
28 | #include <qdir.h> | 28 | #include <qdir.h> |
29 | #include <qlabel.h> | 29 | #include <qlabel.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qpainter.h> | 31 | #include <qpainter.h> |
32 | #include <qspinbox.h> | 32 | #include <qspinbox.h> |
33 | #include <qlayout.h> | 33 | #include <qlayout.h> |
34 | #include <qcheckbox.h> | 34 | #include <qcheckbox.h> |
35 | #include <qmessagebox.h> | 35 | #include <qmessagebox.h> |
36 | #include <qimage.h> | ||
37 | 36 | ||
38 | 37 | ||
39 | /* XPM */ | 38 | /* XPM */ |
40 | static char * snapshot_xpm[] = { | 39 | static char * snapshot_xpm[] = { |
41 | "32 32 177 2", | 40 | "32 32 177 2", |
42 | " c None", | 41 | " c None", |
43 | ". c #042045", | 42 | ". c #042045", |
44 | "+ c #0D2B47", | 43 | "+ c #0D2B47", |
45 | "@ c #0E325E", | 44 | "@ c #0E325E", |
46 | "# c #0D2E50", | 45 | "# c #0D2E50", |
47 | "$ c #0A1C32", | 46 | "$ c #0A1C32", |
48 | "% c #0F3A69", | 47 | "% c #0F3A69", |
49 | "& c #164680", | 48 | "& c #164680", |
50 | "* c #165EAE", | 49 | "* c #165EAE", |
51 | "= c #134D89", | 50 | "= c #134D89", |
52 | "- c #0A3A6E", | 51 | "- c #0A3A6E", |
53 | "; c #031024", | 52 | "; c #031024", |
54 | "> c #031B36", | 53 | "> c #031B36", |
55 | ", c #1A5EA3", | 54 | ", c #1A5EA3", |
56 | "' c #1862B1", | 55 | "' c #1862B1", |
57 | ") c #1866B9", | 56 | ") c #1866B9", |
58 | "! c #0F5AAC", | 57 | "! c #0F5AAC", |
59 | "~ c #0F56A8", | 58 | "~ c #0F56A8", |
60 | "{ c #0C4C96", | 59 | "{ c #0C4C96", |
61 | "] c #030918", | 60 | "] c #030918", |
62 | "^ c #060206", | 61 | "^ c #060206", |
63 | "/ c #20242C", | 62 | "/ c #20242C", |
64 | "( c #3E3B3B", | 63 | "( c #3E3B3B", |
65 | "_ c #186ABD", | 64 | "_ c #186ABD", |
66 | ": c #115EB3", | 65 | ": c #115EB3", |
67 | "< c #082644", | 66 | "< c #082644", |
68 | "[ c #222C38", | 67 | "[ c #222C38", |
69 | "} c #5A5859", | 68 | "} c #5A5859", |
70 | "| c #091921", | 69 | "| c #091921", |
71 | "1 c #1E7EDE", | 70 | "1 c #1E7EDE", |
72 | "2 c #1A7ADA", | 71 | "2 c #1A7ADA", |
73 | "3 c #1970CD", | 72 | "3 c #1970CD", |
74 | "4 c #1758A1", | 73 | "4 c #1758A1", |
75 | "5 c #0E529A", | 74 | "5 c #0E529A", |
76 | "6 c #094388", | 75 | "6 c #094388", |
77 | "7 c #22364E", | 76 | "7 c #22364E", |
78 | "8 c #384454", | 77 | "8 c #384454", |
79 | "9 c #04162C", | 78 | "9 c #04162C", |
80 | "0 c #123451", | 79 | "0 c #123451", |
81 | "a c #3296B4", | 80 | "a c #3296B4", |
82 | "b c #298AB1", | 81 | "b c #298AB1", |
83 | "c c #2484AC", | 82 | "c c #2484AC", |
84 | "d c #033D86", | 83 | "d c #033D86", |
85 | "e c #033677", | 84 | "e c #033677", |
86 | "f c #072C58", | 85 | "f c #072C58", |
87 | "g c #525862", | 86 | "g c #525862", |
88 | "h c #5E5E5E", | 87 | "h c #5E5E5E", |
89 | "i c #23492A", | 88 | "i c #23492A", |
90 | "j c #4FBD3F", | 89 | "j c #4FBD3F", |
91 | "k c #50B24C", | 90 | "k c #50B24C", |
92 | "l c #51C72E", | 91 | "l c #51C72E", |
93 | "m c #42C64A", | 92 | "m c #42C64A", |
94 | "n c #2686CA", | 93 | "n c #2686CA", |
95 | "o c #0B52A4", | 94 | "o c #0B52A4", |
96 | "p c #054A9A", | 95 | "p c #054A9A", |
97 | "q c #053B7C", | 96 | "q c #053B7C", |
98 | "r c #2B2325", | 97 | "r c #2B2325", |
99 | "s c #6E7070", | 98 | "s c #6E7070", |
100 | "t c #0D240E", | 99 | "t c #0D240E", |
101 | "u c #1E423E", | 100 | "u c #1E423E", |
102 | "v c #468ABE", | 101 | "v c #468ABE", |
103 | "w c #6A8AC2", | 102 | "w c #6A8AC2", |
104 | "x c #7EAA8E", | 103 | "x c #7EAA8E", |
105 | "y c #84BE4E", | 104 | "y c #84BE4E", |
106 | "z c #65C639", | 105 | "z c #65C639", |
107 | "A c #064EA0", | 106 | "A c #064EA0", |
108 | "B c #0A4DA0", | 107 | "B c #0A4DA0", |
109 | "C c #4E5242", | 108 | "C c #4E5242", |
110 | "D c #62362E", | 109 | "D c #62362E", |
111 | "E c #721A1A", | 110 | "E c #721A1A", |
112 | "F c #6E0A0A", | 111 | "F c #6E0A0A", |
113 | "G c #3E0E0E", | 112 | "G c #3E0E0E", |
114 | "H c #6AB85E", | 113 | "H c #6AB85E", |
115 | "I c #7E8ECA", | 114 | "I c #7E8ECA", |
116 | "J c #929CD4", | 115 | "J c #929CD4", |
117 | "K c #9EAECA", | 116 | "K c #9EAECA", |
118 | "L c #9EBEAE", | 117 | "L c #9EBEAE", |
119 | "M c #8EC26A", | 118 | "M c #8EC26A", |
120 | "N c #32A276", | 119 | "N c #32A276", |
121 | "O c #20518C", | 120 | "O c #20518C", |
122 | "P c #46566E", | 121 | "P c #46566E", |
123 | "Q c #614A51", | 122 | "Q c #614A51", |
124 | "R c #AE2A26", | 123 | "R c #AE2A26", |
125 | "S c #C41C1A", | 124 | "S c #C41C1A", |
126 | "T c #CE0A0A", | 125 | "T c #CE0A0A", |
127 | "U c #A60606", | 126 | "U c #A60606", |
128 | "V c #921616", | 127 | "V c #921616", |
129 | "W c #863735", | 128 | "W c #863735", |
130 | "X c #866A66", | 129 | "X c #866A66", |
131 | "Y c #9E9EA2", | 130 | "Y c #9E9EA2", |
132 | "Z c #1E5212", | 131 | "Z c #1E5212", |
diff --git a/core/applets/suspendapplet/suspend.cpp b/core/applets/suspendapplet/suspend.cpp index e17142b..0eb94cb 100644 --- a/core/applets/suspendapplet/suspend.cpp +++ b/core/applets/suspendapplet/suspend.cpp | |||
@@ -1,87 +1,85 @@ | |||
1 | #include <qpe/resource.h> | 1 | #include <qpe/resource.h> |
2 | #include <qpe/qcopenvelope_qws.h> | 2 | #include <qpe/qcopenvelope_qws.h> |
3 | 3 | ||
4 | #include <qapplication.h> | 4 | #include <qapplication.h> |
5 | #include <qiconset.h> | ||
6 | #include <qpopupmenu.h> | ||
7 | 5 | ||
8 | #include "suspend.h" | 6 | #include "suspend.h" |
9 | 7 | ||
10 | 8 | ||
11 | SuspendApplet::SuspendApplet ( ) | 9 | SuspendApplet::SuspendApplet ( ) |
12 | : QObject ( 0, "SuspendApplet" ) | 10 | : QObject ( 0, "SuspendApplet" ) |
13 | { | 11 | { |
14 | } | 12 | } |
15 | 13 | ||
16 | SuspendApplet::~SuspendApplet ( ) | 14 | SuspendApplet::~SuspendApplet ( ) |
17 | { | 15 | { |
18 | } | 16 | } |
19 | 17 | ||
20 | int SuspendApplet::position ( ) const | 18 | int SuspendApplet::position ( ) const |
21 | { | 19 | { |
22 | return 2; | 20 | return 2; |
23 | } | 21 | } |
24 | 22 | ||
25 | QString SuspendApplet::name ( ) const | 23 | QString SuspendApplet::name ( ) const |
26 | { | 24 | { |
27 | return tr( "Suspend shortcut" ); | 25 | return tr( "Suspend shortcut" ); |
28 | } | 26 | } |
29 | 27 | ||
30 | QString SuspendApplet::text ( ) const | 28 | QString SuspendApplet::text ( ) const |
31 | { | 29 | { |
32 | return tr( "Suspend" ); | 30 | return tr( "Suspend" ); |
33 | } | 31 | } |
34 | 32 | ||
35 | QString SuspendApplet::tr( const char* s ) const | 33 | QString SuspendApplet::tr( const char* s ) const |
36 | { | 34 | { |
37 | return qApp->translate( "SuspendApplet", s, 0 ); | 35 | return qApp->translate( "SuspendApplet", s, 0 ); |
38 | } | 36 | } |
39 | 37 | ||
40 | QString SuspendApplet::tr( const char* s, const char* p ) const | 38 | QString SuspendApplet::tr( const char* s, const char* p ) const |
41 | { | 39 | { |
42 | return qApp->translate( "SuspendApplet", s, p ); | 40 | return qApp->translate( "SuspendApplet", s, p ); |
43 | } | 41 | } |
44 | 42 | ||
45 | QIconSet SuspendApplet::icon ( ) const | 43 | QIconSet SuspendApplet::icon ( ) const |
46 | { | 44 | { |
47 | QPixmap pix; | 45 | QPixmap pix; |
48 | QImage img = Resource::loadImage ( "suspend" ); | 46 | QImage img = Resource::loadImage ( "suspend" ); |
49 | 47 | ||
50 | if ( !img. isNull ( )) | 48 | if ( !img. isNull ( )) |
51 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); | 49 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); |
52 | return pix; | 50 | return pix; |
53 | } | 51 | } |
54 | 52 | ||
55 | QPopupMenu *SuspendApplet::popup ( QWidget * ) const | 53 | QPopupMenu *SuspendApplet::popup ( QWidget * ) const |
56 | { | 54 | { |
57 | return 0; | 55 | return 0; |
58 | } | 56 | } |
59 | 57 | ||
60 | void SuspendApplet::activated ( ) | 58 | void SuspendApplet::activated ( ) |
61 | { | 59 | { |
62 | // suspend | 60 | // suspend |
63 | QCopEnvelope ( "QPE/System", "suspend()" ); | 61 | QCopEnvelope ( "QPE/System", "suspend()" ); |
64 | } | 62 | } |
65 | 63 | ||
66 | 64 | ||
67 | QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) | 65 | QRESULT SuspendApplet::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) |
68 | { | 66 | { |
69 | *iface = 0; | 67 | *iface = 0; |
70 | if ( uuid == IID_QUnknown ) | 68 | if ( uuid == IID_QUnknown ) |
71 | *iface = this; | 69 | *iface = this; |
72 | else if ( uuid == IID_MenuApplet ) | 70 | else if ( uuid == IID_MenuApplet ) |
73 | *iface = this; | 71 | *iface = this; |
74 | else | 72 | else |
75 | return QS_FALSE; | 73 | return QS_FALSE; |
76 | 74 | ||
77 | if ( *iface ) | 75 | if ( *iface ) |
78 | (*iface)-> addRef ( ); | 76 | (*iface)-> addRef ( ); |
79 | return QS_OK; | 77 | return QS_OK; |
80 | } | 78 | } |
81 | 79 | ||
82 | Q_EXPORT_INTERFACE( ) | 80 | Q_EXPORT_INTERFACE( ) |
83 | { | 81 | { |
84 | Q_CREATE_INSTANCE( SuspendApplet ) | 82 | Q_CREATE_INSTANCE( SuspendApplet ) |
85 | } | 83 | } |
86 | 84 | ||
87 | 85 | ||
diff --git a/core/applets/volumeapplet/oledbox.cpp b/core/applets/volumeapplet/oledbox.cpp index 7547287..bf275a9 100644 --- a/core/applets/volumeapplet/oledbox.cpp +++ b/core/applets/volumeapplet/oledbox.cpp | |||
@@ -1,98 +1,97 @@ | |||
1 | 1 | ||
2 | #include <qpixmap.h> | ||
3 | #include <qbitmap.h> | 2 | #include <qbitmap.h> |
4 | #include <qpainter.h> | 3 | #include <qpainter.h> |
5 | 4 | ||
6 | #include "oledbox.h" | 5 | #include "oledbox.h" |
7 | 6 | ||
8 | 7 | ||
9 | #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC | 8 | #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC |
10 | 9 | ||
11 | /* XPM */ | 10 | /* XPM */ |
12 | static const char * ledborder_xpm[] = { | 11 | static const char * ledborder_xpm[] = { |
13 | "16 16 11 1", | 12 | "16 16 11 1", |
14 | " c None", | 13 | " c None", |
15 | ".c #626562", | 14 | ".c #626562", |
16 | "+c #7B7D7B", | 15 | "+c #7B7D7B", |
17 | "@c #949594", | 16 | "@c #949594", |
18 | "#c #ACAEAC", | 17 | "#c #ACAEAC", |
19 | "$c #CDCACD", | 18 | "$c #CDCACD", |
20 | "%c #CDCECD", | 19 | "%c #CDCECD", |
21 | ";c #E6E6E6", | 20 | ";c #E6E6E6", |
22 | ">c #FFFFFF", | 21 | ">c #FFFFFF", |
23 | ",c #E6E2E6", | 22 | ",c #E6E2E6", |
24 | "'c #FFFAFF", | 23 | "'c #FFFAFF", |
25 | " .++@@# ", | 24 | " .++@@# ", |
26 | " ...++@@##$ ", | 25 | " ...++@@##$ ", |
27 | " .....+@##$$% ", | 26 | " .....+@##$$% ", |
28 | " ..... #$%%% ", | 27 | " ..... #$%%% ", |
29 | " ... %%; ", | 28 | " ... %%; ", |
30 | ".... ;;;;", | 29 | ".... ;;;;", |
31 | "++. ;>>", | 30 | "++. ;>>", |
32 | "+++ >>>", | 31 | "+++ >>>", |
33 | "@@@ >>>", | 32 | "@@@ >>>", |
34 | "@@# >>>", | 33 | "@@# >>>", |
35 | "#### >>>>", | 34 | "#### >>>>", |
36 | " #$$ >>> ", | 35 | " #$$ >>> ", |
37 | " $$,,' >>>>> ", | 36 | " $$,,' >>>>> ", |
38 | " ,,,''>>>>>>> ", | 37 | " ,,,''>>>>>>> ", |
39 | " ,''>>>>>>> ", | 38 | " ,''>>>>>>> ", |
40 | " '>>>>> "}; | 39 | " '>>>>> "}; |
41 | 40 | ||
42 | 41 | ||
43 | QPixmap *OLedBox::s_border_pix = 0; | 42 | QPixmap *OLedBox::s_border_pix = 0; |
44 | 43 | ||
45 | #endif | 44 | #endif |
46 | 45 | ||
47 | 46 | ||
48 | OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWidget ( parent, name ) | 47 | OLedBox::OLedBox ( const QColor &col, QWidget *parent, const char *name ) : QWidget ( parent, name ) |
49 | { | 48 | { |
50 | m_color = col; | 49 | m_color = col; |
51 | m_on = false; | 50 | m_on = false; |
52 | 51 | ||
53 | m_pix [ 0 ] = m_pix [ 1 ] = false; | 52 | m_pix [ 0 ] = m_pix [ 1 ] = false; |
54 | 53 | ||
55 | setBackgroundMode ( PaletteBackground ); | 54 | setBackgroundMode ( PaletteBackground ); |
56 | 55 | ||
57 | #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC | 56 | #ifdef _QTE_IS_TOO_DUMB_TO_DRAW_AN_ARC |
58 | if ( !s_border_pix ) | 57 | if ( !s_border_pix ) |
59 | s_border_pix = new QPixmap ( ledborder_xpm ); | 58 | s_border_pix = new QPixmap ( ledborder_xpm ); |
60 | #endif | 59 | #endif |
61 | } | 60 | } |
62 | 61 | ||
63 | OLedBox::~OLedBox ( ) | 62 | OLedBox::~OLedBox ( ) |
64 | { | 63 | { |
65 | delete m_pix [ 0 ]; | 64 | delete m_pix [ 0 ]; |
66 | delete m_pix [ 1 ]; | 65 | delete m_pix [ 1 ]; |
67 | } | 66 | } |
68 | 67 | ||
69 | QSize OLedBox::sizeHint ( ) const | 68 | QSize OLedBox::sizeHint ( ) const |
70 | { | 69 | { |
71 | return QSize ( 16, 16 ); | 70 | return QSize ( 16, 16 ); |
72 | } | 71 | } |
73 | 72 | ||
74 | bool OLedBox::isOn ( ) const | 73 | bool OLedBox::isOn ( ) const |
75 | { | 74 | { |
76 | return m_on; | 75 | return m_on; |
77 | } | 76 | } |
78 | 77 | ||
79 | QColor OLedBox::color ( ) const | 78 | QColor OLedBox::color ( ) const |
80 | { | 79 | { |
81 | return m_color; | 80 | return m_color; |
82 | } | 81 | } |
83 | 82 | ||
84 | void OLedBox::setOn ( bool b ) | 83 | void OLedBox::setOn ( bool b ) |
85 | { | 84 | { |
86 | if ( m_on != b ) { | 85 | if ( m_on != b ) { |
87 | m_on = b; | 86 | m_on = b; |
88 | update ( ); | 87 | update ( ); |
89 | } | 88 | } |
90 | } | 89 | } |
91 | 90 | ||
92 | void OLedBox::toggle ( ) | 91 | void OLedBox::toggle ( ) |
93 | { | 92 | { |
94 | setOn ( !isOn ( ) ); | 93 | setOn ( !isOn ( ) ); |
95 | } | 94 | } |
96 | 95 | ||
97 | void OLedBox::setColor ( const QColor &col ) | 96 | void OLedBox::setColor ( const QColor &col ) |
98 | { | 97 | { |
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index 38f827e..c736437 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp | |||
@@ -1,138 +1,134 @@ | |||
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 <stdio.h> | 21 | #include <stdio.h> |
22 | 22 | ||
23 | #include "volume.h" | 23 | #include "volume.h" |
24 | 24 | ||
25 | #include <qpe/resource.h> | 25 | #include <qpe/resource.h> |
26 | #include <qpe/qpeapplication.h> | ||
27 | #include <qpe/applnk.h> | 26 | #include <qpe/applnk.h> |
28 | #include <qpe/config.h> | 27 | #include <qpe/config.h> |
29 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) | 28 | #if ( defined Q_WS_QWS || defined(_WS_QWS_) ) && !defined(QT_NO_COP) |
30 | #include <qpe/qcopenvelope_qws.h> | 29 | #include <qpe/qcopenvelope_qws.h> |
31 | #endif | 30 | #endif |
32 | 31 | ||
33 | #include <qpainter.h> | 32 | #include <qpainter.h> |
34 | #include <qcheckbox.h> | 33 | #include <qcheckbox.h> |
35 | #include <qslider.h> | 34 | #include <qslider.h> |
36 | #include <qlayout.h> | 35 | #include <qlayout.h> |
37 | #include <qframe.h> | ||
38 | #include <qpixmap.h> | ||
39 | #include <qvbox.h> | 36 | #include <qvbox.h> |
40 | #include <qlabel.h> | 37 | #include <qlabel.h> |
41 | 38 | ||
42 | #include <qtoolbutton.h> | ||
43 | #include <qpushbutton.h> | 39 | #include <qpushbutton.h> |
44 | #include <qtimer.h> | 40 | #include <qtimer.h> |
45 | 41 | ||
46 | #include <opie/odevice.h> | 42 | #include <opie/odevice.h> |
47 | 43 | ||
48 | #include "oledbox.h" | 44 | #include "oledbox.h" |
49 | 45 | ||
50 | using namespace Opie; | 46 | using namespace Opie; |
51 | 47 | ||
52 | #define RATE_TIMER_INTERVAL 100 | 48 | #define RATE_TIMER_INTERVAL 100 |
53 | // Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time | 49 | // Ten times per second is fine (RATE_TIMER_INTERVAL 100). A shorter time |
54 | // results in "hanging" buttons on the iPAQ due to quite high CPU consumption. | 50 | // results in "hanging" buttons on the iPAQ due to quite high CPU consumption. |
55 | 51 | ||
56 | 52 | ||
57 | /* XPM */ | 53 | /* XPM */ |
58 | static const char * vol_xpm[] = { | 54 | static const char * vol_xpm[] = { |
59 | "20 20 3 1", | 55 | "20 20 3 1", |
60 | " c None", | 56 | " c None", |
61 | ". c #0000FF", | 57 | ". c #0000FF", |
62 | "+ c #000000", | 58 | "+ c #000000", |
63 | " ", | 59 | " ", |
64 | " . ", | 60 | " . ", |
65 | " . . . . ", | 61 | " . . . . ", |
66 | " . . . . . . ", | 62 | " . . . . . . ", |
67 | " . . . . . . . ", | 63 | " . . . . . . . ", |
68 | " . . ..... . . ", | 64 | " . . ..... . . ", |
69 | " . ... ..... ... ", | 65 | " . ... ..... ... ", |
70 | " ........... .... ", | 66 | " ........... .... ", |
71 | " ................. ", | 67 | " ................. ", |
72 | "++++++++++++++++++++", | 68 | "++++++++++++++++++++", |
73 | " .................. ", | 69 | " .................. ", |
74 | " . ............. . ", | 70 | " . ............. . ", |
75 | " . ..... ....... ", | 71 | " . ..... ....... ", |
76 | " . ... ..... . ", | 72 | " . ... ..... . ", |
77 | " . ... ..... . ", | 73 | " . ... ..... . ", |
78 | " . ... ..... ", | 74 | " . ... ..... ", |
79 | " . . . . . ", | 75 | " . . . . . ", |
80 | " . . . ", | 76 | " . . . ", |
81 | " . . . ", | 77 | " . . . ", |
82 | " "}; | 78 | " "}; |
83 | /* XPM */ | 79 | /* XPM */ |
84 | static const char * mic_xpm[] = { | 80 | static const char * mic_xpm[] = { |
85 | "20 20 21 1", | 81 | "20 20 21 1", |
86 | " c None", | 82 | " c None", |
87 | ". c #000000", | 83 | ". c #000000", |
88 | "+ c #EEEEEE", | 84 | "+ c #EEEEEE", |
89 | "@ c #B4B6B4", | 85 | "@ c #B4B6B4", |
90 | "# c #8B8D8B", | 86 | "# c #8B8D8B", |
91 | "$ c #D5D6D5", | 87 | "$ c #D5D6D5", |
92 | "% c #E6E6E6", | 88 | "% c #E6E6E6", |
93 | "& c #9C9D9C", | 89 | "& c #9C9D9C", |
94 | "* c #6A696A", | 90 | "* c #6A696A", |
95 | "= c #E6E2E6", | 91 | "= c #E6E2E6", |
96 | "- c #F6F2F6", | 92 | "- c #F6F2F6", |
97 | "; c #CDC6CD", | 93 | "; c #CDC6CD", |
98 | "> c #737573", | 94 | "> c #737573", |
99 | ", c #4A484A", | 95 | ", c #4A484A", |
100 | "' c #DEDEDE", | 96 | "' c #DEDEDE", |
101 | ") c #F6EEF6", | 97 | ") c #F6EEF6", |
102 | "! c #414041", | 98 | "! c #414041", |
103 | "~ c #202020", | 99 | "~ c #202020", |
104 | "{ c #ACAEAC", | 100 | "{ c #ACAEAC", |
105 | "] c #838583", | 101 | "] c #838583", |
106 | "^ c #6A656A", | 102 | "^ c #6A656A", |
107 | " ", | 103 | " ", |
108 | " .... ", | 104 | " .... ", |
109 | " .+@+#. ", | 105 | " .+@+#. ", |
110 | " ..$%&%*. ", | 106 | " ..$%&%*. ", |
111 | " .=-.;=>=,. ", | 107 | " .=-.;=>=,. ", |
112 | " .'+).&+!+. ", | 108 | " .'+).&+!+. ", |
113 | " .+;+;.~+~. ", | 109 | " .+;+;.~+~. ", |
114 | " ..%{%,.... ", | 110 | " ..%{%,.... ", |
115 | " ..&=>=~.. ", | 111 | " ..&=>=~.. ", |
116 | " .+..]^,.. ", | 112 | " .+..]^,.. ", |
117 | " .+....... ", | 113 | " .+....... ", |
118 | " .%... ", | 114 | " .%... ", |
119 | " .=... ", | 115 | " .=... ", |
120 | " .+... ", | 116 | " .+... ", |
121 | " .+... ", | 117 | " .+... ", |
122 | " .... ", | 118 | " .... ", |
123 | " .... ", | 119 | " .... ", |
124 | " .. ", | 120 | " .. ", |
125 | " . ", | 121 | " . ", |
126 | ". "}; | 122 | ". "}; |
127 | 123 | ||
128 | 124 | ||
129 | static const char * bass_xpm[] = { | 125 | static const char * bass_xpm[] = { |
130 | "20 20 3 1", | 126 | "20 20 3 1", |
131 | " c None", | 127 | " c None", |
132 | ". c #000000", | 128 | ". c #000000", |
133 | "+ c #0000FF", | 129 | "+ c #0000FF", |
134 | " ", | 130 | " ", |
135 | " ", | 131 | " ", |
136 | " ", | 132 | " ", |
137 | "..... +++ ......", | 133 | "..... +++ ......", |
138 | " +++++++ ", | 134 | " +++++++ ", |
diff --git a/core/applets/volumeapplet/volumeappletimpl.cpp b/core/applets/volumeapplet/volumeappletimpl.cpp index 4cbab31..9c7dea3 100644 --- a/core/applets/volumeapplet/volumeappletimpl.cpp +++ b/core/applets/volumeapplet/volumeappletimpl.cpp | |||
@@ -1,67 +1,65 @@ | |||
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 "volume.h" | 20 | #include "volume.h" |
21 | #include "volumeappletimpl.h" | 21 | #include "volumeappletimpl.h" |
22 | #include <qpe/qcopenvelope_qws.h> | ||
23 | #include <qpe/config.h> | ||
24 | 22 | ||
25 | VolumeAppletImpl::VolumeAppletImpl() | 23 | VolumeAppletImpl::VolumeAppletImpl() |
26 | : volume(0) | 24 | : volume(0) |
27 | { | 25 | { |
28 | } | 26 | } |
29 | 27 | ||
30 | VolumeAppletImpl::~VolumeAppletImpl() | 28 | VolumeAppletImpl::~VolumeAppletImpl() |
31 | { | 29 | { |
32 | delete volume; | 30 | delete volume; |
33 | } | 31 | } |
34 | 32 | ||
35 | QWidget *VolumeAppletImpl::applet( QWidget *parent ) | 33 | QWidget *VolumeAppletImpl::applet( QWidget *parent ) |
36 | { | 34 | { |
37 | if ( !volume ) | 35 | if ( !volume ) |
38 | volume = new VolumeApplet( parent ); | 36 | volume = new VolumeApplet( parent ); |
39 | return volume; | 37 | return volume; |
40 | } | 38 | } |
41 | 39 | ||
42 | int VolumeAppletImpl::position() const | 40 | int VolumeAppletImpl::position() const |
43 | { | 41 | { |
44 | return 6; | 42 | return 6; |
45 | } | 43 | } |
46 | 44 | ||
47 | QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) | 45 | QRESULT VolumeAppletImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface ) |
48 | { | 46 | { |
49 | *iface = 0; | 47 | *iface = 0; |
50 | if ( uuid == IID_QUnknown ) | 48 | if ( uuid == IID_QUnknown ) |
51 | *iface = this; | 49 | *iface = this; |
52 | else if ( uuid == IID_TaskbarApplet ) | 50 | else if ( uuid == IID_TaskbarApplet ) |
53 | *iface = this; | 51 | *iface = this; |
54 | else | 52 | else |
55 | return QS_FALSE; | 53 | return QS_FALSE; |
56 | 54 | ||
57 | if ( *iface ) | 55 | if ( *iface ) |
58 | (*iface)->addRef(); | 56 | (*iface)->addRef(); |
59 | return QS_OK; | 57 | return QS_OK; |
60 | } | 58 | } |
61 | 59 | ||
62 | Q_EXPORT_INTERFACE() | 60 | Q_EXPORT_INTERFACE() |
63 | { | 61 | { |
64 | Q_CREATE_INSTANCE( VolumeAppletImpl ) | 62 | Q_CREATE_INSTANCE( VolumeAppletImpl ) |
65 | } | 63 | } |
66 | 64 | ||
67 | 65 | ||
diff --git a/core/applets/vtapplet/vt.cpp b/core/applets/vtapplet/vt.cpp index 881eb41..bd39093 100644 --- a/core/applets/vtapplet/vt.cpp +++ b/core/applets/vtapplet/vt.cpp | |||
@@ -1,116 +1,113 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. | 2 | ** Copyright (C) 2003 Michael 'Mickey' Lauer. All rights reserved. |
3 | ** | 3 | ** |
4 | ** Contact me @ mickeyl@handhelds.org | 4 | ** Contact me @ mickeyl@handhelds.org |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | **********************************************************************/ | 14 | **********************************************************************/ |
15 | 15 | ||
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/qcopenvelope_qws.h> | ||
18 | 17 | ||
19 | #include <qapplication.h> | ||
20 | #include <qiconset.h> | ||
21 | #include <qpopupmenu.h> | 18 | #include <qpopupmenu.h> |
22 | 19 | ||
23 | #include <fcntl.h> | 20 | #include <fcntl.h> |
24 | #include <unistd.h> | 21 | #include <unistd.h> |
25 | #include <sys/types.h> | 22 | #include <sys/types.h> |
26 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
27 | #include <sys/ioctl.h> | 24 | #include <sys/ioctl.h> |
28 | #include <linux/vt.h> | 25 | #include <linux/vt.h> |
29 | 26 | ||
30 | #include "vt.h" | 27 | #include "vt.h" |
31 | 28 | ||
32 | VTApplet::VTApplet ( ) | 29 | VTApplet::VTApplet ( ) |
33 | : QObject ( 0, "VTApplet" ) | 30 | : QObject ( 0, "VTApplet" ) |
34 | { | 31 | { |
35 | } | 32 | } |
36 | 33 | ||
37 | VTApplet::~VTApplet ( ) | 34 | VTApplet::~VTApplet ( ) |
38 | { | 35 | { |
39 | } | 36 | } |
40 | 37 | ||
41 | int VTApplet::position ( ) const | 38 | int VTApplet::position ( ) const |
42 | { | 39 | { |
43 | return 2; | 40 | return 2; |
44 | } | 41 | } |
45 | 42 | ||
46 | QString VTApplet::name ( ) const | 43 | QString VTApplet::name ( ) const |
47 | { | 44 | { |
48 | return tr( "VT shortcut" ); | 45 | return tr( "VT shortcut" ); |
49 | } | 46 | } |
50 | 47 | ||
51 | QString VTApplet::text ( ) const | 48 | QString VTApplet::text ( ) const |
52 | { | 49 | { |
53 | return tr( "Terminal" ); | 50 | return tr( "Terminal" ); |
54 | } | 51 | } |
55 | 52 | ||
56 | /* | 53 | /* |
57 | QString VTApplet::tr( const char* s ) const | 54 | QString VTApplet::tr( const char* s ) const |
58 | { | 55 | { |
59 | return qApp->translate( "VTApplet", s, 0 ); | 56 | return qApp->translate( "VTApplet", s, 0 ); |
60 | } | 57 | } |
61 | 58 | ||
62 | QString VTApplet::tr( const char* s, const char* p ) const | 59 | QString VTApplet::tr( const char* s, const char* p ) const |
63 | { | 60 | { |
64 | return qApp->translate( "VTApplet", s, p ); | 61 | return qApp->translate( "VTApplet", s, p ); |
65 | } | 62 | } |
66 | */ | 63 | */ |
67 | 64 | ||
68 | QIconSet VTApplet::icon ( ) const | 65 | QIconSet VTApplet::icon ( ) const |
69 | { | 66 | { |
70 | QPixmap pix; | 67 | QPixmap pix; |
71 | QImage img = Resource::loadImage ( "terminal" ); | 68 | QImage img = Resource::loadImage ( "terminal" ); |
72 | 69 | ||
73 | if ( !img. isNull ( )) | 70 | if ( !img. isNull ( )) |
74 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); | 71 | pix. convertFromImage ( img. smoothScale ( 14, 14 )); |
75 | return pix; | 72 | return pix; |
76 | } | 73 | } |
77 | 74 | ||
78 | QPopupMenu *VTApplet::popup ( QWidget* parent ) const | 75 | QPopupMenu *VTApplet::popup ( QWidget* parent ) const |
79 | { | 76 | { |
80 | qDebug( "VTApplet::popup" ); | 77 | qDebug( "VTApplet::popup" ); |
81 | 78 | ||
82 | struct vt_stat vtstat; | 79 | struct vt_stat vtstat; |
83 | int fd = ::open( "/dev/tty0", O_RDWR ); | 80 | int fd = ::open( "/dev/tty0", O_RDWR ); |
84 | if ( fd == -1 ) return 0; | 81 | if ( fd == -1 ) return 0; |
85 | if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0; | 82 | if ( ioctl( fd, VT_GETSTATE, &vtstat ) == -1 ) return 0; |
86 | 83 | ||
87 | m_subMenu = new QPopupMenu( parent ); | 84 | m_subMenu = new QPopupMenu( parent ); |
88 | m_subMenu->setCheckable( true ); | 85 | m_subMenu->setCheckable( true ); |
89 | for ( int i = 1; i < 10; ++i ) | 86 | for ( int i = 1; i < 10; ++i ) |
90 | { | 87 | { |
91 | int id = m_subMenu->insertItem( QString::number( i ), 500+i ); | 88 | int id = m_subMenu->insertItem( QString::number( i ), 500+i ); |
92 | m_subMenu->setItemChecked( id, id-500 == vtstat.v_active ); | 89 | m_subMenu->setItemChecked( id, id-500 == vtstat.v_active ); |
93 | } | 90 | } |
94 | ::close( fd ); | 91 | ::close( fd ); |
95 | 92 | ||
96 | connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) ); | 93 | connect( m_subMenu, SIGNAL( activated(int) ), this, SLOT( changeVT(int) ) ); |
97 | connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); | 94 | connect( m_subMenu, SIGNAL( aboutToShow() ), this, SLOT( updateMenu() ) ); |
98 | 95 | ||
99 | return m_subMenu; | 96 | return m_subMenu; |
100 | } | 97 | } |
101 | 98 | ||
102 | 99 | ||
103 | void VTApplet::changeVT( int index ) | 100 | void VTApplet::changeVT( int index ) |
104 | { | 101 | { |
105 | //qDebug( "VTApplet::changeVT( %d )", index-500 ); | 102 | //qDebug( "VTApplet::changeVT( %d )", index-500 ); |
106 | 103 | ||
107 | int fd = ::open("/dev/tty0", O_RDWR); | 104 | int fd = ::open("/dev/tty0", O_RDWR); |
108 | if ( fd == -1 ) return; | 105 | if ( fd == -1 ) return; |
109 | ioctl( fd, VT_ACTIVATE, index-500 ); | 106 | ioctl( fd, VT_ACTIVATE, index-500 ); |
110 | } | 107 | } |
111 | 108 | ||
112 | 109 | ||
113 | void VTApplet::updateMenu() | 110 | void VTApplet::updateMenu() |
114 | { | 111 | { |
115 | //qDebug( "VTApplet::updateMenu()" ); | 112 | //qDebug( "VTApplet::updateMenu()" ); |
116 | 113 | ||
diff --git a/core/apps/calibrate/main.cpp b/core/apps/calibrate/main.cpp index ec9b5ec..0da0fe0 100644 --- a/core/apps/calibrate/main.cpp +++ b/core/apps/calibrate/main.cpp | |||
@@ -1,47 +1,46 @@ | |||
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 "calibrate.h" | 21 | #include "calibrate.h" |
22 | 22 | ||
23 | #include <qfile.h> | ||
24 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
25 | 24 | ||
26 | #ifdef QWS | 25 | #ifdef QWS |
27 | #include <qwindowsystem_qws.h> | 26 | #include <qwindowsystem_qws.h> |
28 | #endif | 27 | #endif |
29 | 28 | ||
30 | int main( int argc, char ** argv ) | 29 | int main( int argc, char ** argv ) |
31 | { | 30 | { |
32 | QPEApplication a( argc, argv ); | 31 | QPEApplication a( argc, argv ); |
33 | int retval = 0; | 32 | int retval = 0; |
34 | 33 | ||
35 | #ifdef QWS | 34 | #ifdef QWS |
36 | if ( QWSServer::mouseHandler() && | 35 | if ( QWSServer::mouseHandler() && |
37 | QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { | 36 | QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { |
38 | #endif | 37 | #endif |
39 | // Make sure calibration widget starts on top. | 38 | // Make sure calibration widget starts on top. |
40 | Calibrate cal; | 39 | Calibrate cal; |
41 | a.setMainWidget(&cal); | 40 | a.setMainWidget(&cal); |
42 | a.showMainWidget(&cal); | 41 | a.showMainWidget(&cal); |
43 | return a.exec(); | 42 | return a.exec(); |
44 | #ifdef QWS | 43 | #ifdef QWS |
45 | } | 44 | } |
46 | #endif | 45 | #endif |
47 | } | 46 | } |
diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 2a306de..50e5201 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc | |||
@@ -1,103 +1,99 @@ | |||
1 | 1 | ||
2 | #include <qapplication.h> | ||
3 | #include <qfile.h> | ||
4 | #include <qfileinfo.h> | 2 | #include <qfileinfo.h> |
5 | #include <qtextcodec.h> | ||
6 | 3 | ||
7 | #include <qpe/qcopenvelope_qws.h> | ||
8 | 4 | ||
9 | #include <opie/oprocess.h> | 5 | #include <opie/oprocess.h> |
10 | #include "obex.h" | 6 | #include "obex.h" |
11 | 7 | ||
12 | using namespace OpieObex; | 8 | using namespace OpieObex; |
13 | 9 | ||
14 | /* TRANSLATOR OpieObex::Obex */ | 10 | /* TRANSLATOR OpieObex::Obex */ |
15 | 11 | ||
16 | Obex::Obex( QObject *parent, const char* name ) | 12 | Obex::Obex( QObject *parent, const char* name ) |
17 | : QObject(parent, name ) | 13 | : QObject(parent, name ) |
18 | { | 14 | { |
19 | m_rec = 0; | 15 | m_rec = 0; |
20 | m_send=0; | 16 | m_send=0; |
21 | m_count = 0; | 17 | m_count = 0; |
22 | m_receive = false; | 18 | m_receive = false; |
23 | connect( this, SIGNAL(error(int) ), // for recovering to receive | 19 | connect( this, SIGNAL(error(int) ), // for recovering to receive |
24 | SLOT(slotError() ) ); | 20 | SLOT(slotError() ) ); |
25 | connect( this, SIGNAL(sent(bool) ), | 21 | connect( this, SIGNAL(sent(bool) ), |
26 | SLOT(slotError() ) ); | 22 | SLOT(slotError() ) ); |
27 | }; | 23 | }; |
28 | Obex::~Obex() { | 24 | Obex::~Obex() { |
29 | delete m_rec; | 25 | delete m_rec; |
30 | delete m_send; | 26 | delete m_send; |
31 | } | 27 | } |
32 | void Obex::receive() { | 28 | void Obex::receive() { |
33 | m_receive = true; | 29 | m_receive = true; |
34 | m_outp = QString::null; | 30 | m_outp = QString::null; |
35 | qWarning("Receive" ); | 31 | qWarning("Receive" ); |
36 | m_rec = new OProcess(); | 32 | m_rec = new OProcess(); |
37 | *m_rec << "irobex_palm3"; | 33 | *m_rec << "irobex_palm3"; |
38 | // connect to the necessary slots | 34 | // connect to the necessary slots |
39 | connect(m_rec, SIGNAL(processExited(OProcess*) ), | 35 | connect(m_rec, SIGNAL(processExited(OProcess*) ), |
40 | this, SLOT(slotExited(OProcess*) ) ); | 36 | this, SLOT(slotExited(OProcess*) ) ); |
41 | 37 | ||
42 | connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ), | 38 | connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ), |
43 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); | 39 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); |
44 | 40 | ||
45 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 41 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
46 | qWarning("could not start :("); | 42 | qWarning("could not start :("); |
47 | emit done( false ); | 43 | emit done( false ); |
48 | delete m_rec; | 44 | delete m_rec; |
49 | m_rec = 0; | 45 | m_rec = 0; |
50 | } | 46 | } |
51 | // emit currentTry(m_count ); | 47 | // emit currentTry(m_count ); |
52 | 48 | ||
53 | } | 49 | } |
54 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive | 50 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive |
55 | m_count = 0; | 51 | m_count = 0; |
56 | m_file = fileName; | 52 | m_file = fileName; |
57 | qWarning("send %s", fileName.latin1() ); | 53 | qWarning("send %s", fileName.latin1() ); |
58 | if (m_rec != 0 ) { | 54 | if (m_rec != 0 ) { |
59 | qWarning("running"); | 55 | qWarning("running"); |
60 | if (m_rec->isRunning() ) { | 56 | if (m_rec->isRunning() ) { |
61 | emit error(-1 ); | 57 | emit error(-1 ); |
62 | qWarning("is running"); | 58 | qWarning("is running"); |
63 | delete m_rec; | 59 | delete m_rec; |
64 | m_rec = 0; | 60 | m_rec = 0; |
65 | 61 | ||
66 | }else{ | 62 | }else{ |
67 | qWarning("is not running"); | 63 | qWarning("is not running"); |
68 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending | 64 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending |
69 | return; | 65 | return; |
70 | } | 66 | } |
71 | } | 67 | } |
72 | sendNow(); | 68 | sendNow(); |
73 | } | 69 | } |
74 | void Obex::sendNow(){ | 70 | void Obex::sendNow(){ |
75 | qWarning("sendNow"); | 71 | qWarning("sendNow"); |
76 | if ( m_count >= 25 ) { // could not send | 72 | if ( m_count >= 25 ) { // could not send |
77 | emit error(-1 ); | 73 | emit error(-1 ); |
78 | emit sent(false); | 74 | emit sent(false); |
79 | return; | 75 | return; |
80 | } | 76 | } |
81 | // OProcess inititialisation | 77 | // OProcess inititialisation |
82 | m_send = new OProcess(); | 78 | m_send = new OProcess(); |
83 | *m_send << "irobex_palm3"; | 79 | *m_send << "irobex_palm3"; |
84 | *m_send << QFile::encodeName(m_file); | 80 | *m_send << QFile::encodeName(m_file); |
85 | 81 | ||
86 | // connect to slots Exited and and StdOut | 82 | // connect to slots Exited and and StdOut |
87 | connect(m_send, SIGNAL(processExited(OProcess*) ), | 83 | connect(m_send, SIGNAL(processExited(OProcess*) ), |
88 | this, SLOT(slotExited(OProcess*)) ); | 84 | this, SLOT(slotExited(OProcess*)) ); |
89 | connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), | 85 | connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), |
90 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); | 86 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); |
91 | 87 | ||
92 | // now start it | 88 | // now start it |
93 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { | 89 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { |
94 | qWarning("could not send" ); | 90 | qWarning("could not send" ); |
95 | m_count = 25; | 91 | m_count = 25; |
96 | emit error(-1 ); | 92 | emit error(-1 ); |
97 | delete m_send; | 93 | delete m_send; |
98 | m_send=0; | 94 | m_send=0; |
99 | } | 95 | } |
100 | // end | 96 | // end |
101 | m_count++; | 97 | m_count++; |
102 | emit currentTry( m_count ); | 98 | emit currentTry( m_count ); |
103 | } | 99 | } |
diff --git a/core/obex/obexhandler.cpp b/core/obex/obexhandler.cpp index c237555..4034560 100644 --- a/core/obex/obexhandler.cpp +++ b/core/obex/obexhandler.cpp | |||
@@ -1,68 +1,67 @@ | |||
1 | #include <qcopchannel_qws.h> | ||
2 | 1 | ||
3 | #include <qpe/qcopenvelope_qws.h> | 2 | #include <qpe/qcopenvelope_qws.h> |
4 | #include <qpe/qpeapplication.h> | 3 | #include <qpe/qpeapplication.h> |
5 | 4 | ||
6 | #include "obexsend.h" | 5 | #include "obexsend.h" |
7 | #include "receiver.h" | 6 | #include "receiver.h" |
8 | #include "obexhandler.h" | 7 | #include "obexhandler.h" |
9 | 8 | ||
10 | using namespace OpieObex; | 9 | using namespace OpieObex; |
11 | 10 | ||
12 | /* TRANSLATOR OpieObex::ObexHandler */ | 11 | /* TRANSLATOR OpieObex::ObexHandler */ |
13 | 12 | ||
14 | ObexHandler::ObexHandler() { | 13 | ObexHandler::ObexHandler() { |
15 | m_wasRec = false; | 14 | m_wasRec = false; |
16 | m_sender = 0l; | 15 | m_sender = 0l; |
17 | m_receiver = 0l; | 16 | m_receiver = 0l; |
18 | QCopChannel* chan = new QCopChannel("QPE/Obex"); | 17 | QCopChannel* chan = new QCopChannel("QPE/Obex"); |
19 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), | 18 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), |
20 | this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); | 19 | this, SLOT(irdaMessage(const QCString&, const QByteArray& ) ) ); |
21 | } | 20 | } |
22 | ObexHandler::~ObexHandler() { | 21 | ObexHandler::~ObexHandler() { |
23 | delete m_sender; | 22 | delete m_sender; |
24 | delete m_receiver; | 23 | delete m_receiver; |
25 | } | 24 | } |
26 | void ObexHandler::doSend(const QString& str, const QString& desc) { | 25 | void ObexHandler::doSend(const QString& str, const QString& desc) { |
27 | delete m_sender; | 26 | delete m_sender; |
28 | m_sender = new SendWidget; | 27 | m_sender = new SendWidget; |
29 | m_sender->raise(); | 28 | m_sender->raise(); |
30 | QPEApplication::showWidget( m_sender ); | 29 | QPEApplication::showWidget( m_sender ); |
31 | connect(m_sender, SIGNAL(done() ), | 30 | connect(m_sender, SIGNAL(done() ), |
32 | this, SLOT(slotSent() ) ); | 31 | this, SLOT(slotSent() ) ); |
33 | m_sender->send( str, desc ); | 32 | m_sender->send( str, desc ); |
34 | } | 33 | } |
35 | void ObexHandler::doReceive(bool b) { | 34 | void ObexHandler::doReceive(bool b) { |
36 | if (m_receiver && b ) return; // we should enable receiver and it is on | 35 | if (m_receiver && b ) return; // we should enable receiver and it is on |
37 | else if (!m_receiver && !b ) return; // we should disbale receiver and it is off | 36 | else if (!m_receiver && !b ) return; // we should disbale receiver and it is off |
38 | else if (m_receiver && !b ) { | 37 | else if (m_receiver && !b ) { |
39 | delete m_receiver; | 38 | delete m_receiver; |
40 | m_receiver=0; | 39 | m_receiver=0; |
41 | }else if (!m_receiver && b ) { | 40 | }else if (!m_receiver && b ) { |
42 | m_receiver= new Receiver; | 41 | m_receiver= new Receiver; |
43 | } | 42 | } |
44 | } | 43 | } |
45 | void ObexHandler::slotSent() { | 44 | void ObexHandler::slotSent() { |
46 | QString file = m_sender->file(); | 45 | QString file = m_sender->file(); |
47 | delete m_sender; | 46 | delete m_sender; |
48 | m_sender = 0; | 47 | m_sender = 0; |
49 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); | 48 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); |
50 | e << file; | 49 | e << file; |
51 | doReceive(m_wasRec ); | 50 | doReceive(m_wasRec ); |
52 | m_wasRec = false; | 51 | m_wasRec = false; |
53 | } | 52 | } |
54 | void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { | 53 | void ObexHandler::irdaMessage( const QCString& msg, const QByteArray& data) { |
55 | QDataStream stream( data, IO_ReadOnly ); | 54 | QDataStream stream( data, IO_ReadOnly ); |
56 | if ( msg == "send(QString,QString,QString)" ) { | 55 | if ( msg == "send(QString,QString,QString)" ) { |
57 | QString name, desc; | 56 | QString name, desc; |
58 | stream >> desc; | 57 | stream >> desc; |
59 | stream >> name; | 58 | stream >> name; |
60 | m_wasRec = (m_receiver != 0 ); | 59 | m_wasRec = (m_receiver != 0 ); |
61 | doReceive( false ); | 60 | doReceive( false ); |
62 | doSend(name, desc); | 61 | doSend(name, desc); |
63 | }else if (msg == "receive(int)") { | 62 | }else if (msg == "receive(int)") { |
64 | int rec; | 63 | int rec; |
65 | stream >> rec; | 64 | stream >> rec; |
66 | doReceive(rec); | 65 | doReceive(rec); |
67 | } | 66 | } |
68 | } | 67 | } |
diff --git a/core/obex/obexsend.cpp b/core/obex/obexsend.cpp index cf5d958..6b8d467 100644 --- a/core/obex/obexsend.cpp +++ b/core/obex/obexsend.cpp | |||
@@ -1,106 +1,102 @@ | |||
1 | #include <qpushbutton.h> | 1 | #include <qpushbutton.h> |
2 | #include <qlabel.h> | 2 | #include <qlabel.h> |
3 | #include <qhbox.h> | ||
4 | #include <qlayout.h> | 3 | #include <qlayout.h> |
5 | #include <qtimer.h> | 4 | #include <qtimer.h> |
6 | #include <qtl.h> | ||
7 | 5 | ||
8 | #include <qcopchannel_qws.h> | ||
9 | 6 | ||
10 | #include <qpe/resource.h> | ||
11 | #include <qpe/qcopenvelope_qws.h> | 7 | #include <qpe/qcopenvelope_qws.h> |
12 | 8 | ||
13 | #include "obex.h" | 9 | #include "obex.h" |
14 | #include "obexsend.h" | 10 | #include "obexsend.h" |
15 | 11 | ||
16 | using namespace OpieObex; | 12 | using namespace OpieObex; |
17 | 13 | ||
18 | /* TRANSLATOR OpieObex::SendWidget */ | 14 | /* TRANSLATOR OpieObex::SendWidget */ |
19 | 15 | ||
20 | 16 | ||
21 | SendWidget::SendWidget( QWidget* parent, const char* name ) | 17 | SendWidget::SendWidget( QWidget* parent, const char* name ) |
22 | : QWidget( parent, name ) { | 18 | : QWidget( parent, name ) { |
23 | initUI(); | 19 | initUI(); |
24 | } | 20 | } |
25 | SendWidget::~SendWidget() { | 21 | SendWidget::~SendWidget() { |
26 | } | 22 | } |
27 | void SendWidget::initUI() { | 23 | void SendWidget::initUI() { |
28 | m_obex = new Obex(this, "obex"); | 24 | m_obex = new Obex(this, "obex"); |
29 | connect(m_obex, SIGNAL(error(int) ), | 25 | connect(m_obex, SIGNAL(error(int) ), |
30 | this, SLOT(slotIrError(int) ) ); | 26 | this, SLOT(slotIrError(int) ) ); |
31 | connect(m_obex, SIGNAL(sent(bool) ), | 27 | connect(m_obex, SIGNAL(sent(bool) ), |
32 | this, SLOT(slotIrSent(bool) ) ); | 28 | this, SLOT(slotIrSent(bool) ) ); |
33 | connect(m_obex, SIGNAL(currentTry(unsigned int ) ), | 29 | connect(m_obex, SIGNAL(currentTry(unsigned int ) ), |
34 | this, SLOT(slotIrTry(unsigned int ) ) ); | 30 | this, SLOT(slotIrTry(unsigned int ) ) ); |
35 | 31 | ||
36 | QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this ); | 32 | QCopChannel* chan = new QCopChannel("QPE/IrDaAppletBack", this ); |
37 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), | 33 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), |
38 | this, SLOT(dispatchIrda(const QCString&, const QByteArray& ) ) ); | 34 | this, SLOT(dispatchIrda(const QCString&, const QByteArray& ) ) ); |
39 | 35 | ||
40 | chan = new QCopChannel("QPE/BluetoothBack", this ); | 36 | chan = new QCopChannel("QPE/BluetoothBack", this ); |
41 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), | 37 | connect(chan, SIGNAL(received(const QCString&, const QByteArray& ) ), |
42 | this, SLOT(dispatchBt(const QCString&, const QByteArray& ) ) ); | 38 | this, SLOT(dispatchBt(const QCString&, const QByteArray& ) ) ); |
43 | 39 | ||
44 | QVBoxLayout* lay = new QVBoxLayout(this); | 40 | QVBoxLayout* lay = new QVBoxLayout(this); |
45 | 41 | ||
46 | QHBox* nameBox = new QHBox(this); | 42 | QHBox* nameBox = new QHBox(this); |
47 | QLabel* name = new QLabel(nameBox); | 43 | QLabel* name = new QLabel(nameBox); |
48 | name->setText( tr("<qt><h1>Sending:</h1></qt>") ); | 44 | name->setText( tr("<qt><h1>Sending:</h1></qt>") ); |
49 | name->setAlignment( AlignLeft | AlignTop ); | 45 | name->setAlignment( AlignLeft | AlignTop ); |
50 | m_lblFile = new QLabel(nameBox); | 46 | m_lblFile = new QLabel(nameBox); |
51 | lay->addWidget(nameBox, 0); | 47 | lay->addWidget(nameBox, 0); |
52 | 48 | ||
53 | QFrame* frame = new QFrame(this); | 49 | QFrame* frame = new QFrame(this); |
54 | frame->setFrameShape( QFrame::HLine ); | 50 | frame->setFrameShape( QFrame::HLine ); |
55 | frame->setFrameShadow( QFrame::Sunken ); | 51 | frame->setFrameShadow( QFrame::Sunken ); |
56 | lay->addWidget(frame, 10); | 52 | lay->addWidget(frame, 10); |
57 | 53 | ||
58 | QLabel* devices = new QLabel(this); | 54 | QLabel* devices = new QLabel(this); |
59 | devices->setText("<qt><b>Devices:</b></qt>"); | 55 | devices->setText("<qt><b>Devices:</b></qt>"); |
60 | devices->setAlignment( AlignLeft | AlignTop ); | 56 | devices->setAlignment( AlignLeft | AlignTop ); |
61 | lay->addWidget( devices,10 ); | 57 | lay->addWidget( devices,10 ); |
62 | 58 | ||
63 | m_devBox = new DeviceBox(this); | 59 | m_devBox = new DeviceBox(this); |
64 | lay->addWidget( m_devBox, 50 ); | 60 | lay->addWidget( m_devBox, 50 ); |
65 | connect(m_devBox, SIGNAL(selectedDevice(int, int ) ), | 61 | connect(m_devBox, SIGNAL(selectedDevice(int, int ) ), |
66 | this, SLOT(slotSelectedDevice(int, int) ) ); | 62 | this, SLOT(slotSelectedDevice(int, int) ) ); |
67 | 63 | ||
68 | QPushButton *but = new QPushButton(this); | 64 | QPushButton *but = new QPushButton(this); |
69 | but->setText(tr("Done") ); | 65 | but->setText(tr("Done") ); |
70 | connect(but, SIGNAL(clicked() ), | 66 | connect(but, SIGNAL(clicked() ), |
71 | this, SLOT(slotDone() ) ); | 67 | this, SLOT(slotDone() ) ); |
72 | 68 | ||
73 | lay->addWidget( but ); | 69 | lay->addWidget( but ); |
74 | m_lay = lay; | 70 | m_lay = lay; |
75 | 71 | ||
76 | // QT does not like if you add items to an layout which already exits.... | 72 | // QT does not like if you add items to an layout which already exits.... |
77 | // and was layouted invalidate() does not help too | 73 | // and was layouted invalidate() does not help too |
78 | // so we use RichText.... | 74 | // so we use RichText.... |
79 | } | 75 | } |
80 | 76 | ||
81 | /* | 77 | /* |
82 | * in send we'll first set everything up | 78 | * in send we'll first set everything up |
83 | * and then wait for a list of devices. | 79 | * and then wait for a list of devices. |
84 | */ | 80 | */ |
85 | void SendWidget::send( const QString& file, const QString& desc ) { | 81 | void SendWidget::send( const QString& file, const QString& desc ) { |
86 | m_file = file; | 82 | m_file = file; |
87 | m_irDa.clear(); | 83 | m_irDa.clear(); |
88 | m_start = 0; | 84 | m_start = 0; |
89 | m_lblFile->setText(desc.isEmpty() ? file : desc ); | 85 | m_lblFile->setText(desc.isEmpty() ? file : desc ); |
90 | 86 | ||
91 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { | 87 | if ( !QCopChannel::isRegistered("QPE/IrDaApplet") ) { |
92 | m_irDeSearch = m_devBox->addDevice( tr("IrDa is not enabled!"), DeviceBox::Error ); | 88 | m_irDeSearch = m_devBox->addDevice( tr("IrDa is not enabled!"), DeviceBox::Error ); |
93 | m_start++; | 89 | m_start++; |
94 | }else | 90 | }else |
95 | m_irDeSearch = m_devBox->addDevice( tr("Searching for IrDa Devices."), DeviceBox::Search ); | 91 | m_irDeSearch = m_devBox->addDevice( tr("Searching for IrDa Devices."), DeviceBox::Search ); |
96 | 92 | ||
97 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { | 93 | if ( !QCopChannel::isRegistered("QPE/Bluetooth") ) { |
98 | m_btDeSearch = m_devBox->addDevice( tr("Bluetooth is not available"), DeviceBox::Error ); | 94 | m_btDeSearch = m_devBox->addDevice( tr("Bluetooth is not available"), DeviceBox::Error ); |
99 | m_start++; | 95 | m_start++; |
100 | }else | 96 | }else |
101 | m_btDeSearch = m_devBox->addDevice( tr("Searching for bluetooth Devices."), DeviceBox::Search ); | 97 | m_btDeSearch = m_devBox->addDevice( tr("Searching for bluetooth Devices."), DeviceBox::Search ); |
102 | 98 | ||
103 | if (m_start != 2 ) { | 99 | if (m_start != 2 ) { |
104 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); | 100 | QCopEnvelope e0("QPE/IrDaApplet", "enableIrda()"); |
105 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); | 101 | QCopEnvelope e1("QPE/Bluetooth", "enableBluetooth()"); |
106 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); | 102 | QCopEnvelope e2("QPE/IrDaApplet", "listDevices()"); |
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp index bf9e30c..7d9f7ec 100644 --- a/core/obex/receiver.cpp +++ b/core/obex/receiver.cpp | |||
@@ -1,116 +1,112 @@ | |||
1 | #include <sys/types.h> | 1 | #include <sys/types.h> |
2 | #include <sys/stat.h> | 2 | #include <sys/stat.h> |
3 | #include <sys/mman.h> | 3 | #include <sys/mman.h> |
4 | #include <stdlib.h> // int system | 4 | #include <stdlib.h> // int system |
5 | #include <unistd.h> | 5 | #include <unistd.h> |
6 | 6 | ||
7 | #include <fcntl.h> | 7 | #include <fcntl.h> |
8 | 8 | ||
9 | #include <qfile.h> | ||
10 | #include <qfileinfo.h> | 9 | #include <qfileinfo.h> |
11 | #include <qlabel.h> | 10 | #include <qlabel.h> |
12 | #include <qhbox.h> | ||
13 | #include <qregexp.h> | ||
14 | #include <qtextview.h> | 11 | #include <qtextview.h> |
15 | #include <qpushbutton.h> | 12 | #include <qpushbutton.h> |
16 | 13 | ||
17 | #include <qpe/applnk.h> | 14 | #include <qpe/applnk.h> |
18 | #include <qpe/qpeapplication.h> | 15 | #include <qpe/qpeapplication.h> |
19 | #include <qpe/qcopenvelope_qws.h> | 16 | #include <qpe/qcopenvelope_qws.h> |
20 | #include <qpe/global.h> | ||
21 | 17 | ||
22 | #include "obex.h" | 18 | #include "obex.h" |
23 | #include "receiver.h" | 19 | #include "receiver.h" |
24 | 20 | ||
25 | using namespace OpieObex; | 21 | using namespace OpieObex; |
26 | 22 | ||
27 | /* TRANSLATOR OpieObex::Receiver */ | 23 | /* TRANSLATOR OpieObex::Receiver */ |
28 | 24 | ||
29 | Receiver::Receiver() { | 25 | Receiver::Receiver() { |
30 | m_obex = new Obex(this, "Receiver"); | 26 | m_obex = new Obex(this, "Receiver"); |
31 | connect(m_obex, SIGNAL(receivedFile(const QString& ) ), | 27 | connect(m_obex, SIGNAL(receivedFile(const QString& ) ), |
32 | this, SLOT(slotReceived(const QString& ) ) ); | 28 | this, SLOT(slotReceived(const QString& ) ) ); |
33 | m_obex->receive(); | 29 | m_obex->receive(); |
34 | } | 30 | } |
35 | Receiver::~Receiver() { | 31 | Receiver::~Receiver() { |
36 | m_obex->setReceiveEnabled( false ); | 32 | m_obex->setReceiveEnabled( false ); |
37 | delete m_obex; | 33 | delete m_obex; |
38 | } | 34 | } |
39 | void Receiver::slotReceived( const QString& _file ) { | 35 | void Receiver::slotReceived( const QString& _file ) { |
40 | QString file = _file; | 36 | QString file = _file; |
41 | int check = checkFile(file); | 37 | int check = checkFile(file); |
42 | if ( check == AddressBook ) | 38 | if ( check == AddressBook ) |
43 | handleAddr( file ); | 39 | handleAddr( file ); |
44 | else if ( check == Datebook ) | 40 | else if ( check == Datebook ) |
45 | handleDateTodo( file ); | 41 | handleDateTodo( file ); |
46 | else | 42 | else |
47 | handleOther( file ); | 43 | handleOther( file ); |
48 | } | 44 | } |
49 | void Receiver::handleAddr( const QString& str ) { | 45 | void Receiver::handleAddr( const QString& str ) { |
50 | QCopEnvelope e("QPE/Application/addressbook", "setDocument(QString)" ); | 46 | QCopEnvelope e("QPE/Application/addressbook", "setDocument(QString)" ); |
51 | e << str; | 47 | e << str; |
52 | } | 48 | } |
53 | /* we can not say for sure if it's a VEevent ot VTodo */ | 49 | /* we can not say for sure if it's a VEevent ot VTodo */ |
54 | void Receiver::handleDateTodo( const QString& str ) { | 50 | void Receiver::handleDateTodo( const QString& str ) { |
55 | QCopEnvelope e0("QPE/Application/todolist", "setDocument(QString)"); | 51 | QCopEnvelope e0("QPE/Application/todolist", "setDocument(QString)"); |
56 | e0 << str; | 52 | e0 << str; |
57 | QCopEnvelope e1("QPE/Application/datebook", "setDocument(QString)" ); | 53 | QCopEnvelope e1("QPE/Application/datebook", "setDocument(QString)" ); |
58 | e1 << str; | 54 | e1 << str; |
59 | } | 55 | } |
60 | /* | 56 | /* |
61 | * Handle other asks if it should accept the | 57 | * Handle other asks if it should accept the |
62 | * beamed object and creates a DocLnk | 58 | * beamed object and creates a DocLnk |
63 | */ | 59 | */ |
64 | void Receiver::handleOther( const QString& other ) { | 60 | void Receiver::handleOther( const QString& other ) { |
65 | OtherHandler* hand = new OtherHandler(); | 61 | OtherHandler* hand = new OtherHandler(); |
66 | hand->handle( other ); | 62 | hand->handle( other ); |
67 | } | 63 | } |
68 | void Receiver::tidyUp( QString& _file, const QString& ending) { | 64 | void Receiver::tidyUp( QString& _file, const QString& ending) { |
69 | /* libversit fails on BASE64 encoding we try to sed it away */ | 65 | /* libversit fails on BASE64 encoding we try to sed it away */ |
70 | QString file = _file; | 66 | QString file = _file; |
71 | char foo[24]; // big enough | 67 | char foo[24]; // big enough |
72 | (void)::strcpy(foo, "/tmp/opie-XXXXXX"); | 68 | (void)::strcpy(foo, "/tmp/opie-XXXXXX"); |
73 | 69 | ||
74 | int fd = ::mkstemp(foo); | 70 | int fd = ::mkstemp(foo); |
75 | 71 | ||
76 | if ( fd == -1 ) | 72 | if ( fd == -1 ) |
77 | return; | 73 | return; |
78 | 74 | ||
79 | (void)::strncat( foo, ending.latin1(), 4 ); | 75 | (void)::strncat( foo, ending.latin1(), 4 ); |
80 | _file = QString::fromLatin1( foo ); | 76 | _file = QString::fromLatin1( foo ); |
81 | QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); | 77 | QString cmd = QString("sed -e \"s/^\\(X-MICROSOFT-BODYINK\\)\\;/\\1:/;\" < %2 > %2 ").arg( Global::shellQuote(file)).arg( Global::shellQuote(_file) ); |
82 | qWarning("Executing: %s", cmd.latin1() ); | 78 | qWarning("Executing: %s", cmd.latin1() ); |
83 | (void)::system( cmd.latin1() ); | 79 | (void)::system( cmd.latin1() ); |
84 | 80 | ||
85 | cmd = QString("rm %1").arg( Global::shellQuote(file) ); | 81 | cmd = QString("rm %1").arg( Global::shellQuote(file) ); |
86 | (void)::system( cmd.latin1() ); | 82 | (void)::system( cmd.latin1() ); |
87 | } | 83 | } |
88 | int Receiver::checkFile( QString& file ) { | 84 | int Receiver::checkFile( QString& file ) { |
89 | qWarning("check file!! %s", file.latin1() ); | 85 | qWarning("check file!! %s", file.latin1() ); |
90 | int ret; | 86 | int ret; |
91 | QString ending; | 87 | QString ending; |
92 | 88 | ||
93 | if (file.right(4) == ".vcs" ) { | 89 | if (file.right(4) == ".vcs" ) { |
94 | ret = Datebook; | 90 | ret = Datebook; |
95 | ending = QString::fromLatin1(".vcs"); | 91 | ending = QString::fromLatin1(".vcs"); |
96 | }else if ( file.right(4) == ".vcf") { | 92 | }else if ( file.right(4) == ".vcf") { |
97 | ret = AddressBook; | 93 | ret = AddressBook; |
98 | ending = QString::fromLatin1(".vcf"); | 94 | ending = QString::fromLatin1(".vcf"); |
99 | }else | 95 | }else |
100 | ret = Other; | 96 | ret = Other; |
101 | 97 | ||
102 | 98 | ||
103 | if (ending.isEmpty() ) | 99 | if (ending.isEmpty() ) |
104 | return ret; | 100 | return ret; |
105 | 101 | ||
106 | /** | 102 | /** |
107 | * currently the parser is broken in regard of BASE64 encoding | 103 | * currently the parser is broken in regard of BASE64 encoding |
108 | * and M$ likes to send that. So we will executed a small | 104 | * and M$ likes to send that. So we will executed a small |
109 | * tidy up system sed script | 105 | * tidy up system sed script |
110 | * At this point we can also remove umlaute from the filename | 106 | * At this point we can also remove umlaute from the filename |
111 | */ | 107 | */ |
112 | tidyUp( file, ending ); | 108 | tidyUp( file, ending ); |
113 | 109 | ||
114 | qWarning("check it now %d", ret ); | 110 | qWarning("check it now %d", ret ); |
115 | return ret; | 111 | return ret; |
116 | } | 112 | } |