summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/calibrate/opie-calibrate.control8
-rw-r--r--core/launcher/desktop.cpp2
-rw-r--r--core/launcher/launcher.pro4
-rw-r--r--core/launcher/main.cpp15
-rw-r--r--core/launcher/opie-taskbar.control4
-rw-r--r--core/launcher/taskbar.cpp17
-rw-r--r--core/launcher/taskbar.h2
7 files changed, 32 insertions, 20 deletions
diff --git a/core/apps/calibrate/opie-calibrate.control b/core/apps/calibrate/opie-calibrate.control
deleted file mode 100644
index 6eafb94..0000000
--- a/core/apps/calibrate/opie-calibrate.control
+++ b/dev/null
@@ -1,8 +0,0 @@
1Files: bin/calibrate apps/Settings/Calibrate.desktop
2Priority: required
3Section: opie/system
4Maintainer: Project Opie <opie@handhelds.org>
5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION.3
7Depends: libqpe1, libqt2-emb
8Description: Opie calibration tool
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp
index ef0bf4c..6def126 100644
--- a/core/launcher/desktop.cpp
+++ b/core/launcher/desktop.cpp
@@ -77,48 +77,49 @@ public:
77 return keyCode; 77 return keyCode;
78 } 78 }
79 QCString getChannel() const 79 QCString getChannel() const
80 { 80 {
81 return channel; 81 return channel;
82 } 82 }
83 QCString getMessage() const 83 QCString getMessage() const
84 { 84 {
85 return message; 85 return message;
86 } 86 }
87 87
88private: 88private:
89 int keyCode; 89 int keyCode;
90 QCString channel, message; 90 QCString channel, message;
91}; 91};
92 92
93typedef QValueList<QCopKeyRegister> KeyRegisterList; 93typedef QValueList<QCopKeyRegister> KeyRegisterList;
94KeyRegisterList keyRegisterList; 94KeyRegisterList keyRegisterList;
95 95
96static Desktop* qpedesktop = 0; 96static Desktop* qpedesktop = 0;
97static int loggedin = 0; 97static int loggedin = 0;
98static void login( bool at_poweron ) 98static void login( bool at_poweron )
99{ 99{
100 if ( !loggedin ) { 100 if ( !loggedin ) {
101 Global::terminateBuiltin( "calibrate" );
101 Password::authenticate( at_poweron ); 102 Password::authenticate( at_poweron );
102 loggedin = 1; 103 loggedin = 1;
103 QCopEnvelope e( "QPE/Desktop", "unlocked()" ); 104 QCopEnvelope e( "QPE/Desktop", "unlocked()" );
104 } 105 }
105} 106}
106 107
107bool Desktop::screenLocked() 108bool Desktop::screenLocked()
108{ 109{
109 return loggedin == 0; 110 return loggedin == 0;
110} 111}
111 112
112/* 113/*
113 Priority is number of alerts that are needed to pop up 114 Priority is number of alerts that are needed to pop up
114 alert. 115 alert.
115 */ 116 */
116class DesktopPowerAlerter : public QMessageBox 117class DesktopPowerAlerter : public QMessageBox
117{ 118{
118public: 119public:
119 DesktopPowerAlerter( QWidget *parent, const char *name = 0 ) 120 DesktopPowerAlerter( QWidget *parent, const char *name = 0 )
120 : QMessageBox( tr( "Battery Status" ), "Low Battery", 121 : QMessageBox( tr( "Battery Status" ), "Low Battery",
121 QMessageBox::Critical, 122 QMessageBox::Critical,
122 QMessageBox::Ok | QMessageBox::Default, 123 QMessageBox::Ok | QMessageBox::Default,
123 QMessageBox::NoButton, QMessageBox::NoButton, 124 QMessageBox::NoButton, QMessageBox::NoButton,
124 parent, name, FALSE ) 125 parent, name, FALSE )
@@ -600,48 +601,49 @@ static bool isVisibleWindow( int wid )
600 } 601 }
601#endif 602#endif
602 return FALSE; 603 return FALSE;
603} 604}
604 605
605static bool hasVisibleWindow( const QString& clientname ) 606static bool hasVisibleWindow( const QString& clientname )
606{ 607{
607#ifdef QWS 608#ifdef QWS
608 const QList<QWSWindow> &list = qwsServer->clientWindows(); 609 const QList<QWSWindow> &list = qwsServer->clientWindows();
609 QWSWindow* w; 610 QWSWindow* w;
610 for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) { 611 for ( QListIterator<QWSWindow> it( list ); ( w = it.current() ); ++it ) {
611 if ( w->client() ->identity() == clientname && !w->isFullyObscured() ) 612 if ( w->client() ->identity() == clientname && !w->isFullyObscured() )
612 return TRUE; 613 return TRUE;
613 } 614 }
614#endif 615#endif
615 return FALSE; 616 return FALSE;
616} 617}
617 618
618 619
619void Desktop::executeOrModify( const QString& appLnkFile ) 620void Desktop::executeOrModify( const QString& appLnkFile )
620{ 621{
621 AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile ); 622 AppLnk lnk( MimeType::appsFolderName() + "/" + appLnkFile );
622 if ( lnk.isValid() ) { 623 if ( lnk.isValid() ) {
623 QCString app = lnk.exec().utf8(); 624 QCString app = lnk.exec().utf8();
625 Global::terminateBuiltin( "calibrate" );
624 if ( QCopChannel::isRegistered( "QPE/Application/" + app ) ) { 626 if ( QCopChannel::isRegistered( "QPE/Application/" + app ) ) {
625 // MRUList::addTask( &lnk ); 627 // MRUList::addTask( &lnk );
626 if ( hasVisibleWindow( app ) ) 628 if ( hasVisibleWindow( app ) )
627 QCopChannel::send( "QPE/Application/" + app, "nextView()" ); 629 QCopChannel::send( "QPE/Application/" + app, "nextView()" );
628 else 630 else
629 QCopChannel::send( "QPE/Application/" + app, "raise()" ); 631 QCopChannel::send( "QPE/Application/" + app, "raise()" );
630 } 632 }
631 else { 633 else {
632 lnk.execute(); 634 lnk.execute();
633 } 635 }
634 } 636 }
635} 637}
636 638
637// autoStarts apps on resume and start 639// autoStarts apps on resume and start
638void Desktop::execAutoStart() 640void Desktop::execAutoStart()
639{ 641{
640 QString appName; 642 QString appName;
641 int delay; 643 int delay;
642 QDateTime now = QDateTime::currentDateTime(); 644 QDateTime now = QDateTime::currentDateTime();
643 Config cfg( "autostart" ); 645 Config cfg( "autostart" );
644 cfg.setGroup( "AutoStart" ); 646 cfg.setGroup( "AutoStart" );
645 appName = cfg.readEntry( "Apps", "" ); 647 appName = cfg.readEntry( "Apps", "" );
646 delay = ( cfg.readEntry( "Delay", "0" ) ).toInt(); 648 delay = ( cfg.readEntry( "Delay", "0" ) ).toInt();
647 // If the time between suspend and resume was longer then the 649 // If the time between suspend and resume was longer then the
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro
index ba01954..f5597c5 100644
--- a/core/launcher/launcher.pro
+++ b/core/launcher/launcher.pro
@@ -1,118 +1,122 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on release 2 CONFIG = qt warn_on release
3 DESTDIR = ../../bin 3 DESTDIR = ../../bin
4 HEADERS = background.h \ 4 HEADERS = background.h \
5 desktop.h \ 5 desktop.h \
6 screensaver.h \ 6 screensaver.h \
7 mediummountgui.h \ 7 mediummountgui.h \
8 info.h \ 8 info.h \
9 appicons.h \ 9 appicons.h \
10 taskbar.h \ 10 taskbar.h \
11 sidething.h \ 11 sidething.h \
12 runningappbar.h \ 12 runningappbar.h \
13 stabmon.h \ 13 stabmon.h \
14 inputmethods.h \ 14 inputmethods.h \
15 systray.h \ 15 systray.h \
16 wait.h \ 16 wait.h \
17 shutdownimpl.h \ 17 shutdownimpl.h \
18 launcher.h \ 18 launcher.h \
19 launcherview.h \ 19 launcherview.h \
20 ../../core/apps/calibrate/calibrate.h \
20 startmenu.h \ 21 startmenu.h \
21 transferserver.h \ 22 transferserver.h \
22 qcopbridge.h \ 23 qcopbridge.h \
23 packageslave.h \ 24 packageslave.h \
24 irserver.h \ 25 irserver.h \
25 ../../rsync/buf.h \ 26 ../../rsync/buf.h \
26 ../../rsync/checksum.h \ 27 ../../rsync/checksum.h \
27 ../../rsync/command.h \ 28 ../../rsync/command.h \
28 ../../rsync/emit.h \ 29 ../../rsync/emit.h \
29 ../../rsync/job.h \ 30 ../../rsync/job.h \
30 ../../rsync/netint.h \ 31 ../../rsync/netint.h \
31 ../../rsync/protocol.h \ 32 ../../rsync/protocol.h \
32 ../../rsync/prototab.h \ 33 ../../rsync/prototab.h \
33 ../../rsync/rsync.h \ 34 ../../rsync/rsync.h \
34 ../../rsync/search.h \ 35 ../../rsync/search.h \
35 ../../rsync/stream.h \ 36 ../../rsync/stream.h \
36 ../../rsync/sumset.h \ 37 ../../rsync/sumset.h \
37 ../../rsync/trace.h \ 38 ../../rsync/trace.h \
38 ../../rsync/types.h \ 39 ../../rsync/types.h \
39 ../../rsync/util.h \ 40 ../../rsync/util.h \
40 ../../rsync/whole.h \ 41 ../../rsync/whole.h \
41 ../../rsync/config_rsync.h \ 42 ../../rsync/config_rsync.h \
42 ../../rsync/qrsync.h \ 43 ../../rsync/qrsync.h \
43 quicklauncher.h 44 quicklauncher.h
44 SOURCES = background.cpp \ 45 SOURCES = background.cpp \
45 desktop.cpp \ 46 desktop.cpp \
46 screensaver.cpp \ 47 screensaver.cpp \
47 mediummountgui.cpp \ 48 mediummountgui.cpp \
48 info.cpp \ 49 info.cpp \
49 appicons.cpp \ 50 appicons.cpp \
50 taskbar.cpp \ 51 taskbar.cpp \
51 sidething.cpp \ 52 sidething.cpp \
52 runningappbar.cpp \ 53 runningappbar.cpp \
53 stabmon.cpp \ 54 stabmon.cpp \
54 inputmethods.cpp \ 55 inputmethods.cpp \
55 systray.cpp \ 56 systray.cpp \
56 wait.cpp \ 57 wait.cpp \
57 shutdownimpl.cpp \ 58 shutdownimpl.cpp \
58 launcher.cpp \ 59 launcher.cpp \
59 launcherview.cpp \ 60 launcherview.cpp \
61 ../../core/apps/calibrate/calibrate.cpp \
60 transferserver.cpp \ 62 transferserver.cpp \
61 packageslave.cpp \ 63 packageslave.cpp \
62 irserver.cpp \ 64 irserver.cpp \
63 qcopbridge.cpp \ 65 qcopbridge.cpp \
64 startmenu.cpp \ 66 startmenu.cpp \
65 main.cpp \ 67 main.cpp \
66 ../../rsync/base64.c \ 68 ../../rsync/base64.c \
67 ../../rsync/buf.c \ 69 ../../rsync/buf.c \
68 ../../rsync/checksum.c \ 70 ../../rsync/checksum.c \
69 ../../rsync/command.c \ 71 ../../rsync/command.c \
70 ../../rsync/delta.c \ 72 ../../rsync/delta.c \
71 ../../rsync/emit.c \ 73 ../../rsync/emit.c \
72 ../../rsync/hex.c \ 74 ../../rsync/hex.c \
73 ../../rsync/job.c \ 75 ../../rsync/job.c \
74 ../../rsync/mdfour.c \ 76 ../../rsync/mdfour.c \
75 ../../rsync/mksum.c \ 77 ../../rsync/mksum.c \
76 ../../rsync/msg.c \ 78 ../../rsync/msg.c \
77 ../../rsync/netint.c \ 79 ../../rsync/netint.c \
78 ../../rsync/patch.c \ 80 ../../rsync/patch.c \
79 ../../rsync/prototab.c \ 81 ../../rsync/prototab.c \
80 ../../rsync/readsums.c \ 82 ../../rsync/readsums.c \
81 ../../rsync/scoop.c \ 83 ../../rsync/scoop.c \
82 ../../rsync/search.c \ 84 ../../rsync/search.c \
83 ../../rsync/stats.c \ 85 ../../rsync/stats.c \
84 ../../rsync/stream.c \ 86 ../../rsync/stream.c \
85 ../../rsync/sumset.c \ 87 ../../rsync/sumset.c \
86 ../../rsync/trace.c \ 88 ../../rsync/trace.c \
87 ../../rsync/tube.c \ 89 ../../rsync/tube.c \
88 ../../rsync/util.c \ 90 ../../rsync/util.c \
89 ../../rsync/version.c \ 91 ../../rsync/version.c \
90 ../../rsync/whole.c \ 92 ../../rsync/whole.c \
91 ../../rsync/qrsync.cpp 93 ../../rsync/qrsync.cpp
92 INTERFACES= syncdialog.ui 94 INTERFACES= syncdialog.ui
93INCLUDEPATH += ../../include 95INCLUDEPATH += ../../include
94 DEPENDPATH+= ../../include . 96 DEPENDPATH+= ../../include .
97INCLUDEPATH += ../../core/apps/calibrate
98 DEPENDPATH+= ../../core/apps/calibrate
95INCLUDEPATH += ../../rsync 99INCLUDEPATH += ../../rsync
96 DEPENDPATH+= ../../rsync 100 DEPENDPATH+= ../../rsync
97 TARGET = qpe 101 TARGET = qpe
98 LIBS += -lqpe -lcrypt -lopie 102 LIBS += -lqpe -lcrypt -lopie
99 103
100TRANSLATIONS = ../../i18n/de/qpe.ts \ 104TRANSLATIONS = ../../i18n/de/qpe.ts \
101 ../../i18n/nl/qpe.ts \ 105 ../../i18n/nl/qpe.ts \
102 ../../i18n/xx/qpe.ts \ 106 ../../i18n/xx/qpe.ts \
103 ../../i18n/en/qpe.ts \ 107 ../../i18n/en/qpe.ts \
104 ../../i18n/es/qpe.ts \ 108 ../../i18n/es/qpe.ts \
105 ../../i18n/fr/qpe.ts \ 109 ../../i18n/fr/qpe.ts \
106 ../../i18n/hu/qpe.ts \ 110 ../../i18n/hu/qpe.ts \
107 ../../i18n/ja/qpe.ts \ 111 ../../i18n/ja/qpe.ts \
108 ../../i18n/ko/qpe.ts \ 112 ../../i18n/ko/qpe.ts \
109 ../../i18n/no/qpe.ts \ 113 ../../i18n/no/qpe.ts \
110 ../../i18n/pl/qpe.ts \ 114 ../../i18n/pl/qpe.ts \
111 ../../i18n/pt/qpe.ts \ 115 ../../i18n/pt/qpe.ts \
112 ../../i18n/pt_BR/qpe.ts \ 116 ../../i18n/pt_BR/qpe.ts \
113 ../../i18n/sl/qpe.ts \ 117 ../../i18n/sl/qpe.ts \
114 ../../i18n/zh_CN/qpe.ts \ 118 ../../i18n/zh_CN/qpe.ts \
115 ../../i18n/it/qpe.ts \ 119 ../../i18n/it/qpe.ts \
116 ../../i18n/zh_TW/qpe.ts \ 120 ../../i18n/zh_TW/qpe.ts \
117 ../../i18n/da/qpe.ts 121 ../../i18n/da/qpe.ts
118 122
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp
index e96eeae..20a1ecd 100644
--- a/core/launcher/main.cpp
+++ b/core/launcher/main.cpp
@@ -9,63 +9,64 @@
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include "desktop.h" 21#include "desktop.h"
22#include "taskbar.h" 22#include "taskbar.h"
23#include "stabmon.h" 23#include "stabmon.h"
24 24
25#include <qpe/qpeapplication.h> 25#include <qpe/qpeapplication.h>
26#include <qpe/network.h> 26#include <qpe/network.h>
27#include <qpe/config.h> 27#include <qpe/config.h>
28#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ ) 28#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ )
29#include <qpe/custom.h> 29#include <qpe/custom.h>
30#endif 30#endif
31 31
32#include <opie/odevice.h> 32#include <opie/odevice.h>
33#include <opie/oprocess.h>
34 33
35#include <qmessagebox.h> 34#include <qmessagebox.h>
36#include <qfile.h> 35#include <qfile.h>
37#include <qimage.h> 36#include <qimage.h>
38#include <qwindowsystem_qws.h> 37#include <qwindowsystem_qws.h>
39#include <qwsmouse_qws.h> 38#include <qwsmouse_qws.h>
40#include <qpe/qcopenvelope_qws.h> 39#include <qpe/qcopenvelope_qws.h>
41#include <qpe/alarmserver.h> 40#include <qpe/alarmserver.h>
42 41
43#include <stdlib.h> 42#include <stdlib.h>
44#include <stdio.h> 43#include <stdio.h>
45#include <signal.h> 44#include <signal.h>
46#include <unistd.h> 45#include <unistd.h>
47 46
47#include "../calibrate/calibrate.h"
48
48using namespace Opie; 49using namespace Opie;
49 50
50void initEnvironment() 51void initEnvironment()
51{ 52{
52 int rot; 53 int rot;
53 Config config("locale"); 54 Config config("locale");
54 55
55 config.setGroup( "Location" ); 56 config.setGroup( "Location" );
56 QString tz = config.readEntry( "Timezone", getenv("TZ") ); 57 QString tz = config.readEntry( "Timezone", getenv("TZ") );
57 58
58 // if not timezone set, pick New York 59 // if not timezone set, pick New York
59 if (tz.isNull()) 60 if (tz.isNull())
60 tz = "America/New_York"; 61 tz = "America/New_York";
61 62
62 setenv( "TZ", tz, 1 ); 63 setenv( "TZ", tz, 1 );
63 config.writeEntry( "Timezone", tz); 64 config.writeEntry( "Timezone", tz);
64 65
65 config.setGroup( "Language" ); 66 config.setGroup( "Language" );
66 QString lang = config.readEntry( "Language", getenv("LANG") ); 67 QString lang = config.readEntry( "Language", getenv("LANG") );
67 if ( !lang.isNull() ) 68 if ( !lang.isNull() )
68 setenv( "LANG", lang, 1 ); 69 setenv( "LANG", lang, 1 );
69 70
70#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_SL5XXX) 71#if !defined(QT_QWS_CASSIOPEIA) && !defined(QT_QWS_IPAQ) && !defined(QT_QWS_SL5XXX)
71 setenv( "QWS_SIZE", "240x320", 0 ); 72 setenv( "QWS_SIZE", "240x320", 0 );
@@ -96,56 +97,52 @@ int initApplication( int argc, char ** argv )
96 97
97 ODevice::inst ( )-> setSoftSuspend ( true ); 98 ODevice::inst ( )-> setSoftSuspend ( true );
98 99
99 { // init backlight 100 { // init backlight
100 QCopEnvelope e("QPE/System", "setBacklight(int)" ); 101 QCopEnvelope e("QPE/System", "setBacklight(int)" );
101 e << -3; // Forced on 102 e << -3; // Forced on
102 } 103 }
103 104
104 AlarmServer::initialize(); 105 AlarmServer::initialize();
105 106
106 Desktop *d = new Desktop(); 107 Desktop *d = new Desktop();
107 108
108 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) ); 109 QObject::connect( &a, SIGNAL(power()), d, SLOT(togglePower()) );
109 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) ); 110 QObject::connect( &a, SIGNAL(backlight()), d, SLOT(toggleLight()) );
110 QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) ); 111 QObject::connect( &a, SIGNAL(symbol()), d, SLOT(toggleSymbolInput()) );
111 QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) ); 112 QObject::connect( &a, SIGNAL(numLockStateToggle()), d, SLOT(toggleNumLockState()) );
112 QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) ); 113 QObject::connect( &a, SIGNAL(capsLockStateToggle()), d, SLOT(toggleCapsLockState()) );
113 QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) ); 114 QObject::connect( &a, SIGNAL(prepareForRestart()), d, SLOT(terminateServers()) );
114 115
115 (void)new SysFileMonitor(d); 116 (void)new SysFileMonitor(d);
116 Network::createServer(d); 117 Network::createServer(d);
117 118
118 if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) { 119 if ( QWSServer::mouseHandler() ->inherits("QCalibratedMouseHandler") ) {
119 if ( !QFile::exists( "/etc/pointercal" ) ) { 120 if ( !QFile::exists( "/etc/pointercal" ) ) {
120 OProcess cal; 121 // Make sure calibration widget starts on top.
121 cal << "calibrate"; 122 Calibrate *cal = new Calibrate;
122 123 cal->exec();
123 if ( ! cal.start(OProcess::Block, OProcess::NoCommunication) ) { 124 delete cal;
124 QMessageBox::warning( 0, "Unable to calibrate",
125 "Failed to start the calibration tool.\n"
126 );
127 }
128 } 125 }
129 } 126 }
130 127
131 d->show(); 128 d->show();
132 129
133 if ( QDate::currentDate ( ). year ( ) < 2000 ) { 130 if ( QDate::currentDate ( ). year ( ) < 2000 ) {
134 if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" ). arg( TimeString::dateString ( QDate::currentDate ( ))), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) { 131 if ( QMessageBox::information ( 0, DesktopApplication::tr( "Information" ), DesktopApplication::tr( "<p>The system date doesn't seem to be valid.\n(%1)</p><p>Do you want to correct the clock ?</p>" ). arg( TimeString::dateString ( QDate::currentDate ( ))), QMessageBox::Yes, QMessageBox::No ) == QMessageBox::Yes ) {
135 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" ); 132 QCopEnvelope e ( "QPE/Application/systemtime", "setDocument(QString)" );
136 e << QString ( ); 133 e << QString ( );
137 } 134 }
138 } 135 }
139 136
140 int rv = a.exec(); 137 int rv = a.exec();
141 138
142 delete d; 139 delete d;
143 140
144 ODevice::inst ( )-> setSoftSuspend ( false ); 141 ODevice::inst ( )-> setSoftSuspend ( false );
145 142
146 return rv; 143 return rv;
147} 144}
148 145
149static const char *pidfile_path = "/var/run/opie.pid"; 146static const char *pidfile_path = "/var/run/opie.pid";
150 147
151void create_pidfile ( ) 148void create_pidfile ( )
diff --git a/core/launcher/opie-taskbar.control b/core/launcher/opie-taskbar.control
index db66a05..c0430b7 100644
--- a/core/launcher/opie-taskbar.control
+++ b/core/launcher/opie-taskbar.control
@@ -1,9 +1,9 @@
1Files: bin/qpe pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* plugins/applets/librotateapplet.so* root/etc/init.d/opie 1Files: bin/qpe apps/Settings/Calibrate.desktop pics/launcher pics/devicebuttons/*.png plugins/applets/libsuspendapplet.so* plugins/applets/libhomeapplet.so* plugins/applets/liblogoutapplet.so* plugins/applets/librotateapplet.so* root/etc/init.d/opie
2Priority: required 2Priority: required
3Section: opie/system 3Section: opie/system
4Maintainer: Project Opie <opie@handhelds.org> 4Maintainer: Project Opie <opie@handhelds.org>
5Architecture: arm 5Architecture: arm
6Version: $QPE_VERSION-$SUB_VERSION.3 6Version: $QPE_VERSION-$SUB_VERSION.3
7Depends: opie-base, opie-calibrate 7Depends: opie-base
8Replaces: opie-rotation 8Replaces: opie-rotation
9Description: Launcher for Opie 9Description: Launcher for Opie
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 8158128..8af568d 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -1,48 +1,49 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19*********************************************************************/ 19*********************************************************************/
20 20
21#include "startmenu.h" 21#include "startmenu.h"
22#include "inputmethods.h" 22#include "inputmethods.h"
23#include "runningappbar.h" 23#include "runningappbar.h"
24#include "systray.h" 24#include "systray.h"
25#include "calibrate.h"
25#include "wait.h" 26#include "wait.h"
26#include "appicons.h" 27#include "appicons.h"
27 28
28#include "taskbar.h" 29#include "taskbar.h"
29#include "desktop.h" 30#include "desktop.h"
30 31
31#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
32#include <qpe/qcopenvelope_qws.h> 33#include <qpe/qcopenvelope_qws.h>
33#include <qpe/global.h> 34#include <qpe/global.h>
34 35
35#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ ) 36#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ )
36#include <qpe/custom.h> 37#include <qpe/custom.h>
37#endif 38#endif
38 39
39#include <opie/odevice.h> 40#include <opie/odevice.h>
40 41
41#include <qlabel.h> 42#include <qlabel.h>
42#include <qlayout.h> 43#include <qlayout.h>
43#include <qtimer.h> 44#include <qtimer.h>
44#include <qwindowsystem_qws.h> 45#include <qwindowsystem_qws.h>
45#include <qwidgetstack.h> 46#include <qwidgetstack.h>
46 47
47#if defined( Q_WS_QWS ) 48#if defined( Q_WS_QWS )
48#include <qwsdisplay_qws.h> 49#include <qwsdisplay_qws.h>
@@ -60,54 +61,57 @@ using namespace Opie;
60 w->showMaximized(); \ 61 w->showMaximized(); \
61 } else { \ 62 } else { \
62 w->resize( QSize( 300, 300 ) ); \ 63 w->resize( QSize( 300, 300 ) ); \
63 } \ 64 } \
64 } \ 65 } \
65 w->show(); \ 66 w->show(); \
66 return w; \ 67 return w; \
67 } 68 }
68 69
69 70
70#ifdef SINGLE_APP 71#ifdef SINGLE_APP
71#define APP(a,b,c,d) FACTORY(b) 72#define APP(a,b,c,d) FACTORY(b)
72#include "../launcher/apps.h" 73#include "../launcher/apps.h"
73#undef APP 74#undef APP
74#endif // SINGLE_APP 75#endif // SINGLE_APP
75 76
76static Global::Command builtins[] = { 77static Global::Command builtins[] = {
77 78
78#ifdef SINGLE_APP 79#ifdef SINGLE_APP
79#define APP(a,b,c,d) { a, new##b, c }, 80#define APP(a,b,c,d) { a, new##b, c },
80#include "../launcher/apps.h" 81#include "../launcher/apps.h"
81#undef APP 82#undef APP
82#endif 83#endif
83 84
85#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX)
86 { "calibrate", TaskBar::calibrate, 1, 0 },
87#endif
84#if !defined(QT_QWS_CASSIOPEIA) 88#if !defined(QT_QWS_CASSIOPEIA)
85 { "shutdown", Global::shutdown, 1, 0 }, 89 { "shutdown", Global::shutdown, 1, 0 },
86// { "run", run, 1, 0 }, 90// { "run", run, 1, 0 },
87#endif 91#endif
88 92
89 { 0, 0, 0, 0 }, 93 { 0, TaskBar::calibrate, 0, 0 },
90}; 94};
91 95
92static bool initNumLock() 96static bool initNumLock()
93{ 97{
94#ifdef QPE_INITIAL_NUMLOCK_STATE 98#ifdef QPE_INITIAL_NUMLOCK_STATE
95 QPE_INITIAL_NUMLOCK_STATE 99 QPE_INITIAL_NUMLOCK_STATE
96#endif 100#endif
97 return FALSE; 101 return FALSE;
98} 102}
99 103
100class LockKeyState : public QWidget 104class LockKeyState : public QWidget
101{ 105{
102public: 106public:
103 LockKeyState( QWidget *parent ) : 107 LockKeyState( QWidget *parent ) :
104 QWidget(parent), 108 QWidget(parent),
105 nl(initNumLock()), cl(FALSE) 109 nl(initNumLock()), cl(FALSE)
106 { 110 {
107 nl_pm = Resource::loadPixmap("numlock"); 111 nl_pm = Resource::loadPixmap("numlock");
108 cl_pm = Resource::loadPixmap("capslock"); 112 cl_pm = Resource::loadPixmap("capslock");
109 } 113 }
110 QSize sizeHint() const 114 QSize sizeHint() const
111 { 115 {
112 return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); 116 return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1);
113 } 117 }
@@ -281,48 +285,59 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data )
281 else if ( msg == "setLed(int,bool)" ) { 285 else if ( msg == "setLed(int,bool)" ) {
282 int led, status; 286 int led, status;
283 stream >> led >> status; 287 stream >> led >> status;
284 288
285 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); 289 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( );
286 if ( ll. count ( )){ 290 if ( ll. count ( )){
287 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; 291 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0];
288 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); 292 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow );
289 293
290 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off ); 294 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off );
291 } 295 }
292 } 296 }
293 else if ( msg == "toggleMenu()" ) { 297 else if ( msg == "toggleMenu()" ) {
294 if ( sm-> launchMenu-> isVisible ( )) 298 if ( sm-> launchMenu-> isVisible ( ))
295 sm-> launch ( ); 299 sm-> launch ( );
296 else { 300 else {
297 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" ); 301 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" );
298 } 302 }
299 } 303 }
300 else if ( msg == "toggleStartMenu()" ) { 304 else if ( msg == "toggleStartMenu()" ) {
301 sm-> launch ( ); 305 sm-> launch ( );
302 } 306 }
303} 307}
304 308
309QWidget *TaskBar::calibrate(bool)
310{
311#ifdef Q_WS_QWS
312 Calibrate *c = new Calibrate;
313 c->show();
314 return c;
315#else
316 return 0;
317#endif
318}
319
305void TaskBar::toggleNumLockState() 320void TaskBar::toggleNumLockState()
306{ 321{
307 if ( lockState ) lockState->toggleNumLockState(); 322 if ( lockState ) lockState->toggleNumLockState();
308} 323}
309 324
310void TaskBar::toggleCapsLockState() 325void TaskBar::toggleCapsLockState()
311{ 326{
312 if ( lockState ) lockState->toggleCapsLockState(); 327 if ( lockState ) lockState->toggleCapsLockState();
313} 328}
314 329
315void TaskBar::toggleSymbolInput() 330void TaskBar::toggleSymbolInput()
316{ 331{
317 if ( inputMethods->currentShown() == "Unicode" ) { 332 if ( inputMethods->currentShown() == "Unicode" ) {
318 inputMethods->hideInputMethod(); 333 inputMethods->hideInputMethod();
319 } else { 334 } else {
320 inputMethods->showInputMethod("Unicode"); 335 inputMethods->showInputMethod("Unicode");
321 } 336 }
322} 337}
323 338
324bool TaskBar::recoverMemory() 339bool TaskBar::recoverMemory()
325{ 340{
326 //eturn mru->quitOldApps(); 341 //eturn mru->quitOldApps();
327 return true; 342 return true;
328} 343}
diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h
index 575a8c9..a0bf395 100644
--- a/core/launcher/taskbar.h
+++ b/core/launcher/taskbar.h
@@ -21,48 +21,50 @@
21#ifndef __TASKBAR_H__ 21#ifndef __TASKBAR_H__
22#define __TASKBAR_H__ 22#define __TASKBAR_H__
23 23
24#include <qhbox.h> 24#include <qhbox.h>
25 25
26class QLabel; 26class QLabel;
27class QTimer; 27class QTimer;
28class InputMethods; 28class InputMethods;
29class Wait; 29class Wait;
30class SysTray; 30class SysTray;
31//class MRUList; 31//class MRUList;
32class RunningAppBar; 32class RunningAppBar;
33class QWidgetStack; 33class QWidgetStack;
34class QTimer; 34class QTimer;
35class QLabel; 35class QLabel;
36class StartMenu; 36class StartMenu;
37class LockKeyState; 37class LockKeyState;
38 38
39class TaskBar : public QHBox { 39class TaskBar : public QHBox {
40 Q_OBJECT 40 Q_OBJECT
41public: 41public:
42 TaskBar(); 42 TaskBar();
43 ~TaskBar(); 43 ~TaskBar();
44 44
45 static QWidget *calibrate( bool );
46
45 bool recoverMemory(); 47 bool recoverMemory();
46 48
47 StartMenu *startMenu() const { return sm; } 49 StartMenu *startMenu() const { return sm; }
48public slots: 50public slots:
49 void startWait(); 51 void startWait();
50 void stopWait(const QString&); 52 void stopWait(const QString&);
51 void stopWait(); 53 void stopWait();
52 void clearStatusBar(); 54 void clearStatusBar();
53 void toggleNumLockState(); 55 void toggleNumLockState();
54 void toggleCapsLockState(); 56 void toggleCapsLockState();
55 void toggleSymbolInput(); 57 void toggleSymbolInput();
56 58
57protected: 59protected:
58 void resizeEvent( QResizeEvent * ); 60 void resizeEvent( QResizeEvent * );
59 void styleChange( QStyle & ); 61 void styleChange( QStyle & );
60 void setStatusMessage( const QString &text ); 62 void setStatusMessage( const QString &text );
61 63
62public slots: 64public slots:
63 void calcMaxWindowRect(); 65 void calcMaxWindowRect();
64private slots: 66private slots:
65 void receive( const QCString &msg, const QByteArray &data ); 67 void receive( const QCString &msg, const QByteArray &data );
66 68
67private: 69private:
68 70