summaryrefslogtreecommitdiff
path: root/core/launcher
Unidiff
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/appicons.cpp14
-rw-r--r--core/launcher/applauncher.cpp8
-rw-r--r--core/launcher/firstuse.cpp8
-rw-r--r--core/launcher/inputmethods.cpp4
-rw-r--r--core/launcher/launcher.cpp12
-rw-r--r--core/launcher/launcherview.cpp12
-rw-r--r--core/launcher/packageslave.cpp4
-rw-r--r--core/launcher/qcopbridge.cpp12
-rw-r--r--core/launcher/runningappbar.cpp4
-rw-r--r--core/launcher/server.cpp18
-rw-r--r--core/launcher/serverapp.cpp10
-rw-r--r--core/launcher/shutdownimpl.cpp6
-rw-r--r--core/launcher/taskbar.cpp4
-rw-r--r--core/launcher/transferserver.cpp12
14 files changed, 65 insertions, 63 deletions
diff --git a/core/launcher/appicons.cpp b/core/launcher/appicons.cpp
index c51ee5a..4d48b24 100644
--- a/core/launcher/appicons.cpp
+++ b/core/launcher/appicons.cpp
@@ -1,95 +1,97 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of the Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21 21
22#include "appicons.h" 22#include "appicons.h"
23 23
24#include <qpe/qcopenvelope_qws.h> 24#ifdef QWS
25#include <qtopia/qcopenvelope_qws.h>
26#endif
25 27
26#include <qtooltip.h> 28#include <qtooltip.h>
27#include <qpixmap.h> 29#include <qpixmap.h>
28 30
29 31
30AppIcons::AppIcons( QWidget *parent ) : 32AppIcons::AppIcons( QWidget *parent ) :
31 QHBox(parent) 33 QHBox(parent)
32{ 34{
33 buttons.setAutoDelete(TRUE); 35 buttons.setAutoDelete(TRUE);
34 36
35#ifndef QT_NO_COP 37#ifndef QT_NO_COP
36 QCopChannel* channel = new QCopChannel("Qt/Tray", this); 38 QCopChannel* channel = new QCopChannel("Qt/Tray", this);
37 connect(channel, SIGNAL(received(const QCString&, const QByteArray&)), 39 connect(channel, SIGNAL(received(const QCString&,const QByteArray&)),
38 this, SLOT(receive(const QCString&, const QByteArray&))); 40 this, SLOT(receive(const QCString&,const QByteArray&)));
39#endif 41#endif
40} 42}
41 43
42void AppIcons::setIcon(int id, const QPixmap& pm) 44void AppIcons::setIcon(int id, const QPixmap& pm)
43{ 45{
44 button(id)->setPixmap(pm); 46 button(id)->setPixmap(pm);
45} 47}
46 48
47class FlatButton : public QLabel { 49class FlatButton : public QLabel {
48 Q_OBJECT 50 Q_OBJECT
49public: 51public:
50 FlatButton(QWidget* parent) : QLabel(parent) { } 52 FlatButton(QWidget* parent) : QLabel(parent) { }
51 53
52 void mouseDoubleClickEvent(QMouseEvent* e) 54 void mouseDoubleClickEvent(QMouseEvent* e)
53 { 55 {
54 emit clicked(e->pos(),e->button(),TRUE); 56 emit clicked(e->pos(),e->button(),TRUE);
55 } 57 }
56 void mouseReleaseEvent(QMouseEvent* e) 58 void mouseReleaseEvent(QMouseEvent* e)
57 { 59 {
58 if ( rect().contains(e->pos()) ) 60 if ( rect().contains(e->pos()) )
59 emit clicked(e->pos(),e->button(),FALSE); 61 emit clicked(e->pos(),e->button(),FALSE);
60 } 62 }
61 63
62signals: 64signals:
63 void clicked(const QPoint&, int, bool); 65 void clicked(const QPoint&, int, bool);
64}; 66};
65 67
66QLabel* AppIcons::button(int id) 68QLabel* AppIcons::button(int id)
67{ 69{
68 QLabel* f = buttons.find(id); 70 QLabel* f = buttons.find(id);
69 if ( !f ) { 71 if ( !f ) {
70 buttons.insert(id,f=new FlatButton(this)); 72 buttons.insert(id,f=new FlatButton(this));
71 connect(f,SIGNAL(clicked(const QPoint&, int, bool)),this,SLOT(clicked(const QPoint&, int, bool))); 73 connect(f,SIGNAL(clicked(const QPoint&,int,bool)),this,SLOT(clicked(const QPoint&,int,bool)));
72 f->show(); 74 f->show();
73 } 75 }
74 return f; 76 return f;
75} 77}
76 78
77int AppIcons::findId(QLabel* b) 79int AppIcons::findId(QLabel* b)
78{ 80{
79 QIntDictIterator<QLabel> it(buttons); 81 QIntDictIterator<QLabel> it(buttons);
80 for ( ; ; ++it ) 82 for ( ; ; ++it )
81 if ( it.current() == b ) return it.currentKey(); 83 if ( it.current() == b ) return it.currentKey();
82} 84}
83 85
84void AppIcons::clicked(const QPoint& relpos, int button, bool dbl) 86void AppIcons::clicked(const QPoint& relpos, int button, bool dbl)
85{ 87{
86#ifndef QT_NO_COP 88#ifndef QT_NO_COP
87 QLabel* s = (QLabel*)sender(); 89 QLabel* s = (QLabel*)sender();
88 if ( button == RightButton ) { 90 if ( button == RightButton ) {
89 QCopEnvelope("Qt/Tray","popup(int,QPoint)") 91 QCopEnvelope("Qt/Tray","popup(int,QPoint)")
90 << findId(s) << s->mapToGlobal(QPoint(0,0)); 92 << findId(s) << s->mapToGlobal(QPoint(0,0));
91 } else { 93 } else {
92 QCopEnvelope("Qt/Tray", 94 QCopEnvelope("Qt/Tray",
93 dbl ? "doubleClicked(int,QPoint)" : "clicked(int,QPoint)") 95 dbl ? "doubleClicked(int,QPoint)" : "clicked(int,QPoint)")
94 << findId(s) << relpos; 96 << findId(s) << relpos;
95 } 97 }
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
index 7d3c032..08a3cb4 100644
--- a/core/launcher/applauncher.cpp
+++ b/core/launcher/applauncher.cpp
@@ -65,54 +65,54 @@ const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
65static AppLauncher* appLauncherPtr; 65static AppLauncher* appLauncherPtr;
66 66
67const int appStopEventID = 1290; 67const int appStopEventID = 1290;
68 68
69class AppStoppedEvent : public QCustomEvent 69class AppStoppedEvent : public QCustomEvent
70{ 70{
71public: 71public:
72 AppStoppedEvent(int pid, int status) 72 AppStoppedEvent(int pid, int status)
73 : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { } 73 : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { }
74 74
75 int pid() { return mPid; } 75 int pid() { return mPid; }
76 int status() { return mStatus; } 76 int status() { return mStatus; }
77 77
78private: 78private:
79 int mPid, mStatus; 79 int mPid, mStatus;
80}; 80};
81 81
82AppLauncher::AppLauncher(QObject *parent, const char *name) 82AppLauncher::AppLauncher(QObject *parent, const char *name)
83 : QObject(parent, name), qlPid(0), qlReady(FALSE), 83 : QObject(parent, name), qlPid(0), qlReady(FALSE),
84 appKillerBox(0) 84 appKillerBox(0)
85{ 85{
86 connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&))); 86 connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&)));
87 connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&))); 87 connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&)));
88 QCopChannel* channel = new QCopChannel( "QPE/System", this ); 88 QCopChannel* channel = new QCopChannel( "QPE/System", this );
89 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 89 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
90 this, SLOT(received(const QCString&, const QByteArray&)) ); 90 this, SLOT(received(const QCString&,const QByteArray&)) );
91 91
92 channel = new QCopChannel( "QPE/Server", this ); 92 channel = new QCopChannel( "QPE/Server", this );
93 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 93 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
94 this, SLOT(received(const QCString&, const QByteArray&)) ); 94 this, SLOT(received(const QCString&,const QByteArray&)) );
95 95
96#ifndef Q_OS_WIN32 96#ifndef Q_OS_WIN32
97 signal(SIGCHLD, signalHandler); 97 signal(SIGCHLD, signalHandler);
98#else 98#else
99 runningAppsProc.setAutoDelete( TRUE ); 99 runningAppsProc.setAutoDelete( TRUE );
100#endif 100#endif
101 QString tmp = qApp->argv()[0]; 101 QString tmp = qApp->argv()[0];
102 int pos = tmp.findRev('/'); 102 int pos = tmp.findRev('/');
103 if ( pos > -1 ) 103 if ( pos > -1 )
104 tmp = tmp.mid(++pos); 104 tmp = tmp.mid(++pos);
105 runningApps[::getpid()] = tmp; 105 runningApps[::getpid()] = tmp;
106 106
107 appLauncherPtr = this; 107 appLauncherPtr = this;
108 108
109 QTimer::singleShot( 1000, this, SLOT(createQuickLauncher()) ); 109 QTimer::singleShot( 1000, this, SLOT(createQuickLauncher()) );
110} 110}
111 111
112AppLauncher::~AppLauncher() 112AppLauncher::~AppLauncher()
113{ 113{
114 appLauncherPtr = 0; 114 appLauncherPtr = 0;
115#ifndef Q_OS_WIN32 115#ifndef Q_OS_WIN32
116 signal(SIGCHLD, SIG_DFL); 116 signal(SIGCHLD, SIG_DFL);
117#endif 117#endif
118 if ( qlPid ) { 118 if ( qlPid ) {
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
index 50ae6c2..4316648 100644
--- a/core/launcher/firstuse.cpp
+++ b/core/launcher/firstuse.cpp
@@ -77,50 +77,50 @@ settingsTable [] =
77 QT_TR_NOOP("Time and Date") }, 77 QT_TR_NOOP("Time and Date") },
78#endif 78#endif
79 { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr 79 { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
80 QT_TR_NOOP("Personal Information") }, 80 QT_TR_NOOP("Personal Information") },
81 { FALSE, 0, 0, 0, 0 } 81 { FALSE, 0, 0, 0, 0 }
82}; 82};
83 83
84 84
85FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) : 85FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
86 QDialog( parent, name, TRUE, wf), 86 QDialog( parent, name, TRUE, wf),
87 transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1), 87 transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1),
88 waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE) 88 waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE)
89{ 89{
90 ServerApplication::allowRestart = FALSE; 90 ServerApplication::allowRestart = FALSE;
91 // we force our height beyound the maximum (which we set anyway) 91 // we force our height beyound the maximum (which we set anyway)
92 QRect desk = qApp->desktop()->geometry(); 92 QRect desk = qApp->desktop()->geometry();
93 setGeometry( 0, 0, desk.width(), desk.height() ); 93 setGeometry( 0, 0, desk.width(), desk.height() );
94 94
95 connect(qwsServer, SIGNAL(newChannel(const QString&)), 95 connect(qwsServer, SIGNAL(newChannel(const QString&)),
96 this, SLOT(newQcopChannel(const QString&))); 96 this, SLOT(newQcopChannel(const QString&)));
97 97
98 // Create a DocumentList so appLauncher has appLnkSet to search 98 // Create a DocumentList so appLauncher has appLnkSet to search
99 docList = new DocumentList( 0, FALSE ); 99 docList = new DocumentList( 0, FALSE );
100 appLauncher = new AppLauncher( this ); 100 appLauncher = new AppLauncher( this );
101 connect( appLauncher, SIGNAL(terminated(int, const QString&)), 101 connect( appLauncher, SIGNAL(terminated(int,const QString&)),
102 this, SLOT(terminated(int, const QString&)) ); 102 this, SLOT(terminated(int,const QString&)) );
103 103
104 // more hackery 104 // more hackery
105 // I will be run as either the main server or as part of the main server 105 // I will be run as either the main server or as part of the main server
106 QWSServer::setScreenSaverIntervals(0); 106 QWSServer::setScreenSaverIntervals(0);
107 loadPixmaps(); 107 loadPixmaps();
108 108
109 //check if there is a language program 109 //check if there is a language program
110#ifndef Q_OS_WIN32 110#ifndef Q_OS_WIN32
111 QString exeSuffix; 111 QString exeSuffix;
112#else 112#else
113 QString exeSuffix(".exe"); 113 QString exeSuffix(".exe");
114#endif 114#endif
115 115
116 for ( int i = 0; settingsTable[i].app; i++ ) { 116 for ( int i = 0; settingsTable[i].app; i++ ) {
117 QString file = QPEApplication::qpeDir() + "bin/"; 117 QString file = QPEApplication::qpeDir() + "bin/";
118 file += settingsTable[i].app; 118 file += settingsTable[i].app;
119 file += exeSuffix; 119 file += exeSuffix;
120 if ( QFile::exists(file) ) 120 if ( QFile::exists(file) )
121 settingsTable[i].enabled = TRUE; 121 settingsTable[i].enabled = TRUE;
122 } 122 }
123 123
124 setFocusPolicy(NoFocus); 124 setFocusPolicy(NoFocus);
125 125
126 taskBar = new QWidget(0, 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | WGroupLeader); 126 taskBar = new QWidget(0, 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | WGroupLeader);
@@ -136,50 +136,50 @@ FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
136 next = new QPushButton(tr("Next >>"), taskBar); 136 next = new QPushButton(tr("Next >>"), taskBar);
137 next->setFocusPolicy(NoFocus); 137 next->setFocusPolicy(NoFocus);
138 connect(next, SIGNAL(clicked()), this, SLOT(nextDialog()) ); 138 connect(next, SIGNAL(clicked()), this, SLOT(nextDialog()) );
139 139
140 // need to set the geom to lower corner 140 // need to set the geom to lower corner
141 QSize sz = inputMethods->sizeHint(); 141 QSize sz = inputMethods->sizeHint();
142 int buttonWidth = (width() - sz.width()) / 2; 142 int buttonWidth = (width() - sz.width()) / 2;
143 int x = 0; 143 int x = 0;
144 144
145 controlHeight = back->sizeHint().height(); 145 controlHeight = back->sizeHint().height();
146 146
147 inputMethods->setGeometry(0,0, sz.width(), controlHeight ); 147 inputMethods->setGeometry(0,0, sz.width(), controlHeight );
148 x += sz.width(); 148 x += sz.width();
149 149
150 back->setGeometry(x, 0, buttonWidth, controlHeight); 150 back->setGeometry(x, 0, buttonWidth, controlHeight);
151 x += buttonWidth; 151 x += buttonWidth;
152 next->setGeometry(x, 0, buttonWidth, controlHeight); 152 next->setGeometry(x, 0, buttonWidth, controlHeight);
153 153
154 taskBar->setGeometry( 0, height() - controlHeight, desk.width(), controlHeight); 154 taskBar->setGeometry( 0, height() - controlHeight, desk.width(), controlHeight);
155 taskBar->hide(); 155 taskBar->hide();
156 156
157#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 157#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
158 qDebug("Setting up QCop to QPE/System"); 158 qDebug("Setting up QCop to QPE/System");
159 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 159 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
160 connect(sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), 160 connect(sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
161 this, SLOT(message(const QCString &, const QByteArray &)) ); 161 this, SLOT(message(const QCString&,const QByteArray&)) );
162#endif 162#endif
163 calcMaxWindowRect(); 163 calcMaxWindowRect();
164 164
165 m_calHandler = ( QWSServer::mouseHandler() && QWSServer::mouseHandler()->inherits("QCalibratedMouseHandler") ) ? true : false; 165 m_calHandler = ( QWSServer::mouseHandler() && QWSServer::mouseHandler()->inherits("QCalibratedMouseHandler") ) ? true : false;
166 166
167 if ( m_calHandler) { 167 if ( m_calHandler) {
168 if ( !QFile::exists("/etc/pointercal") ) { 168 if ( !QFile::exists("/etc/pointercal") ) {
169 needCalibrate = TRUE; 169 needCalibrate = TRUE;
170 grabMouse(); 170 grabMouse();
171 } 171 }
172 } 172 }
173 173
174 Config config("locale"); 174 Config config("locale");
175 config.setGroup( "Language"); 175 config.setGroup( "Language");
176 lang = config.readEntry( "Language", "en"); 176 lang = config.readEntry( "Language", "en");
177 177
178 defaultFont = font(); 178 defaultFont = font();
179 179
180 //###language/font hack; should look it up somewhere 180 //###language/font hack; should look it up somewhere
181#ifdef Q_WS_QWS 181#ifdef Q_WS_QWS
182 if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) { 182 if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
183 QFont fn = FontManager::unicodeFont( FontManager::Proportional ); 183 QFont fn = FontManager::unicodeFont( FontManager::Proportional );
184 qApp->setFont( fn, TRUE ); 184 qApp->setFont( fn, TRUE );
185 } 185 }
diff --git a/core/launcher/inputmethods.cpp b/core/launcher/inputmethods.cpp
index 683f1e2..19e799a 100644
--- a/core/launcher/inputmethods.cpp
+++ b/core/launcher/inputmethods.cpp
@@ -124,50 +124,50 @@ InputMethods::InputMethods( QWidget *parent ) :
124 124
125 connect( (QPEApplication*)qApp, SIGNAL(clientMoused()), 125 connect( (QPEApplication*)qApp, SIGNAL(clientMoused()),
126 this, SLOT(resetStates()) ); 126 this, SLOT(resetStates()) );
127 127
128 128
129 imButton = new QWidgetStack( this ); // later a widget stack 129 imButton = new QWidgetStack( this ); // later a widget stack
130 imButton->setFocusPolicy(NoFocus); 130 imButton->setFocusPolicy(NoFocus);
131 if (parent->sizeHint().height() > 0) 131 if (parent->sizeHint().height() > 0)
132 imButton->setFixedHeight( parent->sizeHint().height() ); 132 imButton->setFixedHeight( parent->sizeHint().height() );
133 hbox->addWidget(imButton); 133 hbox->addWidget(imButton);
134 134
135 imChoice = new QToolButton( this ); 135 imChoice = new QToolButton( this );
136 imChoice->setFocusPolicy(NoFocus); 136 imChoice->setFocusPolicy(NoFocus);
137 imChoice->setPixmap( QPixmap( (const char **)tri_xpm ) ); 137 imChoice->setPixmap( QPixmap( (const char **)tri_xpm ) );
138 if (parent->sizeHint().height() > 0) 138 if (parent->sizeHint().height() > 0)
139 imChoice->setFixedHeight( parent->sizeHint().height() ); 139 imChoice->setFixedHeight( parent->sizeHint().height() );
140 imChoice->setFixedWidth( 13 ); 140 imChoice->setFixedWidth( 13 );
141 imChoice->setAutoRaise( TRUE ); 141 imChoice->setAutoRaise( TRUE );
142 hbox->addWidget( imChoice ); 142 hbox->addWidget( imChoice );
143 connect( imChoice, SIGNAL(clicked()), this, SLOT(chooseIm()) ); 143 connect( imChoice, SIGNAL(clicked()), this, SLOT(chooseIm()) );
144 144
145 loadInputMethods(); 145 loadInputMethods();
146 146
147 QCopChannel *channel = new QCopChannel( "QPE/IME", this ); 147 QCopChannel *channel = new QCopChannel( "QPE/IME", this );
148 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 148 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
149 this, SLOT(qcopReceive(const QCString&, const QByteArray&)) ); 149 this, SLOT(qcopReceive(const QCString&,const QByteArray&)) );
150} 150}
151 151
152InputMethods::~InputMethods() 152InputMethods::~InputMethods()
153{ 153{
154 Config cfg("qpe"); 154 Config cfg("qpe");
155 cfg.setGroup("InputMethod"); 155 cfg.setGroup("InputMethod");
156 if (imethod) 156 if (imethod)
157 cfg.writeEntry("im", imethod->name() ); 157 cfg.writeEntry("im", imethod->name() );
158 if (mkeyboard) 158 if (mkeyboard)
159 cfg.writeEntry("current", mkeyboard->name() ); 159 cfg.writeEntry("current", mkeyboard->name() );
160 160
161 unloadInputMethods(); 161 unloadInputMethods();
162} 162}
163 163
164void InputMethods::hideInputMethod() 164void InputMethods::hideInputMethod()
165{ 165{
166 kbdButton->setOn( FALSE ); 166 kbdButton->setOn( FALSE );
167} 167}
168 168
169void InputMethods::showInputMethod() 169void InputMethods::showInputMethod()
170{ 170{
171 kbdButton->setOn( TRUE ); 171 kbdButton->setOn( TRUE );
172} 172}
173 173
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 54efb0b..5d0c778 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -77,52 +77,52 @@
77 77
78 78
79static bool isVisibleWindow( int ); 79static bool isVisibleWindow( int );
80//=========================================================================== 80//===========================================================================
81 81
82LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : 82LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
83 QVBox( parent ), docview( 0 ) 83 QVBox( parent ), docview( 0 )
84{ 84{
85 docLoadingWidgetEnabled = false; 85 docLoadingWidgetEnabled = false;
86 docLoadingWidget = 0; 86 docLoadingWidget = 0;
87 docLoadingWidgetProgress = 0; 87 docLoadingWidgetProgress = 0;
88 launcher = parent; 88 launcher = parent;
89 categoryBar = new LauncherTabBar( this ); 89 categoryBar = new LauncherTabBar( this );
90 QPalette pal = categoryBar->palette(); 90 QPalette pal = categoryBar->palette();
91 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); 91 pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) );
92 pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); 92 pal.setColor( QColorGroup::Background, pal.active().background().light(110) );
93 categoryBar->setPalette( pal ); 93 categoryBar->setPalette( pal );
94 stack = new QWidgetStack(this); 94 stack = new QWidgetStack(this);
95 connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) ); 95 connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) );
96 categoryBar->show(); 96 categoryBar->show();
97 stack->show(); 97 stack->show();
98 98
99#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 99#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
100 QCopChannel *channel = new QCopChannel( "QPE/Launcher", this ); 100 QCopChannel *channel = new QCopChannel( "QPE/Launcher", this );
101 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 101 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
102 this, SLOT(launcherMessage(const QCString&, const QByteArray&)) ); 102 this, SLOT(launcherMessage(const QCString&,const QByteArray&)) );
103 connect( qApp, SIGNAL(appMessage(const QCString&, const QByteArray&)), 103 connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)),
104 this, SLOT(appMessage(const QCString&, const QByteArray&))); 104 this, SLOT(appMessage(const QCString&,const QByteArray&)));
105#endif 105#endif
106 106
107 createDocLoadingWidget(); 107 createDocLoadingWidget();
108} 108}
109 109
110void LauncherTabWidget::createDocLoadingWidget() 110void LauncherTabWidget::createDocLoadingWidget()
111{ 111{
112 // Construct the 'doc loading widget' shown when finding documents 112 // Construct the 'doc loading widget' shown when finding documents
113 113
114 // ### LauncherView class needs changing to be more generic so 114 // ### LauncherView class needs changing to be more generic so
115 // this widget can change its background similar to the iconviews 115 // this widget can change its background similar to the iconviews
116 // so the background for this matches 116 // so the background for this matches
117 docLoadingWidget = new LauncherView( stack ); 117 docLoadingWidget = new LauncherView( stack );
118 docLoadingWidget->hideIcons(); 118 docLoadingWidget->hideIcons();
119 QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); 119 QVBox *docLoadingVBox = new QVBox( docLoadingWidget );
120 120
121 docLoadingVBox->setSpacing( 20 ); 121 docLoadingVBox->setSpacing( 20 );
122 docLoadingVBox->setMargin( 10 ); 122 docLoadingVBox->setMargin( 10 );
123 123
124 QWidget *space1 = new QWidget( docLoadingVBox ); 124 QWidget *space1 = new QWidget( docLoadingVBox );
125 docLoadingVBox->setStretchFactor( space1, 1 ); 125 docLoadingVBox->setStretchFactor( space1, 1 );
126 126
127 QLabel *waitPixmap = new QLabel( docLoadingVBox ); 127 QLabel *waitPixmap = new QLabel( docLoadingVBox );
128 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); 128 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
@@ -456,50 +456,50 @@ void Launcher::createGUI()
456 tabs = new LauncherTabWidget( this ); 456 tabs = new LauncherTabWidget( this );
457 setCentralWidget( tabs ); 457 setCentralWidget( tabs );
458 458
459 ServerInterface::dockWidget( tb, ServerInterface::Bottom ); 459 ServerInterface::dockWidget( tb, ServerInterface::Bottom );
460 tb->show(); 460 tb->show();
461 461
462 qApp->installEventFilter( this ); 462 qApp->installEventFilter( this );
463 463
464 464
465 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); 465 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
466 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); 466 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
467 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); 467 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
468 468
469 connect( tb, SIGNAL(tabSelected(const QString&)), 469 connect( tb, SIGNAL(tabSelected(const QString&)),
470 this, SLOT(showTab(const QString&)) ); 470 this, SLOT(showTab(const QString&)) );
471 connect( tabs, SIGNAL(selected(const QString&)), 471 connect( tabs, SIGNAL(selected(const QString&)),
472 this, SLOT(viewSelected(const QString&)) ); 472 this, SLOT(viewSelected(const QString&)) );
473 connect( tabs, SIGNAL(clicked(const AppLnk*)), 473 connect( tabs, SIGNAL(clicked(const AppLnk*)),
474 this, SLOT(select(const AppLnk*))); 474 this, SLOT(select(const AppLnk*)));
475 connect( tabs, SIGNAL(rightPressed(AppLnk*)), 475 connect( tabs, SIGNAL(rightPressed(AppLnk*)),
476 this, SLOT(properties(AppLnk*))); 476 this, SLOT(properties(AppLnk*)));
477 477
478#if defined(Q_WS_QWS) && !defined(QT_NO_COP) 478#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
479 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); 479 QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
480 connect( sysChannel, SIGNAL(received(const QCString &, const QByteArray &)), 480 connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)),
481 this, SLOT(systemMessage( const QCString &, const QByteArray &)) ); 481 this, SLOT(systemMessage(const QCString&,const QByteArray&)) );
482#endif 482#endif
483 483
484 // all documents 484 // all documents
485 QImage img( Resource::loadImage( "DocsIcon" ) ); 485 QImage img( Resource::loadImage( "DocsIcon" ) );
486 QPixmap pm; 486 QPixmap pm;
487 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 487 pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
488 // It could add this itself if it handles docs 488 // It could add this itself if it handles docs
489 489
490 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); 490 tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE );
491 491
492 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); 492 QTimer::singleShot( 0, tabs, SLOT( initLayout() ) );
493 qApp->setMainWidget( this ); 493 qApp->setMainWidget( this );
494 QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); 494 QTimer::singleShot( 500, this, SLOT( makeVisible() ) );
495} 495}
496 496
497Launcher::~Launcher() 497Launcher::~Launcher()
498{ 498{
499 if ( tb ) 499 if ( tb )
500 destroyGUI(); 500 destroyGUI();
501} 501}
502 502
503 bool Launcher::requiresDocuments() const 503 bool Launcher::requiresDocuments() const
504 { 504 {
505 Config cfg( "Launcher" ); 505 Config cfg( "Launcher" );
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index 513b1bd..6c7d487 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -594,56 +594,56 @@ bool LauncherIconView::removeLink(const QString& linkfile)
594 return did; 594 return did;
595} 595}
596 596
597//=========================================================================== 597//===========================================================================
598 598
599LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) 599LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
600 : QVBox( parent, name, fl ) 600 : QVBox( parent, name, fl )
601{ 601{
602 catmb = 0; 602 catmb = 0;
603 icons = new LauncherIconView( this ); 603 icons = new LauncherIconView( this );
604 setFocusProxy(icons); 604 setFocusProxy(icons);
605 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); 605 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
606 606
607 icons->setItemsMovable( FALSE ); 607 icons->setItemsMovable( FALSE );
608 icons->setAutoArrange( TRUE ); 608 icons->setAutoArrange( TRUE );
609 icons->setSorting( TRUE ); 609 icons->setSorting( TRUE );
610 icons->setFrameStyle( QFrame::NoFrame ); 610 icons->setFrameStyle( QFrame::NoFrame );
611 icons->setMargin( 0 ); 611 icons->setMargin( 0 );
612 icons->setSelectionMode( QIconView::NoSelection ); 612 icons->setSelectionMode( QIconView::NoSelection );
613 icons->setBackgroundMode( PaletteBase ); 613 icons->setBackgroundMode( PaletteBase );
614 icons->setResizeMode( QIconView::Fixed ); 614 icons->setResizeMode( QIconView::Fixed );
615 vmode = (ViewMode)-1; 615 vmode = (ViewMode)-1;
616 setViewMode( Icon ); 616 setViewMode( Icon );
617 617
618 connect( icons, SIGNAL(mouseButtonClicked(int, QIconViewItem *, const QPoint&)), 618 connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)),
619 SLOT(itemClicked(int, QIconViewItem *)) ); 619 SLOT(itemClicked(int,QIconViewItem*)) );
620 connect( icons, SIGNAL(selectionChanged()), 620 connect( icons, SIGNAL(selectionChanged()),
621 SLOT(selectionChanged()) ); 621 SLOT(selectionChanged()) );
622 connect( icons, SIGNAL(returnPressed(QIconViewItem *)), 622 connect( icons, SIGNAL(returnPressed(QIconViewItem*)),
623 SLOT(returnPressed(QIconViewItem *)) ); 623 SLOT(returnPressed(QIconViewItem*)) );
624 connect( icons, SIGNAL(mouseButtonPressed(int, QIconViewItem *, const QPoint&)), 624 connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)),
625 SLOT(itemPressed(int, QIconViewItem *)) ); 625 SLOT(itemPressed(int,QIconViewItem*)) );
626 626
627 tools = 0; 627 tools = 0;
628 setBackgroundType( Ruled, QString::null ); 628 setBackgroundType( Ruled, QString::null );
629} 629}
630 630
631LauncherView::~LauncherView() 631LauncherView::~LauncherView()
632{ 632{
633 if ( bgCache && bgCache->contains( bgName ) ) 633 if ( bgCache && bgCache->contains( bgName ) )
634 (*bgCache)[bgName]->ref--; 634 (*bgCache)[bgName]->ref--;
635} 635}
636 636
637void LauncherView::hideIcons() 637void LauncherView::hideIcons()
638{ 638{
639 icons->hide(); 639 icons->hide();
640} 640}
641 641
642void LauncherView::setToolsEnabled(bool y) 642void LauncherView::setToolsEnabled(bool y)
643{ 643{
644 if ( !y != !tools ) { 644 if ( !y != !tools ) {
645 if ( y ) { 645 if ( y ) {
646 tools = new QHBox(this); 646 tools = new QHBox(this);
647 647
648 // Type filter 648 // Type filter
649 typemb = new QComboBox(tools); 649 typemb = new QComboBox(tools);
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp
index 321b5dd..7e61b0e 100644
--- a/core/launcher/packageslave.cpp
+++ b/core/launcher/packageslave.cpp
@@ -31,50 +31,50 @@
31 31
32#include <qtextstream.h> 32#include <qtextstream.h>
33 33
34#include <stdlib.h> 34#include <stdlib.h>
35#include <sys/stat.h> // mkdir() 35#include <sys/stat.h> // mkdir()
36 36
37#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 37#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
38#include <unistd.h> 38#include <unistd.h>
39#include <sys/vfs.h> 39#include <sys/vfs.h>
40#include <mntent.h> 40#include <mntent.h>
41#elif defined(Q_OS_WIN32) 41#elif defined(Q_OS_WIN32)
42#include <windows.h> 42#include <windows.h>
43#include <winbase.h> 43#include <winbase.h>
44#elif defined(Q_OS_MACX) 44#elif defined(Q_OS_MACX)
45#include <unistd.h> 45#include <unistd.h>
46#endif 46#endif
47 47
48 48
49PackageHandler::PackageHandler( QObject *parent, char* name ) 49PackageHandler::PackageHandler( QObject *parent, char* name )
50 : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE ) 50 : QObject( parent, name ), packageChannel( 0 ), currentProcess( 0 ), mNoSpaceLeft( FALSE )
51{ 51{
52 // setup qcop channel 52 // setup qcop channel
53#ifndef QT_NO_COP 53#ifndef QT_NO_COP
54 packageChannel = new QCopChannel( "QPE/Package", this ); 54 packageChannel = new QCopChannel( "QPE/Package", this );
55 connect( packageChannel, SIGNAL( received(const QCString &, const QByteArray &) ), 55 connect( packageChannel, SIGNAL( received(const QCString&,const QByteArray&) ),
56 this, SLOT( qcopMessage( const QCString &, const QByteArray &) ) ); 56 this, SLOT( qcopMessage(const QCString&,const QByteArray&) ) );
57#endif 57#endif
58} 58}
59 59
60void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data ) 60void PackageHandler::qcopMessage( const QCString &msg, const QByteArray &data )
61{ 61{
62 QDataStream stream( data, IO_ReadOnly ); 62 QDataStream stream( data, IO_ReadOnly );
63 63
64 if ( msg == "installPackage(QString)" ) { 64 if ( msg == "installPackage(QString)" ) {
65 QString file; 65 QString file;
66 stream >> file; 66 stream >> file;
67 installPackage( file ); 67 installPackage( file );
68 } else if ( msg == "removePackage(QString)" ) { 68 } else if ( msg == "removePackage(QString)" ) {
69 QString file; 69 QString file;
70 stream >> file; 70 stream >> file;
71 removePackage( file ); 71 removePackage( file );
72 } else if ( msg == "addPackageFiles(QString,QString)" ) { 72 } else if ( msg == "addPackageFiles(QString,QString)" ) {
73 QString location, listfile; 73 QString location, listfile;
74 stream >> location >> listfile; 74 stream >> location >> listfile;
75 addPackageFiles( location, listfile); 75 addPackageFiles( location, listfile);
76 } else if ( msg == "addPackages(QString)" ) { 76 } else if ( msg == "addPackages(QString)" ) {
77 QString location; 77 QString location;
78 stream >> location; 78 stream >> location;
79 addPackages( location ); 79 addPackages( location );
80 } else if ( msg == "cleanupPackageFiles(QString)" ) { 80 } else if ( msg == "cleanupPackageFiles(QString)" ) {
diff --git a/core/launcher/qcopbridge.cpp b/core/launcher/qcopbridge.cpp
index 24f471d..53efba4 100644
--- a/core/launcher/qcopbridge.cpp
+++ b/core/launcher/qcopbridge.cpp
@@ -44,87 +44,87 @@
44#include <unistd.h> 44#include <unistd.h>
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
57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent, 57QCopBridge::QCopBridge( Q_UINT16 port, QObject *parent,
58 const char* name ) 58 const char* name )
59 : QServerSocket( port, 1, parent, name ), 59 : QServerSocket( port, 1, parent, name ),
60 desktopChannel( 0 ), 60 desktopChannel( 0 ),
61 cardChannel( 0 ) 61 cardChannel( 0 )
62{ 62{
63 if ( !ok() ) 63 if ( !ok() )
64 qWarning( "Failed to bind to port %d", port ); 64 qWarning( "Failed to bind to port %d", port );
65 else { 65 else {
66#ifndef QT_NO_COP 66#ifndef QT_NO_COP
67 desktopChannel = new QCopChannel( "QPE/Desktop", this ); 67 desktopChannel = new QCopChannel( "QPE/Desktop", this );
68 connect( desktopChannel, SIGNAL(received(const QCString &, const QByteArray &)), 68 connect( desktopChannel, SIGNAL(received(const QCString&,const QByteArray&)),
69 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); 69 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
70 cardChannel = new QCopChannel( "QPE/Card", this ); 70 cardChannel = new QCopChannel( "QPE/Card", this );
71 connect( cardChannel, SIGNAL(received(const QCString &, const QByteArray &)), 71 connect( cardChannel, SIGNAL(received(const QCString&,const QByteArray&)),
72 this, SLOT(desktopMessage( const QCString &, const QByteArray &)) ); 72 this, SLOT(desktopMessage(const QCString&,const QByteArray&)) );
73#endif 73#endif
74 } 74 }
75 sendSync = FALSE; 75 sendSync = FALSE;
76 openConnections.setAutoDelete( TRUE ); 76 openConnections.setAutoDelete( TRUE );
77 authorizeConnections(); 77 authorizeConnections();
78} 78}
79 79
80QCopBridge::~QCopBridge() 80QCopBridge::~QCopBridge()
81{ 81{
82#ifndef QT_NO_COP 82#ifndef QT_NO_COP
83 delete desktopChannel; 83 delete desktopChannel;
84#endif 84#endif
85} 85}
86 86
87void QCopBridge::authorizeConnections() 87void QCopBridge::authorizeConnections()
88{ 88{
89 Config cfg("Security"); 89 Config cfg("Security");
90 cfg.setGroup("SyncMode"); 90 cfg.setGroup("SyncMode");
91 m_mode = Mode(cfg.readNumEntry("Mode", Sharp )); 91 m_mode = Mode(cfg.readNumEntry("Mode", Sharp ));
92 QListIterator<QCopBridgePI> it(openConnections); 92 QListIterator<QCopBridgePI> it(openConnections);
93 while ( it.current() ) { 93 while ( it.current() ) {
94 if ( !it.current()->verifyAuthorised() ) { 94 if ( !it.current()->verifyAuthorised() ) {
95 disconnect ( it.current(), SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) ); 95 disconnect ( it.current(), SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
96 openConnections.removeRef( it.current() ); 96 openConnections.removeRef( it.current() );
97 } else 97 } else
98 ++it; 98 ++it;
99 } 99 }
100} 100}
101 101
102void QCopBridge::newConnection( int socket ) 102void QCopBridge::newConnection( int socket )
103{ 103{
104 QCopBridgePI *pi = new QCopBridgePI( socket, this ); 104 QCopBridgePI *pi = new QCopBridgePI( socket, this );
105 openConnections.append( pi ); 105 openConnections.append( pi );
106 connect ( pi, SIGNAL( connectionClosed( QCopBridgePI *) ), this, SLOT( closed( QCopBridgePI *) ) ); 106 connect ( pi, SIGNAL( connectionClosed(QCopBridgePI*) ), this, SLOT( closed(QCopBridgePI*) ) );
107 107
108 /* ### libqtopia merge FIXME */ 108 /* ### libqtopia merge FIXME */
109#if 0 109#if 0
110 QPEApplication::setTempScreenSaverMode( QPEApplication::DisableSuspend ); 110 QPEApplication::setTempScreenSaverMode( QPEApplication::DisableSuspend );
111#endif 111#endif
112#ifndef QT_NO_COP 112#ifndef QT_NO_COP
113 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend; 113 QCopEnvelope( "QPE/System", "setScreenSaverMode(int)" ) << QPEApplication::DisableSuspend;
114#endif 114#endif
115 115
116 if ( sendSync ) { 116 if ( sendSync ) {
117 pi ->startSync(); 117 pi ->startSync();
118 sendSync = FALSE; 118 sendSync = FALSE;
119 } 119 }
120} 120}
121 121
122void QCopBridge::closed( QCopBridgePI *pi ) 122void QCopBridge::closed( QCopBridgePI *pi )
123{ 123{
124 emit connectionClosed( pi->peerAddress() ); 124 emit connectionClosed( pi->peerAddress() );
125 openConnections.removeRef( pi ); 125 openConnections.removeRef( pi );
126 if ( openConnections.count() == 0 ) { 126 if ( openConnections.count() == 0 ) {
127 /* ### FIXME libqtopia merge */ 127 /* ### FIXME libqtopia merge */
128#if 0 128#if 0
129 QPEApplication::setTempScreenSaverMode( QPEApplication::Enable ); 129 QPEApplication::setTempScreenSaverMode( QPEApplication::Enable );
130#endif 130#endif
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp
index 11d10dc..2e9d2a9 100644
--- a/core/launcher/runningappbar.cpp
+++ b/core/launcher/runningappbar.cpp
@@ -13,50 +13,50 @@
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#define QTOPIA_INTERNAL_PRELOADACCESS 21#define QTOPIA_INTERNAL_PRELOADACCESS
22 22
23 23
24#include <stdlib.h> 24#include <stdlib.h>
25 25
26#include <qpainter.h> 26#include <qpainter.h>
27 27
28#include <qtopia/qcopenvelope_qws.h> 28#include <qtopia/qcopenvelope_qws.h>
29 29
30#include "runningappbar.h" 30#include "runningappbar.h"
31#include "serverinterface.h" 31#include "serverinterface.h"
32 32
33RunningAppBar::RunningAppBar(QWidget* parent) 33RunningAppBar::RunningAppBar(QWidget* parent)
34 : QFrame(parent), selectedAppIndex(-1) 34 : QFrame(parent), selectedAppIndex(-1)
35{ 35{
36 QCopChannel* channel = new QCopChannel( "QPE/System", this ); 36 QCopChannel* channel = new QCopChannel( "QPE/System", this );
37 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 37 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
38 this, SLOT(received(const QCString&, const QByteArray&)) ); 38 this, SLOT(received(const QCString&,const QByteArray&)) );
39 39
40 spacing = AppLnk::smallIconSize()+3; 40 spacing = AppLnk::smallIconSize()+3;
41} 41}
42 42
43RunningAppBar::~RunningAppBar() 43RunningAppBar::~RunningAppBar()
44{ 44{
45} 45}
46 46
47void RunningAppBar::received(const QCString& msg, const QByteArray& data) { 47void RunningAppBar::received(const QCString& msg, const QByteArray& data) {
48 // Since fast apps appear and disappear without disconnecting from their 48 // Since fast apps appear and disappear without disconnecting from their
49 // channel we need to watch for the showing/hiding events and update according. 49 // channel we need to watch for the showing/hiding events and update according.
50 QDataStream stream( data, IO_ReadOnly ); 50 QDataStream stream( data, IO_ReadOnly );
51 if ( msg == "fastAppShowing(QString)") { 51 if ( msg == "fastAppShowing(QString)") {
52 QString appName; 52 QString appName;
53 stream >> appName; 53 stream >> appName;
54 // qDebug("fastAppShowing %s", appName.data() ); 54 // qDebug("fastAppShowing %s", appName.data() );
55 const AppLnk* f = ServerInterface::appLnks().findExec(appName); 55 const AppLnk* f = ServerInterface::appLnks().findExec(appName);
56 if ( f ) addTask(*f); 56 if ( f ) addTask(*f);
57 } else if ( msg == "fastAppHiding(QString)") { 57 } else if ( msg == "fastAppHiding(QString)") {
58 QString appName; 58 QString appName;
59 stream >> appName; 59 stream >> appName;
60 const AppLnk* f = ServerInterface::appLnks().findExec(appName); 60 const AppLnk* f = ServerInterface::appLnks().findExec(appName);
61 if ( f ) removeTask(*f); 61 if ( f ) removeTask(*f);
62 } 62 }
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
index 068d716..ea0b792 100644
--- a/core/launcher/server.cpp
+++ b/core/launcher/server.cpp
@@ -126,72 +126,72 @@ static Global::Command builtins[] = {
126Server::Server() : 126Server::Server() :
127 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ), 127 QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
128 qcopBridge( 0 ), 128 qcopBridge( 0 ),
129 transferServer( 0 ), 129 transferServer( 0 ),
130 packageHandler( 0 ), 130 packageHandler( 0 ),
131 syncDialog( 0 ) 131 syncDialog( 0 )
132{ 132{
133 Global::setBuiltinCommands(builtins); 133 Global::setBuiltinCommands(builtins);
134 134
135 tid_xfer = 0; 135 tid_xfer = 0;
136 /* ### FIXME ### */ 136 /* ### FIXME ### */
137/* tid_today = startTimer(3600*2*1000);*/ 137/* tid_today = startTimer(3600*2*1000);*/
138 last_today_show = QDate::currentDate(); 138 last_today_show = QDate::currentDate();
139 139
140#if 0 140#if 0
141 tsmMonitor = new TempScreenSaverMode(); 141 tsmMonitor = new TempScreenSaverMode();
142 connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) ); 142 connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) );
143#endif 143#endif
144 144
145 serverGui = new Launcher; 145 serverGui = new Launcher;
146 serverGui->createGUI(); 146 serverGui->createGUI();
147 147
148 docList = new DocumentList( serverGui ); 148 docList = new DocumentList( serverGui );
149 appLauncher = new AppLauncher(this); 149 appLauncher = new AppLauncher(this);
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::ODeviceButton*,bool)),
163 this,SLOT(activate(const Opie::ODeviceButton*,bool))); 163 this,SLOT(activate(const Opie::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()) );
176 connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) ); 176 connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) );
177 177
178 preloadApps(); 178 preloadApps();
179} 179}
180 180
181void Server::show() 181void Server::show()
182{ 182{
183 ServerApplication::login(TRUE); 183 ServerApplication::login(TRUE);
184 QWidget::show(); 184 QWidget::show();
185} 185}
186 186
187Server::~Server() 187Server::~Server()
188{ 188{
189 serverGui->destroyGUI(); 189 serverGui->destroyGUI();
190 delete docList; 190 delete docList;
191 delete qcopBridge; 191 delete qcopBridge;
192 delete transferServer; 192 delete transferServer;
193 delete serverGui; 193 delete serverGui;
194#if 0 194#if 0
195 delete tsmMonitor; 195 delete tsmMonitor;
196#endif 196#endif
197} 197}
@@ -592,50 +592,50 @@ bool Server::mkdir(const QString &localPath)
592 //qDebug("mkdir making dir %s", checkedPath.latin1()); 592 //qDebug("mkdir making dir %s", checkedPath.latin1());
593 593
594 if (!checkDir.mkdir(checkedPath)) { 594 if (!checkDir.mkdir(checkedPath)) {
595 qDebug("Unable to make directory %s", checkedPath.latin1()); 595 qDebug("Unable to make directory %s", checkedPath.latin1());
596 return FALSE; 596 return FALSE;
597 } 597 }
598 } 598 }
599 599
600 } 600 }
601 return TRUE; 601 return TRUE;
602} 602}
603 603
604void Server::styleChange( QStyle &s ) 604void Server::styleChange( QStyle &s )
605{ 605{
606 QWidget::styleChange( s ); 606 QWidget::styleChange( s );
607} 607}
608 608
609void Server::startTransferServer() 609void Server::startTransferServer()
610{ 610{
611 if ( !qcopBridge ) { 611 if ( !qcopBridge ) {
612 // start qcop bridge server 612 // start qcop bridge server
613 qcopBridge = new QCopBridge( 4243 ); 613 qcopBridge = new QCopBridge( 4243 );
614 if ( qcopBridge->ok() ) { 614 if ( qcopBridge->ok() ) {
615 // ... OK 615 // ... OK
616 connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress &)), 616 connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress&)),
617 this, SLOT(syncConnectionClosed(const QHostAddress &)) ); 617 this, SLOT(syncConnectionClosed(const QHostAddress&)) );
618 } else { 618 } else {
619 delete qcopBridge; 619 delete qcopBridge;
620 qcopBridge = 0; 620 qcopBridge = 0;
621 } 621 }
622 } 622 }
623 if ( !transferServer ) { 623 if ( !transferServer ) {
624 // start transfer server 624 // start transfer server
625 transferServer = new TransferServer( 4242 ); 625 transferServer = new TransferServer( 4242 );
626 if ( transferServer->ok() ) { 626 if ( transferServer->ok() ) {
627 // ... OK 627 // ... OK
628 } else { 628 } else {
629 delete transferServer; 629 delete transferServer;
630 transferServer = 0; 630 transferServer = 0;
631 } 631 }
632 } 632 }
633 if ( !transferServer || !qcopBridge ) 633 if ( !transferServer || !qcopBridge )
634 tid_xfer = startTimer( 2000 ); 634 tid_xfer = startTimer( 2000 );
635} 635}
636 636
637void Server::timerEvent( QTimerEvent *e ) 637void Server::timerEvent( QTimerEvent *e )
638{ 638{
639 if ( e->timerId() == tid_xfer ) { 639 if ( e->timerId() == tid_xfer ) {
640 killTimer( tid_xfer ); 640 killTimer( tid_xfer );
641 tid_xfer = 0; 641 tid_xfer = 0;
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
index f7c2341..d38dd97 100644
--- a/core/launcher/serverapp.cpp
+++ b/core/launcher/serverapp.cpp
@@ -280,60 +280,60 @@ void ServerApplication::switchLCD( bool on ) {
280 dapp-> m_screensaver-> setDisplayState ( false ); 280 dapp-> m_screensaver-> setDisplayState ( false );
281 281
282 282
283} 283}
284 284
285ServerApplication::ServerApplication( int& argc, char **argv, Type t ) 285ServerApplication::ServerApplication( int& argc, char **argv, Type t )
286 : QPEApplication( argc, argv, t ) 286 : QPEApplication( argc, argv, t )
287{ 287{
288 ms_is_starting = true; 288 ms_is_starting = true;
289 289
290 // We know we'll have lots of cached pixmaps due to App/DocLnks 290 // We know we'll have lots of cached pixmaps due to App/DocLnks
291 QPixmapCache::setCacheLimit(512); 291 QPixmapCache::setCacheLimit(512);
292 292
293 m_ps = new PowerStatus; 293 m_ps = new PowerStatus;
294 m_ps_last = new PowerStatus; 294 m_ps_last = new PowerStatus;
295 pa = new DesktopPowerAlerter( 0 ); 295 pa = new DesktopPowerAlerter( 0 );
296 296
297 m_apm_timer = new QTimer( this ); 297 m_apm_timer = new QTimer( this );
298 connect(m_apm_timer, SIGNAL( timeout() ), 298 connect(m_apm_timer, SIGNAL( timeout() ),
299 this, SLOT( apmTimeout() ) ); 299 this, SLOT( apmTimeout() ) );
300 300
301 reloadPowerWarnSettings(); 301 reloadPowerWarnSettings();
302 302
303 QCopChannel *channel = new QCopChannel( "QPE/System", this ); 303 QCopChannel *channel = new QCopChannel( "QPE/System", this );
304 connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ), 304 connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ),
305 this, SLOT(systemMessage(const QCString&, const QByteArray& ) ) ); 305 this, SLOT(systemMessage(const QCString&,const QByteArray&) ) );
306 306
307 channel = new QCopChannel("QPE/Launcher", this ); 307 channel = new QCopChannel("QPE/Launcher", this );
308 connect(channel, SIGNAL(received( const QCString&, const QByteArray& ) ), 308 connect(channel, SIGNAL(received(const QCString&,const QByteArray&) ),
309 this, SLOT(launcherMessage( const QCString&, const QByteArray& ) ) ); 309 this, SLOT(launcherMessage(const QCString&,const QByteArray&) ) );
310 310
311 m_screensaver = new OpieScreenSaver(); 311 m_screensaver = new OpieScreenSaver();
312 m_screensaver->setInterval( -1 ); 312 m_screensaver->setInterval( -1 );
313 QWSServer::setScreenSaver( m_screensaver ); 313 QWSServer::setScreenSaver( m_screensaver );
314 314
315 connect( qApp, SIGNAL( volumeChanged( bool ) ), 315 connect( qApp, SIGNAL( volumeChanged(bool) ),
316 this, SLOT( rereadVolumes() ) ); 316 this, SLOT( rereadVolumes() ) );
317 317
318 318
319 /* ### PluginLoader libqtopia SafeMode */ 319 /* ### PluginLoader libqtopia SafeMode */
320#if 0 320#if 0
321 if ( PluginLoader::inSafeMode() ) 321 if ( PluginLoader::inSafeMode() )
322 QTimer::singleShot(500, this, SLOT(showSafeMode()) ); 322 QTimer::singleShot(500, this, SLOT(showSafeMode()) );
323 QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) ); 323 QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
324#endif 324#endif
325 325
326 kf = new KeyFilter(this); 326 kf = new KeyFilter(this);
327 327
328 connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) ); 328 connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
329 connect( kf, SIGNAL(power()), this, SIGNAL(power()) ); 329 connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
330 connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) ); 330 connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
331 connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol())); 331 connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
332 connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle())); 332 connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
333 connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle())); 333 connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
334 connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)), 334 connect( kf, SIGNAL(activate(const Opie::ODeviceButton*,bool)),
335 this,SIGNAL(activate(const Opie::ODeviceButton*,bool))); 335 this,SIGNAL(activate(const Opie::ODeviceButton*,bool)));
336 336
337 337
338 connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) ); 338 connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
339 339
diff --git a/core/launcher/shutdownimpl.cpp b/core/launcher/shutdownimpl.cpp
index f43a2a3..2731568 100644
--- a/core/launcher/shutdownimpl.cpp
+++ b/core/launcher/shutdownimpl.cpp
@@ -85,52 +85,52 @@ ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl )
85 grid-> addWidget ( shutdown, 0, 0 ); 85 grid-> addWidget ( shutdown, 0, 0 );
86 86
87 vbox-> addWidget ( btngrp ); 87 vbox-> addWidget ( btngrp );
88 88
89 m_info = new QLabel ( this, "info" ); 89 m_info = new QLabel ( this, "info" );
90 m_info-> setText( tr( "<p>\n" "These termination options are provided primarily for use while developing and testing the Opie system. In a normal environment, these concepts are unnecessary." ) ); 90 m_info-> setText( tr( "<p>\n" "These termination options are provided primarily for use while developing and testing the Opie system. In a normal environment, these concepts are unnecessary." ) );
91 vbox-> addWidget ( m_info ); 91 vbox-> addWidget ( m_info );
92 92
93 m_progress = new QProgressBar ( this, "progressBar" ); 93 m_progress = new QProgressBar ( this, "progressBar" );
94 m_progress-> setFrameShape ( QProgressBar::Panel ); 94 m_progress-> setFrameShape ( QProgressBar::Panel );
95 m_progress-> setFrameShadow ( QProgressBar::Sunken ); 95 m_progress-> setFrameShadow ( QProgressBar::Sunken );
96 m_progress-> setTotalSteps ( 20 ); 96 m_progress-> setTotalSteps ( 20 );
97 m_progress-> setIndicatorFollowsStyle ( false ); 97 m_progress-> setIndicatorFollowsStyle ( false );
98 vbox-> addWidget ( m_progress ); 98 vbox-> addWidget ( m_progress );
99 99
100 vbox-> addItem ( new QSpacerItem ( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ) ); 100 vbox-> addItem ( new QSpacerItem ( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ) );
101 101
102 QPushButton *cancel = new QPushButton ( tr( "Cancel" ), this, "cancel" ); 102 QPushButton *cancel = new QPushButton ( tr( "Cancel" ), this, "cancel" );
103 changeButtonColor ( cancel, QColor( 181, 222, 178 ) ); 103 changeButtonColor ( cancel, QColor( 181, 222, 178 ) );
104 cancel-> setDefault ( true ); 104 cancel-> setDefault ( true );
105 cancel-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding, cancel-> sizePolicy ( ). hasHeightForWidth ( ) ) ); 105 cancel-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding, cancel-> sizePolicy ( ). hasHeightForWidth ( ) ) );
106 vbox-> addWidget ( cancel ); 106 vbox-> addWidget ( cancel );
107 107
108 m_timer = new QTimer ( this ); 108 m_timer = new QTimer ( this );
109 connect ( m_timer, SIGNAL( timeout ( ) ), this, SLOT( timeout ( ) ) ); 109 connect ( m_timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
110 110
111 connect ( btngrp, SIGNAL( clicked ( int ) ), this, SLOT( buttonClicked ( int ) ) ); 111 connect ( btngrp, SIGNAL( clicked(int) ), this, SLOT( buttonClicked(int) ) );
112 connect ( cancel, SIGNAL( clicked ( ) ), this, SLOT( cancelClicked ( ) ) ); 112 connect ( cancel, SIGNAL( clicked() ), this, SLOT( cancelClicked() ) );
113 113
114 m_progress-> hide ( ); 114 m_progress-> hide ( );
115 Global::hideInputMethod ( ); 115 Global::hideInputMethod ( );
116} 116}
117 117
118void ShutdownImpl::buttonClicked ( int b ) 118void ShutdownImpl::buttonClicked ( int b )
119{ 119{
120 m_counter = 0; 120 m_counter = 0;
121 121
122 switch ( b ) { 122 switch ( b ) {
123 case 1: 123 case 1:
124 m_operation = ShutdownSystem; 124 m_operation = ShutdownSystem;
125 break; 125 break;
126 case 2: 126 case 2:
127 m_operation = RebootSystem; 127 m_operation = RebootSystem;
128 break; 128 break;
129 case 3: 129 case 3:
130 m_operation = RestartDesktop; 130 m_operation = RestartDesktop;
131 break; 131 break;
132 case 4: 132 case 4:
133 m_operation = TerminateDesktop; 133 m_operation = TerminateDesktop;
134 break; 134 break;
135 } 135 }
136 m_info-> hide ( ); 136 m_info-> hide ( );
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 491a8a3..91e2f20 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -192,50 +192,50 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn
192 runningAppBar = new RunningAppBar(stack); 192 runningAppBar = new RunningAppBar(stack);
193 stack->raiseWidget(runningAppBar); 193 stack->raiseWidget(runningAppBar);
194 194
195 waitIcon = new Wait( this ); 195 waitIcon = new Wait( this );
196 (void) new AppIcons( this ); 196 (void) new AppIcons( this );
197 197
198 sysTray = new SysTray( this ); 198 sysTray = new SysTray( this );
199 199
200 /* ### FIXME plugin loader and safe mode */ 200 /* ### FIXME plugin loader and safe mode */
201#if 0 201#if 0
202 if (PluginLoader::inSafeMode()) 202 if (PluginLoader::inSafeMode())
203 (void)new SafeMode( this ); 203 (void)new SafeMode( this );
204#endif 204#endif
205 205
206 // ## make customizable in some way? 206 // ## make customizable in some way?
207#ifdef QT_QWS_CUSTOM 207#ifdef QT_QWS_CUSTOM
208 lockState = new LockKeyState( this ); 208 lockState = new LockKeyState( this );
209#else 209#else
210 lockState = 0; 210 lockState = 0;
211#endif 211#endif
212 212
213#if defined(Q_WS_QWS) 213#if defined(Q_WS_QWS)
214#if !defined(QT_NO_COP) 214#if !defined(QT_NO_COP)
215 QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this ); 215 QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this );
216 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 216 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
217 this, SLOT(receive(const QCString&, const QByteArray&)) ); 217 this, SLOT(receive(const QCString&,const QByteArray&)) );
218#endif 218#endif
219#endif 219#endif
220 waitTimer = new QTimer( this ); 220 waitTimer = new QTimer( this );
221 connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); 221 connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) );
222 clearer = new QTimer( this ); 222 clearer = new QTimer( this );
223 QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); 223 QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar()));
224 224
225 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); 225 connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) );
226 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); 226 connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) );
227 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); 227 connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) );
228} 228}
229 229
230void TaskBar::setStatusMessage( const QString &text ) 230void TaskBar::setStatusMessage( const QString &text )
231{ 231{
232 if ( !text.isEmpty() ) { 232 if ( !text.isEmpty() ) {
233 label->setText( text ); 233 label->setText( text );
234 stack->raiseWidget( label ); 234 stack->raiseWidget( label );
235 if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) 235 if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) )
236 sysTray->hide(); 236 sysTray->hide();
237 clearer->start( 3000, TRUE ); 237 clearer->start( 3000, TRUE );
238 } else { 238 } else {
239 clearStatusBar(); 239 clearStatusBar();
240 } 240 }
241} 241}
diff --git a/core/launcher/transferserver.cpp b/core/launcher/transferserver.cpp
index b998e95..a5e20b2 100644
--- a/core/launcher/transferserver.cpp
+++ b/core/launcher/transferserver.cpp
@@ -52,68 +52,68 @@
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
62TransferServer::TransferServer( Q_UINT16 port, QObject *parent, 62TransferServer::TransferServer( Q_UINT16 port, QObject *parent,
63 const char* name) 63 const char* name)
64 : QServerSocket( port, 1, parent, name ) 64 : QServerSocket( port, 1, parent, name )
65{ 65{
66 connections.setAutoDelete( TRUE ); 66 connections.setAutoDelete( TRUE );
67 if ( !ok() ) 67 if ( !ok() )
68 qWarning( "Failed to bind to port %d", port ); 68 qWarning( "Failed to bind to port %d", port );
69} 69}
70 70
71void TransferServer::authorizeConnections() 71void TransferServer::authorizeConnections()
72{ 72{
73 QListIterator<ServerPI> it(connections); 73 QListIterator<ServerPI> it(connections);
74 while ( it.current() ) { 74 while ( it.current() ) {
75 if ( !it.current()->verifyAuthorised() ) { 75 if ( !it.current()->verifyAuthorised() ) {
76 disconnect( it.current(), SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); 76 disconnect( it.current(), SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) );
77 connections.removeRef( it.current() ); 77 connections.removeRef( it.current() );
78 } else 78 } else
79 ++it; 79 ++it;
80 } 80 }
81} 81}
82 82
83void TransferServer::closed(ServerPI *item) 83void TransferServer::closed(ServerPI *item)
84{ 84{
85 connections.removeRef(item); 85 connections.removeRef(item);
86} 86}
87 87
88TransferServer::~TransferServer() 88TransferServer::~TransferServer()
89{ 89{
90} 90}
91 91
92void TransferServer::newConnection( int socket ) 92void TransferServer::newConnection( int socket )
93{ 93{
94 ServerPI *ptr = new ServerPI( socket, this ); 94 ServerPI *ptr = new ServerPI( socket, this );
95 connect( ptr, SIGNAL(connectionClosed(ServerPI *)), this, SLOT( closed(ServerPI *)) ); 95 connect( ptr, SIGNAL(connectionClosed(ServerPI*)), this, SLOT( closed(ServerPI*)) );
96 connections.append( ptr ); 96 connections.append( ptr );
97} 97}
98 98
99QString SyncAuthentication::serverId() 99QString SyncAuthentication::serverId()
100{ 100{
101 Config cfg("Security"); 101 Config cfg("Security");
102 cfg.setGroup("Sync"); 102 cfg.setGroup("Sync");
103 QString r = cfg.readEntry("serverid"); 103 QString r = cfg.readEntry("serverid");
104 104
105 if ( r.isEmpty() ) { 105 if ( r.isEmpty() ) {
106 r = OGlobal::generateUuid(); 106 r = OGlobal::generateUuid();
107 cfg.writeEntry("serverid", r ); 107 cfg.writeEntry("serverid", r );
108 } 108 }
109 return r; 109 return r;
110} 110}
111 111
112QString SyncAuthentication::ownerName() 112QString SyncAuthentication::ownerName()
113{ 113{
114 QString vfilename = Global::applicationFileName("addressbook", 114 QString vfilename = Global::applicationFileName("addressbook",
115 "businesscard.vcf"); 115 "businesscard.vcf");
116 if (QFile::exists(vfilename)) { 116 if (QFile::exists(vfilename)) {
117 Contact c; 117 Contact c;
118 c = Contact::readVCard( vfilename )[0]; 118 c = Contact::readVCard( vfilename )[0];
119 return c.fullName(); 119 return c.fullName();
@@ -312,61 +312,61 @@ ServerPI::ServerPI( int socket, QObject *parent, const char* name )
312 312
313 peerport = peerPort(); 313 peerport = peerPort();
314 peeraddress = peerAddress(); 314 peeraddress = peerAddress();
315 315
316#ifndef INSECURE 316#ifndef INSECURE
317 if ( !SyncAuthentication::isAuthorized(peeraddress) ) { 317 if ( !SyncAuthentication::isAuthorized(peeraddress) ) {
318 state = Forbidden; 318 state = Forbidden;
319 startTimer( 0 ); 319 startTimer( 0 );
320 } else 320 } else
321#endif 321#endif
322 { 322 {
323 connect( this, SIGNAL( readyRead() ), SLOT( read() ) ); 323 connect( this, SIGNAL( readyRead() ), SLOT( read() ) );
324 connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); 324 connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) );
325 325
326 passiv = FALSE; 326 passiv = FALSE;
327 for( int i = 0; i < 4; i++ ) 327 for( int i = 0; i < 4; i++ )
328 wait[i] = FALSE; 328 wait[i] = FALSE;
329 329
330 send( "220 Qtopia " QPE_VERSION " FTP Server" ); // No tr 330 send( "220 Qtopia " QPE_VERSION " FTP Server" ); // No tr
331 state = Wait_USER; 331 state = Wait_USER;
332 332
333 dtp = new ServerDTP( this ); 333 dtp = new ServerDTP( this );
334 connect( dtp, SIGNAL( completed() ), SLOT( dtpCompleted() ) ); 334 connect( dtp, SIGNAL( completed() ), SLOT( dtpCompleted() ) );
335 connect( dtp, SIGNAL( failed() ), SLOT( dtpFailed() ) ); 335 connect( dtp, SIGNAL( failed() ), SLOT( dtpFailed() ) );
336 connect( dtp, SIGNAL( error( int ) ), SLOT( dtpError( int ) ) ); 336 connect( dtp, SIGNAL( error(int) ), SLOT( dtpError(int) ) );
337 337
338 338
339 directory = QDir::currentDirPath(); 339 directory = QDir::currentDirPath();
340 340
341 static int p = 1024; 341 static int p = 1024;
342 342
343 while ( !serversocket || !serversocket->ok() ) { 343 while ( !serversocket || !serversocket->ok() ) {
344 delete serversocket; 344 delete serversocket;
345 serversocket = new ServerSocket( ++p, this ); 345 serversocket = new ServerSocket( ++p, this );
346 } 346 }
347 connect( serversocket, SIGNAL( newIncomming( int ) ), 347 connect( serversocket, SIGNAL( newIncomming(int) ),
348 SLOT( newConnection( int ) ) ); 348 SLOT( newConnection(int) ) );
349 } 349 }
350} 350}
351 351
352ServerPI::~ServerPI() 352ServerPI::~ServerPI()
353{ 353{
354 close(); 354 close();
355 355
356 if ( dtp ) 356 if ( dtp )
357 dtp->close(); 357 dtp->close();
358 delete dtp; 358 delete dtp;
359 delete serversocket; 359 delete serversocket;
360} 360}
361 361
362bool ServerPI::verifyAuthorised() 362bool ServerPI::verifyAuthorised()
363{ 363{
364 if ( !SyncAuthentication::isAuthorized(peerAddress()) ) { 364 if ( !SyncAuthentication::isAuthorized(peerAddress()) ) {
365 state = Forbidden; 365 state = Forbidden;
366 return FALSE; 366 return FALSE;
367 } 367 }
368 return TRUE; 368 return TRUE;
369} 369}
370 370
371void ServerPI::connectionClosed() 371void ServerPI::connectionClosed()
372{ 372{
@@ -1065,49 +1065,49 @@ QString ServerPI::absFilePath( const QString& file )
1065{ 1065{
1066 if ( file.isEmpty() ) return file; 1066 if ( file.isEmpty() ) return file;
1067 1067
1068 QString filepath( file ); 1068 QString filepath( file );
1069 if ( file[0] != "/" ) 1069 if ( file[0] != "/" )
1070 filepath = directory.path() + "/" + file; 1070 filepath = directory.path() + "/" + file;
1071 1071
1072 return filepath; 1072 return filepath;
1073} 1073}
1074 1074
1075 1075
1076void ServerPI::timerEvent( QTimerEvent * ) 1076void ServerPI::timerEvent( QTimerEvent * )
1077{ 1077{
1078 connectionClosed(); 1078 connectionClosed();
1079} 1079}
1080 1080
1081 1081
1082ServerDTP::ServerDTP( QObject *parent, const char* name) 1082ServerDTP::ServerDTP( QObject *parent, const char* name)
1083 : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ), 1083 : QSocket( parent, name ), mode( Idle ), createTargzProc( 0 ),
1084 retrieveTargzProc( 0 ) 1084 retrieveTargzProc( 0 )
1085{ 1085{
1086 1086
1087 connect( this, SIGNAL( connected() ), SLOT( connected() ) ); 1087 connect( this, SIGNAL( connected() ), SLOT( connected() ) );
1088 connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) ); 1088 connect( this, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) );
1089 connect( this, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) ); 1089 connect( this, SIGNAL( bytesWritten(int) ), SLOT( bytesWritten(int) ) );
1090 connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) ); 1090 connect( this, SIGNAL( readyRead() ), SLOT( readyRead() ) );
1091 1091
1092 createTargzProc = new QProcess( QString("tar"), this, "createTargzProc"); // No tr 1092 createTargzProc = new QProcess( QString("tar"), this, "createTargzProc"); // No tr
1093 createTargzProc->setCommunication( QProcess::Stdout ); 1093 createTargzProc->setCommunication( QProcess::Stdout );
1094 createTargzProc->setWorkingDirectory( QDir::rootDirPath() ); 1094 createTargzProc->setWorkingDirectory( QDir::rootDirPath() );
1095 connect( createTargzProc, SIGNAL( processExited() ), SLOT( targzDone() ) ); 1095 connect( createTargzProc, SIGNAL( processExited() ), SLOT( targzDone() ) );
1096 1096
1097 retrieveTargzProc = new QProcess( this, "retrieveTargzProc" ); 1097 retrieveTargzProc = new QProcess( this, "retrieveTargzProc" );
1098 retrieveTargzProc->setCommunication( QProcess::Stdin ); 1098 retrieveTargzProc->setCommunication( QProcess::Stdin );
1099 retrieveTargzProc->setWorkingDirectory( QDir::rootDirPath() ); 1099 retrieveTargzProc->setWorkingDirectory( QDir::rootDirPath() );
1100 connect( retrieveTargzProc, SIGNAL( processExited() ), 1100 connect( retrieveTargzProc, SIGNAL( processExited() ),
1101 SIGNAL( completed() ) ); 1101 SIGNAL( completed() ) );
1102 connect( retrieveTargzProc, SIGNAL( processExited() ), 1102 connect( retrieveTargzProc, SIGNAL( processExited() ),
1103 SLOT( extractTarDone() ) ); 1103 SLOT( extractTarDone() ) );
1104} 1104}
1105 1105
1106ServerDTP::~ServerDTP() 1106ServerDTP::~ServerDTP()
1107{ 1107{
1108 buf.close(); 1108 buf.close();
1109 if ( RetrieveFile == mode && file.isOpen() ) { 1109 if ( RetrieveFile == mode && file.isOpen() ) {
1110 // We're being shutdown before the client closed. 1110 // We're being shutdown before the client closed.
1111 file.close(); 1111 file.close();
1112 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) { 1112 if ( recvFileSize >= 0 && (int)file.size() != recvFileSize ) {
1113 qDebug( "STOR incomplete" ); 1113 qDebug( "STOR incomplete" );