summaryrefslogtreecommitdiff
path: root/core
authorzecke <zecke>2004-03-13 21:27:29 (UTC)
committer zecke <zecke>2004-03-13 21:27:29 (UTC)
commit184a0cd9935d0a249038cdbe05488c181b273d64 (patch) (unidiff)
treec8f3508ab1be012083d9e2140221cfeb9a9ab83a /core
parenta3304e23c7f8576a4584475ef0cf49d0e588671e (diff)
downloadopie-184a0cd9935d0a249038cdbe05488c181b273d64.zip
opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.gz
opie-184a0cd9935d0a249038cdbe05488c181b273d64.tar.bz2
Fix namespaces in the launcher.. and found a problem with my script
Diffstat (limited to 'core') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/applauncher.cpp1
-rw-r--r--core/launcher/documentlist.cpp1
-rw-r--r--core/launcher/main.cpp2
-rw-r--r--core/launcher/qcopbridge.cpp1
-rw-r--r--core/launcher/screensaver.cpp20
-rw-r--r--core/launcher/server.cpp10
-rw-r--r--core/launcher/server.h4
-rw-r--r--core/launcher/serverapp.cpp9
-rw-r--r--core/launcher/serverapp.h10
-rw-r--r--core/launcher/transferserver.cpp1
-rw-r--r--core/launcher/wait.cpp1
-rw-r--r--core/launcher/wait.h4
12 files changed, 37 insertions, 27 deletions
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index efbf426..5a5517c 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -49,24 +49,25 @@
49 49
50#include <qtimer.h> 50#include <qtimer.h>
51#include <qwindowsystem_qws.h> 51#include <qwindowsystem_qws.h>
52#include <qmessagebox.h> 52#include <qmessagebox.h>
53#include <qfileinfo.h> 53#include <qfileinfo.h>
54 54
55#include <qtopia/qcopenvelope_qws.h> 55#include <qtopia/qcopenvelope_qws.h>
56#include <qtopia/qpeapplication.h> 56#include <qtopia/qpeapplication.h>
57 57
58#include "applauncher.h" 58#include "applauncher.h"
59#include "documentlist.h" 59#include "documentlist.h"
60 60
61using namespace Opie::Core;
61const int AppLauncher::RAISE_TIMEOUT_MS = 5000; 62const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
62 63
63//--------------------------------------------------------------------------- 64//---------------------------------------------------------------------------
64 65
65static AppLauncher* appLauncherPtr; 66static AppLauncher* appLauncherPtr;
66 67
67const int appStopEventID = 1290; 68const int appStopEventID = 1290;
68 69
69class AppStoppedEvent : public QCustomEvent 70class AppStoppedEvent : public QCustomEvent
70{ 71{
71public: 72public:
72 AppStoppedEvent(int pid, int status) 73 AppStoppedEvent(int pid, int status)
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
index 63f853e..3e0a96c 100644
--- a/core/launcher/documentlist.cpp
+++ b/core/launcher/documentlist.cpp
@@ -38,24 +38,25 @@
38#include <qfileinfo.h> 38#include <qfileinfo.h>
39#include <qtextstream.h> 39#include <qtextstream.h>
40#include <qfile.h> 40#include <qfile.h>
41#include <qdir.h> 41#include <qdir.h>
42#include <qpainter.h> 42#include <qpainter.h>
43#include <qimage.h> 43#include <qimage.h>
44#include <qcopchannel_qws.h> 44#include <qcopchannel_qws.h>
45#include <qlistview.h> 45#include <qlistview.h>
46#include <qlist.h> 46#include <qlist.h>
47#include <qpixmap.h> 47#include <qpixmap.h>
48 48
49 49
50using namespace Opie::Core;
50AppLnkSet *DocumentList::appLnkSet = 0; 51AppLnkSet *DocumentList::appLnkSet = 0;
51 52
52static const int MAX_SEARCH_DEPTH = 10; 53static const int MAX_SEARCH_DEPTH = 10;
53 54
54 55
55class DocumentListPrivate : public QObject { 56class DocumentListPrivate : public QObject {
56 Q_OBJECT 57 Q_OBJECT
57public: 58public:
58 DocumentListPrivate( ServerInterface *gui ); 59 DocumentListPrivate( ServerInterface *gui );
59 ~DocumentListPrivate(); 60 ~DocumentListPrivate();
60 61
61 void initialize(); 62 void initialize();
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index c136bd9..3e7e0d2 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -53,25 +53,25 @@
53 53
54#ifdef QT_QWS_LOGIN 54#ifdef QT_QWS_LOGIN
55#include "../login/qdmdialogimpl.h" 55#include "../login/qdmdialogimpl.h"
56#endif 56#endif
57 57
58#ifdef Q_WS_QWS 58#ifdef Q_WS_QWS
59#include <qkeyboard_qws.h> 59#include <qkeyboard_qws.h>
60#endif 60#endif
61 61
62#include <qmessagebox.h> 62#include <qmessagebox.h>
63#include <opie2/odevice.h> 63#include <opie2/odevice.h>
64 64
65using namespace Opie; 65using namespace Opie::Core;
66 66
67 67
68static void cleanup() 68static void cleanup()
69{ 69{
70 QDir dir( "/tmp", "qcop-msg-*" ); 70 QDir dir( "/tmp", "qcop-msg-*" );
71 71
72 QStringList stale = dir.entryList(); 72 QStringList stale = dir.entryList();
73 QStringList::Iterator it; 73 QStringList::Iterator it;
74 for ( it = stale.begin(); it != stale.end(); ++it ) { 74 for ( it = stale.begin(); it != stale.end(); ++it ) {
75 dir.remove( *it ); 75 dir.remove( *it );
76 } 76 }
77} 77}
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 53efba4..33df6c4 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -45,24 +45,25 @@
45#include <sys/types.h> 45#include <sys/types.h>
46#endif 46#endif
47 47
48#if defined(_OS_LINUX_) 48#if defined(_OS_LINUX_)
49#include <shadow.h> 49#include <shadow.h>
50#endif 50#endif
51 51
52 52
53//#define INSECURE 53//#define INSECURE
54 54
55const int block_size = 51200; 55const int block_size = 51200;
56 56
57using namespace Opie::Core;
57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 58QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
58 const char* name ) 59 const char* name )
59 : QServerSocket( port, 1, parent, name ), 60 : QServerSocket( port, 1, parent, name ),
60 desktopChannel( 0 ), 61 desktopChannel( 0 ),
61 cardChannel( 0 ) 62 cardChannel( 0 )
62{ 63{
63 if ( !ok() ) 64 if ( !ok() )
64 qWarning( "Failed to bind to port %d", port ); 65 qWarning( "Failed to bind to port %d", port );
65 else { 66 else {
66#ifndef QT_NO_COP 67#ifndef QT_NO_COP
67 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 68 desktopChannel = new QCopChannel( "QPE/Desktop", this );
68 connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)), 69 connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
diff --git a/core/launcher/screensaver.cpp b/core/launcher/screensaver.cpp
index e544c61..6aaab3a 100644
--- a/core/launcher/screensaver.cpp
+++ b/core/launcher/screensaver.cpp
@@ -1,22 +1,22 @@
1 1
2#include "screensaver.h" 2#include "screensaver.h"
3 3
4#include <qpe/config.h> 4#include <qpe/config.h>
5#include <qpe/network.h> 5#include <qpe/network.h>
6 6
7#include <opie2/odevice.h> 7#include <opie2/odevice.h>
8 8
9 9
10using namespace Opie; 10using namespace Opie::Core;
11 11
12 12
13 13
14OpieScreenSaver::OpieScreenSaver ( ) 14OpieScreenSaver::OpieScreenSaver ( )
15 : QObject ( 0, "screensaver" ), QWSScreenSaver ( ) 15 : QObject ( 0, "screensaver" ), QWSScreenSaver ( )
16{ 16{
17 m_disable_suspend = 100; 17 m_disable_suspend = 100;
18 m_enable_dim = false; 18 m_enable_dim = false;
19 m_enable_lightoff = false; 19 m_enable_lightoff = false;
20 m_enable_suspend = false; 20 m_enable_suspend = false;
21 m_onlylcdoff = false; 21 m_onlylcdoff = false;
22 22
@@ -148,25 +148,25 @@ void OpieScreenSaver::setIntervals ( int dim, int lightoff, int suspend )
148 if ( m_on_ac ) { 148 if ( m_on_ac ) {
149 m_enable_dim_ac = ( dim > 0 ); 149 m_enable_dim_ac = ( dim > 0 );
150 m_enable_lightoff_ac = ( lightoff > 0 ); 150 m_enable_lightoff_ac = ( lightoff > 0 );
151 m_enable_suspend_ac = ( suspend > 0 ); 151 m_enable_suspend_ac = ( suspend > 0 );
152 m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false ); 152 m_onlylcdoff_ac = config.readBoolEntry ( "LcdOffOnly", false );
153 } 153 }
154 else { 154 else {
155 m_enable_dim = ( dim > 0 ); 155 m_enable_dim = ( dim > 0 );
156 m_enable_lightoff = ( lightoff > 0 ); 156 m_enable_lightoff = ( lightoff > 0 );
157 m_enable_suspend = ( suspend > 0 ); 157 m_enable_suspend = ( suspend > 0 );
158 m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false ); 158 m_onlylcdoff = config.readBoolEntry ( "LcdOffOnly", false );
159 } 159 }
160 160
161 //qDebug("screen saver intervals: %d %d %d", dim, lightoff, suspend); 161 //qDebug("screen saver intervals: %d %d %d", dim, lightoff, suspend);
162 162
163 v [ 0 ] = QMAX( 1000 * dim, 100 ); 163 v [ 0 ] = QMAX( 1000 * dim, 100 );
164 v [ 1 ] = QMAX( 1000 * lightoff, 100 ); 164 v [ 1 ] = QMAX( 1000 * lightoff, 100 );
165 v [ 2 ] = QMAX( 1000 * suspend, 100 ); 165 v [ 2 ] = QMAX( 1000 * suspend, 100 );
166 v [ 3 ] = 0; 166 v [ 3 ] = 0;
167 167
168 if ( !dim && !lightoff && !suspend ) 168 if ( !dim && !lightoff && !suspend )
169 QWSServer::setScreenSaverInterval( 0 ); 169 QWSServer::setScreenSaverInterval( 0 );
170 else 170 else
171 QWSServer::setScreenSaverIntervals( v ); 171 QWSServer::setScreenSaverIntervals( v );
172} 172}
@@ -206,32 +206,32 @@ void OpieScreenSaver::setBacklight ( int bright )
206 // Read from config 206 // Read from config
207 Config config ( "apm" ); 207 Config config ( "apm" );
208 config. setGroup ( m_on_ac ? "AC" : "Battery" ); 208 config. setGroup ( m_on_ac ? "AC" : "Battery" );
209 m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 ); 209 m_backlight_normal = config. readNumEntry ( "Brightness", m_on_ac ? 255 : 127 );
210 int contrast = config. readNumEntry ( "Contrast", 127); 210 int contrast = config. readNumEntry ( "Contrast", 127);
211 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false ); 211 m_use_light_sensor = config. readBoolEntry ( "LightSensor", false );
212 212
213 //qDebug ( "setBacklight: %d (norm: %d) (ls: %d)", bright, m_backlight_normal, m_use_light_sensor ? 1 : 0 ); 213 //qDebug ( "setBacklight: %d (norm: %d) (ls: %d)", bright, m_backlight_normal, m_use_light_sensor ? 1 : 0 );
214 214
215 killTimers ( ); 215 killTimers ( );
216 if (( bright < 0 ) && m_use_light_sensor ) { 216 if (( bright < 0 ) && m_use_light_sensor ) {
217 QStringList sl = config. readListEntry ( "LightSensorData", ';' ); 217 QStringList sl = config. readListEntry ( "LightSensorData", ';' );
218 218
219 m_sensordata [LS_SensorMin] = 40; 219 m_sensordata [LS_SensorMin] = 40;
220 m_sensordata [LS_SensorMax] = 215; 220 m_sensordata [LS_SensorMax] = 215;
221 m_sensordata [LS_LightMin] = 1; 221 m_sensordata [LS_LightMin] = 1;
222 m_sensordata [LS_LightMax] = 255; 222 m_sensordata [LS_LightMax] = 255;
223 m_sensordata [LS_Steps] = 12; 223 m_sensordata [LS_Steps] = 12;
224 m_sensordata [LS_Interval] = 2000; 224 m_sensordata [LS_Interval] = 2000;
225 225
226 for ( uint i = 0; i < LS_Count; i++ ) { 226 for ( uint i = 0; i < LS_Count; i++ ) {
227 if ( i < sl. count ( )) 227 if ( i < sl. count ( ))
228 m_sensordata [i] = sl [i]. toInt ( ); 228 m_sensordata [i] = sl [i]. toInt ( );
229 } 229 }
230 if ( m_sensordata [LS_Steps] < 2 ) // sanity check to avoid SIGFPE 230 if ( m_sensordata [LS_Steps] < 2 ) // sanity check to avoid SIGFPE
231 m_sensordata [LS_Steps] = 2; 231 m_sensordata [LS_Steps] = 2;
232 232
233 timerEvent ( 0 ); 233 timerEvent ( 0 );
234 startTimer ( m_sensordata [LS_Interval] ); 234 startTimer ( m_sensordata [LS_Interval] );
235 } 235 }
236 236
237 setBacklightInternal ( bright ); 237 setBacklightInternal ( bright );
@@ -270,35 +270,35 @@ void OpieScreenSaver::setBacklightInternal ( int bright )
270 m_backlight_current = bright; 270 m_backlight_current = bright;
271 } 271 }
272} 272}
273 273
274 274
275/** 275/**
276 * Timer event used for automatic setting the backlight according to a light sensor 276 * Timer event used for automatic setting the backlight according to a light sensor
277 * and to set the default brightness 277 * and to set the default brightness
278 */ 278 */
279void OpieScreenSaver::timerEvent ( QTimerEvent * ) 279void OpieScreenSaver::timerEvent ( QTimerEvent * )
280{ 280{
281 int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( ); 281 int s = ODevice::inst ( )-> readLightSensor ( ) * 256 / ODevice::inst ( )-> lightSensorResolution ( );
282 282
283 if ( s < m_sensordata [LS_SensorMin] ) 283 if ( s < m_sensordata [LS_SensorMin] )
284 m_backlight_sensor = m_sensordata [LS_LightMax]; 284 m_backlight_sensor = m_sensordata [LS_LightMax];
285 else if ( s >= m_sensordata [LS_SensorMax] ) 285 else if ( s >= m_sensordata [LS_SensorMax] )
286 m_backlight_sensor = m_sensordata [LS_LightMin]; 286 m_backlight_sensor = m_sensordata [LS_LightMin];
287 else { 287 else {
288 int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin]; 288 int dx = m_sensordata [LS_SensorMax] - m_sensordata [LS_SensorMin];
289 int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin]; 289 int dy = m_sensordata [LS_LightMax] - m_sensordata [LS_LightMin];
290 290
291 int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0 291 int stepno = ( s - m_sensordata [LS_SensorMin] ) * m_sensordata [LS_Steps] / dx; // dx is never 0
292 292
293 m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 ); 293 m_backlight_sensor = m_sensordata [LS_LightMax] - dy * stepno / ( m_sensordata [LS_Steps] - 1 );
294 } 294 }
295 295
296 //qDebug ( "f(%d) = %d [%d - %d] -> [%d - %d] / %d", s, m_backlight_sensor, m_sensordata [LS_SensorMin], m_sensordata [LS_SensorMax], m_sensordata [LS_LightMin], m_sensordata [LS_LightMax], m_sensordata [LS_Steps] ); 296 //qDebug ( "f(%d) = %d [%d - %d] -> [%d - %d] / %d", s, m_backlight_sensor, m_sensordata [LS_SensorMin], m_sensordata [LS_SensorMax], m_sensordata [LS_LightMin], m_sensordata [LS_LightMax], m_sensordata [LS_Steps] );
297 297
298 if ( m_level <= 0 ) 298 if ( m_level <= 0 )
299 setBacklightInternal ( -1 ); 299 setBacklightInternal ( -1 );
300} 300}
301 301
302 302
303/** 303/**
304 * Like ODevice::setDisplayStatus(), but keep current state in m_lcd_status. 304 * Like ODevice::setDisplayStatus(), but keep current state in m_lcd_status.
@@ -309,20 +309,20 @@ void OpieScreenSaver::setDisplayState ( bool on )
309 ODevice::inst ( ) -> setDisplayStatus ( on ); 309 ODevice::inst ( ) -> setDisplayStatus ( on );
310 m_lcd_status = on; 310 m_lcd_status = on;
311 } 311 }
312} 312}
313 313
314 314
315/** 315/**
316 * Set display to default ac/battery settings when power status changed. 316 * Set display to default ac/battery settings when power status changed.
317 */ 317 */
318void OpieScreenSaver::powerStatusChanged ( PowerStatus ps ) 318void OpieScreenSaver::powerStatusChanged ( PowerStatus ps )
319{ 319{
320 bool newonac = ( ps. acStatus ( ) == PowerStatus::Online ); 320 bool newonac = ( ps. acStatus ( ) == PowerStatus::Online );
321 321
322 if ( newonac != m_on_ac ) { 322 if ( newonac != m_on_ac ) {
323 m_on_ac = newonac; 323 m_on_ac = newonac;
324 setInterval ( -1 ); 324 setInterval ( -1 );
325 setBacklight ( -1 ); 325 setBacklight ( -1 );
326 restore ( ); 326 restore ( );
327 } 327 }
328} 328}
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index ea0b792..634082b 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -54,26 +54,26 @@
54#include <opie2/odevice.h> 54#include <opie2/odevice.h>
55 55
56#include <unistd.h> 56#include <unistd.h>
57#include <qmainwindow.h> 57#include <qmainwindow.h>
58#include <qmessagebox.h> 58#include <qmessagebox.h>
59#include <qtimer.h> 59#include <qtimer.h>
60#include <qtextstream.h> 60#include <qtextstream.h>
61 61
62#include <stdlib.h> 62#include <stdlib.h>
63 63
64extern QRect qt_maxWindowRect; 64extern QRect qt_maxWindowRect;
65 65
66using namespace Opie;
67 66
67using namespace Opie::Core;
68static QWidget *calibrate(bool) 68static QWidget *calibrate(bool)
69{ 69{
70#ifdef Q_WS_QWS 70#ifdef Q_WS_QWS
71 Calibrate *c = new Calibrate; 71 Calibrate *c = new Calibrate;
72 c->show(); 72 c->show();
73 return c; 73 return c;
74#else 74#else
75 return 0; 75 return 0;
76#endif 76#endif
77} 77}
78 78
79#define FACTORY(T) \ 79#define FACTORY(T) \
@@ -150,26 +150,26 @@ Server::Server() :
150 connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) ); 150 connect(appLauncher, SIGNAL(launched(int,const QString&)), this, SLOT(applicationLaunched(int,const QString&)) );
151 connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) ); 151 connect(appLauncher, SIGNAL(terminated(int,const QString&)), this, SLOT(applicationTerminated(int,const QString&)) );
152 connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) ); 152 connect(appLauncher, SIGNAL(connected(const QString&)), this, SLOT(applicationConnected(const QString&)) );
153 153
154 storage = new StorageInfo( this ); 154 storage = new StorageInfo( this );
155 connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) ); 155 connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) );
156 156
157 // start services 157 // start services
158 startTransferServer(); 158 startTransferServer();
159 (void) new IrServer( this ); 159 (void) new IrServer( this );
160 160
161 packageHandler = new PackageHandler( this ); 161 packageHandler = new PackageHandler( this );
162 connect(qApp, SIGNAL(activate(const Opie::ODeviceButton*,bool)), 162 connect(qApp, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)),
163 this,SLOT(activate(const Opie::ODeviceButton*,bool))); 163 this,SLOT(activate(const Opie::Core::ODeviceButton*,bool)));
164 164
165 setGeometry( -10, -10, 9, 9 ); 165 setGeometry( -10, -10, 9, 9 );
166 166
167 QCopChannel *channel = new QCopChannel("QPE/System", this); 167 QCopChannel *channel = new QCopChannel("QPE/System", this);
168 connect(channel, SIGNAL(received(const QCString&,const QByteArray&)), 168 connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
169 this, SLOT(systemMsg(const QCString&,const QByteArray&)) ); 169 this, SLOT(systemMsg(const QCString&,const QByteArray&)) );
170 170
171 QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this ); 171 QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this );
172 connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)), 172 connect( tbChannel, SIGNAL(received(const QCString&,const QByteArray&)),
173 this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) ); 173 this, SLOT(receiveTaskBar(const QCString&,const QByteArray&)) );
174 174
175 connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) ); 175 connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) );
@@ -212,28 +212,28 @@ static bool hasVisibleWindow(const QString& clientname, bool partial)
212# else 212# else
213 QRect mwr = qt_maxWindowRect; 213 QRect mwr = qt_maxWindowRect;
214# endif 214# endif
215 if ( mwr.contains(w->requested().boundingRect()) ) 215 if ( mwr.contains(w->requested().boundingRect()) )
216 return TRUE; 216 return TRUE;
217 } 217 }
218 } 218 }
219 } 219 }
220#endif 220#endif
221 return FALSE; 221 return FALSE;
222} 222}
223 223
224void Server::activate(const Opie::ODeviceButton* button, bool held) 224void Server::activate(const ODeviceButton* button, bool held)
225{ 225{
226 Global::terminateBuiltin("calibrate"); // No tr 226 Global::terminateBuiltin("calibrate"); // No tr
227 Opie::OQCopMessage om; 227 OQCopMessage om;
228 if ( held ) { 228 if ( held ) {
229 om = button->heldAction(); 229 om = button->heldAction();
230 } else { 230 } else {
231 om = button->pressedAction(); 231 om = button->pressedAction();
232 } 232 }
233 233
234 if ( om.channel() != "ignore" ) 234 if ( om.channel() != "ignore" )
235 om.send(); 235 om.send();
236 236
237 // A button with no action defined, will return a null ServiceRequest. Don't attempt 237 // A button with no action defined, will return a null ServiceRequest. Don't attempt
238 // to send/do anything with this as it will crash 238 // to send/do anything with this as it will crash
239 /* ### FIXME */ 239 /* ### FIXME */
diff --git a/core/launcher/server.h b/core/launcher/server.h
index 91bf883..1dc5e7e 100644
--- a/core/launcher/server.h
+++ b/core/launcher/server.h
@@ -29,47 +29,49 @@ class QCopBridge;
29class QHostAddress; 29class QHostAddress;
30class TransferServer; 30class TransferServer;
31class PackageHandler; 31class PackageHandler;
32class ServiceRequest; 32class ServiceRequest;
33class TempScreenSaverMonitor; 33class TempScreenSaverMonitor;
34class AppLauncher; 34class AppLauncher;
35class AppLnkSet; 35class AppLnkSet;
36class StorageInfo; 36class StorageInfo;
37class SyncDialog; 37class SyncDialog;
38class DocumentList; 38class DocumentList;
39class ServerInterface; 39class ServerInterface;
40namespace Opie { 40namespace Opie {
41namespace Core {
41 class ODeviceButton; 42 class ODeviceButton;
42} 43}
44}
43 45
44class Server : public QWidget { 46class Server : public QWidget {
45 Q_OBJECT 47 Q_OBJECT
46public: 48public:
47 Server(); 49 Server();
48 ~Server(); 50 ~Server();
49 51
50 static bool mkdir(const QString &path); 52 static bool mkdir(const QString &path);
51 53
52 void show(); 54 void show();
53 55
54 static bool setKeyboardLayout( const QString &kb ); 56 static bool setKeyboardLayout( const QString &kb );
55 57
56public slots: 58public slots:
57 void systemMsg(const QCString &, const QByteArray &); 59 void systemMsg(const QCString &, const QByteArray &);
58 void receiveTaskBar(const QCString &msg, const QByteArray &data); 60 void receiveTaskBar(const QCString &msg, const QByteArray &data);
59 void terminateServers(); 61 void terminateServers();
60 void pokeTimeMonitors(); 62 void pokeTimeMonitors();
61 63
62private slots: 64private slots:
63 void activate(const Opie::ODeviceButton*,bool); 65 void activate(const Opie::Core::ODeviceButton*,bool);
64 void syncConnectionClosed( const QHostAddress & ); 66 void syncConnectionClosed( const QHostAddress & );
65 void applicationLaunched(int pid, const QString &app); 67 void applicationLaunched(int pid, const QString &app);
66 void applicationTerminated(int pid, const QString &app); 68 void applicationTerminated(int pid, const QString &app);
67 void applicationConnected(const QString &app); 69 void applicationConnected(const QString &app);
68 void storageChanged(); 70 void storageChanged();
69 void cancelSync(); 71 void cancelSync();
70 72
71protected: 73protected:
72 void styleChange( QStyle & ); 74 void styleChange( QStyle & );
73 void timerEvent( QTimerEvent *e ); 75 void timerEvent( QTimerEvent *e );
74 76
75private: 77private:
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index d38dd97..e4e16f2 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -46,24 +46,25 @@
46#include <qpainter.h> 46#include <qpainter.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qpixmapcache.h> 48#include <qpixmapcache.h>
49 49
50#include <stdlib.h> 50#include <stdlib.h>
51#include "screensaver.h" 51#include "screensaver.h"
52 52
53static ServerApplication *serverApp = 0; 53static ServerApplication *serverApp = 0;
54static int loggedin=0; 54static int loggedin=0;
55 55
56using namespace Opie; 56using namespace Opie;
57 57
58using namespace Opie::Core;
58QCopKeyRegister::QCopKeyRegister() 59QCopKeyRegister::QCopKeyRegister()
59 : m_keyCode( 0 ) { 60 : m_keyCode( 0 ) {
60} 61}
61 62
62QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m ) 63QCopKeyRegister::QCopKeyRegister( int k, const QCString& c, const QCString& m )
63 :m_keyCode( k ), m_channel( c ), m_message( m ) { 64 :m_keyCode( k ), m_channel( c ), m_message( m ) {
64} 65}
65 66
66int QCopKeyRegister::keyCode()const { 67int QCopKeyRegister::keyCode()const {
67 return m_keyCode; 68 return m_keyCode;
68} 69}
69 70
@@ -188,25 +189,25 @@ bool KeyFilter::checkButtonAction(bool db, int keycode, int press, int autoRepe
188 && keycode != Key_Up 189 && keycode != Key_Up
189 && keycode != Key_Down ) 190 && keycode != Key_Down )
190 return TRUE; 191 return TRUE;
191 192
192 /* check if it was registered */ 193 /* check if it was registered */
193 if (!db ) { 194 if (!db ) {
194 if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) ) 195 if (keycode != 0 &&press && !autoRepeat && keyRegistered(keycode) )
195 return true; 196 return true;
196 }else { 197 }else {
197 198
198 199
199 // First check to see if DeviceButtonManager knows something about this button: 200 // First check to see if DeviceButtonManager knows something about this button:
200 const Opie::ODeviceButton* button = Opie::ODevice::inst()->buttonForKeycode(keycode); 201 const ODeviceButton* button = ODevice::inst()->buttonForKeycode(keycode);
201 if (button && !autoRepeat) { 202 if (button && !autoRepeat) {
202 if ( held_tid ) { 203 if ( held_tid ) {
203 killTimer(held_tid); 204 killTimer(held_tid);
204 held_tid = 0; 205 held_tid = 0;
205 } 206 }
206 if ( button->heldAction().isNull() ) { 207 if ( button->heldAction().isNull() ) {
207 if ( press ) 208 if ( press )
208 emit activate(button, FALSE); 209 emit activate(button, FALSE);
209 } else if ( press ) { 210 } else if ( press ) {
210 heldButton = button; 211 heldButton = button;
211 held_tid = startTimer( ODevice::inst ()->buttonHoldTime () ); 212 held_tid = startTimer( ODevice::inst ()->buttonHoldTime () );
212 } else if ( heldButton ) { 213 } else if ( heldButton ) {
@@ -322,42 +323,42 @@ ServerApplication::ServerApplication( int& argc, char **argv, Type t )
322 QTimer::singleShot(500, this, SLOT(showSafeMode()) ); 323 QTimer::singleShot(500, this, SLOT(showSafeMode()) );
323 QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); 324 QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
324#endif 325#endif
325 326
326 kf = new KeyFilter(this); 327 kf = new KeyFilter(this);
327 328
328 connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); 329 connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
329 connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); 330 connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
330 connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); 331 connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
331 connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); 332 connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
332 connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); 333 connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
333 connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); 334 connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
334 connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)), 335 connect( kf, SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)),
335 this,SIGNAL(activate(const Opie::ODeviceButton*,bool))); 336 this,SIGNAL(activate(const Opie::Core::ODeviceButton*,bool)));
336 337
337 338
338 connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) ); 339 connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
339 340
340 connect( this, SIGNAL(power() ), 341 connect( this, SIGNAL(power() ),
341 SLOT(togglePower() ) ); 342 SLOT(togglePower() ) );
342 343
343 rereadVolumes(); 344 rereadVolumes();
344 345
345 serverApp = this; 346 serverApp = this;
346 347
347 apmTimeout(); 348 apmTimeout();
348 grabKeyboard(); 349 grabKeyboard();
349 350
350 /* make sure the event filter is installed */ 351 /* make sure the event filter is installed */
351 const Opie::ODeviceButton* but = Opie::ODevice::inst()->buttonForKeycode( -1 ); 352 const ODeviceButton* but = ODevice::inst()->buttonForKeycode( -1 );
352} 353}
353 354
354 355
355ServerApplication::~ServerApplication() 356ServerApplication::~ServerApplication()
356{ 357{
357 ungrabKeyboard(); 358 ungrabKeyboard();
358 359
359 360
360 delete pa; 361 delete pa;
361 delete m_ps; 362 delete m_ps;
362 delete m_ps_last; 363 delete m_ps_last;
363} 364}
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h
index 4d9f808..916d83c 100644
--- a/core/launcher/serverapp.h
+++ b/core/launcher/serverapp.h
@@ -26,26 +26,28 @@
26#include <qwidget.h> 26#include <qwidget.h>
27#ifdef QWS 27#ifdef QWS
28#include <qwindowsystem_qws.h> 28#include <qwindowsystem_qws.h>
29#endif 29#endif
30 30
31#include "shutdownimpl.h" 31#include "shutdownimpl.h"
32 32
33class PowerStatus; 33class PowerStatus;
34class DesktopPowerAlerter; 34class DesktopPowerAlerter;
35 35
36class OpieScreenSaver; 36class OpieScreenSaver;
37namespace Opie { 37namespace Opie {
38namespace Core {
38 class ODeviceButton; 39 class ODeviceButton;
39} 40}
41}
40 42
41struct QCopKeyRegister { 43struct QCopKeyRegister {
42 QCopKeyRegister(); 44 QCopKeyRegister();
43 QCopKeyRegister( int k, const QCString&, const QCString& ); 45 QCopKeyRegister( int k, const QCString&, const QCString& );
44 int keyCode()const; 46 int keyCode()const;
45 QCString channel()const; 47 QCString channel()const;
46 QCString message()const; 48 QCString message()const;
47 inline bool send(); 49 inline bool send();
48 50
49private: 51private:
50 int m_keyCode; 52 int m_keyCode;
51 QCString m_channel, m_message; 53 QCString m_channel, m_message;
@@ -64,65 +66,65 @@ public:
64 66
65 67
66protected: 68protected:
67 void timerEvent(QTimerEvent*); 69 void timerEvent(QTimerEvent*);
68 70
69signals: 71signals:
70 void launch(); 72 void launch();
71 void power(); 73 void power();
72 void backlight(); 74 void backlight();
73 void symbol(); 75 void symbol();
74 void numLockStateToggle(); 76 void numLockStateToggle();
75 void capsLockStateToggle(); 77 void capsLockStateToggle();
76 void activate(const Opie::ODeviceButton*,bool); 78 void activate(const Opie::Core::ODeviceButton*,bool);
77 79
78 80
79private: 81private:
80 bool keyRegistered( int key ); 82 bool keyRegistered( int key );
81 int held_tid; 83 int held_tid;
82 const Opie::ODeviceButton* heldButton; 84 const Opie::Core::ODeviceButton* heldButton;
83 KeyRegisterList m_keys; 85 KeyRegisterList m_keys;
84}; 86};
85 87
86class ServerApplication : public QPEApplication 88class ServerApplication : public QPEApplication
87{ 89{
88 Q_OBJECT 90 Q_OBJECT
89public: 91public:
90 ServerApplication( int& argc, char **argv, Type t ); 92 ServerApplication( int& argc, char **argv, Type t );
91 ~ServerApplication(); 93 ~ServerApplication();
92 94
93 static bool doRestart; 95 static bool doRestart;
94 static bool allowRestart; 96 static bool allowRestart;
95 static bool screenLocked(); 97 static bool screenLocked();
96 static void login(bool at_poweron); 98 static void login(bool at_poweron);
97 99
98 static bool isStarting(); 100 static bool isStarting();
99 101
100 static void switchLCD ( bool on ); // only for togglePower in Desktop 102 static void switchLCD ( bool on ); // only for togglePower in Desktop
101 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar 103 static void soundAlarm(); // only because QCop soundAlarm() is defined in QPE/TaskBar
102 104
103 void restart(); 105 void restart();
104 int exec(); 106 int exec();
105 107
106signals: 108signals:
107 void menu(); 109 void menu();
108 void home(); 110 void home();
109 void launch(); 111 void launch();
110 void power(); 112 void power();
111 void backlight(); 113 void backlight();
112 void symbol(); 114 void symbol();
113 void numLockStateToggle(); 115 void numLockStateToggle();
114 void capsLockStateToggle(); 116 void capsLockStateToggle();
115 void prepareForRestart(); 117 void prepareForRestart();
116 void activate(const Opie::ODeviceButton*,bool); 118 void activate(const Opie::Core::ODeviceButton*,bool);
117 119
118public slots: 120public slots:
119 virtual void systemMessage( const QCString& msg, const QByteArray& ); 121 virtual void systemMessage( const QCString& msg, const QByteArray& );
120 virtual void launcherMessage( const QCString& msg, const QByteArray& ); 122 virtual void launcherMessage( const QCString& msg, const QByteArray& );
121 void rereadVolumes(); 123 void rereadVolumes();
122 124
123protected: 125protected:
124 bool eventFilter( QObject*, QEvent* ); 126 bool eventFilter( QObject*, QEvent* );
125#ifdef Q_WS_QWS 127#ifdef Q_WS_QWS
126 bool qwsEventFilter( QWSEvent * ); 128 bool qwsEventFilter( QWSEvent * );
127#endif 129#endif
128 void shutdown(); 130 void shutdown();
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index a5e20b2..e32cf41 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -50,24 +50,25 @@
50#include <qtopia/private/contact.h> 50#include <qtopia/private/contact.h>
51#include <qtopia/version.h> 51#include <qtopia/version.h>
52#ifdef Q_WS_QWS 52#ifdef Q_WS_QWS
53#include <qtopia/qcopenvelope_qws.h> 53#include <qtopia/qcopenvelope_qws.h>
54#endif 54#endif
55 55
56 56
57#include "transferserver.h" 57#include "transferserver.h"
58#include <qtopia/qprocess.h> 58#include <qtopia/qprocess.h>
59 59
60const int block_size = 51200; 60const int block_size = 51200;
61 61
62using namespace Opie::Core;
62TransferServer::TransferServer( Q_UINT16 port, QObject *parent, 63TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
63 const char* name) 64 const char* name)
64 : QServerSocket( port, 1, parent, name ) 65 : QServerSocket( port, 1, parent, name )
65{ 66{
66 connections.setAutoDelete( TRUE ); 67 connections.setAutoDelete( TRUE );
67 if ( !ok() ) 68 if ( !ok() )
68 qWarning( "Failed to bind to port %d", port ); 69 qWarning( "Failed to bind to port %d", port );
69} 70}
70 71
71void TransferServer::authorizeConnections() 72void TransferServer::authorizeConnections()
72{ 73{
73 QListIterator<ServerPI> it(connections); 74 QListIterator<ServerPI> it(connections);
diff --git a/core/launcher/wait.cpp b/core/launcher/wait.cpp
index 4148e57..a5b329d 100644
--- a/core/launcher/wait.cpp
+++ b/core/launcher/wait.cpp
@@ -20,24 +20,25 @@
20 20
21#include "wait.h" 21#include "wait.h"
22 22
23#include <qtopia/config.h> 23#include <qtopia/config.h>
24 24
25#include <opie2/owait.h> 25#include <opie2/owait.h>
26 26
27 27
28 28
29Wait *lastWaitObject = NULL; 29Wait *lastWaitObject = NULL;
30 30
31 31
32using namespace Opie::Ui;
32Wait::Wait( QWidget *parent ) : QWidget( parent ), 33Wait::Wait( QWidget *parent ) : QWidget( parent ),
33 pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE ) 34 pm( Resource::loadPixmap( "wait" ) ), waiting( FALSE )
34{ 35{
35 setFixedSize( pm.size() ); 36 setFixedSize( pm.size() );
36 lastWaitObject = this; 37 lastWaitObject = this;
37 m_centralWait = new OWait( 0l ); 38 m_centralWait = new OWait( 0l );
38 m_centralWait->hide(); 39 m_centralWait->hide();
39 hide(); 40 hide();
40} 41}
41 42
42 43
43Wait *Wait::getWaitObject() 44Wait *Wait::getWaitObject()
diff --git a/core/launcher/wait.h b/core/launcher/wait.h
index e7294d2..010fcc3 100644
--- a/core/launcher/wait.h
+++ b/core/launcher/wait.h
@@ -18,29 +18,29 @@
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#ifndef __WAIT_H__ 21#ifndef __WAIT_H__
22#define __WAIT_H__ 22#define __WAIT_H__
23 23
24#include <qtopia/resource.h> 24#include <qtopia/resource.h>
25 25
26#include <qwidget.h> 26#include <qwidget.h>
27#include <qpixmap.h> 27#include <qpixmap.h>
28#include <qpainter.h> 28#include <qpainter.h>
29 29
30class OWait; 30namespace Opie {namespace Ui {class OWait;}}
31class Wait : public QWidget 31class Wait : public QWidget
32{ 32{
33public: 33public:
34 Wait( QWidget *parent ); 34 Wait( QWidget *parent );
35 void setWaiting( bool w ); 35 void setWaiting( bool w );
36 void paintEvent( QPaintEvent * ); 36 void paintEvent( QPaintEvent * );
37 static Wait *getWaitObject(); 37 static Wait *getWaitObject();
38private: 38private:
39 QPixmap pm; 39 QPixmap pm;
40 bool waiting; 40 bool waiting;
41 OWait* m_centralWait; 41 Opie::Ui::OWait* m_centralWait;
42}; 42};
43 43
44 44
45#endif // __WAIT_H__ 45#endif // __WAIT_H__
46 46