summaryrefslogtreecommitdiff
path: root/core/launcher
authorzecke <zecke>2003-08-25 15:00:50 (UTC)
committer zecke <zecke>2003-08-25 15:00:50 (UTC)
commitbf3c4abb9dff716e098f05852d9a3d8ac8cbcb44 (patch) (side-by-side diff)
treef74d4765868000d27c45771573032515ac8db8be /core/launcher
parent292b097e7db25dd231381c5b09307a1fbe81a492 (diff)
downloadopie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.zip
opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.gz
opie-bf3c4abb9dff716e098f05852d9a3d8ac8cbcb44.tar.bz2
Initial revision
Diffstat (limited to 'core/launcher') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/Makefile1085
-rw-r--r--core/launcher/applauncher.cpp705
-rw-r--r--core/launcher/applauncher.h82
-rw-r--r--core/launcher/documentlist.cpp646
-rw-r--r--core/launcher/documentlist.h77
-rw-r--r--core/launcher/firstuse.cpp517
-rw-r--r--core/launcher/firstuse.h84
-rw-r--r--core/launcher/launchertab.cpp284
-rw-r--r--core/launcher/launchertab.h90
-rw-r--r--core/launcher/qpe-de.ts324
-rw-r--r--core/launcher/qpe-en_GB.ts324
-rw-r--r--core/launcher/qpe-ja.ts352
-rw-r--r--core/launcher/qpe-no.ts329
-rw-r--r--core/launcher/server.cpp657
-rw-r--r--core/launcher/server.h94
-rw-r--r--core/launcher/server.pro118
-rw-r--r--core/launcher/serverapp.cpp617
-rw-r--r--core/launcher/serverapp.h116
-rw-r--r--core/launcher/serverinterface.cpp372
-rw-r--r--core/launcher/serverinterface.h72
-rw-r--r--core/launcher/specification.html213
-rw-r--r--core/launcher/suspendmonitor.cpp167
-rw-r--r--core/launcher/suspendmonitor.h56
-rw-r--r--core/launcher/syncdialog.cpp184
-rw-r--r--core/launcher/syncdialog.h58
25 files changed, 7623 insertions, 0 deletions
diff --git a/core/launcher/Makefile b/core/launcher/Makefile
new file mode 100644
index 0000000..a45dec8
--- a/dev/null
+++ b/core/launcher/Makefile
@@ -0,0 +1,1085 @@
+#############################################################################
+# Automatically generated from server/Makefile.in
+# Build options from
+#############################################################################
+
+default: all # package
+
+CONTROL = server/qpe-taskbar.control
+
+# Compiling
+INTERFACE_DECL_PATH = .
+SYSCONF_CXX = g++
+SYSCONF_CC = gcc
+DASHCROSS =
+
+# Compiling with support libraries
+SYSCONF_CXXFLAGS_X11 =
+SYSCONF_CXXFLAGS_QT = -I$(QTDIR)/include
+SYSCONF_CXXFLAGS_QTOPIA = -I$(QPEDIR)/include
+SYSCONF_CFLAGS_QTOPIA = -I$(QPEDIR)/include
+SYSCONF_CXXFLAGS_OPENGL = -I/usr/X11R6/include
+
+# Compiling YACC output
+SYSCONF_CXXFLAGS_YACC = -Wno-unused -Wno-parentheses
+
+# Linking with support libraries
+SYSCONF_RPATH_X11 =
+SYSCONF_RPATH_QT = -Wl,-rpath,$(QTDIR)/lib
+SYSCONF_RPATH_QTOPIA = -Wl,-rpath,$(QPEDIR)/lib
+SYSCONF_RPATH_OPENGL = -Wl,-rpath,/usr/X11R6/lib
+
+# Linking with support libraries
+# X11
+SYSCONF_LFLAGS_X11 =
+SYSCONF_LIBS_X11 =
+# Qt, Qt+OpenGL
+SYSCONF_LFLAGS_QT = -L$(QTDIR)/lib
+SYSCONF_LFLAGS_QTOPIA = -L$(QPEDIR)/lib
+SYSCONF_LIBS_QT = -lqte$(QT_THREAD_SUFFIX)
+SYSCONF_LIBS_QT_OPENGL =
+SYSCONF_LIBS_QTOPIA = -lqtopia
+# OpenGL
+SYSCONF_LFLAGS_OPENGL = -L/usr/X11R6/lib
+SYSCONF_LIBS_OPENGL =
+# Yacc
+SYSCONF_LIBS_YACC =
+
+# Linking applications
+SYSCONF_LINK = gcc
+SYSCONF_LFLAGS =
+SYSCONF_LIBS =
+
+# Link flags for shared objects
+SYSCONF_LFLAGS_SHOBJ = -shared
+
+# Flags for threading
+SYSCONF_CFLAGS_THREAD = -D_REENTRANT
+SYSCONF_CXXFLAGS_THREAD = -D_REENTRANT
+SYSCONF_LFLAGS_THREAD =
+SYSCONF_LIBS_THREAD = -lpthread
+
+# Meta-object compiler
+SYSCONF_MOC = $(QTDIR)/bin/moc
+
+# UI compiler
+SYSCONF_UIC = $(QTDIR)/bin/uic
+
+# Linking shared libraries
+# - Build the $(TARGET) library, eg. lib$(TARGET).so.2.2.2
+# - Place target in $(DESTDIR) - which has a trailing /
+# - Usually needs to incorporate $(VER_MAJ), $(VER_MIN) and $(VER_PATCH)
+#
+SYSCONF_LINK_SHLIB = gcc
+SYSCONF_LINK_TARGET_SHARED = lib$(TARGET).so.$(VER_MAJ).$(VER_MIN).$(VER_PATCH)
+SYSCONF_LINK_LIB_SHARED = $(SYSCONF_LINK_SHLIB) -shared -Wl,-soname,lib$(TARGET).so.$(VER_MAJ) \
+ $(LFLAGS) -o $(SYSCONF_LINK_TARGET_SHARED) \
+ $(OBJECTS) $(OBJMOC) $(LIBS) && \
+ mv $(SYSCONF_LINK_TARGET_SHARED) $(DESTDIR); \
+ cd $(DESTDIR) && \
+ rm -f lib$(TARGET).so lib$(TARGET).so.$(VER_MAJ) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN); \
+ ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so; \
+ ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ); \
+ ln -s $(SYSCONF_LINK_TARGET_SHARED) lib$(TARGET).so.$(VER_MAJ).$(VER_MIN)
+
+# Linking static libraries
+# - Build the $(TARGET) library, eg. lib$(TARGET).a
+# - Place target in $(DESTDIR) - which has a trailing /
+#
+SYSCONF_AR = ar cqs
+SYSCONF_LINK_TARGET_STATIC = lib$(TARGET).a
+SYSCONF_LINK_LIB_STATIC = rm -f $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) ; \
+ $(SYSCONF_AR) $(DESTDIR)$(SYSCONF_LINK_TARGET_STATIC) $(OBJECTS) $(OBJMOC)
+# Compiling application source
+SYSCONF_CXXFLAGS = -pipe -DQWS -fno-exceptions -fno-rtti -g -Wall -W
+SYSCONF_CFLAGS = -pipe -g -Wall -W
+# Default link type (static linking is still be used where required)
+SYSCONF_LINK_LIB = $(SYSCONF_LINK_LIB_SHARED)
+SYSCONF_LINK_TARGET = $(SYSCONF_LINK_TARGET_SHARED)
+# Compiling library source
+SYSCONF_CXXFLAGS_LIB = -fPIC
+SYSCONF_CFLAGS_LIB = -fPIC
+# Compiling shared-object source
+SYSCONF_CXXFLAGS_SHOBJ = -fPIC
+SYSCONF_CFLAGS_SHOBJ = -fPIC
+# Linking Qt
+SYSCONF_LIBS_QTLIB = $(SYSCONF_LFLAGS_X11) $(QT_LIBS_MT) $(QT_LIBS_OPT)
+# Linking Qt applications
+SYSCONF_LIBS_QTAPP =
+
+# Platform output directories
+MOC_DIR = .moc/linux-generic-g++/
+OBJECTS_DIR = .obj/linux-generic-g++/
+
+#############################################################################
+
+####### Compiler, tools and options
+
+CXX = $(SYSCONF_CXX) $(QT_CXX_MT)
+CXXFLAGS= $(SYSCONF_CXXFLAGS_QTOPIA) $(SYSCONF_CXXFLAGS_QT) $(SYSCONF_CXXFLAGS) -DQTOPIA_APP_INTERFACE
+CC = $(SYSCONF_CC) $(QT_C_MT)
+CFLAGS = $(SYSCONF_CFLAGS_QTOPIA) $(SYSCONF_CFLAGS) -DQTOPIA_APP_INTERFACE
+INCPATH = -I$(MOC_DIR) -I$(QPEDIR)/src/settings/calibrate -I$(QPEDIR)/src/3rdparty/libraries/rsync
+LFLAGS = $(SYSCONF_LFLAGS_QTOPIA) $(SYSCONF_RPATH_QTOPIA) $(SYSCONF_LFLAGS_QT) $(SYSCONF_RPATH_QT) $(SYSCONF_LFLAGS) $(QT_LFLAGS_MT)
+LIBS = $(SUBLIBS) -ljpeg -Wl,-Bstatic -Wl,-whole-archive -Wl,-no-whole-archive -Wl,-Bdynamic -lcrypt -luuid -lqpe $(SYSCONF_LIBS_QTOPIA) $(SYSCONF_LIBS_QT) $(SYSCONF_LIBS) $(SYSCONF_LIBS_QTAPP)
+MOC = $(SYSCONF_MOC)
+UIC = $(SYSCONF_UIC)
+
+####### Target
+
+DESTDIR = $(QPEDIR)/bin/
+VER_MAJ = 1
+VER_MIN = 0
+VER_PATCH = 0
+TARGET = qpe
+TARGET1 = lib$(TARGET).so.$(VER_MAJ)
+
+####### Files
+
+HEADERS = server.h \
+ serverinterface.h \
+ launchertab.h \
+ documentlist.h \
+ suspendmonitor.h \
+ appicons.h \
+ taskbar.h \
+ runningappbar.h \
+ applauncher.h \
+ stabmon.h \
+ inputmethods.h \
+ systray.h \
+ wait.h \
+ shutdownimpl.h \
+ launcher.h \
+ launcherview.h \
+ $(QPEDIR)/src/settings/calibrate/calibrate.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+ packageslave.h \
+ irserver.h \
+ firstuse.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/types.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/whole.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.h \
+ syncdialog.h \
+ serverapp.h
+SOURCES = server.cpp \
+ serverinterface.cpp \
+ launchertab.cpp \
+ documentlist.cpp \
+ suspendmonitor.cpp \
+ appicons.cpp \
+ taskbar.cpp \
+ runningappbar.cpp \
+ applauncher.cpp \
+ stabmon.cpp \
+ inputmethods.cpp \
+ systray.cpp \
+ wait.cpp \
+ shutdownimpl.cpp \
+ launcher.cpp \
+ launcherview.cpp \
+ $(QPEDIR)/src/settings/calibrate/calibrate.cpp \
+ transferserver.cpp \
+ packageslave.cpp \
+ irserver.cpp \
+ qcopbridge.cpp \
+ startmenu.cpp \
+ main.cpp \
+ firstuse.cpp \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/base64.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/delta.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/hex.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/mdfour.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/mksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/msg.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/patch.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/readsums.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/scoop.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stats.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/tube.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/version.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/whole.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.cpp \
+ syncdialog.cpp \
+ serverapp.cpp
+OBJECTS = $(OBJECTS_DIR)/server.o \
+ $(OBJECTS_DIR)/serverinterface.o \
+ $(OBJECTS_DIR)/launchertab.o \
+ $(OBJECTS_DIR)/documentlist.o \
+ $(OBJECTS_DIR)/suspendmonitor.o \
+ $(OBJECTS_DIR)/appicons.o \
+ $(OBJECTS_DIR)/taskbar.o \
+ $(OBJECTS_DIR)/runningappbar.o \
+ $(OBJECTS_DIR)/applauncher.o \
+ $(OBJECTS_DIR)/stabmon.o \
+ $(OBJECTS_DIR)/inputmethods.o \
+ $(OBJECTS_DIR)/systray.o \
+ $(OBJECTS_DIR)/wait.o \
+ $(OBJECTS_DIR)/shutdownimpl.o \
+ $(OBJECTS_DIR)/launcher.o \
+ $(OBJECTS_DIR)/launcherview.o \
+ $(OBJECTS_DIR)/calibrate.o \
+ $(OBJECTS_DIR)/transferserver.o \
+ $(OBJECTS_DIR)/packageslave.o \
+ $(OBJECTS_DIR)/irserver.o \
+ $(OBJECTS_DIR)/qcopbridge.o \
+ $(OBJECTS_DIR)/startmenu.o \
+ $(OBJECTS_DIR)/main.o \
+ $(OBJECTS_DIR)/firstuse.o \
+ $(OBJECTS_DIR)/base64.o \
+ $(OBJECTS_DIR)/buf.o \
+ $(OBJECTS_DIR)/checksum.o \
+ $(OBJECTS_DIR)/command.o \
+ $(OBJECTS_DIR)/delta.o \
+ $(OBJECTS_DIR)/emit.o \
+ $(OBJECTS_DIR)/hex.o \
+ $(OBJECTS_DIR)/job.o \
+ $(OBJECTS_DIR)/mdfour.o \
+ $(OBJECTS_DIR)/mksum.o \
+ $(OBJECTS_DIR)/msg.o \
+ $(OBJECTS_DIR)/netint.o \
+ $(OBJECTS_DIR)/patch.o \
+ $(OBJECTS_DIR)/prototab.o \
+ $(OBJECTS_DIR)/readsums.o \
+ $(OBJECTS_DIR)/scoop.o \
+ $(OBJECTS_DIR)/search.o \
+ $(OBJECTS_DIR)/stats.o \
+ $(OBJECTS_DIR)/stream.o \
+ $(OBJECTS_DIR)/sumset.o \
+ $(OBJECTS_DIR)/trace.o \
+ $(OBJECTS_DIR)/tube.o \
+ $(OBJECTS_DIR)/util.o \
+ $(OBJECTS_DIR)/version.o \
+ $(OBJECTS_DIR)/whole.o \
+ $(OBJECTS_DIR)/qrsync.o \
+ $(OBJECTS_DIR)/syncdialog.o \
+ $(OBJECTS_DIR)/serverapp.o \
+ $(OBJECTS_DIR)/shutdown.o
+INTERFACES = shutdown.ui
+UICDECLS = shutdown.h
+UICIMPLS = shutdown.cpp
+SRCMOC = $(MOC_DIR)/moc_server.cpp \
+ $(MOC_DIR)/moc_launchertab.cpp \
+ $(MOC_DIR)/moc_documentlist.cpp \
+ $(MOC_DIR)/moc_suspendmonitor.cpp \
+ $(MOC_DIR)/moc_appicons.cpp \
+ $(MOC_DIR)/moc_taskbar.cpp \
+ $(MOC_DIR)/moc_runningappbar.cpp \
+ $(MOC_DIR)/moc_applauncher.cpp \
+ $(MOC_DIR)/moc_inputmethods.cpp \
+ $(MOC_DIR)/moc_systray.cpp \
+ $(MOC_DIR)/moc_shutdownimpl.cpp \
+ $(MOC_DIR)/moc_launcher.cpp \
+ $(MOC_DIR)/moc_launcherview.cpp \
+ $(MOC_DIR)/moc_calibrate.cpp \
+ $(MOC_DIR)/moc_startmenu.cpp \
+ $(MOC_DIR)/moc_transferserver.cpp \
+ $(MOC_DIR)/moc_qcopbridge.cpp \
+ $(MOC_DIR)/moc_packageslave.cpp \
+ $(MOC_DIR)/moc_irserver.cpp \
+ $(MOC_DIR)/moc_firstuse.cpp \
+ $(MOC_DIR)/moc_syncdialog.cpp \
+ $(MOC_DIR)/moc_serverapp.cpp \
+ $(MOC_DIR)/moc_shutdown.cpp \
+ $(MOC_DIR)/serverinterface.moc \
+ $(MOC_DIR)/documentlist.moc \
+ $(MOC_DIR)/appicons.moc \
+ $(MOC_DIR)/taskbar.moc \
+ $(MOC_DIR)/serverapp.moc
+OBJMOC = $(OBJECTS_DIR)/moc_server.o \
+ $(OBJECTS_DIR)/moc_launchertab.o \
+ $(OBJECTS_DIR)/moc_documentlist.o \
+ $(OBJECTS_DIR)/moc_suspendmonitor.o \
+ $(OBJECTS_DIR)/moc_appicons.o \
+ $(OBJECTS_DIR)/moc_taskbar.o \
+ $(OBJECTS_DIR)/moc_runningappbar.o \
+ $(OBJECTS_DIR)/moc_applauncher.o \
+ $(OBJECTS_DIR)/moc_inputmethods.o \
+ $(OBJECTS_DIR)/moc_systray.o \
+ $(OBJECTS_DIR)/moc_shutdownimpl.o \
+ $(OBJECTS_DIR)/moc_launcher.o \
+ $(OBJECTS_DIR)/moc_launcherview.o \
+ $(OBJECTS_DIR)/moc_calibrate.o \
+ $(OBJECTS_DIR)/moc_startmenu.o \
+ $(OBJECTS_DIR)/moc_transferserver.o \
+ $(OBJECTS_DIR)/moc_qcopbridge.o \
+ $(OBJECTS_DIR)/moc_packageslave.o \
+ $(OBJECTS_DIR)/moc_irserver.o \
+ $(OBJECTS_DIR)/moc_firstuse.o \
+ $(OBJECTS_DIR)/moc_syncdialog.o \
+ $(OBJECTS_DIR)/moc_serverapp.o \
+ $(OBJECTS_DIR)/moc_shutdown.o
+
+
+####### Implicit rules
+
+.SUFFIXES: .cpp .cxx .cc .C .c
+
+.cpp.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cxx.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.cc.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.C.o:
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $@ $<
+
+.c.o:
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $<
+
+####### Build rules
+
+
+all: $(DESTDIR)$(TARGET)
+
+$(DESTDIR)$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) $(SUBLIBS)
+ $(SYSCONF_LINK) $(LFLAGS) -o $(DESTDIR)$(TARGET) $(OBJECTS) $(OBJMOC) $(LIBS)
+
+moc: $(SRCMOC)
+
+tmake:
+ tmake server.pro
+
+clean:
+ -rm -f $(OBJECTS) $(OBJMOC) $(SRCMOC) $(UICIMPLS) $(UICDECLS)
+ -rm -f *~ core
+ -rm -f allmoc.cpp
+
+####### Extension Modules
+
+listpromodules:
+ @echo
+
+listallmodules:
+ @echo
+
+listaddonpromodules:
+ @echo
+
+listaddonentmodules:
+ @echo
+
+
+REQUIRES=
+
+####### Sub-libraries
+
+
+###### Combined headers
+
+
+
+####### Compile
+
+$(OBJECTS_DIR)/server.o: server.cpp \
+ server.h \
+ serverapp.h \
+ shutdownimpl.h \
+ shutdown.h \
+ launcher.h \
+ launcherview.h \
+ launchertab.h \
+ serverinterface.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+ irserver.h \
+ packageslave.h \
+ $(QPEDIR)/src/settings/calibrate/calibrate.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.h \
+ syncdialog.h \
+ applauncher.h \
+ suspendmonitor.h \
+ documentlist.h \
+ apps.h \
+ ../applications/addressbook/addressbook.h \
+ ../applications/datebook/datebook.h \
+ ../applications/todo/mainwindow.h \
+ ../libraries/qtopiacalc/calculator.h \
+ ../applications/clock/clock.h \
+ ../applications/helpbrowser/helpbrowser.h \
+ ../applications/imageviewer/showimg.h \
+ ../applications/mediaplayer/maindocumentwidgetstack.h \
+ ../applications/textedit/textedit.h \
+ ../games/fifteen/fifteen.h \
+ ../games/mindbreaker/mindbreaker.h \
+ ../games/minesweep/minesweep.h \
+ ../games/qasteroids/toplevel.h \
+ ../games/snake/interface.h \
+ ../games/solitaire/canvascardwindow.h \
+ ../settings/systemtime/settime.h \
+ ../settings/appearance/appearance.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/server.o server.cpp
+
+$(OBJECTS_DIR)/serverinterface.o: serverinterface.cpp \
+ $(MOC_DIR)/serverinterface.moc \
+ serverinterface.h \
+ server.h \
+ documentlist.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/serverinterface.o serverinterface.cpp
+
+$(OBJECTS_DIR)/launchertab.o: launchertab.cpp \
+ launchertab.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/launchertab.o launchertab.cpp
+
+$(OBJECTS_DIR)/documentlist.o: documentlist.cpp \
+ $(MOC_DIR)/documentlist.moc \
+ documentlist.h \
+ serverinterface.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/documentlist.o documentlist.cpp
+
+$(OBJECTS_DIR)/suspendmonitor.o: suspendmonitor.cpp \
+ suspendmonitor.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/suspendmonitor.o suspendmonitor.cpp
+
+$(OBJECTS_DIR)/appicons.o: appicons.cpp \
+ $(MOC_DIR)/appicons.moc \
+ appicons.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/appicons.o appicons.cpp
+
+$(OBJECTS_DIR)/taskbar.o: taskbar.cpp \
+ $(MOC_DIR)/taskbar.moc \
+ startmenu.h \
+ inputmethods.h \
+ runningappbar.h \
+ systray.h \
+ wait.h \
+ appicons.h \
+ taskbar.h \
+ serverinterface.h \
+ server.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/taskbar.o taskbar.cpp
+
+$(OBJECTS_DIR)/runningappbar.o: runningappbar.cpp \
+ runningappbar.h \
+ serverinterface.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/runningappbar.o runningappbar.cpp
+
+$(OBJECTS_DIR)/applauncher.o: applauncher.cpp \
+ applauncher.h \
+ documentlist.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/applauncher.o applauncher.cpp
+
+$(OBJECTS_DIR)/stabmon.o: stabmon.cpp \
+ stabmon.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/stabmon.o stabmon.cpp
+
+$(OBJECTS_DIR)/inputmethods.o: inputmethods.cpp \
+ inputmethods.h \
+ ../plugins/inputmethods/handwriting/handwritingimpl.h \
+ ../plugins/inputmethods/keyboard/keyboardimpl.h \
+ ../3rdparty/plugins/inputmethods/pickboard/pickboardimpl.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/inputmethods.o inputmethods.cpp
+
+$(OBJECTS_DIR)/systray.o: systray.cpp \
+ systray.h \
+ ../plugins/applets/clockapplet/clockappletimpl.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/systray.o systray.cpp
+
+$(OBJECTS_DIR)/wait.o: wait.cpp \
+ wait.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/wait.o wait.cpp
+
+$(OBJECTS_DIR)/shutdownimpl.o: shutdownimpl.cpp \
+ shutdownimpl.h \
+ shutdown.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/shutdownimpl.o shutdownimpl.cpp
+
+$(OBJECTS_DIR)/launcher.o: launcher.cpp \
+ startmenu.h \
+ taskbar.h \
+ serverinterface.h \
+ launcherview.h \
+ launcher.h \
+ launchertab.h \
+ server.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/launcher.o launcher.cpp
+
+$(OBJECTS_DIR)/launcherview.o: launcherview.cpp \
+ launcherview.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/launcherview.o launcherview.cpp
+
+$(OBJECTS_DIR)/calibrate.o: $(QPEDIR)/src/settings/calibrate/calibrate.cpp \
+ $(QPEDIR)/src/settings/calibrate/calibrate.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/calibrate.o $(QPEDIR)/src/settings/calibrate/calibrate.cpp
+
+$(OBJECTS_DIR)/transferserver.o: transferserver.cpp \
+ transferserver.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/transferserver.o transferserver.cpp
+
+$(OBJECTS_DIR)/packageslave.o: packageslave.cpp \
+ packageslave.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/packageslave.o packageslave.cpp
+
+$(OBJECTS_DIR)/irserver.o: irserver.cpp \
+ irserver.h \
+ obexinterface.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/irserver.o irserver.cpp
+
+$(OBJECTS_DIR)/qcopbridge.o: qcopbridge.cpp \
+ qcopbridge.h \
+ transferserver.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/qcopbridge.o qcopbridge.cpp
+
+$(OBJECTS_DIR)/startmenu.o: startmenu.cpp \
+ startmenu.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/startmenu.o startmenu.cpp
+
+$(OBJECTS_DIR)/main.o: main.cpp \
+ server.h \
+ serverapp.h \
+ shutdownimpl.h \
+ shutdown.h \
+ taskbar.h \
+ serverinterface.h \
+ startmenu.h \
+ stabmon.h \
+ launcher.h \
+ launcherview.h \
+ launchertab.h \
+ firstuse.h \
+ $(QPEDIR)/src/settings/calibrate/../calibrate/calibrate.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/main.o main.cpp
+
+$(OBJECTS_DIR)/firstuse.o: firstuse.cpp \
+ firstuse.h \
+ inputmethods.h \
+ applauncher.h \
+ serverapp.h \
+ shutdownimpl.h \
+ shutdown.h \
+ ../settings/calibrate/calibrate.h \
+ documentlist.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/firstuse.o firstuse.cpp
+
+$(OBJECTS_DIR)/base64.o: $(QPEDIR)/src/3rdparty/libraries/rsync/base64.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/base64.o $(QPEDIR)/src/3rdparty/libraries/rsync/base64.c
+
+$(OBJECTS_DIR)/buf.o: $(QPEDIR)/src/3rdparty/libraries/rsync/buf.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/buf.o $(QPEDIR)/src/3rdparty/libraries/rsync/buf.c
+
+$(OBJECTS_DIR)/checksum.o: $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/checksum.o $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.c
+
+$(OBJECTS_DIR)/command.o: $(QPEDIR)/src/3rdparty/libraries/rsync/command.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/command.o $(QPEDIR)/src/3rdparty/libraries/rsync/command.c
+
+$(OBJECTS_DIR)/delta.o: $(QPEDIR)/src/3rdparty/libraries/rsync/delta.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/types.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/delta.o $(QPEDIR)/src/3rdparty/libraries/rsync/delta.c
+
+$(OBJECTS_DIR)/emit.o: $(QPEDIR)/src/3rdparty/libraries/rsync/emit.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/emit.o $(QPEDIR)/src/3rdparty/libraries/rsync/emit.c
+
+$(OBJECTS_DIR)/hex.o: $(QPEDIR)/src/3rdparty/libraries/rsync/hex.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/hex.o $(QPEDIR)/src/3rdparty/libraries/rsync/hex.c
+
+$(OBJECTS_DIR)/job.o: $(QPEDIR)/src/3rdparty/libraries/rsync/job.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/job.o $(QPEDIR)/src/3rdparty/libraries/rsync/job.c
+
+$(OBJECTS_DIR)/mdfour.o: $(QPEDIR)/src/3rdparty/libraries/rsync/mdfour.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/types.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/mdfour.o $(QPEDIR)/src/3rdparty/libraries/rsync/mdfour.c
+
+$(OBJECTS_DIR)/mksum.o: $(QPEDIR)/src/3rdparty/libraries/rsync/mksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/mksum.o $(QPEDIR)/src/3rdparty/libraries/rsync/mksum.c
+
+$(OBJECTS_DIR)/msg.o: $(QPEDIR)/src/3rdparty/libraries/rsync/msg.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/msg.o $(QPEDIR)/src/3rdparty/libraries/rsync/msg.c
+
+$(OBJECTS_DIR)/netint.o: $(QPEDIR)/src/3rdparty/libraries/rsync/netint.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/netint.o $(QPEDIR)/src/3rdparty/libraries/rsync/netint.c
+
+$(OBJECTS_DIR)/patch.o: $(QPEDIR)/src/3rdparty/libraries/rsync/patch.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/patch.o $(QPEDIR)/src/3rdparty/libraries/rsync/patch.c
+
+$(OBJECTS_DIR)/prototab.o: $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/prototab.o $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.c
+
+$(OBJECTS_DIR)/readsums.o: $(QPEDIR)/src/3rdparty/libraries/rsync/readsums.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/readsums.o $(QPEDIR)/src/3rdparty/libraries/rsync/readsums.c
+
+$(OBJECTS_DIR)/scoop.o: $(QPEDIR)/src/3rdparty/libraries/rsync/scoop.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/scoop.o $(QPEDIR)/src/3rdparty/libraries/rsync/scoop.c
+
+$(OBJECTS_DIR)/search.o: $(QPEDIR)/src/3rdparty/libraries/rsync/search.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/search.o $(QPEDIR)/src/3rdparty/libraries/rsync/search.c
+
+$(OBJECTS_DIR)/stats.o: $(QPEDIR)/src/3rdparty/libraries/rsync/stats.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/stats.o $(QPEDIR)/src/3rdparty/libraries/rsync/stats.c
+
+$(OBJECTS_DIR)/stream.o: $(QPEDIR)/src/3rdparty/libraries/rsync/stream.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/stream.o $(QPEDIR)/src/3rdparty/libraries/rsync/stream.c
+
+$(OBJECTS_DIR)/sumset.o: $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/sumset.o $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.c
+
+$(OBJECTS_DIR)/trace.o: $(QPEDIR)/src/3rdparty/libraries/rsync/trace.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/trace.o $(QPEDIR)/src/3rdparty/libraries/rsync/trace.c
+
+$(OBJECTS_DIR)/tube.o: $(QPEDIR)/src/3rdparty/libraries/rsync/tube.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/tube.o $(QPEDIR)/src/3rdparty/libraries/rsync/tube.c
+
+$(OBJECTS_DIR)/util.o: $(QPEDIR)/src/3rdparty/libraries/rsync/util.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/util.o $(QPEDIR)/src/3rdparty/libraries/rsync/util.c
+
+$(OBJECTS_DIR)/version.o: $(QPEDIR)/src/3rdparty/libraries/rsync/version.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/version.o $(QPEDIR)/src/3rdparty/libraries/rsync/version.c
+
+$(OBJECTS_DIR)/whole.o: $(QPEDIR)/src/3rdparty/libraries/rsync/whole.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_linux.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/fileutil.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/whole.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/whole.o $(QPEDIR)/src/3rdparty/libraries/rsync/whole.c
+
+$(OBJECTS_DIR)/qrsync.o: $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.cpp \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/qrsync.o $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.cpp
+
+$(OBJECTS_DIR)/syncdialog.o: syncdialog.cpp \
+ syncdialog.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/syncdialog.o syncdialog.cpp
+
+$(OBJECTS_DIR)/serverapp.o: serverapp.cpp \
+ $(MOC_DIR)/serverapp.moc \
+ serverapp.h \
+ shutdownimpl.h \
+ shutdown.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/serverapp.o serverapp.cpp
+
+shutdown.h: shutdown.ui
+ $(UIC) shutdown.ui -o $(INTERFACE_DECL_PATH)/shutdown.h
+
+shutdown.cpp: shutdown.ui
+ $(UIC) shutdown.ui -i shutdown.h -o shutdown.cpp
+
+$(OBJECTS_DIR)/shutdown.o: shutdown.cpp \
+ shutdown.h \
+ shutdown.ui
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/shutdown.o shutdown.cpp
+
+$(OBJECTS_DIR)/moc_server.o: $(MOC_DIR)/moc_server.cpp \
+ server.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_server.o $(MOC_DIR)/moc_server.cpp
+
+$(OBJECTS_DIR)/moc_launchertab.o: $(MOC_DIR)/moc_launchertab.cpp \
+ launchertab.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_launchertab.o $(MOC_DIR)/moc_launchertab.cpp
+
+$(OBJECTS_DIR)/moc_documentlist.o: $(MOC_DIR)/moc_documentlist.cpp \
+ documentlist.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_documentlist.o $(MOC_DIR)/moc_documentlist.cpp
+
+$(OBJECTS_DIR)/moc_suspendmonitor.o: $(MOC_DIR)/moc_suspendmonitor.cpp \
+ suspendmonitor.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_suspendmonitor.o $(MOC_DIR)/moc_suspendmonitor.cpp
+
+$(OBJECTS_DIR)/moc_appicons.o: $(MOC_DIR)/moc_appicons.cpp \
+ appicons.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_appicons.o $(MOC_DIR)/moc_appicons.cpp
+
+$(OBJECTS_DIR)/moc_taskbar.o: $(MOC_DIR)/moc_taskbar.cpp \
+ taskbar.h \
+ serverinterface.h \
+ startmenu.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_taskbar.o $(MOC_DIR)/moc_taskbar.cpp
+
+$(OBJECTS_DIR)/moc_runningappbar.o: $(MOC_DIR)/moc_runningappbar.cpp \
+ runningappbar.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_runningappbar.o $(MOC_DIR)/moc_runningappbar.cpp
+
+$(OBJECTS_DIR)/moc_applauncher.o: $(MOC_DIR)/moc_applauncher.cpp \
+ applauncher.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_applauncher.o $(MOC_DIR)/moc_applauncher.cpp
+
+$(OBJECTS_DIR)/moc_inputmethods.o: $(MOC_DIR)/moc_inputmethods.cpp \
+ inputmethods.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_inputmethods.o $(MOC_DIR)/moc_inputmethods.cpp
+
+$(OBJECTS_DIR)/moc_systray.o: $(MOC_DIR)/moc_systray.cpp \
+ systray.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_systray.o $(MOC_DIR)/moc_systray.cpp
+
+$(OBJECTS_DIR)/moc_shutdownimpl.o: $(MOC_DIR)/moc_shutdownimpl.cpp \
+ shutdownimpl.h \
+ shutdown.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_shutdownimpl.o $(MOC_DIR)/moc_shutdownimpl.cpp
+
+$(OBJECTS_DIR)/moc_launcher.o: $(MOC_DIR)/moc_launcher.cpp \
+ launcher.h \
+ launcherview.h \
+ launchertab.h \
+ serverinterface.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_launcher.o $(MOC_DIR)/moc_launcher.cpp
+
+$(OBJECTS_DIR)/moc_launcherview.o: $(MOC_DIR)/moc_launcherview.cpp \
+ launcherview.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_launcherview.o $(MOC_DIR)/moc_launcherview.cpp
+
+$(OBJECTS_DIR)/moc_calibrate.o: $(MOC_DIR)/moc_calibrate.cpp \
+ $(QPEDIR)/src/settings/calibrate/calibrate.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_calibrate.o $(MOC_DIR)/moc_calibrate.cpp
+
+$(OBJECTS_DIR)/moc_startmenu.o: $(MOC_DIR)/moc_startmenu.cpp \
+ startmenu.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_startmenu.o $(MOC_DIR)/moc_startmenu.cpp
+
+$(OBJECTS_DIR)/moc_transferserver.o: $(MOC_DIR)/moc_transferserver.cpp \
+ transferserver.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_transferserver.o $(MOC_DIR)/moc_transferserver.cpp
+
+$(OBJECTS_DIR)/moc_qcopbridge.o: $(MOC_DIR)/moc_qcopbridge.cpp \
+ qcopbridge.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_qcopbridge.o $(MOC_DIR)/moc_qcopbridge.cpp
+
+$(OBJECTS_DIR)/moc_packageslave.o: $(MOC_DIR)/moc_packageslave.cpp \
+ packageslave.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_packageslave.o $(MOC_DIR)/moc_packageslave.cpp
+
+$(OBJECTS_DIR)/moc_irserver.o: $(MOC_DIR)/moc_irserver.cpp \
+ irserver.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_irserver.o $(MOC_DIR)/moc_irserver.cpp
+
+$(OBJECTS_DIR)/moc_firstuse.o: $(MOC_DIR)/moc_firstuse.cpp \
+ firstuse.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_firstuse.o $(MOC_DIR)/moc_firstuse.cpp
+
+$(OBJECTS_DIR)/moc_syncdialog.o: $(MOC_DIR)/moc_syncdialog.cpp \
+ syncdialog.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_syncdialog.o $(MOC_DIR)/moc_syncdialog.cpp
+
+$(OBJECTS_DIR)/moc_serverapp.o: $(MOC_DIR)/moc_serverapp.cpp \
+ serverapp.h \
+ shutdownimpl.h \
+ shutdown.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_serverapp.o $(MOC_DIR)/moc_serverapp.cpp
+
+$(OBJECTS_DIR)/moc_shutdown.o: $(MOC_DIR)/moc_shutdown.cpp \
+ shutdown.h
+ $(CXX) -c $(CXXFLAGS) $(INCPATH) -o $(OBJECTS_DIR)/moc_shutdown.o $(MOC_DIR)/moc_shutdown.cpp
+
+$(MOC_DIR)/moc_server.cpp: server.h
+ $(MOC) server.h -o $(MOC_DIR)/moc_server.cpp
+
+$(MOC_DIR)/moc_launchertab.cpp: launchertab.h
+ $(MOC) launchertab.h -o $(MOC_DIR)/moc_launchertab.cpp
+
+$(MOC_DIR)/moc_documentlist.cpp: documentlist.h
+ $(MOC) documentlist.h -o $(MOC_DIR)/moc_documentlist.cpp
+
+$(MOC_DIR)/moc_suspendmonitor.cpp: suspendmonitor.h
+ $(MOC) suspendmonitor.h -o $(MOC_DIR)/moc_suspendmonitor.cpp
+
+$(MOC_DIR)/moc_appicons.cpp: appicons.h
+ $(MOC) appicons.h -o $(MOC_DIR)/moc_appicons.cpp
+
+$(MOC_DIR)/moc_taskbar.cpp: taskbar.h
+ $(MOC) taskbar.h -o $(MOC_DIR)/moc_taskbar.cpp
+
+$(MOC_DIR)/moc_runningappbar.cpp: runningappbar.h
+ $(MOC) runningappbar.h -o $(MOC_DIR)/moc_runningappbar.cpp
+
+$(MOC_DIR)/moc_applauncher.cpp: applauncher.h
+ $(MOC) applauncher.h -o $(MOC_DIR)/moc_applauncher.cpp
+
+$(MOC_DIR)/moc_inputmethods.cpp: inputmethods.h
+ $(MOC) inputmethods.h -o $(MOC_DIR)/moc_inputmethods.cpp
+
+$(MOC_DIR)/moc_systray.cpp: systray.h
+ $(MOC) systray.h -o $(MOC_DIR)/moc_systray.cpp
+
+$(MOC_DIR)/moc_shutdownimpl.cpp: shutdownimpl.h
+ $(MOC) shutdownimpl.h -o $(MOC_DIR)/moc_shutdownimpl.cpp
+
+$(MOC_DIR)/moc_launcher.cpp: launcher.h
+ $(MOC) launcher.h -o $(MOC_DIR)/moc_launcher.cpp
+
+$(MOC_DIR)/moc_launcherview.cpp: launcherview.h
+ $(MOC) launcherview.h -o $(MOC_DIR)/moc_launcherview.cpp
+
+$(MOC_DIR)/moc_calibrate.cpp: $(QPEDIR)/src/settings/calibrate/calibrate.h
+ $(MOC) $(QPEDIR)/src/settings/calibrate/calibrate.h -o $(MOC_DIR)/moc_calibrate.cpp
+
+$(MOC_DIR)/moc_startmenu.cpp: startmenu.h
+ $(MOC) startmenu.h -o $(MOC_DIR)/moc_startmenu.cpp
+
+$(MOC_DIR)/moc_transferserver.cpp: transferserver.h
+ $(MOC) transferserver.h -o $(MOC_DIR)/moc_transferserver.cpp
+
+$(MOC_DIR)/moc_qcopbridge.cpp: qcopbridge.h
+ $(MOC) qcopbridge.h -o $(MOC_DIR)/moc_qcopbridge.cpp
+
+$(MOC_DIR)/moc_packageslave.cpp: packageslave.h
+ $(MOC) packageslave.h -o $(MOC_DIR)/moc_packageslave.cpp
+
+$(MOC_DIR)/moc_irserver.cpp: irserver.h
+ $(MOC) irserver.h -o $(MOC_DIR)/moc_irserver.cpp
+
+$(MOC_DIR)/moc_firstuse.cpp: firstuse.h
+ $(MOC) firstuse.h -o $(MOC_DIR)/moc_firstuse.cpp
+
+$(MOC_DIR)/moc_syncdialog.cpp: syncdialog.h
+ $(MOC) syncdialog.h -o $(MOC_DIR)/moc_syncdialog.cpp
+
+$(MOC_DIR)/moc_serverapp.cpp: serverapp.h
+ $(MOC) serverapp.h -o $(MOC_DIR)/moc_serverapp.cpp
+
+$(MOC_DIR)/serverinterface.moc: serverinterface.cpp
+ $(MOC) serverinterface.cpp -o $(MOC_DIR)/serverinterface.moc
+
+$(MOC_DIR)/documentlist.moc: documentlist.cpp
+ $(MOC) documentlist.cpp -o $(MOC_DIR)/documentlist.moc
+
+$(MOC_DIR)/appicons.moc: appicons.cpp
+ $(MOC) appicons.cpp -o $(MOC_DIR)/appicons.moc
+
+$(MOC_DIR)/taskbar.moc: taskbar.cpp
+ $(MOC) taskbar.cpp -o $(MOC_DIR)/taskbar.moc
+
+$(MOC_DIR)/serverapp.moc: serverapp.cpp
+ $(MOC) serverapp.cpp -o $(MOC_DIR)/serverapp.moc
+
+$(MOC_DIR)/moc_shutdown.cpp: shutdown.h
+ $(MOC) shutdown.h -o $(MOC_DIR)/moc_shutdown.cpp
+
+
+
+lupdate-check:
+ @sed -e '/$$$$QTOPIA1DIR[^ ]*/ d' \
+ -e '/$$(.*/ d' \
+ -e 's/^static:.*//' \
+ <server.pro >t$$$$.pro && \
+ rm -rf t$$$$&& \
+ mkdir t$$$$ && \
+ cp -a *.ts t$$$$ && \
+ chmod +w *.ts && \
+ lupdate t$$$$.pro && \
+ rm t$$$$.pro && \
+ for i in *.ts; \
+ do \
+ if cmp -s $$i t$$$$/$$i; \
+ then \
+ true; \
+ else \
+ echo out-of-date $$i; \
+ fi; \
+ rm $$i; \
+ mv t$$$$/$$i $$i; \
+ done && \
+ rmdir t$$$$
+
+lupdate:
+ sed -e '/$$$$QTOPIA1DIR[^ ]*/ d' \
+ -e '/$$(.*/ d' \
+ -e 's/^static:.*//' \
+ <server.pro >t$$$$.pro && \
+ lupdate t$$$$.pro && \
+ rm t$$$$.pro
+
+lrelease:
+ lrelease server.pro
+ $(QPEDIR)/bin/qtopia-linstall server.pro
+
+
+ipkg: $(DESTDIR)$(TARGET) # among other things...
+ CTL="$(CONTROL)"; for ctrl in $$CTL; do cd $(QPEDIR)/ipkg; ../bin/mkipks -platform generic $(QPEDIR)/src/$$ctrl ; done
+
+package: ipkg
+ cd $(QPEDIR)/ipkg; ../bin/mkPackages
+
+Makefile: server.pro
+ cd $(QPEDIR)/src; ./configure -debug -make server
diff --git a/core/launcher/applauncher.cpp b/core/launcher/applauncher.cpp
new file mode 100644
index 0000000..50c1b71
--- a/dev/null
+++ b/core/launcher/applauncher.cpp
@@ -0,0 +1,705 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef QTOPIA_INTERNAL_PRELOADACCESS
+#define QTOPIA_INTERNAL_PRELOADACCESS
+#endif
+#ifndef QTOPIA_INTERNAL_FILEOPERATIONS
+#define QTOPIA_INTERNAL_FILEOPERATIONS
+#endif
+#ifndef QTOPIA_PROGRAM_MONITOR
+#define QTOPIA_PROGRAM_MONITOR
+#endif
+#include <qtopia/qpeglobal.h>
+
+#ifndef Q_OS_WIN32
+#include <sys/stat.h>
+#include <sys/wait.h>
+#include <sys/file.h>
+#include <unistd.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <errno.h>
+#else
+#include <process.h>
+#include <windows.h>
+#include <winbase.h>
+#endif
+
+#include <signal.h>
+#include <sys/types.h>
+#include <stdlib.h>
+
+#include <qtimer.h>
+#include <qwindowsystem_qws.h>
+#include <qmessagebox.h>
+#include <qfile.h>
+#include <qfileinfo.h>
+
+#include <qtopia/qcopenvelope_qws.h>
+#include <qtopia/applnk.h>
+#include <qtopia/qpeapplication.h>
+#include <qtopia/config.h>
+#include <qtopia/global.h>
+
+#include "applauncher.h"
+#include "documentlist.h"
+
+const int AppLauncher::RAISE_TIMEOUT_MS = 5000;
+
+//---------------------------------------------------------------------------
+
+static AppLauncher* appLauncherPtr;
+
+const int appStopEventID = 1290;
+
+class AppStoppedEvent : public QCustomEvent
+{
+public:
+ AppStoppedEvent(int pid, int status)
+ : QCustomEvent( appStopEventID ), mPid(pid), mStatus(status) { }
+
+ int pid() { return mPid; }
+ int status() { return mStatus; }
+
+private:
+ int mPid, mStatus;
+};
+
+AppLauncher::AppLauncher(QObject *parent, const char *name)
+ : QObject(parent, name), qlPid(0), qlReady(FALSE),
+ appKillerBox(0)
+{
+ connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&)));
+ connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&)));
+ QCopChannel* channel = new QCopChannel( "QPE/System", this );
+ connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT(received(const QCString&, const QByteArray&)) );
+
+ channel = new QCopChannel( "QPE/Server", this );
+ connect( channel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT(received(const QCString&, const QByteArray&)) );
+
+#ifndef Q_OS_WIN32
+ signal(SIGCHLD, signalHandler);
+#else
+ runningAppsProc.setAutoDelete( TRUE );
+#endif
+ QString tmp = qApp->argv()[0];
+ int pos = tmp.findRev('/');
+ if ( pos > -1 )
+ tmp = tmp.mid(++pos);
+ runningApps[::getpid()] = tmp;
+
+ appLauncherPtr = this;
+
+ QTimer::singleShot( 1000, this, SLOT(createQuickLauncher()) );
+}
+
+AppLauncher::~AppLauncher()
+{
+ appLauncherPtr = 0;
+#ifndef Q_OS_WIN32
+ signal(SIGCHLD, SIG_DFL);
+#endif
+ if ( qlPid ) {
+ int status;
+ ::kill( qlPid, SIGTERM );
+ waitpid( qlPid, &status, 0 );
+ }
+}
+
+/* We use the QCopChannel of the app as an indicator of when it has been launched
+ so that we can disable the busy indicators */
+void AppLauncher::newQcopChannel(const QString& channelName)
+{
+// qDebug("channel %s added", channelName.data() );
+ QString prefix("QPE/Application/");
+ if (channelName.startsWith(prefix)) {
+ {
+ QCopEnvelope e("QPE/System", "newChannel(QString)");
+ e << channelName;
+ }
+ QString appName = channelName.mid(prefix.length());
+ if ( appName != "quicklauncher" ) {
+ emit connected( appName );
+ QCopEnvelope e("QPE/System", "notBusy(QString)");
+ e << appName;
+ }
+ } else if (channelName.startsWith("QPE/QuickLauncher-")) {
+ qDebug("Registered %s", channelName.latin1());
+ int pid = channelName.mid(18).toInt();
+ if (pid == qlPid)
+ qlReady = TRUE;
+ }
+}
+
+void AppLauncher::removedQcopChannel(const QString& channelName)
+{
+ if (channelName.startsWith("QPE/Application/")) {
+ QCopEnvelope e("QPE/System", "removedChannel(QString)");
+ e << channelName;
+ }
+}
+
+void AppLauncher::received(const QCString& msg, const QByteArray& data)
+{
+ QDataStream stream( data, IO_ReadOnly );
+ if ( msg == "execute(QString)" ) {
+ QString t;
+ stream >> t;
+ if ( !executeBuiltin( t, QString::null ) )
+ execute(t, QString::null);
+ } else if ( msg == "execute(QString,QString)" ) {
+ QString t,d;
+ stream >> t >> d;
+ if ( !executeBuiltin( t, d ) )
+ execute( t, d );
+ } else if ( msg == "processQCop(QString)" ) { // from QPE/Server
+ QString t;
+ stream >> t;
+ if ( !executeBuiltin( t, QString::null ) )
+ execute( t, QString::null, TRUE);
+ } else if ( msg == "raise(QString)" ) {
+ QString appName;
+ stream >> appName;
+
+ if ( !executeBuiltin( appName, QString::null ) ) {
+ if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) {
+ //qDebug( "Raising: %s", appName.latin1() );
+ QCString channel = "QPE/Application/";
+ channel += appName.latin1();
+
+ // Need to lock it to avoid race conditions with QPEApplication::processQCopFile
+ QFile f("/tmp/qcop-msg-" + appName);
+ if ( f.open(IO_WriteOnly | IO_Append) ) {
+#ifndef Q_OS_WIN32
+ flock(f.handle(), LOCK_EX);
+#endif
+ QDataStream ds(&f);
+ QByteArray b;
+ QDataStream bstream(b, IO_WriteOnly);
+ ds << channel << QCString("raise()") << b;
+ f.flush();
+#ifndef Q_OS_WIN32
+ flock(f.handle(), LOCK_UN);
+#endif
+ f.close();
+ }
+ bool alreadyRunning = isRunning( appName );
+ if ( execute(appName, QString::null) ) {
+ int id = startTimer(RAISE_TIMEOUT_MS + alreadyRunning?2000:0);
+ waitingHeartbeat.insert( appName, id );
+ }
+ }
+ }
+ } else if ( msg == "sendRunningApps()" ) {
+ QStringList apps;
+ QMap<int,QString>::Iterator it;
+ for( it = runningApps.begin(); it != runningApps.end(); ++it )
+ apps.append( *it );
+ QCopEnvelope e( "QPE/Desktop", "runningApps(QStringList)" );
+ e << apps;
+ } else if ( msg == "appRaised(QString)" ) {
+ QString appName;
+ stream >> appName;
+ qDebug("Got a heartbeat from %s", appName.latin1());
+ QMap<QString,int>::Iterator it = waitingHeartbeat.find(appName);
+ if ( it != waitingHeartbeat.end() ) {
+ killTimer( *it );
+ waitingHeartbeat.remove(it);
+ }
+ // Check to make sure we're not waiting on user input...
+ if ( appKillerBox && appName == appKillerName ) {
+ // If we are, we kill the dialog box, and the code waiting on the result
+ // will clean us up (basically the user said "no").
+ delete appKillerBox;
+ appKillerBox = 0;
+ appKillerName = QString::null;
+ }
+ }
+}
+
+void AppLauncher::signalHandler(int)
+{
+#ifndef Q_OS_WIN32
+ int status;
+ pid_t pid = waitpid(-1, &status, WNOHANG);
+/* if (pid == 0 || &status == 0 ) {
+ qDebug("hmm, could not get return value from signal");
+ }
+*/
+ QApplication::postEvent(appLauncherPtr, new AppStoppedEvent(pid, status) );
+#else
+ qDebug("Unhandled signal see by AppLauncher::signalHandler(int)");
+#endif
+}
+
+bool AppLauncher::event(QEvent *e)
+{
+ if ( e->type() == appStopEventID ) {
+ AppStoppedEvent *ae = (AppStoppedEvent *) e;
+ sigStopped(ae->pid(), ae->status() );
+ return TRUE;
+ }
+
+ return QObject::event(e);
+}
+
+void AppLauncher::timerEvent( QTimerEvent *e )
+{
+ int id = e->timerId();
+ QMap<QString,int>::Iterator it;
+ for ( it = waitingHeartbeat.begin(); it != waitingHeartbeat.end(); ++it ) {
+ if ( *it == id ) {
+ if ( appKillerBox ) // we're already dealing with one
+ return;
+
+ appKillerName = it.key();
+ killTimer( id );
+ waitingHeartbeat.remove( it );
+
+ // qDebug("Checking in on %s", appKillerName.latin1());
+
+ // We store this incase the application responds while we're
+ // waiting for user input so we know not to delete ourselves.
+ appKillerBox = new QMessageBox(tr("Application Problem"),
+ tr("<p>%1 is not responding.</p>").arg(appKillerName) +
+ tr("<p>Would you like to force the application to exit?</p>"),
+ QMessageBox::Warning, QMessageBox::Yes,
+ QMessageBox::No | QMessageBox::Default,
+ QMessageBox::NoButton);
+ if (appKillerBox->exec() == QMessageBox::Yes) {
+ // qDebug("Killing the app!!! Bwuhahahaha!");
+ int pid = pidForName(appKillerName);
+ if ( pid > 0 )
+ kill( pid );
+ }
+ appKillerName = QString::null;
+ delete appKillerBox;
+ appKillerBox = 0;
+ return;
+ }
+ }
+
+ QObject::timerEvent( e );
+}
+
+#ifndef Q_OS_WIN32
+void AppLauncher::sigStopped(int sigPid, int sigStatus)
+{
+ int exitStatus = 0;
+
+ bool crashed = WIFSIGNALED(sigStatus);
+ if ( !crashed ) {
+ if ( WIFEXITED(sigStatus) )
+ exitStatus = WEXITSTATUS(sigStatus);
+ } else {
+ exitStatus = WTERMSIG(sigStatus);
+ }
+
+ QMap<int,QString>::Iterator it = runningApps.find( sigPid );
+ if ( it == runningApps.end() ) {
+ if ( sigPid == qlPid ) {
+ qDebug( "quicklauncher stopped" );
+ qlPid = 0;
+ qlReady = FALSE;
+ QFile::remove("/tmp/qcop-msg-quicklauncher" );
+ QTimer::singleShot( 2000, this, SLOT(createQuickLauncher()) );
+ }
+/*
+ if ( sigPid == -1 )
+ qDebug("non-qtopia application exited (disregarded)");
+ else
+ qDebug("==== no pid matching %d in list, definite bug", sigPid);
+*/
+ return;
+ }
+ QString appName = *it;
+ runningApps.remove(it);
+
+ QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName);
+ if ( hbit != waitingHeartbeat.end() ) {
+ killTimer( *hbit );
+ waitingHeartbeat.remove( hbit );
+ }
+ if ( appName == appKillerName ) {
+ appKillerName = QString::null;
+ delete appKillerBox;
+ appKillerBox = 0;
+ }
+
+ /* we must disable preload for an app that crashes as the system logic relies on preloaded apps
+ actually being loaded. If eg. the crash happened in the constructor, we can't automatically reload
+ the app (withouth some timeout value for eg. 3 tries (which I think is a bad solution)
+ */
+ bool preloadDisabled = FALSE;
+ if ( !DocumentList::appLnkSet ) return;
+ const AppLnk* app = DocumentList::appLnkSet->findExec( appName );
+ if ( !app ) return; // QCop messages processed to slow?
+ if ( crashed && app->isPreloaded() ) {
+ Config cfg("Launcher");
+ cfg.setGroup("Preload");
+ QStringList apps = cfg.readListEntry("Apps",',');
+ QString exe = app->exec();
+ apps.remove(exe);
+ cfg.writeEntry("Apps",apps,',');
+ preloadDisabled = TRUE;
+ }
+
+ // clean up
+ if ( exitStatus ) {
+ QCopEnvelope e("QPE/System", "notBusy(QString)");
+ e << app->exec();
+ }
+/*
+ // debug info
+ for (it = runningApps.begin(); it != runningApps.end(); ++it) {
+ qDebug("running according to internal list: %s, with pid %d", (*it).data(), it.key() );
+ }
+*/
+
+#ifdef QTOPIA_PROGRAM_MONITOR
+ if ( crashed ) {
+ QString sig;
+ switch( exitStatus ) {
+ case SIGABRT: sig = "SIGABRT"; break;
+ case SIGALRM: sig = "SIGALRM"; break;
+ case SIGBUS: sig = "SIGBUS"; break;
+ case SIGFPE: sig = "SIGFPE"; break;
+ case SIGHUP: sig = "SIGHUP"; break;
+ case SIGILL: sig = "SIGILL"; break;
+ case SIGKILL: sig = "SIGKILL"; break;
+ case SIGPIPE: sig = "SIGPIPE"; break;
+ case SIGQUIT: sig = "SIGQUIT"; break;
+ case SIGSEGV: sig = "SIGSEGV"; break;
+ case SIGTERM: sig = "SIGTERM"; break;
+ case SIGTRAP: sig = "SIGTRAP"; break;
+ default: sig = QString("Unkown %1").arg(exitStatus);
+ }
+ if ( preloadDisabled )
+ sig += tr("<qt><p>Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.</qt>");
+
+ QString str = tr("<qt><b>%1</b> was terminated due to signal code %2</qt>").arg( app->name() ).arg( sig );
+ QMessageBox::information(0, tr("Application terminated"), str );
+ } else {
+ if ( exitStatus == 255 ) { //could not find app (because global returns -1)
+ QMessageBox::information(0, tr("Application not found"), tr("<qt>Could not locate application <b>%1</b></qt>").arg( app->exec() ) );
+ } else {
+ QFileInfo fi(Global::tempDir() + "qcop-msg-" + appName);
+ if ( fi.exists() && fi.size() ) {
+ emit terminated(sigPid, appName);
+ execute( appName, QString::null );
+ return;
+ }
+ }
+ }
+
+#endif
+
+ emit terminated(sigPid, appName);
+}
+#else
+void AppLauncher::sigStopped(int sigPid, int sigStatus)
+{
+ qDebug("Unhandled signal : AppLauncher::sigStopped(int sigPid, int sigStatus)");
+}
+#endif // Q_OS_WIN32
+
+bool AppLauncher::isRunning(const QString &app)
+{
+ for (QMap<int,QString>::ConstIterator it = runningApps.begin(); it != runningApps.end(); ++it) {
+ if ( *it == app ) {
+#ifdef Q_OS_UNIX
+ pid_t t = ::__getpgid( it.key() );
+ if ( t == -1 ) {
+ qDebug("appLauncher bug, %s believed running, but pid %d is not existing", app.data(), it.key() );
+ runningApps.remove( it.key() );
+ return FALSE;
+ }
+#endif
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+bool AppLauncher::executeBuiltin(const QString &c, const QString &document)
+{
+ Global::Command* builtin = Global::builtinCommands();
+ QGuardedPtr<QWidget> *running = Global::builtinRunning();
+
+ // Attempt to execute the app using a builtin class for the app
+ if (builtin) {
+ for (int i = 0; builtin[i].file; i++) {
+ if ( builtin[i].file == c ) {
+ if ( running[i] ) {
+ if ( !document.isNull() && builtin[i].documentary )
+ Global::setDocument(running[i], document);
+ running[i]->raise();
+ running[i]->show();
+ running[i]->setActiveWindow();
+ } else {
+ running[i] = builtin[i].func( builtin[i].maximized );
+ }
+#ifndef QT_NO_COP
+ QCopEnvelope e("QPE/System", "notBusy(QString)" );
+ e << c; // that was quick ;-)
+#endif
+ return TRUE;
+ }
+ }
+ }
+
+ // Convert the command line in to a list of arguments
+ QStringList list = QStringList::split(QRegExp(" *"),c);
+ QString ap=list[0];
+
+ if ( ap == "suspend" ) { // No tr
+ QWSServer::processKeyEvent( 0xffff, Qt::Key_F34, FALSE, TRUE, FALSE );
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+bool AppLauncher::execute(const QString &c, const QString &docParam, bool noRaise)
+{
+ // Convert the command line in to a list of arguments
+ QStringList list = QStringList::split(QRegExp(" *"),c);
+ if ( !docParam.isEmpty() )
+ list.append( docParam );
+
+ QString appName = list[0];
+ if ( isRunning(appName) ) {
+ QCString channel = "QPE/Application/";
+ channel += appName.latin1();
+
+ // Need to lock it to avoid race conditions with QPEApplication::processQCopFile
+ QFile f(Global::tempDir() + "qcop-msg-" + appName);
+ if ( !noRaise && f.open(IO_WriteOnly | IO_Append) ) {
+#ifndef Q_OS_WIN32
+ flock(f.handle(), LOCK_EX);
+#endif
+
+ QDataStream ds(&f);
+ QByteArray b;
+ QDataStream bstream(b, IO_WriteOnly);
+ if ( !f.size() ) {
+ ds << channel << QCString("raise()") << b;
+ if ( !waitingHeartbeat.contains( appName ) && appKillerName != appName ) {
+ int id = startTimer(RAISE_TIMEOUT_MS);
+ waitingHeartbeat.insert( appName, id );
+ }
+ }
+ if ( !docParam.isEmpty() ) {
+ bstream << docParam;
+ ds << channel << QCString("setDocument(QString)") << b;
+ }
+
+ f.flush();
+#ifndef Q_OS_WIN32
+ flock(f.handle(), LOCK_UN);
+#endif
+ f.close();
+ }
+ if ( QCopChannel::isRegistered(channel) ) // avoid unnecessary warnings
+ QCopChannel::send(channel,"QPEProcessQCop()");
+
+ return TRUE;
+ }
+
+#ifdef QT_NO_QWS_MULTIPROCESS
+ QMessageBox::warning( 0, tr("Error"), tr("Could not find the application %1").arg(c),
+ tr("OK"), 0, 0, 0, 1 );
+#else
+
+ QStrList slist;
+ unsigned j;
+ for ( j = 0; j < list.count(); j++ )
+ slist.append( list[j].utf8() );
+
+ const char **args = new const char *[slist.count() + 1];
+ for ( j = 0; j < slist.count(); j++ )
+ args[j] = slist.at(j);
+ args[j] = NULL;
+
+#ifndef Q_OS_WIN32
+ if ( qlPid && qlReady && QFile::exists( QPEApplication::qpeDir()+"plugins/application/lib"+args[0] + ".so" ) ) {
+ qDebug( "Quick launching: %s", args[0] );
+ if ( getuid() == 0 )
+ setpriority( PRIO_PROCESS, qlPid, 0 );
+ QCString qlch("QPE/QuickLauncher-");
+ qlch += QString::number(qlPid);
+ QCopEnvelope env( qlch, "execute(QStrList)" );
+ env << slist;
+ runningApps[qlPid] = QString(args[0]);
+ emit launched(qlPid, QString(args[0]));
+ QCopEnvelope e("QPE/System", "busy()");
+ qlPid = 0;
+ qlReady = FALSE;
+ QTimer::singleShot( getuid() == 0 ? 800 : 1500, this, SLOT(createQuickLauncher()) );
+ } else {
+ int pid = ::vfork();
+ if ( !pid ) {
+ for ( int fd = 3; fd < 100; fd++ )
+ ::close( fd );
+ ::setpgid( ::getpid(), ::getppid() );
+ // Try bindir first, so that foo/bar works too
+ ::execv( QPEApplication::qpeDir()+"bin/"+args[0], (char * const *)args );
+ ::execvp( args[0], (char * const *)args );
+ _exit( -1 );
+ }
+
+ runningApps[pid] = QString(args[0]);
+ emit launched(pid, QString(args[0]));
+ QCopEnvelope e("QPE/System", "busy()");
+ }
+#else
+ QProcess *proc = new QProcess(this);
+ if (proc){
+ for (int i=0; i < slist.count(); i++)
+ proc->addArgument(args[i]);
+ connect(proc, SIGNAL(processExited()), this, SLOT(processExited()));
+ if (!proc->start()){
+ qDebug("Unable to start application %s", args[0]);
+ }else{
+ PROCESS_INFORMATION *procInfo = (PROCESS_INFORMATION *)proc->processIdentifier();
+ if (procInfo){
+ DWORD pid = procInfo->dwProcessId;
+ runningApps[pid] = QString(args[0]);
+ runningAppsProc.append(proc);
+ emit launched(pid, QString(args[0]));
+ QCopEnvelope e("QPE/System", "busy()");
+ }else{
+ qDebug("Unable to read process inforation #1 for %s", args[0]);
+ }
+ }
+ }else{
+ qDebug("Unable to create process for application %s", args[0]);
+ return FALSE;
+ }
+#endif
+#endif //QT_NO_QWS_MULTIPROCESS
+
+ delete [] args;
+ return TRUE;
+}
+
+void AppLauncher::kill( int pid )
+{
+#ifndef Q_OS_WIN32
+ ::kill( pid, SIGTERM );
+#else
+ for ( QProcess *proc = runningAppsProc.first(); proc; proc = runningAppsProc.next() ) {
+ if ( proc->processIdentifier() == pid ) {
+ proc->kill();
+ break;
+ }
+ }
+#endif
+}
+
+int AppLauncher::pidForName( const QString &appName )
+{
+ int pid = -1;
+
+ QMap<int, QString>::Iterator it;
+ for (it = runningApps.begin(); it!= runningApps.end(); ++it) {
+ if (*it == appName) {
+ pid = it.key();
+ break;
+ }
+ }
+
+ return pid;
+}
+
+void AppLauncher::createQuickLauncher()
+{
+ qlReady = FALSE;
+ qlPid = ::vfork();
+ if ( !qlPid ) {
+ char **args = new char *[2];
+ args[0] = "quicklauncher";
+ args[1] = 0;
+ for ( int fd = 3; fd < 100; fd++ )
+ ::close( fd );
+ ::setpgid( ::getpid(), ::getppid() );
+ // Try bindir first, so that foo/bar works too
+ setenv( "LD_BIND_NOW", "1", 1 );
+ ::execv( QPEApplication::qpeDir()+"bin/quicklauncher", args );
+ ::execvp( "quicklauncher", args );
+ _exit( -1 );
+ } else if ( qlPid == -1 ) {
+ qlPid = 0;
+ } else {
+ if ( getuid() == 0 )
+ setpriority( PRIO_PROCESS, qlPid, 19 );
+ }
+}
+
+// Used only by Win32
+void AppLauncher::processExited()
+{
+#ifdef Q_OS_WIN32
+ qDebug("AppLauncher::processExited()");
+ bool found = FALSE;
+ QProcess *proc = (QProcess *) sender();
+ if (!proc){
+ qDebug("Interanl error NULL proc");
+ return;
+ }
+
+ QString appName = proc->arguments()[0];
+ qDebug("Removing application %s", appName.latin1());
+ runningAppsProc.remove(proc);
+
+ QMap<QString,int>::Iterator hbit = waitingHeartbeat.find(appName);
+ if ( hbit != waitingHeartbeat.end() ) {
+ killTimer( *hbit );
+ waitingHeartbeat.remove( hbit );
+ }
+ if ( appName == appKillerName ) {
+ appKillerName = QString::null;
+ delete appKillerBox;
+ appKillerBox = 0;
+ }
+
+ // Search for the app to find its PID
+ QMap<int, QString>::Iterator it;
+ for (it = runningApps.begin(); it!= runningApps.end(); ++it){
+ if (it.data() == appName){
+ found = TRUE;
+ break;
+ }
+ }
+
+ if (found){
+ emit terminated(it.key(), it.data());
+ runningApps.remove(it.key());
+ }else{
+ qDebug("Internal error application %s not listed as running", appName.latin1());
+ }
+
+#endif
+}
+
diff --git a/core/launcher/applauncher.h b/core/launcher/applauncher.h
new file mode 100644
index 0000000..6a1e416
--- a/dev/null
+++ b/core/launcher/applauncher.h
@@ -0,0 +1,82 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef APP_LAUNCHER_H
+#define APP_LAUNCHER_H
+
+#include <qtopia/qpeglobal.h>
+#include <qobject.h>
+#include <qmap.h>
+#ifdef Q_OS_WIN32
+#include <qtopia/qprocess.h>
+#include <qlist.h>
+#endif
+
+class QMessageBox;
+
+class AppLauncher : public QObject
+{
+ Q_OBJECT
+public:
+ AppLauncher(QObject *parent = 0, const char *name = 0);
+ ~AppLauncher();
+
+ bool isRunning(const QString &app);
+
+ static const int RAISE_TIMEOUT_MS;
+
+signals:
+ void launched(int pid, const QString &app);
+ void terminated(int pid, const QString &app);
+ void connected(const QString &app);
+
+protected slots:
+ void sigStopped(int sigPid, int sigStatus);
+ void received(const QCString& msg, const QByteArray& data);
+ void newQcopChannel(const QString& channel);
+ void removedQcopChannel(const QString& channel);
+ void createQuickLauncher();
+ void processExited();
+
+protected:
+ bool event(QEvent *);
+ void timerEvent( QTimerEvent * );
+
+private:
+ static void signalHandler(int sig);
+ bool executeBuiltin(const QString &c, const QString &document);
+ bool execute(const QString &c, const QString &document, bool noRaise = FALSE);
+ void kill( int pid );
+ int pidForName( const QString & );
+
+private:
+ QMap<int,QString> runningApps;
+ QMap<QString,int> waitingHeartbeat;
+#ifdef Q_OS_WIN32
+ QList<QProcess> runningAppsProc;
+#endif
+ int qlPid;
+ bool qlReady;
+ QMessageBox *appKillerBox;
+ QString appKillerName;
+};
+
+#endif
+
diff --git a/core/launcher/documentlist.cpp b/core/launcher/documentlist.cpp
new file mode 100644
index 0000000..033dd10
--- a/dev/null
+++ b/core/launcher/documentlist.cpp
@@ -0,0 +1,646 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "documentlist.h"
+#include "serverinterface.h"
+
+#include <qtopia/mimetype.h>
+#include <qtopia/resource.h>
+#include <qtopia/global.h>
+#include <qtopia/categories.h>
+#include <qtopia/qpeapplication.h>
+#include <qtopia/applnk.h>
+#include <qtopia/storage.h>
+#ifdef Q_WS_QWS
+#include <qtopia/qcopenvelope_qws.h>
+#endif
+
+#include <qtimer.h>
+#include <qfileinfo.h>
+#include <qtextstream.h>
+#include <qfile.h>
+#include <qdir.h>
+#include <qpainter.h>
+#include <qimage.h>
+#include <qcopchannel_qws.h>
+#include <qlistview.h>
+#include <qlist.h>
+#include <qpixmap.h>
+
+
+AppLnkSet *DocumentList::appLnkSet = 0;
+
+static const int MAX_SEARCH_DEPTH = 10;
+
+
+class DocumentListPrivate : public QObject {
+ Q_OBJECT
+public:
+ DocumentListPrivate( ServerInterface *gui );
+ ~DocumentListPrivate();
+
+ void initialize();
+
+ const QString nextFile();
+ const DocLnk *iterate();
+ bool store( DocLnk* dl );
+ void estimatedPercentScanned();
+
+ DocLnkSet dls;
+ QDict<void> reference;
+ QDictIterator<void> *dit;
+ enum { Find, RemoveKnownFiles, MakeUnknownFiles, Done } state;
+
+ QStringList docPaths;
+ unsigned int docPathsSearched;
+
+ int searchDepth;
+ QDir *listDirs[MAX_SEARCH_DEPTH];
+ const QFileInfoList *lists[MAX_SEARCH_DEPTH];
+ unsigned int listPositions[MAX_SEARCH_DEPTH];
+
+ StorageInfo *storage;
+
+ int tid;
+
+ ServerInterface *serverGui;
+
+ bool needToSendAllDocLinks;
+ bool sendAppLnks;
+ bool sendDocLnks;
+ bool scanDocs;
+};
+
+
+DocumentList::DocumentList( ServerInterface *serverGui, bool scanDocs,
+ QObject *parent, const char *name )
+ : QObject( parent, name )
+{
+ appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
+ d = new DocumentListPrivate( serverGui );
+ d->scanDocs = scanDocs;
+ d->needToSendAllDocLinks = false;
+
+ QTimer::singleShot( 10, this, SLOT( startInitialScan() ) );
+}
+
+void DocumentList::startInitialScan()
+{
+ reloadAppLnks();
+ reloadDocLnks();
+}
+
+DocumentList::~DocumentList()
+{
+ delete appLnkSet;
+ delete d;
+}
+
+
+void DocumentList::add( const DocLnk& doc )
+{
+ if ( d->serverGui && QFile::exists( doc.file() ) )
+ d->serverGui->documentAdded( doc );
+}
+
+
+void DocumentList::start()
+{
+ resume();
+}
+
+
+void DocumentList::pause()
+{
+ //qDebug("pause %i", d->tid);
+ killTimer( d->tid );
+ d->tid = 0;
+}
+
+
+void DocumentList::resume()
+{
+ if ( d->tid == 0 ) {
+ d->tid = startTimer( 0 );
+ //qDebug("resumed %i", d->tid);
+ }
+}
+
+/*
+void DocumentList::resend()
+{
+ // Re-emits all the added items to the list (firstly letting everyone know to
+ // clear what they have as it is being sent again)
+ pause();
+ emit allRemoved();
+ QTimer::singleShot( 5, this, SLOT( resendWorker() ) );
+}
+
+
+void DocumentList::resendWorker()
+{
+ const QList<DocLnk> &list = d->dls.children();
+ for ( QListIterator<DocLnk> it( list ); it.current(); ++it )
+ add( *(*it) );
+ resume();
+}
+*/
+
+void DocumentList::rescan()
+{
+ //qDebug("rescan");
+ pause();
+ d->initialize();
+ resume();
+}
+
+
+void DocumentList::timerEvent( QTimerEvent *te )
+{
+ if ( te->timerId() == d->tid ) {
+ // Do 3 at a time
+ for (int i = 0; i < 3; i++ ) {
+ const DocLnk *lnk = d->iterate();
+ if ( lnk ) {
+ add( *lnk );
+ } else {
+ // stop when done
+ pause();
+ if ( d->serverGui )
+ d->serverGui->documentScanningProgress( 100 );
+ if ( d->needToSendAllDocLinks )
+ sendAllDocLinks();
+ break;
+ }
+ }
+ }
+}
+
+
+void DocumentList::reloadAppLnks()
+{
+ if ( d->sendAppLnks && d->serverGui ) {
+ d->serverGui->applicationScanningProgress( 0 );
+ d->serverGui->allApplicationsRemoved();
+ }
+
+ delete appLnkSet;
+ appLnkSet = new AppLnkSet( MimeType::appsFolderName() );
+
+ if ( d->sendAppLnks && d->serverGui ) {
+ static QStringList prevTypeList;
+ QStringList types = appLnkSet->types();
+ for ( QStringList::Iterator ittypes=types.begin(); ittypes!=types.end(); ++ittypes) {
+ if ( !(*ittypes).isEmpty() ) {
+ if ( !prevTypeList.contains(*ittypes) ) {
+ QString name = appLnkSet->typeName(*ittypes);
+ QPixmap pm = appLnkSet->typePixmap(*ittypes);
+ QPixmap bgPm = appLnkSet->typeBigPixmap(*ittypes);
+
+ if (pm.isNull()) {
+ QImage img( Resource::loadImage( "UnknownDocument" ) );
+ pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
+ bgPm = img.smoothScale( AppLnk::bigIconSize(), AppLnk::bigIconSize() );
+ }
+
+ //qDebug("adding type %s", (*ittypes).latin1());
+
+ // ### our current launcher expects docs tab to be last
+ d->serverGui->typeAdded( *ittypes, name.isNull() ? (*ittypes) : name, pm, bgPm );
+ }
+ prevTypeList.remove(*ittypes);
+ }
+ }
+ for ( QStringList::Iterator ittypes=prevTypeList.begin(); ittypes!=prevTypeList.end(); ++ittypes) {
+ //qDebug("removing type %s", (*ittypes).latin1());
+ d->serverGui->typeRemoved(*ittypes);
+ }
+ prevTypeList = types;
+ }
+
+ QListIterator<AppLnk> itapp( appLnkSet->children() );
+ AppLnk* l;
+ while ( (l=itapp.current()) ) {
+ ++itapp;
+ if ( d->sendAppLnks && d->serverGui )
+ d->serverGui->applicationAdded( l->type(), *l );
+ }
+
+ if ( d->sendAppLnks && d->serverGui )
+ d->serverGui->applicationScanningProgress( 100 );
+}
+
+void DocumentList::reloadDocLnks()
+{
+ if ( !d->scanDocs )
+ return;
+
+ if ( d->sendDocLnks && d->serverGui ) {
+ d->serverGui->documentScanningProgress( 0 );
+ d->serverGui->allDocumentsRemoved();
+ }
+
+ rescan();
+}
+
+void DocumentList::linkChanged( QString arg )
+{
+ //qDebug( "linkchanged( %s )", arg.latin1() );
+
+ if ( arg.isNull() || Global::isAppLnkFileName( arg ) ) {
+ reloadAppLnks();
+ } else {
+
+ const QList<DocLnk> &list = d->dls.children();
+ QListIterator<DocLnk> it( list );
+ while ( it.current() ) {
+ DocLnk *doc = it.current();
+ ++it;
+ if ( ( doc->linkFileKnown() && doc->linkFile() == arg )
+ || ( doc->fileKnown() && doc->file() == arg ) ) {
+ //qDebug( "found old link" );
+ DocLnk* dl = new DocLnk( arg );
+ // add new one if it exists and matches the mimetype
+ if ( d->store( dl ) ) {
+ // Existing link has been changed, send old link ref and a ref
+ // to the new link
+ //qDebug( "change case" );
+ if ( d->serverGui )
+ d->serverGui->documentChanged( *doc, *dl );
+
+ } else {
+ // Link has been removed or doesn't match the mimetypes any more
+ // so we aren't interested in it, so take it away from the list
+ //qDebug( "removal case" );
+ if ( d->serverGui )
+ d->serverGui->documentRemoved( *doc );
+
+ }
+ d->dls.remove( doc ); // remove old link from docLnkSet
+ delete doc;
+ return;
+ }
+ }
+ // Didn't find existing link, must be new
+ DocLnk* dl = new DocLnk( arg );
+ if ( d->store( dl ) ) {
+ // Add if it's a link we are interested in
+ //qDebug( "add case" );
+ add( *dl );
+ }
+
+ }
+}
+
+void DocumentList::restoreDone()
+{
+ reloadAppLnks();
+ reloadDocLnks();
+}
+
+void DocumentList::storageChanged()
+{
+ // ### can implement better
+ reloadAppLnks();
+ reloadDocLnks();
+ // ### Optimization opportunity
+ // Could be a bit more intelligent and somehow work out which
+ // mtab entry has changed and then only scan that and add and remove
+ // links appropriately.
+// rescan();
+}
+
+void DocumentList::sendAllDocLinks()
+{
+ if ( d->tid != 0 ) {
+ // We are in the middle of scanning, set a flag so
+ // we do this when we finish our scanning
+ d->needToSendAllDocLinks = true;
+ return;
+ }
+
+ QString contents;
+ Categories cats;
+ for ( QListIterator<DocLnk> it( d->dls.children() ); it.current(); ++it ) {
+ DocLnk *doc = it.current();
+ QFileInfo fi( doc->file() );
+ if ( !fi.exists() )
+ continue;
+
+ bool fake = !doc->linkFileKnown();
+ if ( !fake ) {
+ QFile f( doc->linkFile() );
+ if ( f.open( IO_ReadOnly ) ) {
+ QTextStream ts( &f );
+ ts.setEncoding( QTextStream::UnicodeUTF8 );
+ contents += ts.read();
+ f.close();
+ } else
+ fake = TRUE;
+ }
+ if (fake) {
+ contents += "[Desktop Entry]\n"; // No tr
+ contents += "Categories = " + // No tr
+ cats.labels("Document View",doc->categories()).join(";") + "\n"; // No tr
+ contents += "Name = "+doc->name()+"\n"; // No tr
+ contents += "Type = "+doc->type()+"\n"; // No tr
+ }
+ contents += "File = "+doc->file()+"\n"; // No tr // (resolves path)
+ contents += QString("Size = %1\n").arg( fi.size() ); // No tr
+ }
+
+ //qDebug( "sending length %d", contents.length() );
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "docLinks(QString)" );
+ e << contents;
+#endif
+ //qDebug( "================ \n\n%s\n\n===============", contents.latin1() );
+
+ d->needToSendAllDocLinks = false;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+DocumentListPrivate::DocumentListPrivate( ServerInterface *gui )
+{
+ storage = new StorageInfo( this );
+ serverGui = gui;
+ if ( serverGui ) {
+ sendAppLnks = serverGui->requiresApplications();
+ sendDocLnks = serverGui->requiresDocuments();
+ } else {
+ sendAppLnks = false;
+ sendDocLnks = false;
+ }
+ for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) {
+ listDirs[i] = 0;
+ lists[i] = 0;
+ listPositions[i] = 0;
+ }
+ initialize();
+ tid = 0;
+}
+
+
+void DocumentListPrivate::initialize()
+{
+ // Reset
+ dls.clear();
+ docPaths.clear();
+ reference.clear();
+
+ QDir docDir( QPEApplication::documentDir() );
+ if ( docDir.exists() )
+ docPaths += QPEApplication::documentDir();
+ int i = 1;
+ const QList<FileSystem> &fs = storage->fileSystems();
+ QListIterator<FileSystem> it( fs );
+ for ( ; it.current(); ++it )
+ if ( (*it)->isRemovable() ) {
+ docPaths += (*it)->path();
+ i++;
+ }
+
+ for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ ) {
+ if ( listDirs[i] ) {
+ delete listDirs[i];
+ listDirs[i] = 0;
+ }
+ lists[i] = 0;
+ listPositions[i] = 0;
+ }
+
+ docPathsSearched = 0;
+ searchDepth = -1;
+ state = Find;
+ dit = 0;
+}
+
+
+DocumentListPrivate::~DocumentListPrivate()
+{
+ for ( int i = 0; i < MAX_SEARCH_DEPTH; i++ )
+ if ( listDirs[i] )
+ delete listDirs[i];
+ delete dit;
+}
+
+
+void DocumentListPrivate::estimatedPercentScanned()
+{
+ double overallProgress = 0.0;
+ double levelWeight = 75.0;
+
+ int topCount = docPaths.count();
+ if ( topCount > 1 ) {
+ levelWeight = levelWeight / topCount;
+ overallProgress += (docPathsSearched - 1) * levelWeight;
+ }
+
+ for ( int d = 0; d <= searchDepth; d++ ) {
+ if ( listDirs[d] ) {
+ int items = lists[d]->count();
+ if ( items > 1 ) {
+ levelWeight = levelWeight / items;
+ // Take in to account "." and ".."
+ overallProgress += (listPositions[d] - 3) * levelWeight;
+ }
+ } else {
+ break;
+ }
+ }
+
+ // qDebug( "overallProgress: %f", overallProgress );
+
+ if ( serverGui )
+ serverGui->documentScanningProgress( (int)overallProgress );
+}
+
+
+const QString DocumentListPrivate::nextFile()
+{
+ while ( TRUE ) {
+ while ( searchDepth < 0 ) {
+ // go to next base path
+ if ( docPathsSearched >= docPaths.count() ) {
+ // end of base paths
+ return QString::null;
+ } else {
+ QDir dir( docPaths[docPathsSearched] );
+ // qDebug("now using base path: %s", docPaths[docPathsSearched].latin1() );
+ docPathsSearched++;
+ if ( !dir.exists( ".Qtopia-ignore" ) ) {
+ listDirs[0] = new QDir( dir );
+ lists[0] = listDirs[0]->entryInfoList();
+ listPositions[0] = 0;
+ searchDepth = 0;
+ }
+ }
+ }
+
+ const QFileInfoList *fil = lists[searchDepth];
+ QFileInfoList *fl = (QFileInfoList *)fil;
+ unsigned int pos = listPositions[searchDepth];
+
+ if ( pos >= fl->count() ) {
+ // go up a depth
+ delete listDirs[searchDepth];
+ listDirs[searchDepth] = 0;
+ lists[searchDepth] = 0;
+ listPositions[searchDepth] = 0;
+ searchDepth--;
+ } else {
+ const QFileInfo *fi = fl->at(pos);
+ listPositions[searchDepth]++;
+ QString bn = fi->fileName();
+ if ( bn[0] != '.' ) {
+ if ( fi->isDir() ) {
+ if ( bn != "CVS" && bn != "Qtopia" && bn != "QtPalmtop" ) {
+ // go down a depth
+ QDir dir( fi->filePath() );
+ // qDebug("now going in to path: %s", bn.latin1() );
+ if ( !dir.exists( ".Qtopia-ignore" ) ) {
+ if ( searchDepth < MAX_SEARCH_DEPTH - 1) {
+ searchDepth++;
+ listDirs[searchDepth] = new QDir( dir );
+ lists[searchDepth] = listDirs[searchDepth]->entryInfoList();
+ listPositions[searchDepth] = 0;
+ }
+ }
+ }
+ } else {
+ estimatedPercentScanned();
+ return fl->at(pos)->filePath();
+ }
+ }
+ }
+ }
+
+ return QString::null;
+}
+
+
+bool DocumentListPrivate::store( DocLnk* dl )
+{
+ // if ( dl->fileKnown() && !dl->file().isEmpty() ) {
+ if ( dl && dl->fileKnown() ) {
+ dls.add( dl ); // store
+ return TRUE;
+ }
+
+ // don't store - delete
+ delete dl;
+ return FALSE;
+}
+
+
+#define MAGIC_NUMBER ((void*)2)
+
+const DocLnk *DocumentListPrivate::iterate()
+{
+ if ( state == Find ) {
+ //qDebug("state Find");
+ QString file = nextFile();
+ while ( !file.isNull() ) {
+ if ( file.right(8) == ".desktop" ) { // No tr
+ DocLnk* dl = new DocLnk( file );
+ if ( store(dl) )
+ return dl;
+ } else {
+ reference.insert( file, MAGIC_NUMBER );
+ }
+ file = nextFile();
+ }
+ state = RemoveKnownFiles;
+
+ if ( serverGui )
+ serverGui->documentScanningProgress( 75 );
+ }
+
+ static int iterationI;
+ static int iterationCount;
+
+ if ( state == RemoveKnownFiles ) {
+ //qDebug("state RemoveKnownFiles");
+ const QList<DocLnk> &list = dls.children();
+ for ( QListIterator<DocLnk> it( list ); it.current(); ++it ) {
+ reference.remove( (*it)->file() );
+ // ### does this need to be deleted?
+ }
+ dit = new QDictIterator<void>(reference);
+ state = MakeUnknownFiles;
+
+ iterationI = 0;
+ iterationCount = dit->count();
+ }
+
+ if ( state == MakeUnknownFiles ) {
+ //qDebug("state MakeUnknownFiles");
+ for (void* c; (c=dit->current()); ++(*dit) ) {
+ if ( c == MAGIC_NUMBER ) {
+ DocLnk* dl = new DocLnk;
+ QFileInfo fi( dit->currentKey() );
+ dl->setFile( fi.filePath() );
+ dl->setName( fi.baseName() );
+ if ( store(dl) ) {
+ ++*dit;
+ iterationI++;
+ if ( serverGui )
+ serverGui->documentScanningProgress( 75 + (25*iterationI)/iterationCount );
+ return dl;
+ }
+ }
+ iterationI++;
+ }
+
+ delete dit;
+ dit = 0;
+ state = Done;
+ }
+
+ //qDebug("state Done");
+ return NULL;
+}
+
+
+#include "documentlist.moc"
+
+
+
diff --git a/core/launcher/documentlist.h b/core/launcher/documentlist.h
new file mode 100644
index 0000000..bd5c031
--- a/dev/null
+++ b/core/launcher/documentlist.h
@@ -0,0 +1,77 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef DOCUMENT_LIST_H
+#define DOCUMENT_LIST_H
+
+
+#include <qobject.h>
+#include <qtopia/applnk.h>
+
+
+class DocumentListPrivate;
+class ServerInterface;
+
+class DocumentList : public QObject {
+ Q_OBJECT
+public:
+ DocumentList( ServerInterface *serverGui, bool scanDocs = TRUE,
+ QObject *parent = 0, const char *name = 0 );
+ ~DocumentList();
+
+ void linkChanged( QString link );
+ void restoreDone();
+ void storageChanged();
+ void sendAllDocLinks();
+
+ void reloadAppLnks();
+ void reloadDocLnks();
+
+// Orig DocList stuff
+ void start();
+ void pause();
+ void resume();
+ void rescan();
+
+ static AppLnkSet *appLnkSet;
+
+/*
+ void resend();
+signals:
+ void added( const DocLnk& doc );
+ void removed( const DocLnk& doc );
+ void changed( const DocLnk& oldDoc, const DocLnk& newDoc );
+ void allRemoved();
+ void doneForNow();
+private slots:
+ void resendWorker();
+*/
+private slots:
+ void startInitialScan();
+protected:
+ void timerEvent( QTimerEvent *te );
+private:
+ void add( const DocLnk& doc );
+ DocumentListPrivate *d;
+
+};
+
+
+#endif
+
diff --git a/core/launcher/firstuse.cpp b/core/launcher/firstuse.cpp
new file mode 100644
index 0000000..31b7923
--- a/dev/null
+++ b/core/launcher/firstuse.cpp
@@ -0,0 +1,517 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+// I need access to some things you don't normally get access to.
+
+#ifndef _MSC_VER
+ //### revise to allow removal of translators under MSVC
+#define private public
+#define protected public
+#endif
+#include "firstuse.h"
+#include "inputmethods.h"
+#include "applauncher.h"
+#include "serverapp.h"
+#include <qtopia/custom.h>
+#if defined(QPE_NEED_CALIBRATION)
+#include "../settings/calibrate/calibrate.h"
+#endif
+#include "documentlist.h"
+
+#include <qtopia/resource.h>
+#include <qtopia/qcopenvelope_qws.h>
+#include <qtopia/qpeapplication.h>
+#include <qtopia/config.h>
+#include <qtopia/applnk.h>
+#include <qtopia/mimetype.h>
+#include <qtopia/fontmanager.h>
+
+#include <qapplication.h>
+#include <qfile.h>
+#include <qpainter.h>
+#include <qcstring.h>
+#include <qsimplerichtext.h>
+#include <qcolor.h>
+#include <qpushbutton.h>
+#include <qhbox.h>
+#include <qlabel.h>
+#include <qtimer.h>
+
+#if defined( Q_WS_QWS )
+#include <qwsdisplay_qws.h>
+#include <qgfx_qws.h>
+#endif
+
+#include <qwindowsystem_qws.h>
+
+#include <stdlib.h>
+#include <sys/types.h>
+#if defined(Q_OS_LINUX) || defined(_OS_LINUX_)
+#include <unistd.h>
+#endif
+
+
+struct {
+ bool enabled;
+ const char *app;
+ const char *start;
+ const char *stop;
+ const char *desc;
+}
+settingsTable [] =
+{
+ { FALSE, "language", "raise()", "accept()", // No tr
+ QT_TR_NOOP("Language") },
+#ifndef Q_OS_WIN32
+ { FALSE, "systemtime", "raise()", "accept()", // No tr
+ QT_TR_NOOP("Time and Date") },
+#endif
+ { FALSE, "addressbook", "editPersonalAndClose()", "accept()", // No tr
+ QT_TR_NOOP("Personal Information") },
+ { FALSE, 0, 0, 0, 0 }
+};
+
+
+FirstUse::FirstUse(QWidget* parent, const char * name, WFlags wf) :
+ QDialog( parent, name, TRUE, wf),
+ transApp(0), transLib(0), needCalibrate(FALSE), currApp(-1),
+ waitForExit(-1), waitingForLaunch(FALSE), needRestart(FALSE)
+{
+ ServerApplication::allowRestart = FALSE;
+ // we force our height beyound the maximum (which we set anyway)
+ QRect desk = qApp->desktop()->geometry();
+ setGeometry( 0, 0, desk.width(), desk.height() );
+
+ connect(qwsServer, SIGNAL(newChannel(const QString&)),
+ this, SLOT(newQcopChannel(const QString&)));
+
+ // Create a DocumentList so appLauncher has appLnkSet to search
+ docList = new DocumentList( 0, FALSE );
+ appLauncher = new AppLauncher( this );
+ connect( appLauncher, SIGNAL(terminated(int, const QString&)),
+ this, SLOT(terminated(int, const QString&)) );
+
+ // more hackery
+ // I will be run as either the main server or as part of the main server
+ QWSServer::setScreenSaverIntervals(0);
+ loadPixmaps();
+
+ //check if there is a language program
+#ifndef Q_OS_WIN32
+ QString exeSuffix;
+#else
+ QString exeSuffix(".exe");
+#endif
+
+ for ( int i = 0; settingsTable[i].app; i++ ) {
+ QString file = QPEApplication::qpeDir() + "bin/";
+ file += settingsTable[i].app;
+ file += exeSuffix;
+ if ( QFile::exists(file) )
+ settingsTable[i].enabled = TRUE;
+ }
+
+ setFocusPolicy(NoFocus);
+
+ taskBar = new QWidget(0, 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop | WGroupLeader);
+
+ inputMethods = new InputMethods(taskBar);
+ connect(inputMethods, SIGNAL(inputToggled(bool)),
+ this, SLOT(calcMaxWindowRect()));
+
+ back = new QPushButton(tr("<< Back"), taskBar);
+ back->setFocusPolicy(NoFocus);
+ connect(back, SIGNAL(clicked()), this, SLOT(previousDialog()) );
+
+ next = new QPushButton(tr("Next >>"), taskBar);
+ next->setFocusPolicy(NoFocus);
+ connect(next, SIGNAL(clicked()), this, SLOT(nextDialog()) );
+
+ // need to set the geom to lower corner
+ QSize sz = inputMethods->sizeHint();
+ int buttonWidth = (width() - sz.width()) / 2;
+ int x = 0;
+
+ controlHeight = back->sizeHint().height();
+
+ inputMethods->setGeometry(0,0, sz.width(), controlHeight );
+ x += sz.width();
+
+ back->setGeometry(x, 0, buttonWidth, controlHeight);
+ x += buttonWidth;
+ next->setGeometry(x, 0, buttonWidth, controlHeight);
+
+ taskBar->setGeometry( 0, height() - controlHeight, desk.width(), controlHeight);
+ taskBar->hide();
+
+#if defined(Q_WS_QWS) && !defined(QT_NO_COP)
+ qDebug("Setting up QCop to QPE/System");
+ QCopChannel* sysChannel = new QCopChannel( "QPE/System", this );
+ connect(sysChannel, SIGNAL(received(const QCString &, const QByteArray &)),
+ this, SLOT(message(const QCString &, const QByteArray &)) );
+#endif
+ calcMaxWindowRect();
+#if defined(QPE_NEED_CALIBRATION)
+ if ( !QFile::exists("/etc/pointercal") ) {
+ needCalibrate = TRUE;
+ grabMouse();
+ }
+#endif
+ Config config("locale");
+ config.setGroup( "Language");
+ lang = config.readEntry( "Language", "en");
+
+ defaultFont = font();
+
+ //###language/font hack; should look it up somewhere
+#ifdef Q_WS_QWS
+ if ( lang == "ja" || lang == "zh_CN" || lang == "zh_TW" || lang == "ko" ) {
+ QFont fn = FontManager::unicodeFont( FontManager::Proportional );
+ qApp->setFont( fn, TRUE );
+ }
+#endif
+}
+
+FirstUse::~FirstUse()
+{
+ delete appLauncher;
+ delete docList;
+ delete taskBar;
+ ServerApplication::allowRestart = TRUE;
+}
+
+void FirstUse::calcMaxWindowRect()
+{
+#ifdef Q_WS_QWS
+ QRect wr;
+ int displayWidth = qApp->desktop()->width();
+ QRect ir = inputMethods->inputRect();
+ if ( ir.isValid() ) {
+ wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 );
+ } else {
+ wr.setCoords( 0, 0, displayWidth-1,
+ qApp->desktop()->height() - controlHeight-1);
+ }
+
+#if QT_VERSION < 0x030000
+ QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,
+ QSize(qt_screen->width(),qt_screen->height()))
+ );
+#else
+ QWSServer::setMaxWindowRect( wr );
+#endif
+#endif
+}
+
+/* cancel current dialog, and bring up next */
+void FirstUse::nextDialog()
+{
+ int prevApp = currApp;
+ do {
+ currApp++;
+ qDebug( "currApp = %d", currApp );
+ if ( settingsTable[currApp].app == 0 ) {
+ if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) {
+ // The last application is still running.
+ // Tell it to stop, and when its done we'll come back
+ // to nextDialog and exit.
+ qDebug( "Waiting for %s to exit", settingsTable[prevApp].app );
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
+ settingsTable[prevApp].stop );
+ currApp = prevApp;
+ } else {
+ qDebug( "Done!" );
+ Config config( "qpe" );
+ config.setGroup( "Startup" );
+ config.writeEntry( "FirstUse", FALSE );
+ QPixmap pix = Resource::loadPixmap("bigwait");
+ QLabel *lblWait = new QLabel(0, "wait hack!", // No tr
+ QWidget::WStyle_Customize | QWidget::WDestructiveClose |
+ QWidget::WStyle_NoBorder | QWidget::WStyle_Tool |
+ QWidget::WStyle_StaysOnTop);
+ lblWait->setPixmap( pix );
+ lblWait->setAlignment( QWidget::AlignCenter );
+ lblWait->setGeometry( qApp->desktop()->geometry() );
+ lblWait->show();
+ qApp->processEvents();
+ QTimer::singleShot( 1000, lblWait, SLOT(close()) );
+ repaint();
+ close();
+ ServerApplication::allowRestart = TRUE;
+ }
+ return;
+ }
+ } while ( !settingsTable[currApp].enabled );
+
+ if ( prevApp >= 0 && appLauncher->isRunning(settingsTable[prevApp].app) ) {
+ qDebug( "Shutdown: %s", settingsTable[prevApp].app );
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
+ settingsTable[prevApp].stop );
+ waitForExit = prevApp;
+ } else {
+ qDebug( "Startup: %s", settingsTable[currApp].app );
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app,
+ settingsTable[currApp].start );
+ waitingForLaunch = TRUE;
+ }
+
+ updateButtons();
+}
+
+/* accept current dialog and bring up previous */
+void FirstUse::previousDialog()
+{
+ int prevApp = currApp;
+ do {
+ currApp--;
+ if ( currApp < 0 ) {
+ currApp = prevApp;
+ return;
+ }
+ } while ( !settingsTable[currApp].enabled );
+
+ if ( prevApp >= 0 ) {
+ qDebug( "Shutdown: %s", settingsTable[prevApp].app );
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[prevApp].app,
+ settingsTable[prevApp].stop );
+/*
+ if (settingsTable[prevApp].app == QString("systemtime"))
+ QCopEnvelope e("QPE/Application/citytime", "close()");
+*/
+ waitForExit = prevApp;
+ } else {
+ qDebug( "Startup: %s", settingsTable[currApp].app );
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app,
+ settingsTable[currApp].start );
+ waitingForLaunch = TRUE;
+ }
+
+ updateButtons();
+}
+
+void FirstUse::message(const QCString &msg, const QByteArray &data)
+{
+ QDataStream stream( data, IO_ReadOnly );
+ if ( msg == "timeChange(QString)" ) {
+ QString t;
+ stream >> t;
+ if ( t.isNull() )
+ unsetenv("TZ");
+ else
+ setenv( "TZ", t.latin1(), 1 );
+ }
+}
+
+void FirstUse::terminated( int, const QString &app )
+{
+ qDebug( "--- terminated: %s", app.latin1() );
+ if ( waitForExit != -1 && settingsTable[waitForExit].app == app ) {
+ qDebug( "Startup: %s", settingsTable[currApp].app );
+ if ( settingsTable[waitForExit].app == "language" ) { // No tr
+ Config config("locale");
+ config.setGroup( "Language");
+ QString l = config.readEntry( "Language", "en");
+ if ( l != lang ) {
+ reloadLanguages();
+ needRestart = TRUE;
+ lang = l;
+ }
+ }
+ QCopEnvelope e(QCString("QPE/Application/") + settingsTable[currApp].app,
+ settingsTable[currApp].start );
+ waitingForLaunch = TRUE;
+ updateButtons();
+ repaint();
+ waitForExit = -1;
+ } else if ( settingsTable[currApp].app == app ) {
+ nextDialog();
+ } else {
+ back->setEnabled(TRUE);
+ next->setEnabled(TRUE);
+ }
+}
+
+void FirstUse::newQcopChannel(const QString& channelName)
+{
+ qDebug("channel %s added", channelName.data() );
+ QString prefix("QPE/Application/");
+ if (channelName.startsWith(prefix)) {
+ QString appName = channelName.mid(prefix.length());
+ if ( currApp >= 0 && appName == settingsTable[currApp].app ) {
+ qDebug( "Application: %s started", settingsTable[currApp].app );
+ waitingForLaunch = FALSE;
+ updateButtons();
+ repaint();
+ } else if (appName != "quicklauncher") {
+ back->setEnabled(FALSE);
+ next->setEnabled(FALSE);
+ }
+ }
+}
+
+void FirstUse::reloadLanguages()
+{
+ // read language from config file. Waiting on QCop takes too long.
+ Config config("locale");
+ config.setGroup( "Language");
+ QString l = config.readEntry( "Language", "en");
+ QString cl = getenv("LANG");
+ qWarning("language message - " + l);
+ // setting anyway...
+ if (l.isNull() )
+ unsetenv( "LANG" );
+ else {
+ qWarning("and its not null");
+ setenv( "LANG", l.latin1(), 1 );
+ }
+#ifndef QT_NO_TRANSLATION
+ // clear old translators
+#ifndef _MSC_VER
+ //### revise to allow removal of translators under MSVC
+ if(qApp->translators) {
+ qApp->translators->setAutoDelete(TRUE);
+ delete (qApp->translators);
+ qApp->translators = 0;
+ }
+#endif
+
+ // load translation tables
+ transApp = new QTranslator(qApp);
+ QString tfn = QPEApplication::qpeDir() + "i18n/"+l+"/qpe.qm";
+ qWarning("loading " + tfn);
+ if ( transApp->load(tfn) ) {
+ qWarning("installing translator");
+ qApp->installTranslator( transApp );
+ } else {
+ delete transApp;
+ transApp = 0;
+ }
+
+ transLib = new QTranslator(qApp);
+ tfn = QPEApplication::qpeDir() + "i18n/"+l+"/libqpe.qm";
+ qWarning("loading " + tfn);
+ if ( transLib->load(tfn) ) {
+ qWarning("installing translator library");
+ qApp->installTranslator( transLib );
+ } else {
+ delete transLib;
+ transLib = 0;
+ }
+ loadPixmaps();
+ //###language/font hack; should look it up somewhere
+#ifdef Q_WS_QWS
+ if ( l == "ja" || l == "zh_CN" || l == "zh_TW" || l == "ko" ) {
+ QFont fn = FontManager::unicodeFont( FontManager::Proportional );
+ qApp->setFont( fn, TRUE );
+ } else {
+ qApp->setFont( defaultFont, TRUE );
+ }
+#endif
+#endif
+}
+
+void FirstUse::paintEvent( QPaintEvent * )
+{
+ QPainter p( this );
+
+ p.drawPixmap(0,0, splash);
+
+ QFont f = p.font();
+ f.setPointSize(15);
+ f.setItalic(FALSE);
+ f.setBold(FALSE);
+ p.setFont(f);
+
+ if ( currApp < 0 ) {
+ drawText(p, tr( "Tap anywhere on the screen to continue." ));
+ } else if ( settingsTable[currApp].app ) {
+ if ( waitingForLaunch )
+ drawText(p, tr("Please wait, loading %1 settings.").arg(tr(settingsTable[currApp].desc)) );
+ } else {
+ drawText(p, tr("Please wait..."));
+ }
+}
+
+void FirstUse::loadPixmaps()
+{
+ /* create background, tr so can change image with language.
+ images will likely contain text. */
+ splash.convertFromImage( Resource::loadImage(tr("FirstUseBackground"))
+ .smoothScale( width(), height() ) );
+
+ setBackgroundPixmap(splash);
+}
+
+void FirstUse::drawText(QPainter &p, const QString &text)
+{
+ QString altered = "<CENTER>" + text + "</CENTER>";
+
+ QSimpleRichText rt(altered, p.font());
+ rt.setWidth(width() - 20);
+
+ int h = (height() * 3) / 10; // start at 30%
+ if (rt.height() < height() / 2)
+ h += ((height() / 2) - rt.height()) / 2;
+ rt.draw(&p, 10, h, QRegion(0,0, width()-20, height()), palette());
+}
+
+void FirstUse::updateButtons()
+{
+ if ( currApp >= 0 ) {
+ taskBar->show();
+ }
+
+ int i = currApp-1;
+ while ( i >= 0 && !settingsTable[i].enabled )
+ i--;
+ back->setText(tr("<< Back"));
+ back->setEnabled( i >= 0 && !waitingForLaunch );
+
+ i = currApp+1;
+ while ( settingsTable[i].app && !settingsTable[i].enabled )
+ i++;
+ if ( !settingsTable[i].app )
+ next->setText(tr("Finish"));
+ else
+ next->setText(tr("Next >>"));
+ next->setEnabled( !waitingForLaunch );
+}
+
+void FirstUse::keyPressEvent( QKeyEvent *e )
+{
+ // Allow cancelling at first dialog, in case display is broken.
+ if ( e->key() == Key_Escape && currApp < 0 )
+ QDialog::keyPressEvent(e);
+}
+
+void FirstUse::mouseReleaseEvent( QMouseEvent * )
+{
+ if ( currApp < 0 ) {
+#if defined(QPE_NEED_CALIBRATION)
+ if ( needCalibrate ) {
+ releaseMouse();
+ Calibrate *cal = new Calibrate;
+ cal->exec();
+ delete cal;
+ }
+#endif
+ nextDialog();
+ }
+}
diff --git a/core/launcher/firstuse.h b/core/launcher/firstuse.h
new file mode 100644
index 0000000..44a95a8
--- a/dev/null
+++ b/core/launcher/firstuse.h
@@ -0,0 +1,84 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include <qdialog.h>
+#include <qpixmap.h>
+
+class InputMethods;
+class QCString;
+class QPushButton;
+class QTranslator;
+class AppLauncher;
+class DocumentList;
+
+class FirstUse : public QDialog
+{
+ Q_OBJECT
+public:
+ FirstUse(QWidget* parent=0, const char * name=0, WFlags=0);
+ ~FirstUse();
+
+ bool restartNeeded() const { return needRestart; }
+
+private slots:
+ void message(const QCString &, const QByteArray &);
+ void calcMaxWindowRect();
+
+ void nextDialog();
+ void previousDialog();
+ void terminated( int, const QString & );
+ void newQcopChannel(const QString & );
+
+private:
+ void paintEvent( QPaintEvent * );
+ void mouseReleaseEvent( QMouseEvent * );
+ void keyPressEvent( QKeyEvent *e );
+
+ void loadPixmaps();
+
+ void reloadLanguages();
+ void drawText(QPainter &p, const QString &text);
+ void updateButtons();
+
+private:
+ QPixmap splash;
+ QPixmap buttons;
+
+ InputMethods *inputMethods;
+ QPushButton *back;
+ QPushButton *next;
+ int controlHeight;
+
+ QString lang;
+ QTranslator *transApp;
+ QTranslator *transLib;
+
+ bool needCalibrate;
+ DocumentList *docList;
+ AppLauncher *appLauncher;
+ QWidget *taskBar;
+
+ int currApp;
+ int waitForExit;
+ bool waitingForLaunch;
+ bool needRestart;
+
+ QFont defaultFont;
+};
diff --git a/core/launcher/launchertab.cpp b/core/launcher/launchertab.cpp
new file mode 100644
index 0000000..10cfd5f
--- a/dev/null
+++ b/core/launcher/launchertab.cpp
@@ -0,0 +1,284 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "launchertab.h"
+#include <qapplication.h>
+#include <qstyle.h>
+#include <qpainter.h>
+#include <qbitmap.h>
+
+
+LauncherTabBar::LauncherTabBar( QWidget *parent, const char *name )
+ : QTabBar( parent, name )
+{
+ setFocusPolicy( NoFocus );
+ connect( this, SIGNAL( selected(int) ), this, SLOT( layoutTabs() ) );
+}
+
+LauncherTabBar::~LauncherTabBar()
+{
+}
+
+void LauncherTabBar::insertTab( LauncherTab *t, int index )
+{
+ if ( index < 0 )
+ items.append( t );
+ else
+ items.insert( (uint)index, t );
+ tabs.insert( t->type, t );
+ QTabBar::insertTab( t, index );
+}
+
+void LauncherTabBar::removeTab( QTab *tab )
+{
+ LauncherTab *t = (LauncherTab *)tab;
+ tabs.remove( t->type );
+ items.remove( t );
+ QTabBar::removeTab( t );
+}
+
+void LauncherTabBar::prevTab()
+{
+ int n = count();
+ int tab = currentTab();
+ if ( tab >= 0 )
+ setCurrentTab( (tab - 1 + n)%n );
+}
+
+void LauncherTabBar::nextTab()
+{
+ int n = count();
+ int tab = currentTab();
+ setCurrentTab( (tab + 1)%n );
+}
+
+void LauncherTabBar::showTab( const QString& id )
+{
+ setCurrentTab( tabs[id] );
+}
+
+void LauncherTabBar::layoutTabs()
+{
+ if ( !count() )
+ return;
+
+ int available = width()-1;
+
+ QFontMetrics fm = fontMetrics();
+ int hiddenTabWidth = -12;
+ LauncherTab *current = currentLauncherTab();
+ int hframe, vframe, overlap;
+ style().tabbarMetrics( this, hframe, vframe, overlap );
+ int x = 0;
+ QRect r;
+ LauncherTab *t;
+ QListIterator< LauncherTab > it( items );
+ int required = 0;
+ int eventabwidth = (width()-1)/count();
+ enum Mode { HideBackText, Pack, Even } mode=Even;
+ for (it.toFirst(); it.current(); ++it ) {
+ t = it.current();
+ if ( !t )
+ continue;
+ int iw = fm.width( t->text() ) + hframe - overlap;
+ if ( t != current ) {
+ available -= hiddenTabWidth + hframe - overlap;
+ if ( t->iconSet() != 0 )
+ available -= t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
+ }
+ if ( t->iconSet() != 0 )
+ iw += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
+ required += iw;
+ // As space gets tight, packed looks better than even. "10" must be at least 0.
+ if ( iw >= eventabwidth-10 )
+ mode = Pack;
+ }
+ if ( mode == Pack && required > width()-1 )
+ mode = HideBackText;
+ for ( it.toFirst(); it.current(); ++it ) {
+ t = it.current();
+ if ( !t )
+ continue;
+ if ( mode != HideBackText ) {
+ int w = fm.width( t->text() );
+ int ih = 0;
+ if ( t->iconSet() != 0 ) {
+ w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
+ ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
+ }
+ int h = QMAX( fm.height(), ih );
+ h = QMAX( h, QApplication::globalStrut().height() );
+
+ h += vframe;
+ w += hframe;
+
+ QRect totr(x, 0,
+ mode == Even ? eventabwidth : w * (width()-1)/required, h);
+ t->setRect(totr);
+ x += totr.width() - overlap;
+ r = r.unite(totr);
+ } else if ( t != current ) {
+ int w = hiddenTabWidth;
+ int ih = 0;
+ if ( t->iconSet() != 0 ) {
+ w += t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width();
+ ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
+ }
+ int h = QMAX( fm.height(), ih );
+ h = QMAX( h, QApplication::globalStrut().height() );
+
+ h += vframe;
+ w += hframe;
+
+ t->setRect( QRect(x, 0, w, h) );
+ x += t->rect().width() - overlap;
+ r = r.unite( t->rect() );
+ } else {
+ int ih = 0;
+ if ( t->iconSet() != 0 ) {
+ ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
+ }
+ int h = QMAX( fm.height(), ih );
+ h = QMAX( h, QApplication::globalStrut().height() );
+
+ h += vframe;
+
+ t->setRect( QRect(x, 0, available, h) );
+ x += t->rect().width() - overlap;
+ r = r.unite( t->rect() );
+ }
+ }
+
+ t = it.toLast();
+ if (t) {
+ QRect rr = t->rect();
+ rr.setRight(width()-1);
+ t->setRect( rr );
+ }
+
+ for (it.toFirst(); it.current(); ++it ) {
+ t = it.current();
+ QRect tr = t->rect();
+ tr.setHeight( r.height() );
+ t->setRect( tr );
+ }
+
+ update();
+}
+
+void LauncherTabBar::paint( QPainter * p, QTab * t, bool selected ) const
+{
+ LauncherTabBar *that = (LauncherTabBar *) this;
+ LauncherTab *ct = (LauncherTab *)t;
+ QPalette pal = palette();
+ bool setPal = FALSE;
+ if ( ct->bgColor.isValid() ) {
+ pal.setColor( QPalette::Active, QColorGroup::Background, ct->bgColor );
+ pal.setColor( QPalette::Active, QColorGroup::Button, ct->bgColor );
+ pal.setColor( QPalette::Inactive, QColorGroup::Background, ct->bgColor );
+ pal.setColor( QPalette::Inactive, QColorGroup::Button, ct->bgColor );
+ that->setUpdatesEnabled( FALSE );
+ that->setPalette( pal );
+ setPal = TRUE;
+ }
+#if QT_VERSION >= 0x030000
+ QStyle::SFlags flags = QStyle::Style_Default;
+ if ( selected )
+ flags |= QStyle::Style_Selected;
+ style().drawControl( QStyle::CE_TabBarTab, p, this, t->rect(),
+ colorGroup(), flags, QStyleOption(t) );
+#else
+ style().drawTab( p, this, t, selected );
+#endif
+
+ QRect r( t->rect() );
+ QFont f( font() );
+ if ( selected )
+ f.setBold( TRUE );
+ p->setFont( f );
+
+ if ( ct->fgColor.isValid() ) {
+ pal.setColor( QPalette::Active, QColorGroup::Foreground, ct->fgColor );
+ pal.setColor( QPalette::Inactive, QColorGroup::Foreground, ct->fgColor );
+ that->setUpdatesEnabled( FALSE );
+ that->setPalette( pal );
+ setPal = TRUE;
+ }
+ int iw = 0;
+ int ih = 0;
+ if ( t->iconSet() != 0 ) {
+ iw = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).width() + 2;
+ ih = t->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height();
+ }
+ int w = iw + p->fontMetrics().width( t->text() ) + 4;
+ int h = QMAX(p->fontMetrics().height() + 4, ih );
+ paintLabel( p, QRect( r.left() + (r.width()-w)/2 - 3,
+ r.top() + (r.height()-h)/2, w, h ), t,
+#if QT_VERSION >= 0x030000
+ t->identifier() == keyboardFocusTab()
+#else
+ t->identitifer() == keyboardFocusTab()
+#endif
+ );
+ if ( setPal ) {
+ that->unsetPalette();
+ that->setUpdatesEnabled( TRUE );
+ }
+}
+
+void LauncherTabBar::paintLabel( QPainter* p, const QRect&,
+ QTab* t, bool has_focus ) const
+{
+ QRect r = t->rect();
+ // if ( t->id != currentTab() )
+ //r.moveBy( 1, 1 );
+ //
+ if ( t->iconSet() ) {
+ // the tab has an iconset, draw it in the right mode
+ QIconSet::Mode mode = (t->isEnabled() && isEnabled()) ? QIconSet::Normal : QIconSet::Disabled;
+ if ( mode == QIconSet::Normal && has_focus )
+ mode = QIconSet::Active;
+ QPixmap pixmap = t->iconSet()->pixmap( QIconSet::Small, mode );
+ int pixw = pixmap.width();
+ int pixh = pixmap.height();
+ p->drawPixmap( r.left() + 6, r.center().y() - pixh / 2 + 1, pixmap );
+ r.setLeft( r.left() + pixw + 5 );
+ }
+
+ QRect tr = r;
+
+ if ( r.width() < 20 )
+ return;
+
+ if ( t->isEnabled() && isEnabled() ) {
+#if defined(_WS_WIN32_)
+ if ( colorGroup().brush( QColorGroup::Button ) == colorGroup().brush( QColorGroup::Background ) )
+ p->setPen( colorGroup().buttonText() );
+ else
+ p->setPen( colorGroup().foreground() );
+#else
+ p->setPen( colorGroup().foreground() );
+#endif
+ p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() );
+ } else {
+ p->setPen( palette().disabled().foreground() );
+ p->drawText( tr, AlignCenter | AlignVCenter | ShowPrefix, t->text() );
+ }
+}
+
diff --git a/core/launcher/launchertab.h b/core/launcher/launchertab.h
new file mode 100644
index 0000000..653919b
--- a/dev/null
+++ b/core/launcher/launchertab.h
@@ -0,0 +1,90 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef LAUNCHERTAB_H
+#define LAUNCHERTAB_H
+
+#include <qcolor.h>
+#include <qstring.h>
+#include <qwidget.h>
+#include <qrect.h>
+#include <qiconset.h>
+#include <qlist.h>
+#include <qdict.h>
+#include <qtabbar.h>
+
+class LauncherView;
+
+class LauncherTab : public QTab
+{
+public:
+ LauncherTab( const QString &idStr, LauncherView *viewPtr,
+ const QIconSet &iconSet,
+ const QString &textStr=QString::null )
+ : QTab( iconSet, textStr )
+ {
+ type = idStr;
+ view = viewPtr;
+ }
+
+ QString type;
+ LauncherView *view;
+ QColor bgColor;
+ QColor fgColor;
+};
+
+class LauncherTabBar : public QTabBar
+{
+ Q_OBJECT
+public:
+ LauncherTabBar( QWidget *parent=0, const char *name=0 );
+ ~LauncherTabBar();
+
+ void insertTab( LauncherTab *, int index = -1 );
+ void removeTab( QTab * );
+
+ LauncherView *currentView() {
+ return currentLauncherTab()->view;
+ }
+
+ LauncherTab *currentLauncherTab() {
+ return (LauncherTab*) tab( currentTab() );
+ }
+
+ LauncherTab *launcherTab( const QString &id ) const { return tabs[id]; }
+
+ void nextTab();
+ void prevTab();
+
+public slots:
+ void showTab(const QString&);
+
+protected slots:
+ virtual void layoutTabs();
+
+protected:
+ virtual void paint( QPainter *p, QTab *t, bool f ) const;
+ void paintLabel( QPainter* p, const QRect& br, QTab* t, bool has_focus ) const;
+
+private:
+ QList<LauncherTab> items;
+ QDict<LauncherTab> tabs;
+};
+
+#endif
diff --git a/core/launcher/qpe-de.ts b/core/launcher/qpe-de.ts
new file mode 100644
index 0000000..50b55c8
--- a/dev/null
+++ b/core/launcher/qpe-de.ts
@@ -0,0 +1,324 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time and Date</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Personal Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AppLauncher</name>
+ <message>
+ <source>&lt;qt&gt;&lt;p&gt;Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Application terminated</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Application not found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;Could not locate application &lt;b&gt;%1&lt;/b&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not find the application %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; was terminated due to signal code %2&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AppMonitor</name>
+ <message>
+ <source>Application Problem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;%1 is not responding.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Would you like to force the application to exit?&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CategoryTabWidget</name>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Icon View</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>List View</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Desktop</name>
+ <message>
+ <source>Memory Status</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Memory Low
+Please save data.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Critical Memory Shortage
+Please end this application
+immediately.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DesktopApplication</name>
+ <message>
+ <source>Battery is running very low.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Back-up battery is very low.
+Please charge the back-up battery.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;P&gt;A system startup error occurred, and the system is now in Safe Mode. Plugins are not loaded in Safe Mode. You can use the Plugin Manager to disable plugins that cause system error.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Battery level is critical!
+Please recharge the main battery!</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DesktopPowerAlerter</name>
+ <message>
+ <source>Battery Status</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FirstUse</name>
+ <message>
+ <source>&lt;&lt; Back</source>
+ <translation type="unfinished">&lt;&lt; Zurück</translation>
+ </message>
+ <message>
+ <source>Next &gt;&gt;</source>
+ <translation type="unfinished">Nächstes &gt;&gt;</translation>
+ </message>
+ <message>
+ <source>Tap anywhere on the screen to continue.</source>
+ <translation type="unfinished">Berühren Sie den Bildschirm, um fortzufahren</translation>
+ </message>
+ <message>
+ <source>Please wait, loading %1 settings.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Please wait...</source>
+ <translation type="unfinished">Bitte warten...</translation>
+ </message>
+ <message>
+ <source>FirstUseBackground</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Finish</source>
+ <translation type="unfinished">Fertig</translation>
+ </message>
+</context>
+<context>
+ <name>InputMethods</name>
+ <message>
+ <source>Unicode</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Launcher</name>
+ <message>
+ <source>Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> - Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;No application is defined for this document.&lt;p&gt;Type is %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>View as text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Finding documents...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>LauncherView</name>
+ <message>
+ <source>All types</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Document View</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SafeMode</name>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restart Qtopia</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Shutdown</name>
+ <message>
+ <source>Shut down...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Terminate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Terminate Server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reboot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restart Server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shutdown</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;
+These termination options are provided primarily for use while developing and testing the Qtopia system. In a normal environment, these concepts are unnecessary.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SyncAuthentication</name>
+ <message>
+ <source>Sync Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unauthorized system is requesting access to this device.&lt;p&gt;If you are using a version of Qtopia Desktop older than 1.5.1, please upgrade.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Deny</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unrecognized system is requesting access to this device.&lt;p&gt;If you have just initiated a Sync for the first time, this is normal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Allow</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SyncDialog</name>
+ <message>
+ <source>Abort</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Syncing:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TempScreenSaverMonitor</name>
+ <message>
+ <source>&lt;qt&gt;The running applications disabled the screen saver for more than the allowed time (%1).&lt;p&gt;The system was forced to suspend&lt;/p&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Forced suspend</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/core/launcher/qpe-en_GB.ts b/core/launcher/qpe-en_GB.ts
new file mode 100644
index 0000000..03d1db4
--- a/dev/null
+++ b/core/launcher/qpe-en_GB.ts
@@ -0,0 +1,324 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Time and Date</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Personal Information</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AppLauncher</name>
+ <message>
+ <source>&lt;qt&gt;&lt;p&gt;Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Application terminated</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Application not found</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;Could not locate application &lt;b&gt;%1&lt;/b&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Could not find the application %1</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; was terminated due to signal code %2&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>AppMonitor</name>
+ <message>
+ <source>Application Problem</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;%1 is not responding.&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Would you like to force the application to exit?&lt;/p&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>CategoryTabWidget</name>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Icon View</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>List View</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Desktop</name>
+ <message>
+ <source>Memory Status</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Memory Low
+Please save data.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Critical Memory Shortage
+Please end this application
+immediately.</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DesktopApplication</name>
+ <message>
+ <source>Battery is running very low.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>The Back-up battery is very low.
+Please charge the back-up battery.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;P&gt;A system startup error occurred, and the system is now in Safe Mode. Plugins are not loaded in Safe Mode. You can use the Plugin Manager to disable plugins that cause system error.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Battery level is critical!
+Please recharge the main battery!</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>DesktopPowerAlerter</name>
+ <message>
+ <source>Battery Status</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Low Battery</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>FirstUse</name>
+ <message>
+ <source>&lt;&lt; Back</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Next &gt;&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Tap anywhere on the screen to continue.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Please wait, loading %1 settings.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Please wait...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>FirstUseBackground</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Finish</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>InputMethods</name>
+ <message>
+ <source>Unicode</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Launcher</name>
+ <message>
+ <source>Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source> - Launcher</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>No application</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;No application is defined for this document.&lt;p&gt;Type is %1.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>View as text</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Finding documents...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>LauncherView</name>
+ <message>
+ <source>All types</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Document View</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SafeMode</name>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restart Qtopia</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Help...</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>Shutdown</name>
+ <message>
+ <source>Shut down...</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Terminate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Terminate Server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Reboot</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Restart Server</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Shutdown</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;
+These termination options are provided primarily for use while developing and testing the Qtopia system. In a normal environment, these concepts are unnecessary.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SyncAuthentication</name>
+ <message>
+ <source>Sync Connection</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unauthorized system is requesting access to this device.&lt;p&gt;If you are using a version of Qtopia Desktop older than 1.5.1, please upgrade.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Deny</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unrecognized system is requesting access to this device.&lt;p&gt;If you have just initiated a Sync for the first time, this is normal.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Allow</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>SyncDialog</name>
+ <message>
+ <source>Abort</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Syncing:</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
+ <name>TempScreenSaverMonitor</name>
+ <message>
+ <source>&lt;qt&gt;The running applications disabled the screen saver for more than the allowed time (%1).&lt;p&gt;The system was forced to suspend&lt;/p&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Forced suspend</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+</TS>
diff --git a/core/launcher/qpe-ja.ts b/core/launcher/qpe-ja.ts
new file mode 100644
index 0000000..9f39f75
--- a/dev/null
+++ b/core/launcher/qpe-ja.ts
@@ -0,0 +1,352 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>Language</source>
+ <translation>言語</translation>
+ </message>
+ <message>
+ <source>Time and Date</source>
+ <translation>時刻と日付</translation>
+ </message>
+ <message>
+ <source>Personal Information</source>
+ <translation>個人情報</translation>
+ </message>
+ <message>
+ <source>Security</source>
+ <translation type="obsolete">セキュリティ</translation>
+ </message>
+</context>
+<context>
+ <name>AppLauncher</name>
+ <message>
+ <source>&lt;qt&gt;&lt;p&gt;Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;&lt;p&gt;このアプリケーションは高速ロードが無効になっています。アプリケーションアイコンをしばらくタップしたままにして有効に設定し直します。&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Application terminated</source>
+ <translation>アプリケーションは終了しました</translation>
+ </message>
+ <message>
+ <source>Application not found</source>
+ <translation>アプリケーションが見つかりません</translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;Could not locate application &lt;b&gt;%1&lt;/b&gt;&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt;のアプリケーションを検出できませんでした&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation>エラー</translation>
+ </message>
+ <message>
+ <source>Could not find the application %1</source>
+ <translation>%1のアプリケーションが見つかりませんでした</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation>OK</translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; was terminated due to signal code %2&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;シグナルコード%2のため&lt;b&gt;%1&lt;/b&gt;は終了しました&lt;/qt&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AppMonitor</name>
+ <message>
+ <source>Application Problem</source>
+ <translation>アプリケーションに関する問題</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;%1 is not responding.&lt;/p&gt;</source>
+ <translation>&lt;p&gt;%1が応答していません。&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Would you like to force the application to exit?&lt;/p&gt;</source>
+ <translation>&lt;p&gt;アプリケーションを強制終了しますか?&lt;/p&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>CategoryTabWidget</name>
+ <message>
+ <source>Documents</source>
+ <translation>ドキュメント</translation>
+ </message>
+ <message>
+ <source>Icon View</source>
+ <translation>アイコン表示</translation>
+ </message>
+ <message>
+ <source>List View</source>
+ <translation>一覧表示</translation>
+ </message>
+</context>
+<context>
+ <name>Desktop</name>
+ <message>
+ <source>Memory Status</source>
+ <translation>メモリーの状態</translation>
+ </message>
+ <message>
+ <source>Memory Low
+Please save data.</source>
+ <translation>メモリ残量が低
+データを保存してください。</translation>
+ </message>
+ <message>
+ <source>Critical Memory Shortage
+Please end this application
+immediately.</source>
+ <translation>メモリ残量がありません
+直ちにこのアプリケーションを
+終了してください。</translation>
+ </message>
+</context>
+<context>
+ <name>DesktopApplication</name>
+ <message>
+ <source>Battery is running very low.</source>
+ <translation>バッテリーの残量が少なくなっています。</translation>
+ </message>
+ <message>
+ <source>Battery level is critical!
+Keep power off until power restored!</source>
+ <translation type="obsolete">バッテリー残量がありません!
+電力が回復するまで電源を切っておいてください!</translation>
+ </message>
+ <message>
+ <source>The Back-up battery is very low.
+Please charge the back-up battery.</source>
+ <translation>バックアップのバッテリー残量が少なくなっています。
+バックアップのバッテリーを充電してください。</translation>
+ </message>
+ <message>
+ <source>Safe Mode</source>
+ <translation>セーフモード</translation>
+ </message>
+ <message>
+ <source>&lt;P&gt;A system startup error occurred, and the system is now in Safe Mode. Plugins are not loaded in Safe Mode. You can use the Plugin Manager to disable plugins that cause system error.</source>
+ <translation>&lt;P&gt;システムスタートアップのエラーが発生したため、システムは現在セーフモードです。セーフモードではプラグインはロードされません。プラグインマネージャを使用してシステムエラーの要因となるブラグインを無効にすることができます。</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation>OK</translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation>プラグインマネージャ...</translation>
+ </message>
+ <message>
+ <source>Battery level is critical!
+Please recharge the main battery!</source>
+ <translation type="unfinished">バッテリー残量がありません!
+電力が回復するまで電源を切っておいてください!</translation>
+ </message>
+</context>
+<context>
+ <name>DesktopPowerAlerter</name>
+ <message>
+ <source>Battery Status</source>
+ <translation>バッテリーの状態</translation>
+ </message>
+ <message>
+ <source>Low Battery</source>
+ <translation>バッテリー残量が低</translation>
+ </message>
+</context>
+<context>
+ <name>FirstUse</name>
+ <message>
+ <source>&lt;&lt; Back</source>
+ <translation>&lt;&lt; 戻る</translation>
+ </message>
+ <message>
+ <source>Next &gt;&gt;</source>
+ <translation>進む &gt;&gt;</translation>
+ </message>
+ <message>
+ <source>Tap anywhere on the screen to continue.</source>
+ <translation>どこかスクリーンをタップして続ける</translation>
+ </message>
+ <message>
+ <source>Please wait, loading %1 settings.</source>
+ <translation>%1の設定をロード中、お待ちください。</translation>
+ </message>
+ <message>
+ <source>Please wait...</source>
+ <translation>お待ちください...</translation>
+ </message>
+ <message>
+ <source>FirstUseBackground</source>
+ <translation>初めて使う背景</translation>
+ </message>
+ <message>
+ <source>Finish</source>
+ <translation>完了</translation>
+ </message>
+</context>
+<context>
+ <name>InputMethods</name>
+ <message>
+ <source>Unicode</source>
+ <translation>ユニコード</translation>
+ </message>
+</context>
+<context>
+ <name>Launcher</name>
+ <message>
+ <source>Launcher</source>
+ <translation>ランチャー</translation>
+ </message>
+ <message>
+ <source> - Launcher</source>
+ <translation>- ランチャー</translation>
+ </message>
+ <message>
+ <source>No application</source>
+ <translation>アプリケーションがありません</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;No application is defined for this document.&lt;p&gt;Type is %1.</source>
+ <translation>&lt;p&gt;このドキュメント用にアプリケーションが決められていません。&lt;p&gt;タイプは%1です。</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation>OK</translation>
+ </message>
+ <message>
+ <source>View as text</source>
+ <translation>テキストとして表示</translation>
+ </message>
+ <message>
+ <source>Finding documents...</source>
+ <translation>ドキュメントの検索中...</translation>
+ </message>
+</context>
+<context>
+ <name>LauncherView</name>
+ <message>
+ <source>All types</source>
+ <translation>すべてのタイプ</translation>
+ </message>
+ <message>
+ <source>Document View</source>
+ <translation>ドキュメント表示</translation>
+ </message>
+</context>
+<context>
+ <name>SafeMode</name>
+ <message>
+ <source>Safe Mode</source>
+ <translation>セーフモード</translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation>プラグインマネージャ...</translation>
+ </message>
+ <message>
+ <source>Restart Qtopia</source>
+ <translation>Qtopiaを再スタート</translation>
+ </message>
+ <message>
+ <source>Help...</source>
+ <translation>ヘルプ...</translation>
+ </message>
+</context>
+<context>
+ <name>Shutdown</name>
+ <message>
+ <source>Shut down...</source>
+ <translation>シャットダウン...</translation>
+ </message>
+ <message>
+ <source>Terminate</source>
+ <translation>終了</translation>
+ </message>
+ <message>
+ <source>Terminate Server</source>
+ <translation>サーバーを終了</translation>
+ </message>
+ <message>
+ <source>Reboot</source>
+ <translation>再起動</translation>
+ </message>
+ <message>
+ <source>Restart Server</source>
+ <translation>サーバーの再スタート</translation>
+ </message>
+ <message>
+ <source>Shutdown</source>
+ <translation>シャットダウン</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;
+These termination options are provided primarily for use while developing and testing the Qtopia system. In a normal environment, these concepts are unnecessary.</source>
+ <translation>&lt;p&gt;
+これらの終了オプションは、主としてQtopiaシステムのテスト中及び開発中に使用するため提供されています。通常の環境では、これらのコンセプトは不要です。</translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation>取り消し</translation>
+ </message>
+</context>
+<context>
+ <name>SyncAuthentication</name>
+ <message>
+ <source>Sync Connection</source>
+ <translation>同期接続</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unauthorized system is requesting access to this device.&lt;p&gt;If you are using a version of Qtopia Desktop older than 1.5.1, please upgrade.</source>
+ <translation>&lt;p&gt;無許可のシステムがこのデバイスにアクセスを要請しています。&lt;p&gt;1.5.1より古いバージョンのQtopia Desktopをご使用の場合にはアップグレードを行なってください。</translation>
+ </message>
+ <message>
+ <source>Deny</source>
+ <translation>拒否</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unrecognized system is requesting access to this device.&lt;p&gt;If you have just initiated a Sync for the first time, this is normal.</source>
+ <translation>&lt;p&gt;未認可のシステムがこのデバイスにアクセスを要請しています。&lt;p&gt;はじめての同期を開始したばかりの場合には、これが標準です。</translation>
+ </message>
+ <message>
+ <source>Allow</source>
+ <translation>許可</translation>
+ </message>
+</context>
+<context>
+ <name>SyncDialog</name>
+ <message>
+ <source>Syncing</source>
+ <translation type="obsolete">同期中</translation>
+ </message>
+ <message>
+ <source>&lt;b&gt;Contacts&lt;/b&gt;</source>
+ <translation type="obsolete">&lt;b&gt;連絡先&lt;/b&gt;</translation>
+ </message>
+ <message>
+ <source>&amp;Cancel</source>
+ <translation type="obsolete">(&amp;C)取り消し</translation>
+ </message>
+ <message>
+ <source>Abort</source>
+ <translation>中断</translation>
+ </message>
+ <message>
+ <source>Syncing:</source>
+ <translation>同期中:</translation>
+ </message>
+</context>
+<context>
+ <name>TempScreenSaverMonitor</name>
+ <message>
+ <source>&lt;qt&gt;The running applications disabled the screen saver for more than the allowed time (%1).&lt;p&gt;The system was forced to suspend&lt;/p&gt;&lt;/qt&gt;</source>
+ <translation>&lt;qt&gt;実行中のアプリケーションが許可時間を越えてスクリーンセーバーを無効にしました(%1)。&lt;p&gt;システムは強制的に停止になりました。&lt;/p&gt;&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Forced suspend</source>
+ <translation>強制停止</translation>
+ </message>
+</context>
+</TS>
diff --git a/core/launcher/qpe-no.ts b/core/launcher/qpe-no.ts
new file mode 100644
index 0000000..d02ff7f
--- a/dev/null
+++ b/core/launcher/qpe-no.ts
@@ -0,0 +1,329 @@
+<!DOCTYPE TS><TS>
+<context>
+ <name>@default</name>
+ <message>
+ <source>Language</source>
+ <translation type="unfinished">Språk</translation>
+ </message>
+ <message>
+ <source>Time and Date</source>
+ <translation type="unfinished">Tid og dato</translation>
+ </message>
+ <message>
+ <source>Personal Information</source>
+ <translation type="unfinished">Personlig informasjon</translation>
+ </message>
+</context>
+<context>
+ <name>AppLauncher</name>
+ <message>
+ <source>&lt;qt&gt;&lt;p&gt;Fast loading has been disabled for this application. Tap and hold the application icon to reenable it.&lt;/qt&gt;</source>
+ <translation type="unfinished">&lt;qt&gt;&lt;p&gt;Rask innlasting har blitt deaktivert for denne applikasjone. Trykk og hold på applikasjonsikonet for å reaktivere den.&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Application terminated</source>
+ <translation type="unfinished">Applikasjonen avsluttet</translation>
+ </message>
+ <message>
+ <source>Application not found</source>
+ <translation type="unfinished">Applikasjonen ble ikke funnet</translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;Could not locate application &lt;b&gt;%1&lt;/b&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished">&lt;qt&gt;Kunne ikke lokalisere applikasjonen &lt;b&gt;%1&lt;/b&gt;&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Error</source>
+ <translation type="unfinished">Feil</translation>
+ </message>
+ <message>
+ <source>Could not find the application %1</source>
+ <translation type="unfinished">Kunne ikke finne applikasjonen %1</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished">OK</translation>
+ </message>
+ <message>
+ <source>&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt; was terminated due to signal code %2&lt;/qt&gt;</source>
+ <translation type="unfinished">&lt;qt&gt;&lt;b&gt;%1&lt;/b&gt;ble avsluttet grunnet signal kode %2&lt;/qt&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>AppMonitor</name>
+ <message>
+ <source>Application Problem</source>
+ <translation type="unfinished">Applikasjons problem</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;%1 is not responding.&lt;/p&gt;</source>
+ <translation type="unfinished">&lt;p&gt;%1 svarer ikke.&lt;/p&gt;</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;Would you like to force the application to exit?&lt;/p&gt;</source>
+ <translation type="unfinished">&lt;p&gt;Vil du tvinge applikasjonen til å avslutte?&lt;/p&gt;</translation>
+ </message>
+</context>
+<context>
+ <name>CategoryTabWidget</name>
+ <message>
+ <source>Documents</source>
+ <translation type="unfinished">Dokumenter</translation>
+ </message>
+ <message>
+ <source>Icon View</source>
+ <translation type="unfinished">Ikon visning</translation>
+ </message>
+ <message>
+ <source>List View</source>
+ <translation type="unfinished">Liste visning</translation>
+ </message>
+</context>
+<context>
+ <name>Desktop</name>
+ <message>
+ <source>Memory Status</source>
+ <translation type="unfinished">Minne status</translation>
+ </message>
+ <message>
+ <source>Memory Low
+Please save data.</source>
+ <translation type="unfinished">Lavt minne, vennligst lagre infomasjon.</translation>
+ </message>
+ <message>
+ <source>Critical Memory Shortage
+Please end this application
+immediately.</source>
+ <translation type="unfinished">Kritisk lavt minne
+Vennligst avslutt applikasjonen
+øyeblikkelig.</translation>
+ </message>
+</context>
+<context>
+ <name>DesktopApplication</name>
+ <message>
+ <source>Battery is running very low.</source>
+ <translation type="unfinished">Lite batteri igjen.</translation>
+ </message>
+ <message>
+ <source>The Back-up battery is very low.
+Please charge the back-up battery.</source>
+ <translation type="unfinished">Backup batteriet er meget lavt.
+Vennligst lad opp backup batteriet.</translation>
+ </message>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished">Sikkerhetsmodus</translation>
+ </message>
+ <message>
+ <source>&lt;P&gt;A system startup error occurred, and the system is now in Safe Mode. Plugins are not loaded in Safe Mode. You can use the Plugin Manager to disable plugins that cause system error.</source>
+ <translation type="unfinished">&lt;P&gt;Det oppstod en startoppfeil på systemet, og systemet kjører derfor i sikkerhetsmodus. Plugins er ikke lastet i sikkerhetsmodus. Du kan bruke Plugin Manager for å slå av de plugins som forårsaker system feilen.</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished">OK</translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished">Plugin Manager...</translation>
+ </message>
+ <message>
+ <source>Battery level is critical!
+Please recharge the main battery!</source>
+ <translation type="unfinished">Batteri nivå er kritisk lavt!
+Vennligst lad opp ditt hoved batteri!</translation>
+ </message>
+</context>
+<context>
+ <name>DesktopPowerAlerter</name>
+ <message>
+ <source>Battery Status</source>
+ <translation type="unfinished">Batteri status</translation>
+ </message>
+ <message>
+ <source>Low Battery</source>
+ <translation type="unfinished">Lavt batteri</translation>
+ </message>
+</context>
+<context>
+ <name>FirstUse</name>
+ <message>
+ <source>&lt;&lt; Back</source>
+ <translation type="unfinished">&lt;&lt; Tilbake</translation>
+ </message>
+ <message>
+ <source>Next &gt;&gt;</source>
+ <translation type="unfinished">Neste &gt;&gt;</translation>
+ </message>
+ <message>
+ <source>Tap anywhere on the screen to continue.</source>
+ <translation type="unfinished">Trykk hvor som helst på skjermen for å fortsette.</translation>
+ </message>
+ <message>
+ <source>Please wait, loading %1 settings.</source>
+ <translation type="unfinished">Vennligst vent, laster %1 innstillinger.</translation>
+ </message>
+ <message>
+ <source>Please wait...</source>
+ <translation type="unfinished">Vennligst vent...</translation>
+ </message>
+ <message>
+ <source>FirstUseBackground</source>
+ <translation type="unfinished">FirstUseBackground</translation>
+ </message>
+ <message>
+ <source>Finish</source>
+ <translation type="unfinished">Avslutt</translation>
+ </message>
+</context>
+<context>
+ <name>InputMethods</name>
+ <message>
+ <source>Unicode</source>
+ <translation type="unfinished">Unicode</translation>
+ </message>
+</context>
+<context>
+ <name>Launcher</name>
+ <message>
+ <source>Launcher</source>
+ <translation type="unfinished">Launcher</translation>
+ </message>
+ <message>
+ <source> - Launcher</source>
+ <translation type="unfinished">- Launcher</translation>
+ </message>
+ <message>
+ <source>No application</source>
+ <translation type="unfinished">Ingen applikasjoner</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;No application is defined for this document.&lt;p&gt;Type is %1.</source>
+ <translation type="unfinished">&lt;p&gt;Ingen applikasjoner er definert for dette dokumentet.&lt;p&gt;Type er %1.</translation>
+ </message>
+ <message>
+ <source>OK</source>
+ <translation type="unfinished">OK</translation>
+ </message>
+ <message>
+ <source>View as text</source>
+ <translation type="unfinished">Vis som tekst</translation>
+ </message>
+ <message>
+ <source>Finding documents...</source>
+ <translation type="unfinished">Finner dokumenter...</translation>
+ </message>
+</context>
+<context>
+ <name>LauncherView</name>
+ <message>
+ <source>All types</source>
+ <translation type="unfinished">Alle typer</translation>
+ </message>
+ <message>
+ <source>Document View</source>
+ <translation type="unfinished">Dokument visning</translation>
+ </message>
+</context>
+<context>
+ <name>SafeMode</name>
+ <message>
+ <source>Safe Mode</source>
+ <translation type="unfinished">Sikkerhetsmodus</translation>
+ </message>
+ <message>
+ <source>Plugin Manager...</source>
+ <translation type="unfinished">Plugin Manager...</translation>
+ </message>
+ <message>
+ <source>Restart Qtopia</source>
+ <translation type="unfinished">Restart Qtopia</translation>
+ </message>
+ <message>
+ <source>Help...</source>
+ <translation type="unfinished">Hjelp...</translation>
+ </message>
+</context>
+<context>
+ <name>Shutdown</name>
+ <message>
+ <source>Shut down...</source>
+ <translation type="unfinished">Steng av...</translation>
+ </message>
+ <message>
+ <source>Terminate</source>
+ <translation type="unfinished">Tvangsavslutt</translation>
+ </message>
+ <message>
+ <source>Terminate Server</source>
+ <translation type="unfinished">Tvangsavslutt tjener</translation>
+ </message>
+ <message>
+ <source>Reboot</source>
+ <translation type="unfinished">Omstart</translation>
+ </message>
+ <message>
+ <source>Restart Server</source>
+ <translation type="unfinished">Restart tjener</translation>
+ </message>
+ <message>
+ <source>Shutdown</source>
+ <translation type="unfinished">Steng av</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;
+These termination options are provided primarily for use while developing and testing the Qtopia system. In a normal environment, these concepts are unnecessary.</source>
+ <translation type="unfinished">&lt;p&gt;
+Disse avslutningsvalgene er i hovedsak tenkt for dem som utvikler og tester Qtopia systemet. Til normal bruk, er disse valgene unødvendige.</translation>
+ </message>
+ <message>
+ <source>Cancel</source>
+ <translation type="unfinished">Avbryt</translation>
+ </message>
+</context>
+<context>
+ <name>SyncAuthentication</name>
+ <message>
+ <source>Sync Connection</source>
+ <translation type="unfinished">Synkroniser forbindelse</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unauthorized system is requesting access to this device.&lt;p&gt;If you are using a version of Qtopia Desktop older than 1.5.1, please upgrade.</source>
+ <translation type="unfinished">&lt;p&gt;Et uautorisert system ber om tilgang til enheten.&lt;p&gt;Dersom du bruker en versjon av Qtopia Desktop eldre enn 1.5.1, vennligst oppgrader.</translation>
+ </message>
+ <message>
+ <source>Deny</source>
+ <translation type="unfinished">Nekt</translation>
+ </message>
+ <message>
+ <source>&lt;p&gt;An unrecognized system is requesting access to this device.&lt;p&gt;If you have just initiated a Sync for the first time, this is normal.</source>
+ <translation type="unfinished">Et uautorisert system ber om tilgang til denne enheten.&lt;p&gt;Dersom du nettopp har initiert en synkronisering for første gang, er dette normalt.</translation>
+ </message>
+ <message>
+ <source>Allow</source>
+ <translation type="unfinished">Tillatt</translation>
+ </message>
+</context>
+<context>
+ <name>SyncDialog</name>
+ <message>
+ <source>Abort</source>
+ <translation type="unfinished">Avbryt</translation>
+ </message>
+ <message>
+ <source>Syncing:</source>
+ <translation type="unfinished">Synkroniserer:</translation>
+ </message>
+</context>
+<context>
+ <name>TempScreenSaverMonitor</name>
+ <message>
+ <source>&lt;qt&gt;The running applications disabled the screen saver for more than the allowed time (%1).&lt;p&gt;The system was forced to suspend&lt;/p&gt;&lt;/qt&gt;</source>
+ <translation type="unfinished">&lt;qt&gt;De kjørende applikasjoner har slått av screensaveren for mer enn tillatt tid (%1).&lt;p&gt;Systemet var tvunget til hvilemodus&lt;/p&gt;&lt;/qt&gt;</translation>
+ </message>
+ <message>
+ <source>Forced suspend</source>
+ <translation type="unfinished">Tvunget hvilemodus</translation>
+ </message>
+</context>
+</TS>
diff --git a/core/launcher/server.cpp b/core/launcher/server.cpp
new file mode 100644
index 0000000..08baa8e
--- a/dev/null
+++ b/core/launcher/server.cpp
@@ -0,0 +1,657 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "server.h"
+#include "serverapp.h"
+#include "launcher.h"
+#include "startmenu.h"
+#include "transferserver.h"
+#include "qcopbridge.h"
+#include "irserver.h"
+#include "packageslave.h"
+#include "calibrate.h"
+#include "qrsync.h"
+#include "syncdialog.h"
+#include "launcher.h"
+#include "shutdownimpl.h"
+#include "applauncher.h"
+#include "suspendmonitor.h"
+#include "documentlist.h"
+
+#include <qtopia/applnk.h>
+#include <qtopia/categories.h>
+#include <qtopia/mimetype.h>
+#include <qtopia/config.h>
+#include <qtopia/services.h>
+#include <qtopia/devicebuttonmanager.h>
+#include <qtopia/pluginloader.h>
+#include <qtopia/resource.h>
+#include <qtopia/version.h>
+#include <qtopia/storage.h>
+
+#ifdef Q_WS_QWS
+#include <qtopia/qcopenvelope_qws.h>
+#include <qwindowsystem_qws.h>
+#include <qgfx_qws.h>
+#endif
+#include <qtopia/global.h>
+#include <qtopia/custom.h>
+
+#ifdef Q_OS_WIN32
+#include <io.h>
+#include <process.h>
+#else
+#include <unistd.h>
+#endif
+#include <qmainwindow.h>
+#include <qmessagebox.h>
+#include <qtimer.h>
+#include <qtextstream.h>
+
+#include <stdlib.h>
+
+extern QRect qt_maxWindowRect;
+
+static QWidget *calibrate(bool)
+{
+#ifdef Q_WS_QWS
+ Calibrate *c = new Calibrate;
+ c->show();
+ return c;
+#else
+ return 0;
+#endif
+}
+
+#define FACTORY(T) \
+ static QWidget *new##T( bool maximized ) { \
+ QWidget *w = new T( 0, 0, QWidget::WDestructiveClose | QWidget::WGroupLeader ); \
+ if ( maximized ) { \
+ if ( qApp->desktop()->width() <= 350 ) { \
+ w->showMaximized(); \
+ } else { \
+ w->resize( QSize( 300, 300 ) ); \
+ } \
+ } \
+ w->show(); \
+ return w; \
+ }
+
+
+#ifdef SINGLE_APP
+#define APP(a,b,c,d) FACTORY(b)
+#include "apps.h"
+#undef APP
+#endif // SINGLE_APP
+
+static Global::Command builtins[] = {
+
+#ifdef SINGLE_APP
+#define APP(a,b,c,d) { a, new##b, c, d },
+#include "apps.h"
+#undef APP
+#endif
+
+#if defined(QPE_NEED_CALIBRATION)
+ { "calibrate", calibrate, 1, 0 }, // No tr
+#endif
+#if !defined(QT_QWS_CASSIOPEIA)
+ { "shutdown", Global::shutdown, 1, 0 }, // No tr
+// { "run", run, 1, 0 }, // No tr
+#endif
+
+ { 0, calibrate, 0, 0 },
+};
+
+
+//---------------------------------------------------------------------------
+
+
+//===========================================================================
+
+Server::Server() :
+ QWidget( 0, 0, WStyle_Tool | WStyle_Customize ),
+ qcopBridge( 0 ),
+ transferServer( 0 ),
+ packageHandler( 0 ),
+ syncDialog( 0 )
+{
+ Global::setBuiltinCommands(builtins);
+
+ tid_xfer = 0;
+ tid_today = startTimer(3600*2*1000);
+ last_today_show = QDate::currentDate();
+
+ tsmMonitor = new TempScreenSaverMonitor();
+ connect( tsmMonitor, SIGNAL(forceSuspend()), qApp, SIGNAL(power()) );
+
+ serverGui = new Launcher;
+ serverGui->createGUI();
+
+ docList = new DocumentList( serverGui );
+ appLauncher = new AppLauncher(this);
+ connect(appLauncher, SIGNAL(launched(int, const QString &)), this, SLOT(applicationLaunched(int, const QString &)) );
+ connect(appLauncher, SIGNAL(terminated(int, const QString &)), this, SLOT(applicationTerminated(int, const QString &)) );
+ connect(appLauncher, SIGNAL(connected(const QString &)), this, SLOT(applicationConnected(const QString &)) );
+
+ storage = new StorageInfo( this );
+ connect( storage, SIGNAL(disksChanged()), this, SLOT(storageChanged()) );
+
+ // start services
+ startTransferServer();
+ (void) new IrServer( this );
+
+ packageHandler = new PackageHandler( this );
+ connect(qApp, SIGNAL(activate(const DeviceButton*,bool)),this,SLOT(activate(const DeviceButton*,bool)));
+
+ setGeometry( -10, -10, 9, 9 );
+
+ QCopChannel *channel = new QCopChannel("QPE/System", this);
+ connect(channel, SIGNAL(received(const QCString &, const QByteArray &)),
+ this, SLOT(systemMsg(const QCString &, const QByteArray &)) );
+
+ QCopChannel *tbChannel = new QCopChannel( "QPE/TaskBar", this );
+ connect( tbChannel, SIGNAL(received(const QCString&, const QByteArray&)),
+ this, SLOT(receiveTaskBar(const QCString&, const QByteArray&)) );
+
+ connect( qApp, SIGNAL(prepareForRestart()), this, SLOT(terminateServers()) );
+ connect( qApp, SIGNAL(timeChanged()), this, SLOT(pokeTimeMonitors()) );
+
+ preloadApps();
+}
+
+void Server::show()
+{
+ ServerApplication::login(TRUE);
+ QWidget::show();
+}
+
+Server::~Server()
+{
+ serverGui->destroyGUI();
+ delete docList;
+ delete qcopBridge;
+ delete transferServer;
+ delete serverGui;
+ delete tsmMonitor;
+}
+
+static bool hasVisibleWindow(const QString& clientname, bool partial)
+{
+#ifdef QWS
+ const QList<QWSWindow> &list = qwsServer->clientWindows();
+ QWSWindow* w;
+ for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) {
+ if ( w->client()->identity() == clientname ) {
+ if ( partial && !w->isFullyObscured() )
+ return TRUE;
+ if ( !partial && !w->isFullyObscured() && !w->isPartiallyObscured() ) {
+# if QT_VERSION < 0x030000
+ QRect mwr = qt_screen->mapToDevice(qt_maxWindowRect,
+ QSize(qt_screen->width(),qt_screen->height()) );
+# else
+ QRect mwr = qt_maxWindowRect;
+# endif
+ if ( mwr.contains(w->requested().boundingRect()) )
+ return TRUE;
+ }
+ }
+ }
+#endif
+ return FALSE;
+}
+
+void Server::activate(const DeviceButton* button, bool held)
+{
+ Global::terminateBuiltin("calibrate"); // No tr
+ ServiceRequest sr;
+ if ( held ) {
+ sr = button->heldAction();
+ } else {
+ sr = button->pressedAction();
+ }
+ // A button with no action defined, will return a null ServiceRequest. Don't attempt
+ // to send/do anything with this as it will crash
+ if ( !sr.isNull() ) {
+ QString app = sr.app();
+ bool vis = hasVisibleWindow(app, app != "qpe");
+ if ( sr.message() == "raise()" && vis ) {
+ sr.setMessage("nextView()");
+ } else {
+ // "back door"
+ sr << (int)vis;
+ }
+
+ sr.send();
+ }
+}
+
+
+#ifdef Q_WS_QWS
+
+
+typedef struct KeyOverride {
+ ushort scan_code;
+ QWSServer::KeyMap map;
+};
+
+
+static const KeyOverride jp109keys[] = {
+ { 0x03, { Qt::Key_2, '2' , 0x22 , 0xffff } },
+ { 0x07, { Qt::Key_6, '6' , '&' , 0xffff } },
+ { 0x08, { Qt::Key_7, '7' , '\'' , 0xffff } },
+ { 0x09, { Qt::Key_8, '8' , '(' , 0xffff } },
+ { 0x0a, { Qt::Key_9, '9' , ')' , 0xffff } },
+ { 0x0b, { Qt::Key_0, '0' , 0xffff , 0xffff } },
+ { 0x0c, { Qt::Key_Minus, '-' , '=' , 0xffff } },
+ { 0x0d, { Qt::Key_AsciiCircum,'^' , '~' , '^' - 64 } },
+ { 0x1a, { Qt::Key_At, '@' , '`' , 0xffff } },
+ { 0x1b, { Qt::Key_BraceLeft, '[' , '{' , '[' - 64 } },
+ { 0x27, { Qt::Key_Semicolon, ';' , '+' , 0xffff } },
+ { 0x28, { Qt::Key_Colon, ':' , '*' , 0xffff } },
+ { 0x29, { Qt::Key_Zenkaku_Hankaku, 0xffff , 0xffff , 0xffff } },
+ { 0x2b, { Qt::Key_BraceRight, ']' , '}' , ']'-64 } },
+ { 0x70, { Qt::Key_Hiragana_Katakana, 0xffff , 0xffff , 0xffff } },
+ { 0x73, { Qt::Key_Backslash, '\\' , '_' , 0xffff } },
+ { 0x79, { Qt::Key_Henkan, 0xffff , 0xffff , 0xffff } },
+ { 0x7b, { Qt::Key_Muhenkan, 0xffff , 0xffff , 0xffff } },
+ { 0x7d, { Qt::Key_yen, 0x00a5 , '|' , 0xffff } },
+ { 0x00, { 0, 0xffff , 0xffff , 0xffff } }
+};
+
+bool Server::setKeyboardLayout( const QString &kb )
+{
+ //quick demo version that can be extended
+
+ QIntDict<QWSServer::KeyMap> *om = 0;
+ if ( kb == "us101" ) { // No tr
+ om = 0;
+ } else if ( kb == "jp109" ) {
+ om = new QIntDict<QWSServer::KeyMap>(37);
+ const KeyOverride *k = jp109keys;
+ while ( k->scan_code ) {
+ om->insert( k->scan_code, &k->map );
+ k++;
+ }
+ }
+ QWSServer::setOverrideKeys( om );
+
+ return TRUE;
+}
+
+#endif
+
+void Server::systemMsg(const QCString &msg, const QByteArray &data)
+{
+ QDataStream stream( data, IO_ReadOnly );
+
+ if ( msg == "securityChanged()" ) {
+ if ( transferServer )
+ transferServer->authorizeConnections();
+ if ( qcopBridge )
+ qcopBridge->authorizeConnections();
+ } else if ( msg == "setTempScreenSaverMode(int,int)" ) {
+ int mode, pid;
+ stream >> mode >> pid;
+ tsmMonitor->setTempMode(mode, pid);
+ } else if ( msg == "linkChanged(QString)" ) {
+ QString link;
+ stream >> link;
+ qDebug( "desktop.cpp systemMsg -> linkchanged( %s )", link.latin1() );
+ docList->linkChanged(link);
+ } else if ( msg == "serviceChanged(QString)" ) {
+ MimeType::updateApplications();
+ } else if ( msg == "mkdir(QString)" ) {
+ QString dir;
+ stream >> dir;
+ if ( !dir.isEmpty() )
+ mkdir( dir );
+ } else if ( msg == "rdiffGenSig(QString,QString)" ) {
+ QString baseFile, sigFile;
+ stream >> baseFile >> sigFile;
+ QRsync::generateSignature( baseFile, sigFile );
+ } else if ( msg == "rdiffGenDiff(QString,QString,QString)" ) {
+ QString baseFile, sigFile, deltaFile;
+ stream >> baseFile >> sigFile >> deltaFile;
+ QRsync::generateDiff( baseFile, sigFile, deltaFile );
+ } else if ( msg == "rdiffApplyPatch(QString,QString)" ) {
+ QString baseFile, deltaFile;
+ stream >> baseFile >> deltaFile;
+ if ( !QFile::exists( baseFile ) ) {
+ QFile f( baseFile );
+ f.open( IO_WriteOnly );
+ f.close();
+ }
+ QRsync::applyDiff( baseFile, deltaFile );
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "patchApplied(QString)" );
+ e << baseFile;
+#endif
+ } else if ( msg == "rdiffCleanup()" ) {
+ mkdir( "/tmp/rdiff" );
+ QDir dir;
+ dir.setPath( "/tmp/rdiff" );
+ QStringList entries = dir.entryList();
+ for ( QStringList::Iterator it = entries.begin(); it != entries.end(); ++it )
+ dir.remove( *it );
+ } else if ( msg == "sendHandshakeInfo()" ) {
+ QString home = getenv( "HOME" );
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "handshakeInfo(QString,bool)" );
+ e << home;
+ int locked = (int) ServerApplication::screenLocked();
+ e << locked;
+#endif
+
+ } else if ( msg == "sendVersionInfo()" ) {
+ QCopEnvelope e( "QPE/Desktop", "versionInfo(QString,QString)" );
+ QString v = QPE_VERSION;
+ e << Global::version() << Global::architecture();
+ } else if ( msg == "sendCardInfo()" ) {
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "cardInfo(QString)" );
+#endif
+ storage->update();
+ const QList<FileSystem> &fs = storage->fileSystems();
+ QListIterator<FileSystem> it ( fs );
+ QString s;
+ QString homeDir = getenv("HOME");
+ QString homeFs, homeFsPath;
+ for ( ; it.current(); ++it ) {
+ int k4 = (*it)->blockSize()/256;
+ if ( (*it)->isRemovable() ) {
+ s += (*it)->name() + "=" + (*it)->path() + "/Documents " // No tr
+ + QString::number( (*it)->availBlocks() * k4/4 )
+ + "K " + (*it)->options() + ";";
+ } else if ( homeDir.contains( (*it)->path() ) &&
+ (*it)->path().length() > homeFsPath.length() ) {
+ homeFsPath = (*it)->path();
+ homeFs =
+ (*it)->name() + "=" + homeDir + "/Documents " // No tr
+ + QString::number( (*it)->availBlocks() * k4/4 )
+ + "K " + (*it)->options() + ";";
+ }
+ }
+ if ( !homeFs.isEmpty() )
+ s += homeFs;
+
+#ifndef QT_NO_COP
+ e << s;
+#endif
+ } else if ( msg == "sendSyncDate(QString)" ) {
+ QString app;
+ stream >> app;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "syncDate(QString,QString)" );
+ e << app << cfg.readEntry( app );
+#endif
+ //qDebug("QPE/System sendSyncDate for %s: response %s", app.latin1(),
+ //cfg.readEntry( app ).latin1() );
+ } else if ( msg == "setSyncDate(QString,QString)" ) {
+ QString app, date;
+ stream >> app >> date;
+ Config cfg( "qpe" );
+ cfg.setGroup("SyncDate");
+ cfg.writeEntry( app, date );
+ //qDebug("setSyncDate(QString,QString) %s %s", app.latin1(), date.latin1());
+ } else if ( msg == "startSync(QString)" ) {
+ QString what;
+ stream >> what;
+ delete syncDialog;
+ syncDialog = new SyncDialog( this, what );
+ syncDialog->show();
+ connect( syncDialog, SIGNAL(cancel()), SLOT(cancelSync()) );
+ } else if ( msg == "stopSync()") {
+ delete syncDialog;
+ syncDialog = 0;
+ } else if (msg == "restoreDone(QString)") {
+ docList->restoreDone();
+ } else if ( msg == "getAllDocLinks()" ) {
+ docList->sendAllDocLinks();
+ }
+#ifdef Q_WS_QWS
+ else if ( msg == "setMouseProto(QString)" ) {
+ QString mice;
+ stream >> mice;
+ setenv("QWS_MOUSE_PROTO",mice.latin1(),1);
+ qwsServer->openMouse();
+ } else if ( msg == "setKeyboard(QString)" ) {
+ QString kb;
+ stream >> kb;
+ setenv("QWS_KEYBOARD",kb.latin1(),1);
+ qwsServer->openKeyboard();
+
+ } else if ( msg == "setKeyboardAutoRepeat(int,int)" ) {
+ int delay, period;
+ stream >> delay >> period;
+ qwsSetKeyboardAutoRepeat( delay, period );
+ Config cfg( "qpe" );
+ cfg.setGroup("Keyboard");
+ cfg.writeEntry( "RepeatDelay", delay );
+ cfg.writeEntry( "RepeatPeriod", period );
+ } else if ( msg == "setKeyboardLayout(QString)" ) {
+ QString kb;
+ stream >> kb;
+ setKeyboardLayout( kb );
+ Config cfg( "qpe" );
+ cfg.setGroup("Keyboard");
+ cfg.writeEntry( "Layout", kb );
+ }
+#endif
+}
+
+void Server::receiveTaskBar(const QCString &msg, const QByteArray &data)
+{
+ QDataStream stream( data, IO_ReadOnly );
+
+ if ( msg == "reloadApps()" ) {
+ docList->reloadAppLnks();
+ } else if ( msg == "soundAlarm()" ) {
+ soundAlarm();
+ }
+#ifdef CUSTOM_LEDS
+ else if ( msg == "setLed(int,bool)" ) {
+ int led, status;
+ stream >> led >> status;
+ CUSTOM_LEDS( led, status );
+ }
+#endif
+}
+
+void Server::cancelSync()
+{
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "cancelSync()" );
+#endif
+ delete syncDialog;
+ syncDialog = 0;
+}
+
+bool Server::mkdir(const QString &localPath)
+{
+ QDir fullDir(localPath);
+ if (fullDir.exists())
+ return true;
+
+ // at this point the directory doesn't exist
+ // go through the directory tree and start creating the direcotories
+ // that don't exist; if we can't create the directories, return false
+
+ QString dirSeps = "/";
+ int dirIndex = localPath.find(dirSeps);
+ QString checkedPath;
+
+ // didn't find any seps; weird, use the cur dir instead
+ if (dirIndex == -1) {
+ //qDebug("No seperators found in path %s", localPath.latin1());
+ checkedPath = QDir::currentDirPath();
+ }
+
+ while (checkedPath != localPath) {
+ // no more seperators found, use the local path
+ if (dirIndex == -1)
+ checkedPath = localPath;
+ else {
+ // the next directory to check
+ checkedPath = localPath.left(dirIndex) + "/";
+ // advance the iterator; the next dir seperator
+ dirIndex = localPath.find(dirSeps, dirIndex+1);
+ }
+
+ QDir checkDir(checkedPath);
+ if (!checkDir.exists()) {
+ //qDebug("mkdir making dir %s", checkedPath.latin1());
+
+ if (!checkDir.mkdir(checkedPath)) {
+ qDebug("Unable to make directory %s", checkedPath.latin1());
+ return FALSE;
+ }
+ }
+
+ }
+ return TRUE;
+}
+
+void Server::styleChange( QStyle &s )
+{
+ QWidget::styleChange( s );
+}
+
+void Server::startTransferServer()
+{
+ if ( !qcopBridge ) {
+ // start qcop bridge server
+ qcopBridge = new QCopBridge( 4243 );
+ if ( qcopBridge->ok() ) {
+ // ... OK
+ connect( qcopBridge, SIGNAL(connectionClosed(const QHostAddress &)),
+ this, SLOT(syncConnectionClosed(const QHostAddress &)) );
+ } else {
+ delete qcopBridge;
+ qcopBridge = 0;
+ }
+ }
+ if ( !transferServer ) {
+ // start transfer server
+ transferServer = new TransferServer( 4242 );
+ if ( transferServer->ok() ) {
+ // ... OK
+ } else {
+ delete transferServer;
+ transferServer = 0;
+ }
+ }
+ if ( !transferServer || !qcopBridge )
+ tid_xfer = startTimer( 2000 );
+}
+
+void Server::timerEvent( QTimerEvent *e )
+{
+ if ( e->timerId() == tid_xfer ) {
+ killTimer( tid_xfer );
+ tid_xfer = 0;
+ startTransferServer();
+ } else if ( e->timerId() == tid_today ) {
+ QDate today = QDate::currentDate();
+ if ( today != last_today_show ) {
+ last_today_show = today;
+ Config cfg("today");
+ cfg.setGroup("Start");
+#ifndef QPE_DEFAULT_TODAY_MODE
+#define QPE_DEFAULT_TODAY_MODE "Never"
+#endif
+ if ( cfg.readEntry("Mode",QPE_DEFAULT_TODAY_MODE) == "Daily" ) {
+ QCopEnvelope env(Service::channel("today"),"raise()");
+ }
+ }
+ }
+}
+
+void Server::terminateServers()
+{
+ delete transferServer;
+ delete qcopBridge;
+ transferServer = 0;
+ qcopBridge = 0;
+}
+
+void Server::syncConnectionClosed( const QHostAddress & )
+{
+ qDebug( "Lost sync connection" );
+ delete syncDialog;
+ syncDialog = 0;
+}
+
+void Server::pokeTimeMonitors()
+{
+ // inform all TimeMonitors
+ QStrList tms = Service::channels("TimeMonitor");
+ for (const char* ch = tms.first(); ch; ch=tms.next()) {
+ QString t = getenv("TZ");
+ QCopEnvelope e(ch, "timeChange(QString)");
+ e << t;
+ }
+}
+
+void Server::applicationLaunched(int, const QString &app)
+{
+ serverGui->applicationStateChanged( app, ServerInterface::Launching );
+}
+
+void Server::applicationTerminated(int pid, const QString &app)
+{
+ serverGui->applicationStateChanged( app, ServerInterface::Terminated );
+ tsmMonitor->applicationTerminated( pid );
+}
+
+void Server::applicationConnected(const QString &app)
+{
+ serverGui->applicationStateChanged( app, ServerInterface::Running );
+}
+
+void Server::storageChanged()
+{
+ system( "qtopia-update-symlinks" );
+ serverGui->storageChanged( storage->fileSystems() );
+ docList->storageChanged();
+}
+
+
+void Server::soundAlarm()
+{
+#ifdef CUSTOM_SOUND_ALARM
+ CUSTOM_SOUND_ALARM;
+#endif
+}
+
+void Server::preloadApps()
+{
+ Config cfg("Launcher");
+ cfg.setGroup("Preload");
+ QStringList apps = cfg.readListEntry("Apps",',');
+ for (QStringList::ConstIterator it=apps.begin(); it!=apps.end(); ++it) {
+#ifndef QT_NO_COP
+ QCopEnvelope e("QPE/Application/"+(*it).local8Bit(), "enablePreload()");
+#endif
+ }
+}
+
diff --git a/core/launcher/server.h b/core/launcher/server.h
new file mode 100644
index 0000000..21b03af
--- a/dev/null
+++ b/core/launcher/server.h
@@ -0,0 +1,94 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef DESKTOP_H
+#define DESKTOP_H
+
+#include <qwidget.h>
+#include <qdatetime.h>
+
+//#include "qcopbridge.h"
+
+class QCopBridge;
+class QHostAddress;
+class TransferServer;
+class PackageHandler;
+class DeviceButton;
+class ServiceRequest;
+class TempScreenSaverMonitor;
+class AppLauncher;
+class AppLnkSet;
+class StorageInfo;
+class SyncDialog;
+class DocumentList;
+class ServerInterface;
+
+class Server : public QWidget {
+ Q_OBJECT
+public:
+ Server();
+ ~Server();
+
+ static bool mkdir(const QString &path);
+
+ void show();
+
+ static void soundAlarm();
+ static bool setKeyboardLayout( const QString &kb );
+
+public slots:
+ void systemMsg(const QCString &, const QByteArray &);
+ void receiveTaskBar(const QCString &msg, const QByteArray &data);
+ void terminateServers();
+ void pokeTimeMonitors();
+
+private slots:
+ void activate(const DeviceButton*,bool);
+ void syncConnectionClosed( const QHostAddress & );
+ void applicationLaunched(int pid, const QString &app);
+ void applicationTerminated(int pid, const QString &app);
+ void applicationConnected(const QString &app);
+ void storageChanged();
+ void cancelSync();
+
+protected:
+ void styleChange( QStyle & );
+ void timerEvent( QTimerEvent *e );
+
+private:
+ void startTransferServer();
+ void preloadApps();
+
+ QCopBridge *qcopBridge;
+ TransferServer *transferServer;
+ PackageHandler *packageHandler;
+ QDate last_today_show;
+ int tid_xfer;
+ int tid_today;
+ TempScreenSaverMonitor *tsmMonitor;
+ StorageInfo *storage;
+ SyncDialog *syncDialog;
+ AppLauncher *appLauncher;
+ DocumentList *docList;
+ ServerInterface *serverGui;
+};
+
+
+#endif // DESKTOP_H
+
diff --git a/core/launcher/server.pro b/core/launcher/server.pro
new file mode 100644
index 0000000..0fc6dae
--- a/dev/null
+++ b/core/launcher/server.pro
@@ -0,0 +1,118 @@
+TEMPLATE = app
+
+CONFIG += qtopia warn_on release
+win32:DEFINES += QTOPIA_DLL
+
+DESTDIR = $(QPEDIR)/bin
+
+HEADERS += server.h \
+ serverinterface.h \
+ launchertab.h \
+ documentlist.h \
+ suspendmonitor.h \
+ appicons.h \
+ taskbar.h \
+ runningappbar.h \
+ applauncher.h \
+ stabmon.h \
+ inputmethods.h \
+ systray.h \
+ wait.h \
+ shutdownimpl.h \
+ launcher.h \
+ launcherview.h \
+ $(QPEDIR)/src/settings/calibrate/calibrate.h \
+ startmenu.h \
+ transferserver.h \
+ qcopbridge.h \
+ packageslave.h \
+ irserver.h \
+ firstuse.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/protocol.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/types.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/whole.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/config_rsync.h \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.h \
+ syncdialog.h \
+ serverapp.h
+
+SOURCES += server.cpp \
+ serverinterface.cpp \
+ launchertab.cpp \
+ documentlist.cpp \
+ suspendmonitor.cpp \
+ appicons.cpp \
+ taskbar.cpp \
+ runningappbar.cpp \
+ applauncher.cpp \
+ stabmon.cpp \
+ inputmethods.cpp \
+ systray.cpp \
+ wait.cpp \
+ shutdownimpl.cpp \
+ launcher.cpp \
+ launcherview.cpp \
+ $(QPEDIR)/src/settings/calibrate/calibrate.cpp \
+ transferserver.cpp \
+ packageslave.cpp \
+ irserver.cpp \
+ qcopbridge.cpp \
+ startmenu.cpp \
+ main.cpp \
+ firstuse.cpp \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/base64.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/buf.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/checksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/command.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/delta.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/emit.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/hex.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/job.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/mdfour.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/mksum.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/msg.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/netint.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/patch.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/prototab.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/readsums.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/scoop.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/search.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stats.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/stream.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/sumset.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/trace.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/tube.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/util.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/version.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/whole.c \
+ $(QPEDIR)/src/3rdparty/libraries/rsync/qrsync.cpp \
+ syncdialog.cpp \
+ serverapp.cpp
+
+INTERFACES += shutdown.ui
+
+INCLUDEPATH += $(QPEDIR)/src/settings/calibrate
+DEPENDPATH += $(QPEDIR)/src/settings/calibrate
+
+INCLUDEPATH += $(QPEDIR)/src/3rdparty/libraries/rsync
+DEPENDPATH += $(QPEDIR)/src/3rdparty/libraries/rsync
+
+TARGET = qpe
+
+unix:LIBS += -lcrypt -luuid
+win32:LIBS +=
+
+TRANSLATIONS = qpe-en_GB.ts qpe-de.ts qpe-ja.ts qpe-no.ts
diff --git a/core/launcher/serverapp.cpp b/core/launcher/serverapp.cpp
new file mode 100644
index 0000000..6edaa21
--- a/dev/null
+++ b/core/launcher/serverapp.cpp
@@ -0,0 +1,617 @@
+/**********************************************************************
+** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "serverapp.h"
+
+#include <qtopia/password.h>
+#include <qtopia/config.h>
+#include <qtopia/power.h>
+#include <qtopia/devicebuttonmanager.h>
+#include <qtopia/pluginloader.h>
+
+#ifdef Q_WS_QWS
+#include <qtopia/qcopenvelope_qws.h>
+#endif
+#include <qtopia/global.h>
+#include <qtopia/custom.h>
+
+#ifdef Q_WS_QWS
+#include <qgfx_qws.h>
+#endif
+#ifdef Q_OS_WIN32
+#include <io.h>
+#include <process.h>
+#else
+#include <unistd.h>
+#endif
+#include <qmessagebox.h>
+#include <qtimer.h>
+#include <qpainter.h>
+#include <qfile.h>
+#include <qpixmapcache.h>
+
+#include <stdlib.h>
+
+static ServerApplication *serverApp = 0;
+static int loggedin=0;
+
+
+
+/* Apply light/power settings for current power source */
+static void applyLightSettings(PowerStatus *p)
+{
+ int initbright, intervalDim, intervalLightOff, intervalSuspend;
+ bool dim, lightoff, suspend;
+
+ {
+ Config config("qpe");
+ bool defsus;
+ if ( p->acStatus() == PowerStatus::Online ) {
+ config.setGroup("ExternalPower");
+ defsus = FALSE;
+ } else {
+ config.setGroup("BatteryPower");
+ defsus = TRUE;
+ }
+
+ intervalDim = config.readNumEntry( "Interval_Dim", 20 );
+ intervalLightOff = config.readNumEntry("Interval_LightOff", 30);
+ intervalSuspend = config.readNumEntry("Interval", 240);
+ initbright = config.readNumEntry("Brightness", 255);
+ dim = config.readBoolEntry("Dim", TRUE);
+ lightoff = config.readBoolEntry("LightOff", FALSE );
+ suspend = config.readBoolEntry("Suspend", defsus );
+
+ /* For compability */
+ config.setGroup("Screensaver");
+ config.writeEntry( "Dim", dim );
+ config.writeEntry( "LightOff", lightoff );
+ config.writeEntry( "Suspend", suspend );
+ config.writeEntry( "Interval_Dim", intervalDim );
+ config.writeEntry( "Interval_LightOff", intervalLightOff );
+ config.writeEntry( "Interval", intervalSuspend );
+ config.writeEntry( "Brightness", initbright );
+ }
+
+ int i_dim = (dim ? intervalDim : 0);
+ int i_lightoff = (lightoff ? intervalLightOff : 0);
+ int i_suspend = (suspend ? intervalSuspend : 0);
+
+#ifndef QT_NO_COP
+ QCopEnvelope eB("QPE/System", "setBacklight(int)" );
+ eB << initbright;
+
+ QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" );
+ e << i_dim << i_lightoff << i_suspend;
+#endif
+}
+
+//---------------------------------------------------------------------------
+
+/*
+ Priority is number of alerts that are needed to pop up
+ alert.
+ */
+class DesktopPowerAlerter : public QMessageBox
+{
+ Q_OBJECT
+public:
+ DesktopPowerAlerter( QWidget *parent, const char *name = 0 )
+ : QMessageBox( tr("Battery Status"), tr("Low Battery"),
+ QMessageBox::Critical,
+ QMessageBox::Ok | QMessageBox::Default,
+ QMessageBox::NoButton, QMessageBox::NoButton,
+ parent, name, FALSE )
+ {
+ currentPriority = INT_MAX;
+ alertCount = 0;
+ }
+
+ void alert( const QString &text, int priority );
+ void hideEvent( QHideEvent * );
+private:
+ int currentPriority;
+ int alertCount;
+};
+
+void DesktopPowerAlerter::alert( const QString &text, int priority )
+{
+ alertCount++;
+ if ( alertCount < priority )
+ return;
+ if ( priority > currentPriority )
+ return;
+ currentPriority = priority;
+ setText( text );
+ show();
+}
+
+
+void DesktopPowerAlerter::hideEvent( QHideEvent *e )
+{
+ QMessageBox::hideEvent( e );
+ alertCount = 0;
+ currentPriority = INT_MAX;
+}
+
+//---------------------------------------------------------------------------
+
+KeyFilter::KeyFilter(QObject* parent) : QObject(parent), held_tid(0), heldButton(0)
+{
+ qwsServer->setKeyboardFilter(this);
+}
+
+void KeyFilter::timerEvent(QTimerEvent* e)
+{
+ if ( e->timerId() == held_tid ) {
+ killTimer(held_tid);
+ // button held
+ if ( heldButton ) {
+ emit activate(heldButton, TRUE);
+ heldButton = 0;
+ }
+ held_tid = 0;
+ }
+}
+
+bool KeyFilter::filter(int /*unicode*/, int keycode, int modifiers, bool press,
+ bool autoRepeat)
+{
+ if ( !loggedin
+ // Permitted keys
+ && keycode != Key_F34 // power
+ && keycode != Key_F30 // select
+ && keycode != Key_Enter
+ && keycode != Key_Return
+ && keycode != Key_Space
+ && keycode != Key_Left
+ && keycode != Key_Right
+ && keycode != Key_Up
+ && keycode != Key_Down )
+ return TRUE;
+ if ( !modifiers ) {
+ if ( !((ServerApplication*)qApp)->keyboardGrabbed() ) {
+ // First check to see if DeviceButtonManager knows something about this button:
+ const DeviceButton* button = DeviceButtonManager::instance().buttonForKeycode(keycode);
+ if (button && !autoRepeat) {
+ if ( held_tid ) {
+ killTimer(held_tid);
+ held_tid = 0;
+ }
+ if ( button->heldAction().isNull() ) {
+ if ( press )
+ emit activate(button, FALSE);
+ } else if ( press ) {
+ heldButton = button;
+ held_tid = startTimer(500);
+ } else if ( heldButton ) {
+ heldButton = 0;
+ emit activate(button, FALSE);
+ }
+ QWSServer::screenSaverActivate(FALSE);
+ return TRUE;
+ }
+ }
+ if ( keycode == Key_F34 ) {
+ if ( press ) emit power();
+ return TRUE;
+ }
+ if ( keycode == Key_F35 ) {
+ if ( press ) emit backlight();
+ return TRUE;
+ }
+ if ( keycode == Key_F32 ) {
+#ifndef QT_NO_COP
+ if ( press ) QCopEnvelope e( "QPE/Desktop", "startSync()" );
+#endif
+ return TRUE;
+ }
+ if ( keycode == Key_F31 ) {
+ if ( press ) emit symbol();
+ QWSServer::screenSaverActivate(FALSE);
+ return TRUE;
+ }
+ }
+ if ( keycode == Key_NumLock ) {
+ if ( press ) emit numLockStateToggle();
+ }
+ if ( keycode == Key_CapsLock ) {
+ if ( press ) emit capsLockStateToggle();
+ }
+ if ( serverApp )
+ serverApp->keyClick(keycode,press,autoRepeat);
+ return FALSE;
+}
+
+enum MemState { MemUnknown, MemVeryLow, MemLow, MemNormal } memstate=MemUnknown;
+
+#if defined(QPE_HAVE_MEMALERTER)
+QPE_MEMALERTER_IMPL
+#endif
+
+#if defined(CUSTOM_SOUND_IMPL)
+CUSTOM_SOUND_IMPL
+#endif
+
+//---------------------------------------------------------------------------
+
+bool ServerApplication::doRestart = FALSE;
+bool ServerApplication::allowRestart = TRUE;
+
+ServerApplication::ServerApplication( int& argc, char **argv, Type t )
+ : QPEApplication( argc, argv, t )
+{
+#ifdef CUSTOM_SOUND_INIT
+ CUSTOM_SOUND_INIT;
+#endif
+
+#if defined(QPE_HAVE_MEMALERTER)
+ initMemalerter();
+#endif
+
+ // We know we'll have lots of cached pixmaps due to App/DocLnks
+ QPixmapCache::setCacheLimit(512);
+
+ QTimer *timer = new QTimer( this );
+ connect( timer, SIGNAL(timeout()), this, SLOT(psTimeout()) );
+ timer->start( 10000 );
+ ps = new PowerStatus;
+ pa = new DesktopPowerAlerter( 0 );
+
+ applyLightSettings(ps);
+
+ if ( PluginLoader::inSafeMode() )
+ QTimer::singleShot(500, this, SLOT(showSafeMode()) );
+ QTimer::singleShot(20*1000, this, SLOT(clearSafeMode()) );
+
+ KeyFilter* kf = new KeyFilter(this);
+
+ connect( kf, SIGNAL(launch()), this, SIGNAL(launch()) );
+ connect( kf, SIGNAL(power()), this, SIGNAL(power()) );
+ connect( kf, SIGNAL(backlight()), this, SIGNAL(backlight()) );
+ connect( kf, SIGNAL(symbol()), this, SIGNAL(symbol()));
+ connect( kf, SIGNAL(numLockStateToggle()), this,SIGNAL(numLockStateToggle()));
+ connect( kf, SIGNAL(capsLockStateToggle()), this,SIGNAL(capsLockStateToggle()));
+ connect( kf, SIGNAL(activate(const DeviceButton*,bool)), this,SIGNAL(activate(const DeviceButton*,bool)));
+
+ connect( kf, SIGNAL(power()), this, SLOT(togglePower()) );
+ connect( kf, SIGNAL(backlight()), this, SLOT(toggleLight()) );
+
+ connect( this, SIGNAL(volumeChanged(bool)), this, SLOT(rereadVolumes()) );
+ rereadVolumes();
+
+ serverApp = this;
+}
+
+
+ServerApplication::~ServerApplication()
+{
+ delete ps;
+ delete pa;
+}
+
+bool ServerApplication::screenLocked()
+{
+ return loggedin == 0;
+}
+
+void ServerApplication::login(bool at_poweron)
+{
+ if ( !loggedin ) {
+ Global::terminateBuiltin("calibrate"); // No tr
+ Password::authenticate(at_poweron);
+ loggedin=1;
+#ifndef QT_NO_COP
+ QCopEnvelope e( "QPE/Desktop", "unlocked()" );
+#endif
+ }
+}
+
+#if defined(QPE_HAVE_TOGGLELIGHT)
+#include <qtopia/config.h>
+
+#include <sys/ioctl.h>
+#include <sys/types.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <errno.h>
+#include <linux/ioctl.h>
+#include <time.h>
+#endif
+
+static bool blanked=FALSE;
+
+static void blankScreen()
+{
+#ifdef QWS
+ QWidget w(0, 0, Qt::WStyle_Customize | Qt::WStyle_NoBorder | Qt::WStyle_Tool | Qt::WStyle_StaysOnTop | Qt::WPaintUnclipped);
+ w.resize( qt_screen->width(), qt_screen->height() );
+ w.move(0, 0);
+
+ QPainter p(&w);
+ p.fillRect(w.rect(), QBrush(QColor(255,255,255)) );
+ p.end();
+ w.repaint();
+
+ blanked = TRUE;
+#endif
+}
+
+static void darkScreen()
+{
+ qpe_setBacklight(0); // force off
+}
+
+
+void ServerApplication::togglePower()
+{
+ static int haveAPM = -1;
+ if ( haveAPM < 0 ) {
+ if ( QFile::exists( "/proc/apm" ) ) {
+ haveAPM = 1;
+ } else {
+ haveAPM = 0;
+ qWarning( "Cannot suspend - no APM support in kernel" );
+ }
+ }
+
+ if ( haveAPM ) {
+ bool wasloggedin = loggedin;
+ loggedin=0;
+ if ( wasloggedin ) {
+ Config cfg( QPEApplication::qpeDir()+"/etc/Security.conf", Config::File);
+ cfg.setGroup("Passcode");
+ QString passcode = cfg.readEntry("passcode");
+ if ( !passcode.isEmpty() && cfg.readNumEntry("passcode_poweron",0) )
+ blankScreen();
+ }
+
+ system("apm --suspend");
+
+#ifndef QT_NO_COP
+ QWSServer::screenSaverActivate( FALSE );
+ {
+ QCopEnvelope("QPE/Card", "mtabChanged()" ); // might have changed while asleep
+ QCopEnvelope e("QPE/System", "setBacklight(int)");
+ e << -3; // Force on
+ }
+#endif
+ if ( wasloggedin )
+ login(TRUE);
+ }
+
+ //qcopBridge->closeOpenConnections();
+ //qDebug("called togglePower()!!!!!!");
+}
+
+void ServerApplication::toggleLight()
+{
+#ifndef QT_NO_COP
+ QCopEnvelope e("QPE/System", "setBacklight(int)");
+ e << -2; // toggle
+#endif
+}
+
+
+#ifdef Q_WS_QWS
+bool ServerApplication::qwsEventFilter( QWSEvent *e )
+{
+ checkMemory();
+
+ if ( e->type == QWSEvent::Mouse ) {
+ QWSMouseEvent *me = (QWSMouseEvent *)e;
+ static bool up = TRUE;
+ if ( me->simpleData.state&LeftButton ) {
+ if ( up ) {
+ up = FALSE;
+ screenClick(TRUE);
+ }
+ } else if ( !up ) {
+ up = TRUE;
+ screenClick(FALSE);
+ }
+ }
+
+ return QPEApplication::qwsEventFilter( e );
+}
+#endif
+
+void ServerApplication::psTimeout()
+{
+ checkMemory(); // in case no events are being generated
+
+ PowerStatus::ACStatus oldStatus = ps->acStatus();
+
+ *ps = PowerStatusManager::readStatus();
+
+ if ( oldStatus != ps->acStatus() ) {
+ // power source changed, read settings applying to current powersource
+ applyLightSettings(ps);
+ }
+
+
+ if ( (ps->batteryStatus() == PowerStatus::VeryLow ) ) {
+ pa->alert( tr( "Battery is running very low." ), 6 );
+ }
+
+ if ( ps->batteryStatus() == PowerStatus::Critical ) {
+ pa->alert( tr( "Battery level is critical!\n"
+ "Please recharge the main battery!" ), 1 );
+ }
+
+ if ( ps->backupBatteryStatus() == PowerStatus::VeryLow ) {
+ pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 3 );
+ }
+}
+
+void ServerApplication::showSafeMode()
+{
+ if ( QMessageBox::warning(0, tr("Safe Mode"), tr("<P>A system startup error occurred, "
+ "and the system is now in Safe Mode. "
+ "Plugins are not loaded in Safe Mode. "
+ "You can use the Plugin Manager to "
+ "disable plugins that cause system error."), tr("OK"), tr("Plugin Manager..."), 0) == 1 ) {
+ Global::execute( "pluginmanager" );
+ }
+}
+
+void ServerApplication::clearSafeMode()
+{
+ // If we've been running OK for a while then we won't bother going into
+ // safe mode immediately on the next crash.
+ Config cfg( "PluginLoader" );
+ cfg.setGroup( "Global" );
+ QString mode = cfg.readEntry( "Mode", "Normal" );
+ if ( mode == "MaybeSafe" ) {
+ cfg.writeEntry( "Mode", "Normal" );
+ }
+}
+
+void ServerApplication::shutdown()
+{
+ if ( type() != GuiServer )
+ return;
+ ShutdownImpl *sd = new ShutdownImpl( 0, 0, WDestructiveClose );
+ connect( sd, SIGNAL(shutdown(ShutdownImpl::Type)),
+ this, SLOT(shutdown(ShutdownImpl::Type)) );
+ sd->showMaximized();
+}
+
+void ServerApplication::shutdown( ShutdownImpl::Type t )
+{
+ switch ( t ) {
+ case ShutdownImpl::ShutdownSystem:
+#ifndef Q_OS_WIN32
+ execlp("shutdown", "shutdown", "-h", "now", (void*)0); // No tr
+#else
+ qDebug("ServerApplication::ShutdownSystem");
+ prepareForTermination(FALSE);
+ quit();
+#endif
+ break;
+
+ case ShutdownImpl::RebootSystem:
+#ifndef Q_OS_WIN32
+ execlp("shutdown", "shutdown", "-r", "now", (void*)0); // No tr
+#else
+ qDebug("ServerApplication::RebootSystem");
+ restart();
+#endif
+ break;
+
+ case ShutdownImpl::RestartDesktop:
+ restart();
+ break;
+
+ case ShutdownImpl::TerminateDesktop:
+ prepareForTermination(FALSE);
+ quit();
+ break;
+ }
+}
+
+void ServerApplication::restart()
+{
+ if ( allowRestart ) {
+ prepareForTermination(TRUE);
+ doRestart = TRUE;
+ quit();
+ }
+}
+
+void ServerApplication::rereadVolumes()
+{
+ Config cfg("Sound");
+ cfg.setGroup("System");
+ touchclick = cfg.readBoolEntry("Touch");
+ keyclick = cfg.readBoolEntry("Key");
+}
+
+
+void ServerApplication::checkMemory()
+{
+#if defined(QPE_HAVE_MEMALERTER)
+ static bool ignoreNormal=TRUE;
+ static bool existingMessage=FALSE;
+
+ if(existingMessage)
+ return; // don't show a second message while still on first
+
+ existingMessage = TRUE;
+ switch ( memstate ) {
+ case MemUnknown:
+ break;
+ case MemLow:
+ memstate = MemUnknown;
+ if ( !recoverMemory() ) {
+ QMessageBox::warning( 0 , tr("Memory Status"),
+ tr("Memory Low\nPlease save data.") );
+ ignoreNormal = FALSE;
+ }
+ break;
+ case MemNormal:
+ memstate = MemUnknown;
+ if ( !ignoreNormal ) {
+ ignoreNormal = TRUE;
+ QMessageBox::information ( 0 , tr("Memory Status"),
+ "Memory OK" );
+ }
+ break;
+ case MemVeryLow:
+ memstate = MemUnknown;
+ QMessageBox::critical( 0 , tr("Memory Status"),
+ tr("Critical Memory Shortage\n"
+ "Please end this application\n"
+ "immediately.") );
+ recoverMemory();
+ }
+ existingMessage = FALSE;
+#endif
+}
+
+bool ServerApplication::recoverMemory()
+{
+ return FALSE;
+}
+
+void ServerApplication::keyClick(int keycode, bool press, bool repeat)
+{
+#ifdef CUSTOM_SOUND_KEYCLICK
+ if ( keyclick )
+ CUSTOM_SOUND_KEYCLICK(keycode,press,repeat);
+#else
+ Q_UNUSED( keycode );
+ Q_UNUSED( press );
+ Q_UNUSED( repeat );
+#endif
+}
+
+void ServerApplication::screenClick(bool press)
+{
+#ifdef CUSTOM_SOUND_TOUCH
+ if ( touchclick )
+ CUSTOM_SOUND_TOUCH(press);
+#else
+ Q_UNUSED( press );
+#endif
+}
+
+
+#include "serverapp.moc"
diff --git a/core/launcher/serverapp.h b/core/launcher/serverapp.h
new file mode 100644
index 0000000..60d9c41
--- a/dev/null
+++ b/core/launcher/serverapp.h
@@ -0,0 +1,116 @@
+/**********************************************************************
+** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SERVERAPP_H
+#define SERVERAPP_H
+
+#include <qtopia/qpeapplication.h>
+
+#include <qwidget.h>
+#ifdef QWS
+#include <qwindowsystem_qws.h>
+#endif
+
+#include "shutdownimpl.h"
+
+class PowerStatus;
+class DesktopPowerAlerter;
+class DeviceButton;
+
+class KeyFilter : public QObject, public QWSServer::KeyboardFilter {
+ Q_OBJECT
+public:
+ KeyFilter(QObject* parent);
+ bool filter(int unicode, int keycode, int modifiers, bool press,
+ bool autoRepeat);
+
+protected:
+ void timerEvent(QTimerEvent*);
+
+signals:
+ void launch();
+ void power();
+ void backlight();
+ void symbol();
+ void numLockStateToggle();
+ void capsLockStateToggle();
+ void activate(const DeviceButton*,bool);
+
+private:
+ int held_tid;
+ const DeviceButton* heldButton;
+};
+
+class ServerApplication : public QPEApplication
+{
+ Q_OBJECT
+public:
+ ServerApplication( int& argc, char **argv, Type t );
+ ~ServerApplication();
+
+ static bool doRestart;
+ static bool allowRestart;
+ static bool screenLocked();
+ static void login(bool at_poweron);
+
+ void restart();
+
+signals:
+ void home();
+ void launch();
+ void power();
+ void backlight();
+ void symbol();
+ void numLockStateToggle();
+ void capsLockStateToggle();
+ void prepareForRestart();
+ void activate(const DeviceButton*,bool);
+
+protected:
+#ifdef Q_WS_QWS
+ bool qwsEventFilter( QWSEvent * );
+#endif
+ void shutdown();
+ void checkMemory();
+ bool recoverMemory();
+ void keyClick(int keycode, bool press, bool repeat);
+ void screenClick(bool press);
+
+protected slots:
+ void shutdown(ShutdownImpl::Type);
+ void psTimeout();
+ void showSafeMode();
+ void clearSafeMode();
+ void togglePower();
+ void toggleLight();
+ void rereadVolumes();
+
+private:
+ DesktopPowerAlerter *pa;
+ PowerStatus *ps;
+ bool keyclick;
+ bool touchclick;
+
+ friend class KeyFilter;
+};
+
+
+#endif // SERVERAPP_H
+
diff --git a/core/launcher/serverinterface.cpp b/core/launcher/serverinterface.cpp
new file mode 100644
index 0000000..7002243
--- a/dev/null
+++ b/core/launcher/serverinterface.cpp
@@ -0,0 +1,372 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include "serverinterface.h"
+#include "server.h"
+#include "documentlist.h"
+
+#include <qtopia/qpeapplication.h>
+#include <qwindowsystem_qws.h>
+#include <qgfx_qws.h>
+
+class LayoutManager : public QObject
+{
+ Q_OBJECT
+public:
+ LayoutManager();
+
+ void addDocked( QWidget *w, ServerInterface::DockArea placement );
+
+private:
+ struct Item {
+ QWidget *w;
+ ServerInterface::DockArea p;
+ };
+
+ bool eventFilter( QObject *object, QEvent *event );
+ void layout();
+ Item *findWidget( const QWidget *w ) const;
+
+ QList<Item> docked;
+};
+
+LayoutManager::LayoutManager()
+{
+ docked.setAutoDelete( TRUE );
+ qApp->desktop()->installEventFilter( this );
+}
+
+void LayoutManager::addDocked( QWidget *w, ServerInterface::DockArea placement )
+{
+ Item *i = new Item;
+ i->w = w;
+ i->p = placement;
+ w->installEventFilter( this );
+ docked.append(i);
+ layout();
+}
+
+bool LayoutManager::eventFilter( QObject *object, QEvent *event )
+{
+ if ( object == qApp->desktop() ) {
+ if ( event->type() == QEvent::Resize )
+ layout();
+ return QObject::eventFilter( object, event );
+ }
+
+ Item *item;
+
+ switch ( event->type() ) {
+ case QEvent::Destroy:
+ item = findWidget( (QWidget *)object );
+ if ( item ) {
+ docked.removeRef( item );
+ layout();
+ }
+ break;
+
+ case QEvent::Hide:
+ case QEvent::Show:
+ item = findWidget( (QWidget *)object );
+ if ( item )
+ layout();
+ break;
+
+ default:
+ break;
+ }
+
+ return QObject::eventFilter( object, event );
+}
+
+void LayoutManager::layout()
+{
+ QRect mwr( qApp->desktop()->geometry() );
+ QListIterator<Item> it( docked );
+ Item *item;
+ for ( ; (item = it.current()); ++it ) {
+ QWidget *w = item->w;
+ if ( !w->isVisible() )
+ continue;
+ switch ( item->p ) {
+ case ServerInterface::Top:
+ w->resize( mwr.width(), w->sizeHint().height() );
+ w->move( mwr.topLeft() );
+ mwr.setTop( w->geometry().bottom() + 1 );
+ break;
+ case ServerInterface::Bottom:
+ w->resize( mwr.width(), w->sizeHint().height() );
+ w->move( mwr.left(), mwr.bottom()-w->height()+1 );
+ mwr.setBottom( w->geometry().top() - 1 );
+ break;
+ case ServerInterface::Left:
+ w->resize( w->sizeHint().width(), mwr.height() );
+ w->move( mwr.topLeft() );
+ mwr.setLeft( w->geometry().right() + 1 );
+ break;
+ case ServerInterface::Right:
+ w->resize( w->sizeHint().width(), mwr.height() );
+ w->move( mwr.right()-w->width()+1, mwr.top() );
+ mwr.setRight( w->geometry().left() - 1 );
+ break;
+ }
+ }
+
+#ifdef Q_WS_QWS
+# if QT_VERSION < 0x030000
+ QWSServer::setMaxWindowRect( qt_screen->mapToDevice(mwr,
+ QSize(qt_screen->width(),qt_screen->height())) );
+# else
+ QWSServer::setMaxWindowRect( mwr );
+# endif
+#endif
+}
+
+LayoutManager::Item *LayoutManager::findWidget( const QWidget *w ) const
+{
+ QListIterator<Item> it( docked );
+ Item *item;
+ for ( ; (item = it.current()); ++it ) {
+ if ( item->w == w )
+ return item;
+ }
+
+ return 0;
+}
+
+//---------------------------------------------------------------------------
+
+/*! \class ServerInterface serverinterface.h
+ \brief The ServerInterface class provides an interface for Qtopia
+ custom launchers.
+
+ The ServerInterface allows the user interface of the launcher to be
+ customized to suit the device. For a PDA style device, the default
+ launcher is strongly recommended, however specialist devices may
+ choose to provide a launcher better suited to the application.
+
+ The launcher is fixed for any particular device and is not loaded
+ as a plugin. Launcher interfaces must
+ be compilied into the server by editing server.pro and server.cpp.
+*/
+
+/*!
+ \fn ServerInterface::createGUI()
+
+ Implement this function to create the custom launcher UI.
+*/
+
+/*!
+ \fn ServerInterface::destroyGUI()
+
+ Implement this function to destroy the custom launcher UI. All resources
+ allocated by createGUI() must be released.
+*/
+
+/*!
+ \enum ServerInterface::ApplicationState
+
+ The ApplicationState enum type specifies the state of an application.
+ The possible values are: <ul>
+
+ <li> \c Launching - the application has been requested, but is not yet running.
+ <li> \c Running - the application is running.
+ <li> \c Terminated - the application has been terminated.
+</ul>
+*/
+
+/*!
+ \fn ServerInterface::applicationStateChanged(const QString& name, ApplicationState state)
+
+ The application \a name has changed state to \a state. This can be used
+ to show launch notification and update a list of running applications.
+*/
+
+/*!
+ \fn ServerInterface::typeAdded(const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap)
+
+ An application category \a type has been added, for example "Games".
+ \a name is the translated name of the category. \a pixmap and
+ \a bgPixmap are small and large icons for the new type.
+
+ Types can be added or removed at any time, for example, when a storage
+ card containing a non-standard category is inserted or removed.
+
+ \sa typeRemoved()
+*/
+
+/*!
+ \fn ServerInterface::typeRemoved(const QString& type)
+
+ An application category \a type has been removed.
+
+ Types can be added or removed at any time, for example, when a storage
+ card containing a non-standard category is inserted or removed.
+
+ \sa typeAdded()
+*/
+
+/*!
+ \fn ServerInterface::applicationAdded(const QString& type, const AppLnk& app)
+
+ Add an application \a app of type \a type to the launcher.
+
+ \sa applicationRemoved()
+*/
+
+/*!
+ \fn ServerInterface::applicationRemoved(const QString& type, const AppLnk& app)
+
+ Remove an application \a app of type \a type from the launcher.
+
+ \sa applicationAdded()
+*/
+
+/*!
+ \fn ServerInterface::allApplicationsRemoved()
+
+ Remove all applications from the launcher.
+*/
+
+/*!
+ \fn const AppLnkSet &ServerInterface::appLnks()
+
+ Returns the current set of available applications.
+*/
+
+/*!
+ \fn ServerInterface::documentAdded(const DocLnk& doc)
+
+ Add a document \a doc to the launcher.
+
+ \sa documentRemoved()
+*/
+
+/*!
+ \fn ServerInterface::documentRemoved(const DocLnk& doc)
+
+ Remove a document \a doc to the launcher.
+
+ \sa documentAdded()
+*/
+
+/*!
+ \fn ServerInterface::documentChanged(const DocLnk& oldDoc, const DocLnk& newDoc)
+
+ Change document properties of existing document \a oldDoc to \a newDoc.
+*/
+
+/*!
+ \fn ServerInterface::allDocumentsRemoved()
+
+ Remove all documents from the launcher.
+*/
+
+/*!
+ \fn ServerInterface::storageChanged(const QList<FileSystem> &)
+
+ A filesystem has been added or removed.
+*/
+
+/*!
+ \fn ServerInterface::applicationScanningProgress(int percent)
+
+ The system is scanning for installed applications. \a percent
+ provides the percentage of the filesystems scanned. This function will
+ always be called with \a percent equal to zero when scanning starts,
+ and with \a percent equal to 100 when scanning is complete.
+*/
+
+/*!
+ \fn ServerInterface::documentScanningProgress(int percent)
+
+ The system is scanning for documents. \a percent
+ provides the percentage of the filesystems scanned. This function will
+ always be called with \a percent equal to zero when scanning starts,
+ and with \a percent equal to 100 when scanning is complete.
+*/
+
+/*!
+ \fn bool ServerInterface::requiresApplications() const
+
+ Return TRUE if the custom launcher requires the server to scan for
+ applications.
+*/
+
+/*!
+ \fn bool ServerInterface::requiresDocuments() const
+
+ Return TRUE if the custom launcher requires the server to scan for
+ documents.
+*/
+
+/*!
+ \enum ServerInterface::DockArea
+
+ The DockArea enum type defines the areas where widgets can be docked:
+ <ul>
+ <li> \c Top - the top of the screen.
+ <li> \c Bottom - the Bottom of the screen.
+ <li> \c Left - the Left of the screen.
+ <li> \c Right - the Right of the screen.
+ </ul>
+*/
+
+/*!
+ \fn ServerInterface::dockWidget(QWidget *w, DockArea placement)
+
+ Docks a top-level widget \a w on a side of the screen specified by
+ \a placement. The widget is placed
+ according to the order that it was docked, its sizeHint() and whether
+ previously docked widgets are visible. The desktop area available to
+ QWidget::showMaximized() will exclude any visible docked widgets.
+
+ For example, if a widget is
+ docked at the bottom of the screen, its sizeHint() will define its
+ height and it will use the full width of the screen. If a widget is
+ then docked to the right, its sizeHint() will define its width and
+ it will be as high as possible without covering
+ the widget docked at the bottom.
+
+ This function is useful for reserving system areas such as taskbars
+ and input methods that should not be covered by applications.
+*/
+
+
+ServerInterface::~ServerInterface()
+{
+}
+
+void ServerInterface::dockWidget( QWidget *w, DockArea placement )
+{
+ static LayoutManager *lm = 0;
+
+ if ( !lm )
+ lm = new LayoutManager;
+
+ lm->addDocked( w, placement );
+}
+
+const AppLnkSet& ServerInterface::appLnks()
+{
+ return *DocumentList::appLnkSet;
+}
+
+#include "serverinterface.moc"
+
diff --git a/core/launcher/serverinterface.h b/core/launcher/serverinterface.h
new file mode 100644
index 0000000..e57ea51
--- a/dev/null
+++ b/core/launcher/serverinterface.h
@@ -0,0 +1,72 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef SERVER_INTERFACE_H
+#define SERVER_INTERFACE_H
+
+
+#include <qstring.h>
+#include <qpixmap.h>
+#include <qwidget.h>
+#include <qtopia/applnk.h>
+#include <qtopia/storage.h>
+
+
+class ServerInterface {
+public:
+ virtual ~ServerInterface();
+
+ virtual void createGUI() = 0;
+ virtual void destroyGUI() = 0;
+
+ // These notify of the application categories, like what is used in the current launcher tabs,
+ // for example "Applications", "Games" etc.
+ virtual void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ) = 0;
+ virtual void typeRemoved( const QString& type ) = 0;
+
+ // These functions notify when an application is added or removed and to which category it belongs
+ virtual void applicationAdded( const QString& type, const AppLnk& doc ) = 0;
+ virtual void applicationRemoved( const QString& type, const AppLnk& doc ) = 0;
+ virtual void allApplicationsRemoved() = 0;
+ // Useful for wait icons, or running application lists etc
+ enum ApplicationState { Launching, Running, Terminated };
+ virtual void applicationStateChanged( const QString& name, ApplicationState state ) = 0;
+ static const AppLnkSet& appLnks();
+
+ // These functions notify of adding, removal and changes of document links used in the documents tab for example
+ virtual void documentAdded( const DocLnk& doc ) = 0;
+ virtual void documentRemoved( const DocLnk& doc ) = 0;
+ virtual void allDocumentsRemoved() = 0;
+ virtual void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) = 0;
+
+ virtual void storageChanged( const QList<FileSystem> & ) = 0;
+
+ virtual void applicationScanningProgress( int percent ) = 0;
+ virtual void documentScanningProgress( int percent ) = 0;
+
+ // Tells the server if the GUI needs to be updated about documents or applnks
+ virtual bool requiresApplications() const = 0;
+ virtual bool requiresDocuments() const = 0;
+
+ enum DockArea { Top, Bottom, Left, Right };
+ static void dockWidget( QWidget *w, DockArea placement );
+};
+
+
+#endif // SERVER_INTERFACE_H
diff --git a/core/launcher/specification.html b/core/launcher/specification.html
new file mode 100644
index 0000000..8e24837
--- a/dev/null
+++ b/core/launcher/specification.html
@@ -0,0 +1,213 @@
+<html>
+<title>
+Launcher Specification
+</title>
+
+<body>
+
+<h1>Launcher Specification</h1>
+
+
+<!--
+<h2>Specification goals</h2>
+This specification:
+<ol>
+<li> Describes all of the end-user stories and interactions.
+ (eg. the user can view a slide show of images from a digital camera).
+<li> Lists all features, derived from end-user stories,
+ in enough detail to allow the definition of
+ tests for all features.
+<li> Defines contraints and limitations on the application.
+ (eg. can view image sizes as large as 1MB).
+<li>Aides the developer on focusing on the most important aspects of
+ the application and ensuring all important elements are completed.
+</ol>
+-->
+
+<a name=description>
+</a>
+<!-- A one-line description of what this application is and does.
+ This description is then duplicated in the .desktop Comment and
+ the .control file description.
+
+ (eg. The image viewer allows viewing and very minor editing of image files.)
+-->
+The Qtopia Launcher is the your "home" in Qtopia.
+<!-- A one-paragraph description of what this application is and does.
+ This description is then duplicated in the .desktop Comment and
+ the .control file description.
+
+ (eg. The image viewer allows viewing and very minor editing
+ of image files. It assists format conversion, beaming logos
+ to phones, captioning, etc.)
+-->
+<p>
+The Qtopia Launcher allows you to start installed Applications, Games, and Settings.
+It allows you to manage your documents. The launcher has a taskbar which shows current
+running programs and allows switching between them.
+The taskbar supports three plugin types: input
+methods, taskbar applets, and menu applets (also called accessories).
+The Launcher is also responsible for a number of system-level operations.
+</p>
+
+<p>
+Status: RT
+</p>
+
+<a name=usecases>
+<h2>Use Cases</h2>
+</a>
+<!-- Describe real-world stories. Implicit in these use cases is
+ "these things are easy to do".
+ (eg.
+ Roving News Reporter
+
+ The journalist/cameraman takes photos with a digital camera,
+ loads them into the PDAs via CF card, adjusts the contrast,
+ blacks-out a license plate, adds a copyright caption, and
+ emails the image and short story to Reuters.
+ )
+
+ Note: TITLEs may be used as identifiers in bug reports.
+ -->
+<ul>
+<li><b>Write a new text document</b>
+ <p>The user clicks on the Text Editor to create a new text document
+ (or to edit an existing text document).
+<li><b>Play a game</b>
+ <p>The user looks at available games and chooses one to play.
+<li><b>Tweak the system</b>
+ <p>The user changes the way the device looks, feels, and operates
+ by using the Settings programs.
+<li><b>Edit a text document</b>
+ <p>The user clicks on a text document to edit it.
+<li><b>Organizing documents</b>
+ <p>The user looks at all documents of a certain type (such as images),
+ or looks at all documents in a certain category (such as Business).
+<li><b>Beam</b>
+ <p>The user selects a document and beams it to a friend.
+<li><b>Desktop Computer user</b>
+ <p>The user is familiar with desktop computer systems where a menu
+ is used for starting applications. A familiar interface is available
+ in Qtopia (the Q menu).
+<li><b>Accessories</b>
+ <p>The user installs software that appears as an item in the Q menu,
+ for invoking occasional actions.
+<li><b>Input methods</b>
+ <p>The user chooses Handwriting Recognition for most text input,
+ but switches to the more traditional Keyboard input method when
+ using the Terminal.
+<li><b>Switch between applications</b>
+ <p>Bob is writing an email about an upcoming event. Without
+ quitting the Email application, he starts the Calendar, views the event,
+ and easily switches back and forth between the two applications while
+ writing the email.
+<li><b>Broken software</b>
+ <p>Betty installs a game she downloaded off the Internet. When she
+ scores more than 99999 points, the game freezes and stops responding
+ to all input. The system informs her that the program is not responding
+ and she chooses to terminate the game.
+<li><b>Status display</b>
+ <p>The user installs various applets that show the current time,
+ the state of the network, battery level, and inserted media cards.
+ The small displays also provide minor interactions such as
+ setting an alarm clock, starting/stopping the network, getting more
+ detailed information, and ejecting cards.
+<li><b>Frequently used operations</b>
+ <p>The user installs various applets that provide quick access
+ to frequently used operations such as cut and paste, backlight adjustment,
+ and volume control.
+<li><b>Shutdown</b>
+ <p>The user is storing his device for an extremely long period. To prevent
+ system corruption when the battery eventually drains, he shuts down the
+ device.
+<li><b>Calibration</b>
+ <p>The touchpanel on some devices may "drift" over time, or in different
+ environmental conditions. The user then "recalibrates" the display.
+</ul>
+
+<a name=features>
+<h2>Features</h2>
+</a>
+<!-- features are brief
+
+ (eg.
+ * Slide show: view multiple images in sequence
+ * Configurable delay between images.
+ * Hardware-button-controlled stepping between images.
+ * Big images: view larger-than-available-RAM images in some formats.
+ * Formats: view JPEG, PNG, GIF format images.
+ * Scribbling: draw black or white lines on images.
+ * Save: in JPEG, PNG formats.
+ )
+
+ Note: TITLEs may be used as identifiers in bug reports.
+-->
+
+<ul>
+<li>Games tab: games are grouped on their own tab because they are a well-defined
+ group of applications. Games are programs useful solely for
+ entertainment.
+<li>Settings tab: settings are grouped on their own tab because they are a well-defined
+ group of applications. Settings are programs that configure the
+ device without actually contributing to productivity.
+<li>Applications tab: all programs that are not games or settings are grouped
+ as applications, presumably contributing to productivity.
+<li>Documents tab: all user documents are accessible through this tab.
+<li>Invoke application: selecting a application icon starts the application
+ or raises the application if it is already started.
+<li>Invoke document: selecting a document invokes the application associated
+ with the type of document.
+<li>Document Categorization: documents can be members of various categories. The user
+ can filter the view to show just members of a vertain category.
+<li>Document Type: documents each have a single MIME type. The user
+ can filter the view to show just documents of a certain type.
+<li>Beam Document: documents can be sent to other devices (via IrDA).
+<li>Move Document: documents can be moved to different storage locations (eg. CF or SD card).
+<li>Copy Document: documents can be duplicated, with the copy optionally on a different storage location.
+<li>Delete Document: documents can be deleted.
+<li>Q Menu Tab Equivalents: the Application, Games, and Settings tabs can be
+ visible in the Q Menu.
+<li>Q Menu Accessories: plugins (applets) can add items to the Q Menu (eg. IR on/off control).
+<li>Input Method Plugins: pluggable input methods can produce text input to
+ applications using programmed interactions with the user.
+<li>Task Bar: currently running applications are shown as icons in the taskbar,
+ and clicking on these raises the application. If the application does not
+ respond, the user is given the option to terminate it forcefully.
+<li>Status Bar: the task bar doubles as a status bar for temporary messages
+ generated by applications.
+<li>Applets: pluggable applets can show small widgets in the right-hand side
+ of the taskbar. eg. there is a clock applet.
+<li>Shutdown: the device may be shutdown, or the Launcher may be terminated
+ or restarted. The exact meaning of these operations is device-specific.
+<li>Recalibrate: the device may be recalibrated by takling 5 input points from
+ the user and adjusting physical to pixel transformations.
+</ul>
+
+<a name=prerequisites>
+<h2>Prerequisites</h2>
+</a>
+<!--
+ Describes unresolved limitations that cannot
+ be shown within the features list.
+
+ Describes memory and other requirements quantitatively.
+
+ This is a short list, mainly intended as a "known bugs"
+ list for missing features.
+
+ (eg.
+ * Stylus: required for Scribbling.
+ * Memory: requires 250 bytes per event, plus content strings.
+ )
+
+ Note: TITLEs may be used as identifiers in bug reports.
+
+<ul>
+ <li>[PREREQUISITE TITLE]: [PREREQUISITE DETAILS]
+</ul>
+-->
+None.
+
+</body>
+</html>
diff --git a/core/launcher/suspendmonitor.cpp b/core/launcher/suspendmonitor.cpp
new file mode 100644
index 0000000..f555e84
--- a/dev/null
+++ b/core/launcher/suspendmonitor.cpp
@@ -0,0 +1,167 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#include <qtopia/qcopenvelope_qws.h>
+#include <qtopia/qpeapplication.h>
+#include "suspendmonitor.h"
+
+
+#ifdef QTOPIA_MAX_SCREEN_DISABLE_TIME
+#define QTOPIA_MIN_SCREEN_DISABLE_TIME ((int) 300) // min 5 minutes before forced suspend kicks in
+#endif
+
+
+TempScreenSaverMonitor::TempScreenSaverMonitor(QObject *parent, const char *name)
+ : QObject(parent, name)
+{
+ currentMode = QPEApplication::Enable;
+ timerId = 0;
+}
+
+void TempScreenSaverMonitor::setTempMode(int mode, int pid)
+{
+ removeOld(pid);
+ switch(mode) {
+ case QPEApplication::Disable:
+ sStatus[0].append(pid);
+ break;
+ case QPEApplication::DisableLightOff:
+ sStatus[1].append(pid);
+ break;
+ case QPEApplication::DisableSuspend:
+ sStatus[2].append(pid);
+ break;
+ case QPEApplication::Enable:
+ break;
+ default:
+ qWarning("Unrecognized temp power setting. Ignored");
+ return;
+ }
+ updateAll();
+}
+
+// Returns true if app had set a temp Mode earlier
+bool TempScreenSaverMonitor::removeOld(int pid)
+{
+ QValueList<int>::Iterator it;
+ for (int i = 0; i < 3; i++) {
+ it = sStatus[i].find(pid);
+ if ( it != sStatus[i].end() ) {
+ sStatus[i].remove( it );
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+void TempScreenSaverMonitor::updateAll()
+{
+ int mode = QPEApplication::Enable;
+ if ( sStatus[0].count() ) {
+ mode = QPEApplication::Disable;
+ } else if ( sStatus[1].count() ) {
+ mode = QPEApplication::DisableLightOff;
+ } else if ( sStatus[2].count() ) {
+ mode = QPEApplication::DisableSuspend;
+ }
+
+ if ( mode != currentMode ) {
+#ifdef QTOPIA_MAX_SCREEN_DISABLE_TIME
+ if ( currentMode == QPEApplication::Enable) {
+ int tid = timerValue();
+ if ( tid )
+ timerId = startTimer( tid * 1000 );
+ } else if ( mode == QPEApplication::Enable ) {
+ if ( timerId ) {
+ killTimer(timerId);
+ timerId = 0;
+ }
+ }
+#endif
+ currentMode = mode;
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)") << mode;
+ }
+}
+
+void TempScreenSaverMonitor::applicationTerminated(int pid)
+{
+ if ( removeOld(pid) )
+ updateAll();
+}
+
+int TempScreenSaverMonitor::timerValue()
+{
+ int tid = 0;
+#ifdef QTOPIA_MAX_SCREEN_DISABLE_TIME
+ tid = QTOPIA_MAX_SCREEN_DISABLE_TIME;
+
+ char *env = getenv("QTOPIA_DISABLED_APM_TIMEOUT");
+ if ( !env )
+ return tid;
+
+ QString strEnv = env;
+ bool ok = FALSE;
+ int envTime = strEnv.toInt(&ok);
+
+ if ( ok ) {
+ if ( envTime < 0 )
+ return 0;
+ else if ( envTime <= QTOPIA_MIN_SCREEN_DISABLE_TIME )
+ return tid;
+ else
+ return envTime;
+ }
+#endif
+
+ return tid;
+}
+
+void TempScreenSaverMonitor::timerEvent(QTimerEvent *t)
+{
+#ifdef QTOPIA_MAX_SCREEN_DISABLE_TIME
+ if ( timerId && (t->timerId() == timerId) ) {
+
+ /* Clean up */
+ killTimer(timerId);
+ timerId = 0;
+ currentMode = QPEApplication::Enable;
+ QCopEnvelope("QPE/System", "setScreenSaverMode(int)") << currentMode;
+
+ // signal starts on a merry-go-round, which ends up in Desktop::togglePower()
+ emit forceSuspend();
+ // if we have apm we are asleep at this point, next line will be executed when we
+ // awake from suspend.
+ if ( QFile::exists( "/proc/apm" ) ) {
+ QTime t;
+ t = t.addSecs( timerValue() );
+ QString str = tr("<qt>The running applications disabled the screen saver for more than the allowed time (%1).<p>The system was forced to suspend</p></qt>").arg( t.toString() );
+ QMessageBox::information(0, tr("Forced suspend"), str);
+ }
+
+ // Reset all requests.
+ for (int i = 0; i < 3; i++)
+ sStatus[i].clear();
+
+ updateAll();
+ }
+#else
+ Q_UNUSED(t);
+#endif
+}
+
diff --git a/core/launcher/suspendmonitor.h b/core/launcher/suspendmonitor.h
new file mode 100644
index 0000000..553ad19
--- a/dev/null
+++ b/core/launcher/suspendmonitor.h
@@ -0,0 +1,56 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+#ifndef SUSPEND_MONITOR_H
+#define SUSPEND_MONITOR_H
+
+
+#include <qobject.h>
+#include <qvaluelist.h>
+
+
+class TempScreenSaverMonitor : public QObject
+{
+ Q_OBJECT
+public:
+ TempScreenSaverMonitor(QObject *parent = 0, const char *name = 0);
+
+ void setTempMode(int,int);
+ void applicationTerminated(int);
+
+signals:
+ void forceSuspend();
+
+protected:
+ void timerEvent(QTimerEvent *);
+
+private:
+ bool removeOld(int);
+ void updateAll();
+ int timerValue();
+
+private:
+ QValueList<int> sStatus[3];
+ int currentMode;
+ int timerId;
+};
+
+
+#endif // SUSPEND_MONITOR_H
+
diff --git a/core/launcher/syncdialog.cpp b/core/launcher/syncdialog.cpp
new file mode 100644
index 0000000..6f6c781
--- a/dev/null
+++ b/core/launcher/syncdialog.cpp
@@ -0,0 +1,184 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#include "syncdialog.h"
+
+#include <qtopia/resource.h>
+
+#include <qimage.h>
+#include <qpainter.h>
+#include <qapplication.h>
+#include <qpushbutton.h>
+#include <qfile.h>
+
+
+SyncDialog::SyncDialog( QWidget *parent, const QString &w )
+ : QDialog( parent, "SyncDialog", FALSE, WStyle_Tool | WStyle_Customize |
+ WStyle_StaysOnTop ), what(w), nextPt(0), rev(FALSE), hideDot(TRUE)
+{
+ QFont f( font() );
+ f.setPointSize( 16 );
+ setFont(f);
+
+ loadPath();
+
+ QSize ds = qApp->desktop()->size();
+ setGeometry( 0, 0, ds.width(), ds.height() );
+ img = Resource::loadImage( "SyncScreen" );
+ if ( img.width() > ds.width() || img.height() > ds.height() ) {
+ path = scalePath( path, ds.width(), img.width(), ds.height(), img.height() );
+ img = img.smoothScale( ds.width(), ds.height() );
+ }
+ dot = Resource::loadImage( "syncdot" );
+ setBackgroundColor( white );
+
+ QPushButton *pb = new QPushButton( tr("Abort"), this, "CancelSync" );
+ QSize bs = pb->sizeHint();
+ bs.rwidth() += 10;
+ bs.rheight() += 5;
+ pb->setGeometry( (ds.width()-bs.width())/2, 4*ds.height()/5,
+ bs.width(), bs.height() );
+ connect( pb, SIGNAL(clicked()), this, SIGNAL(cancel()) );
+
+ if ( path.count() >= 2 ) {
+ path = generatePath( path, 8 );
+ startTimer( 200 );
+ }
+}
+
+void SyncDialog::paintEvent( QPaintEvent *pe )
+{
+ QPainter p(this );
+ p.setClipRect( pe->rect() );
+ int ox = (width() - img.width())/2;
+ int oy = (height() - img.height())/2;
+
+ QRect ir = QRect(ox, oy, img.width(), img.height()) & pe->rect();
+
+ if ( ir.isValid() )
+ p.drawImage( ir.x(), ir.y(), img, ir.x()-ox, ir.y()-oy, ir.width(), ir.height() );
+
+ QString syncMsg = tr("Syncing:");
+ p.setPen( black );
+ QRect r( 0, 0, width()/2-5, QMAX(oy,80) );
+ p.drawText( r, AlignRight | AlignVCenter, syncMsg );
+ r.moveBy( width()/2, 0 );
+ QFont f( font() );
+ f.setWeight( QFont::Bold );
+ p.setFont( f );
+ p.drawText( r, AlignLeft | AlignVCenter, what );
+
+ if ( !hideDot )
+ p.drawImage( ox+path[nextPt].x()-dot.width()/2, oy+path[nextPt].y()-dot.height()/2, dot );
+}
+
+void SyncDialog::timerEvent( QTimerEvent * )
+{
+ int ox = (width() - img.width())/2;
+ int oy = (height() - img.height())/2;
+ int oldPt = nextPt;
+
+ if ( !rev ) {
+ nextPt++;
+ if ( nextPt == (int)path.count() ) {
+ nextPt -= 2;
+ rev = TRUE;
+ }
+ } else {
+ nextPt--;
+ if ( nextPt < 0 ) {
+ nextPt = 1;
+ rev = FALSE;
+ }
+ }
+
+ hideDot = FALSE;
+ repaint( ox+path[nextPt].x()-dot.width()/2, oy+path[nextPt].y()-dot.height()/2,
+ dot.width(), dot.height() );
+ hideDot = TRUE;
+ repaint( ox+path[oldPt].x()-dot.width()/2, oy+path[oldPt].y()-dot.height()/2,
+ dot.width(), dot.height() );
+}
+
+void SyncDialog::loadPath()
+{
+ QString pfile = Resource::findPixmap( "syncdot" );
+ if ( pfile.isEmpty() )
+ return;
+ int dp = pfile.findRev('.');
+ pfile.replace( dp, pfile.length()-dp, ".path" );
+
+ int count = 0;
+ QFile file( pfile );
+ if ( file.open( IO_ReadOnly ) ) {
+ QString line;
+ while ( file.readLine( line, 256 ) > 0 ) {
+ int x, y;
+ if ( sscanf( line.latin1(), "%d %d", &x, &y ) == 2 ) {
+ path.resize( count+1 );
+ path[count++] = QPoint(x, y);
+ }
+ }
+ }
+}
+
+QPointArray SyncDialog::scalePath( const QPointArray &pa, int xn, int xd, int yn, int yd )
+{
+ QPointArray sa( pa.size() );
+
+ for ( unsigned i = 0; i < pa.count(); i++ ) {
+ int x = xn * pa[int(i)].x() / xd;
+ int y = yn * pa[int(i)].y() / yd;
+ sa[int(i)] = QPoint( x, y );
+ }
+
+ return sa;
+}
+
+QPointArray SyncDialog::generatePath( const QPointArray &pa, int dist )
+{
+ if ( pa.count() < 2 )
+ return pa;
+
+ QPointArray fa;
+ int count = 0;
+ fa.resize( count+1 );
+ fa[count++] = pa[0];
+ for ( unsigned i = 0; i < pa.count()-1; i++ ) {
+ int x1 = pa[int(i)].x();
+ int y1 = pa[int(i)].y();
+ int x2 = pa[int(i+1)].x();
+ int y2 = pa[int(i+1)].y();
+ int dx = x2 - x1;
+ int dy = y2 - y1;
+ int pts = (QMAX(QABS(dx),QABS(dy)) + dist/2 )/dist;
+ for ( int j = 1; j < pts; j++ ) {
+ int x = j * dx / pts;
+ int y = j * dy / pts;
+ fa.resize( count+1 );
+ fa[count++] = pa[int(i)] + QPoint( x, y );
+ }
+ fa.resize( count+1 );
+ fa[count++] = pa[int(i+1)];
+ }
+
+ return fa;
+}
+
diff --git a/core/launcher/syncdialog.h b/core/launcher/syncdialog.h
new file mode 100644
index 0000000..36c01fc
--- a/dev/null
+++ b/core/launcher/syncdialog.h
@@ -0,0 +1,58 @@
+/**********************************************************************
+** Copyright (C) 2000-2002 Trolltech AS. All rights reserved.
+**
+** This file is part of the Qtopia Environment.
+**
+** This file may be distributed and/or modified under the terms of the
+** GNU General Public License version 2 as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL included in the
+** packaging of this file.
+**
+** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+**
+** See http://www.trolltech.com/gpl/ for GPL licensing information.
+**
+** Contact info@trolltech.com if any conditions of this licensing are
+** not clear to you.
+**
+**********************************************************************/
+
+#ifndef SYNCDIALOG_H
+#define SYNCDIALOG_H
+
+#include <qdialog.h>
+#include <qimage.h>
+#include <qpointarray.h>
+
+
+class SyncDialog : public QDialog
+{
+ Q_OBJECT
+public:
+ SyncDialog( QWidget *parent, const QString & );
+
+signals:
+ void cancel();
+
+protected:
+ void paintEvent( QPaintEvent * );
+ void timerEvent( QTimerEvent * );
+
+ void loadPath();
+ QPointArray scalePath( const QPointArray &pa, int xn, int xd, int yn, int yd );
+ QPointArray generatePath( const QPointArray &pa, int dist );
+
+private:
+ QImage img;
+ QImage dot;
+ QString what;
+ QPointArray path;
+ int nextPt;
+ bool rev;
+ bool hideDot;
+};
+
+
+#endif
+