author | zecke <zecke> | 2004-07-15 19:01:40 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-07-15 19:01:40 (UTC) |
commit | dffb08422497af5ccb0e66fc3434f171d57c2216 (patch) (unidiff) | |
tree | 5d6407302546f769f6017b406efe8fc12ee7a4d5 | |
parent | c96296038ac74083c5bf8009449cb22392cd02dc (diff) | |
download | opie-dffb08422497af5ccb0e66fc3434f171d57c2216.zip opie-dffb08422497af5ccb0e66fc3434f171d57c2216.tar.gz opie-dffb08422497af5ccb0e66fc3434f171d57c2216.tar.bz2 |
-Remove double 'connection' of num/capslock/symbol toggle from launcher.
taskbar itself takes care about it
-Make having the LockKeyState indicator in the taskbar configurable and
have it enabled by default for Sharp Zaurus which actually got a keyboard :)
Initial KeyLock State is still not defined/used from within Sharp
-rw-r--r-- | Rules.make | 3 | ||||
-rw-r--r-- | config.in | 5 | ||||
-rw-r--r-- | core/launcher/launcher.cpp | 20 | ||||
-rw-r--r-- | core/launcher/launcher.h | 5 | ||||
-rw-r--r-- | core/launcher/taskbar.cpp | 2 |
5 files changed, 10 insertions, 25 deletions
@@ -1,306 +1,309 @@ | |||
1 | .phony: force | 1 | .phony: force |
2 | force: | 2 | force: |
3 | 3 | ||
4 | $(configs) : | 4 | $(configs) : |
5 | $(call makecfg,$@) | 5 | $(call makecfg,$@) |
6 | 6 | ||
7 | $(TOPDIR)/gen.pro : $(TOPDIR)/.config | 7 | $(TOPDIR)/gen.pro : $(TOPDIR)/.config |
8 | echo > $@ | 8 | echo > $@ |
9 | # added for threaded version | 9 | # added for threaded version |
10 | ifneq ($(CONFIG_THREADED),) | 10 | ifneq ($(CONFIG_THREADED),) |
11 | echo CONFIG += thread >> $@ | 11 | echo CONFIG += thread >> $@ |
12 | else | 12 | else |
13 | echo CONFIG -= thread >> $@ | 13 | echo CONFIG -= thread >> $@ |
14 | endif | 14 | endif |
15 | ifneq ($(CONFIG_DEBUG),) | 15 | ifneq ($(CONFIG_DEBUG),) |
16 | echo CONFIG += debug >> $@ | 16 | echo CONFIG += debug >> $@ |
17 | echo CONFIG -= release >> $@ | 17 | echo CONFIG -= release >> $@ |
18 | echo DEFINES += "QT_COMPONENT_DEBUG=2" >> $@ | 18 | echo DEFINES += "QT_COMPONENT_DEBUG=2" >> $@ |
19 | echo DEFINES += QT_DEBUG >> $@ | 19 | echo DEFINES += QT_DEBUG >> $@ |
20 | else | 20 | else |
21 | echo CONFIG -= debug >> $@ | 21 | echo CONFIG -= debug >> $@ |
22 | echo CONFIG += release >> $@ | 22 | echo CONFIG += release >> $@ |
23 | echo DEFINES += "OPIE_NO_DEBUG" >> $@ | 23 | echo DEFINES += "OPIE_NO_DEBUG" >> $@ |
24 | endif | 24 | endif |
25 | ifeq ($(CONFIG_STATIC),y) | 25 | ifeq ($(CONFIG_STATIC),y) |
26 | echo CONFIG += staticlib >> $@ | 26 | echo CONFIG += staticlib >> $@ |
27 | endif | 27 | endif |
28 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 | 28 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 |
29 | echo CONFIG -= qt3 >> $@ | 29 | echo CONFIG -= qt3 >> $@ |
30 | else | 30 | else |
31 | echo CONFIG += qt3 >> $@ | 31 | echo CONFIG += qt3 >> $@ |
32 | endif | 32 | endif |
33 | ifneq ($(CONFIG_QUICK_LAUNCH),) | 33 | ifneq ($(CONFIG_QUICK_LAUNCH),) |
34 | echo contains\( CONFIG, quick-app \) \{ >> $@ | 34 | echo contains\( CONFIG, quick-app \) \{ >> $@ |
35 | echo CONFIG -= staticlib >> $@ | 35 | echo CONFIG -= staticlib >> $@ |
36 | echo CONFIG -= quick-app >> $@ | 36 | echo CONFIG -= quick-app >> $@ |
37 | echo CONFIG += quick-app-lib >> $@ | 37 | echo CONFIG += quick-app-lib >> $@ |
38 | echo QUICKLAUNCH_PATH = $(CONFIG_QUICKLAUNCH_PATH) >> $@ | 38 | echo QUICKLAUNCH_PATH = $(CONFIG_QUICKLAUNCH_PATH) >> $@ |
39 | echo \} >> $@ | 39 | echo \} >> $@ |
40 | else | 40 | else |
41 | echo contains\( CONFIG, quick-app \) \{ >> $@ | 41 | echo contains\( CONFIG, quick-app \) \{ >> $@ |
42 | echo CONFIG -= quick-app >> $@ | 42 | echo CONFIG -= quick-app >> $@ |
43 | echo CONFIG += quick-app-bin >> $@ | 43 | echo CONFIG += quick-app-bin >> $@ |
44 | echo \} >> $@ | 44 | echo \} >> $@ |
45 | endif | 45 | endif |
46 | ifeq ($(CONFIG_SQL_PIM_BACKEND),y) | 46 | ifeq ($(CONFIG_SQL_PIM_BACKEND),y) |
47 | echo ENABLE_SQL_PIM_BACKEND=$(CONFIG_SQL_PIM_BACKEND) >> $@ | 47 | echo ENABLE_SQL_PIM_BACKEND=$(CONFIG_SQL_PIM_BACKEND) >> $@ |
48 | else | 48 | else |
49 | echo ENABLE_SQL_PIM_BACKEND=n >> $@ | 49 | echo ENABLE_SQL_PIM_BACKEND=n >> $@ |
50 | endif | 50 | endif |
51 | ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y) | 51 | ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y) |
52 | echo CONFIG += no-override >> $@ | 52 | echo CONFIG += no-override >> $@ |
53 | endif | 53 | endif |
54 | ifeq ($(CONFIG_OPIE_NO_ERASERECT_FIX),y) | 54 | ifeq ($(CONFIG_OPIE_NO_ERASERECT_FIX),y) |
55 | echo DEFINES += OPIE_NO_ERASE_RECT_HACKFIX >> $@ | 55 | echo DEFINES += OPIE_NO_ERASE_RECT_HACKFIX >> $@ |
56 | endif | 56 | endif |
57 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) | 57 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) |
58 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ | 58 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ |
59 | endif | 59 | endif |
60 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) | 60 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) |
61 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ | 61 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ |
62 | endif | 62 | endif |
63 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) | 63 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) |
64 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ | 64 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ |
65 | endif | 65 | endif |
66 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) | 66 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) |
67 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ | 67 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ |
68 | endif | 68 | endif |
69 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) | 69 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) |
70 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ | 70 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ |
71 | endif | 71 | endif |
72 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) | 72 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) |
73 | echo DEFINES += OPIE_NEW_MALLOC >> $@ | 73 | echo DEFINES += OPIE_NEW_MALLOC >> $@ |
74 | endif | 74 | endif |
75 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) | 75 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) |
76 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ | 76 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ |
77 | endif | 77 | endif |
78 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ | 78 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ |
79 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) | 79 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) |
80 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ | 80 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ |
81 | endif | 81 | endif |
82 | ifeq ($(CONFIG_OPIE_TASKBAR_LOCK_KEY_STATE),y) | ||
83 | echo DEFINES += OPIE_TASKBAR_LOCK_KEY_STATE >> $@ | ||
84 | endif | ||
82 | # Write LIB dirs and INC dirs... | 85 | # Write LIB dirs and INC dirs... |
83 | ifeq ($(CONFIG_LIBETPAN_DEP),y) | 86 | ifeq ($(CONFIG_LIBETPAN_DEP),y) |
84 | echo LIBETPAN_LIB_DIR = $(CONFIG_LIBETPAN_LIB_DIR) >> $@ | 87 | echo LIBETPAN_LIB_DIR = $(CONFIG_LIBETPAN_LIB_DIR) >> $@ |
85 | echo LIBETPAN_INC_DIR = $(CONFIG_LIBETPAN_INC_DIR) >> $@ | 88 | echo LIBETPAN_INC_DIR = $(CONFIG_LIBETPAN_INC_DIR) >> $@ |
86 | endif | 89 | endif |
87 | ifeq ($(CONFIG_LIBPCAP_DEP),y) | 90 | ifeq ($(CONFIG_LIBPCAP_DEP),y) |
88 | echo LIBPCAP_LIB_DIR = $(CONFIG_LIBPCAP_LIB_DIR) >> $@ | 91 | echo LIBPCAP_LIB_DIR = $(CONFIG_LIBPCAP_LIB_DIR) >> $@ |
89 | echo LIBPCAP_INC_DIR = $(CONFIG_LIBPCAP_INC_DIR) >> $@ | 92 | echo LIBPCAP_INC_DIR = $(CONFIG_LIBPCAP_INC_DIR) >> $@ |
90 | endif | 93 | endif |
91 | ifeq ($(CONFIG_LIBSQLITE_DEP),y) | 94 | ifeq ($(CONFIG_LIBSQLITE_DEP),y) |
92 | echo LIBSQLITE_LIB_DIR = $(CONFIG_LIBSQLITE_LIB_DIR) >> $@ | 95 | echo LIBSQLITE_LIB_DIR = $(CONFIG_LIBSQLITE_LIB_DIR) >> $@ |
93 | echo LIBSQLITE_INC_DIR = $(CONFIG_LIBSQLITE_INC_DIR) >> $@ | 96 | echo LIBSQLITE_INC_DIR = $(CONFIG_LIBSQLITE_INC_DIR) >> $@ |
94 | endif | 97 | endif |
95 | ifeq ($(CONFIG_LIBXINE_DEP),y) | 98 | ifeq ($(CONFIG_LIBXINE_DEP),y) |
96 | echo LIBXINE_LIB_DIR = $(CONFIG_LIBXINE_LIB_DIR) >> $@ | 99 | echo LIBXINE_LIB_DIR = $(CONFIG_LIBXINE_LIB_DIR) >> $@ |
97 | echo LIBXINE_INC_DIR = $(CONFIG_LIBXINE_INC_DIR) >> $@ | 100 | echo LIBXINE_INC_DIR = $(CONFIG_LIBXINE_INC_DIR) >> $@ |
98 | endif | 101 | endif |
99 | ifeq ($(CONFIG_LIBIPK_DEP),y) | 102 | ifeq ($(CONFIG_LIBIPK_DEP),y) |
100 | echo LIBIPK_LIB_DIR = $(CONFIG_LIBIPK_LIB_DIR) >> $@ | 103 | echo LIBIPK_LIB_DIR = $(CONFIG_LIBIPK_LIB_DIR) >> $@ |
101 | echo LIBIPK_INC_DIR = $(CONFIG_LIBIPK_INC_DIR) >> $@ | 104 | echo LIBIPK_INC_DIR = $(CONFIG_LIBIPK_INC_DIR) >> $@ |
102 | endif | 105 | endif |
103 | ifeq ($(CONFIG_LIBSDK_DEP),y) | 106 | ifeq ($(CONFIG_LIBSDK_DEP),y) |
104 | echo LIBSDL_LIB_DIR = $(CONFIG_LIBSDL_LIB_DIR) >> $@ | 107 | echo LIBSDL_LIB_DIR = $(CONFIG_LIBSDL_LIB_DIR) >> $@ |
105 | echo LIBSDL_INC_DIR = $(CONFIG_LIBSDL_INC_DIR) >> $@ | 108 | echo LIBSDL_INC_DIR = $(CONFIG_LIBSDL_INC_DIR) >> $@ |
106 | endif | 109 | endif |
107 | ifeq ($(CONFIG_LIBSWORD_DEP),y) | 110 | ifeq ($(CONFIG_LIBSWORD_DEP),y) |
108 | echo LIBSWORD_LIB_DIR = $(CONFIG_LIBSWORD_LIB_DIR) >> $@ | 111 | echo LIBSWORD_LIB_DIR = $(CONFIG_LIBSWORD_LIB_DIR) >> $@ |
109 | echo LIBSWORD_INC_DIR = $(CONFIG_LIBSWORD_INC_DIR) >> $@ | 112 | echo LIBSWORD_INC_DIR = $(CONFIG_LIBSWORD_INC_DIR) >> $@ |
110 | endif | 113 | endif |
111 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages | 114 | $(TOPDIR)/.depends : $(shell if [ -e $(TOPDIR)/config.in ]\; then echo $(TOPDIR)/config.in\; fi\;) $(TOPDIR)/.config $(TOPDIR)/packages |
112 | @echo Generating dependency information... | 115 | @echo Generating dependency information... |
113 | # add to subdir-y, and add descend rules | 116 | # add to subdir-y, and add descend rules |
114 | @cat $(TOPDIR)/packages | grep -v '^#' | \ | 117 | @cat $(TOPDIR)/packages | grep -v '^#' | \ |
115 | awk '{print \ | 118 | awk '{print \ |
116 | ".PHONY : " $$2 "\n" \ | 119 | ".PHONY : " $$2 "\n" \ |
117 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ | 120 | "subdir-$$(" $$1 ") += " $$2 "\n\n"; \ |
118 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends | 121 | print $$2 " : " $$2 "/Makefile\n\t$$(call descend,$$@,$(filter-out $$@,$$(filter-out $$@,$$(MAKECMDGOALS))))\n"; }' > $(TOPDIR)/.depends |
119 | cat $(TOPDIR)/packages | grep -v '^#' | \ | 122 | cat $(TOPDIR)/packages | grep -v '^#' | \ |
120 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ | 123 | perl -ne '($$cfg, $$dir, $$pro) = $$_ =~ /^(\S+)\s+(\S+)\s+(\S+)/; if ( -e "$$dir/$$pro" ) { print "$$dir/Makefile : $$dir/$$pro \$$(QMAKE) \$$(OPIEDIR)/gen.pro \$$(OPIEDIR)/.config\n\t\$$(call makefilegen,\$$@)\n\n"; }' \ |
121 | >> $(TOPDIR)/.depends | 124 | >> $(TOPDIR)/.depends |
122 | # interpackage dependency generation | 125 | # interpackage dependency generation |
123 | @cat $(TOPDIR)/packages | \ | 126 | @cat $(TOPDIR)/packages | \ |
124 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends | 127 | $(TOPDIR)/scripts/deps.pl >> $(TOPDIR)/.depends |
125 | 128 | ||
126 | $(TOPDIR)/.depends.cfgs: | 129 | $(TOPDIR)/.depends.cfgs: |
127 | # config.in interdependencies | 130 | # config.in interdependencies |
128 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs | 131 | @echo $(configs) | sed -e 's,/config.in,,g' | ( for i in `cat`; do echo $$i; done ) > dirs |
129 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ | 132 | @cat dirs | ( for i in `cat`; do if [ "`cat dirs|grep $$i 2>/dev/null|wc -l`" -ne "1" ]; then deps=`cat dirs|grep $$i| grep -v "^$$i$$"|for i in \`cat|sed -e's,^$(TOPDIR)/,$$(TOPDIR)/,g'\`; do echo $$i/config.in; done`; echo `echo $$i/config.in|sed -e 's,^$(TOPDIR)/,$$(TOPDIR)/,'` : $$deps; fi; done ) >> $@ |
130 | @-rm -f dirs | 133 | @-rm -f dirs |
131 | 134 | ||
132 | $(QTDIR)/stamp-headers : | 135 | $(QTDIR)/stamp-headers : |
133 | @-rm -f $(QTDIR)/stamp-headers* | 136 | @-rm -f $(QTDIR)/stamp-headers* |
134 | ( cd $(QTDIR)/include; \ | 137 | ( cd $(QTDIR)/include; \ |
135 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ | 138 | $(patsubst %,ln -sf ../src/kernel/%;,qgfx_qws.h qwsmouse_qws.h \ |
136 | qcopchannel_qws.h qwindowsystem_qws.h \ | 139 | qcopchannel_qws.h qwindowsystem_qws.h \ |
137 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) | 140 | qfontmanager_qws.h qwsdefaultdecoration_qws.h)) |
138 | touch $@ | 141 | touch $@ |
139 | 142 | ||
140 | $(QTDIR)/stamp-headers-x11 : | 143 | $(QTDIR)/stamp-headers-x11 : |
141 | @-rm -f $(QTDIR)/stamp-headers* | 144 | @-rm -f $(QTDIR)/stamp-headers* |
142 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) | 145 | cd $(QTDIR)/include; $(patsubst %,ln -sf $(OPIEDIR)/x11/libqpe-x11/qt/%;,qgfx_qws.h qwsmouse_qws.h qcopchannel_qws.h qwindowsystem_qws.h qfontmanager_qws.h qwsdefaultdecoration_qws.h) |
143 | touch $@ | 146 | touch $@ |
144 | 147 | ||
145 | $(OPIEDIR)/stamp-headers : | 148 | $(OPIEDIR)/stamp-headers : |
146 | @-rm -f $(OPIEDIR)/stamp-headers* | 149 | @-rm -f $(OPIEDIR)/stamp-headers* |
147 | mkdir -p $(TOPDIR)/include/qpe \ | 150 | mkdir -p $(TOPDIR)/include/qpe \ |
148 | $(TOPDIR)/include/qtopia \ | 151 | $(TOPDIR)/include/qtopia \ |
149 | $(TOPDIR)/include/opie \ | 152 | $(TOPDIR)/include/opie \ |
150 | $(TOPDIR)/include/opie2 \ | 153 | $(TOPDIR)/include/opie2 \ |
151 | $(TOPDIR)/include/qtopia/private \ | 154 | $(TOPDIR)/include/qtopia/private \ |
152 | $(TOPDIR)/include/sl | 155 | $(TOPDIR)/include/sl |
153 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) | 156 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) |
154 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) | 157 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) |
155 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) | 158 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) |
156 | ifeq ($(CONFIG_LIBOPIE),y) | 159 | ifeq ($(CONFIG_LIBOPIE),y) |
157 | # libopie1 | 160 | # libopie1 |
158 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) | 161 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) |
159 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) | 162 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) |
160 | ( cd include/opie && ln -sf ../../libopie/big-screen/*.h .; ) | 163 | ( cd include/opie && ln -sf ../../libopie/big-screen/*.h .; ) |
161 | endif | 164 | endif |
162 | # libopie2 | 165 | # libopie2 |
163 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) | 166 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/*.h .; ) |
164 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/device/*.h .; ) | 167 | ( cd include/opie2 && ln -sf ../../libopie2/opiecore/device/*.h .; ) |
165 | ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) | 168 | ( cd include/opie2 && ln -sf ../../libopie2/opiemm/*.h .; ) |
166 | ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) | 169 | ( cd include/opie2 && ln -sf ../../libopie2/opiedb/*.h .; ) |
167 | ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) | 170 | ( cd include/opie2 && ln -sf ../../libopie2/opienet/*.h .; ) |
168 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) | 171 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/*.h .; ) |
169 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/*.h .; ) | 172 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/*.h .; ) |
170 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/backends/*.h .; ) | 173 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/core/backends/*.h .; ) |
171 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/ui/*.h .; ) | 174 | ( cd include/opie2 && ln -sf ../../libopie2/opiepim/ui/*.h .; ) |
172 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) | 175 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/*.h .; ) |
173 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/fileselector/*.h .; ) | 176 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/fileselector/*.h .; ) |
174 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/big-screen/*.h .; ) | 177 | ( cd include/opie2 && ln -sf ../../libopie2/opieui/big-screen/*.h .; ) |
175 | ( cd include/opie2 && ln -sf ../../libopie2/opiesecurity/*.h .; ) | 178 | ( cd include/opie2 && ln -sf ../../libopie2/opiesecurity/*.h .; ) |
176 | # auxilliary libraries | 179 | # auxilliary libraries |
177 | ( cd include/opie2 && ln -sf ../../libqtaux/*.h .; ) | 180 | ( cd include/opie2 && ln -sf ../../libqtaux/*.h .; ) |
178 | ( cd include/sl && ln -sf ../../libslcompat/*.h .; ) | 181 | ( cd include/sl && ln -sf ../../libslcompat/*.h .; ) |
179 | ( cd include/ && ln -sf ../noncore/net/ftplib/*.h .; ) | 182 | ( cd include/ && ln -sf ../noncore/net/ftplib/*.h .; ) |
180 | ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardcfg.h .; ) | 183 | ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardcfg.h .; ) |
181 | ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardpicks.h .; ) | 184 | ( cd include/ && ln -sf ../inputmethods/pickboard/pickboardpicks.h .; ) |
182 | # all | 185 | # all |
183 | ifeq ($(CONFIG_LIBOPIE),y) | 186 | ifeq ($(CONFIG_LIBOPIE),y) |
184 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 187 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
185 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) | 188 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) |
186 | endif | 189 | endif |
187 | ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opieui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 190 | ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opieui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
188 | ln -sf ../../libopie2/opieui/$$generatedHeader $$generatedHeader; done ) | 191 | ln -sf ../../libopie2/opieui/$$generatedHeader $$generatedHeader; done ) |
189 | ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opiepim/ui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 192 | ( cd include/opie2; for generatedHeader in `cd ../../libopie2/opiepim/ui; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
190 | ln -sf ../../libopie2/opiepim/ui/$$generatedHeader $$generatedHeader; done ) | 193 | ln -sf ../../libopie2/opiepim/ui/$$generatedHeader $$generatedHeader; done ) |
191 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h | 194 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h |
192 | touch $@ | 195 | touch $@ |
193 | 196 | ||
194 | $(OPIEDIR)/stamp-headers-x11 : | 197 | $(OPIEDIR)/stamp-headers-x11 : |
195 | @-rm -f $(OPIEDIR)/stamp-headers* | 198 | @-rm -f $(OPIEDIR)/stamp-headers* |
196 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ | 199 | mkdir -p $(TOPDIR)/include/qpe $(TOPDIR)/include/qtopia \ |
197 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private | 200 | $(TOPDIR)/include/opie $(TOPDIR)/include/qtopia/private |
198 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) | 201 | ( cd include/qpe && rm -f *.h; ln -sf ../../library/*.h .; ln -sf ../../library/backend/*.h .; rm -f *_p.h; ) |
199 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) | 202 | ( cd include/qtopia && rm -f *.h; ln -sf ../../library/*.h .; ) |
200 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) | 203 | ( cd include/qtopia/private && rm -f *.h; ln -sf ../../../library/backend/*.h .; ) |
201 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) | 204 | ( cd include/opie && rm -f *.h; ln -sf ../../libopie/*.h .; rm -f *_p.h; ) |
202 | ( cd include/opie && ln -sf ../../libsql/*.h .; ) | 205 | ( cd include/opie && ln -sf ../../libsql/*.h .; ) |
203 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) | 206 | ( cd include/opie && ln -sf ../../libopie/pim/*.h .; ) |
204 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ | 207 | ( cd include/opie; for generatedHeader in `cd ../../libopie; ls *.ui | sed -e "s,\.ui,\.h,g"`; do \ |
205 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) | 208 | ln -sf ../../libopie/$$generatedHeader $$generatedHeader; done ) |
206 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h | 209 | ln -sf ../../library/custom.h $(TOPDIR)/include/qpe/custom.h |
207 | ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) | 210 | ( cd include/qpe; ln -sf ../../x11/libqpe-x11/qpe/*.h .; ) |
208 | touch $@ | 211 | touch $@ |
209 | 212 | ||
210 | $(TOPDIR)/library/custom.h : $(TOPDIR)/.config | 213 | $(TOPDIR)/library/custom.h : $(TOPDIR)/.config |
211 | @-rm -f $@ | 214 | @-rm -f $@ |
212 | @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ | 215 | @$(if $(patsubst "%",%,$(CONFIG_CUSTOMFILE)),\ |
213 | ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) | 216 | ln -sf $(patsubst "%",%,$(CONFIG_CUSTOMFILE)) $@) |
214 | @touch $@ | 217 | @touch $@ |
215 | 218 | ||
216 | $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: | 219 | $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf $(TOPDIR)/scripts/kconfig/conf $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/qmake/qmake: |
217 | @$(call descend,$(shell dirname $@),$(shell basename $@)) | 220 | @$(call descend,$(shell dirname $@),$(shell basename $@)) |
218 | 221 | ||
219 | menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in | 222 | menuconfig: $(TOPDIR)/scripts/lxdialog/lxdialog $(TOPDIR)/scripts/kconfig/mconf ./config.in |
220 | $(TOPDIR)/scripts/kconfig/mconf ./config.in | 223 | $(TOPDIR)/scripts/kconfig/mconf ./config.in |
221 | @touch ./.config.stamp | 224 | @touch ./.config.stamp |
222 | 225 | ||
223 | xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in | 226 | xconfig: $(TOPDIR)/scripts/kconfig/qconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in |
224 | $(TOPDIR)/scripts/kconfig/qconf ./config.in | 227 | $(TOPDIR)/scripts/kconfig/qconf ./config.in |
225 | @touch .config.stamp | 228 | @touch .config.stamp |
226 | 229 | ||
227 | gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in | 230 | gconfig: $(TOPDIR)/scripts/kconfig/gconf $(TOPDIR)/scripts/kconfig/libkconfig.so ./config.in |
228 | $(TOPDIR)/scripts/kconfig/gconf ./config.in | 231 | $(TOPDIR)/scripts/kconfig/gconf ./config.in |
229 | @touch .config.stamp | 232 | @touch .config.stamp |
230 | 233 | ||
231 | config: $(TOPDIR)/scripts/kconfig/conf ./config.in | 234 | config: $(TOPDIR)/scripts/kconfig/conf ./config.in |
232 | $(TOPDIR)/scripts/kconfig/conf ./config.in | 235 | $(TOPDIR)/scripts/kconfig/conf ./config.in |
233 | @touch .config.stamp | 236 | @touch .config.stamp |
234 | 237 | ||
235 | oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 238 | oldconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
236 | $(TOPDIR)/scripts/kconfig/conf -o ./config.in | 239 | $(TOPDIR)/scripts/kconfig/conf -o ./config.in |
237 | @touch .config.stamp | 240 | @touch .config.stamp |
238 | 241 | ||
239 | randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 242 | randconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
240 | $(TOPDIR)/scripts/kconfig/conf -r ./config.in | 243 | $(TOPDIR)/scripts/kconfig/conf -r ./config.in |
241 | @touch .config.stamp | 244 | @touch .config.stamp |
242 | 245 | ||
243 | allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 246 | allyesconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
244 | $(TOPDIR)/scripts/kconfig/conf -y ./config.in | 247 | $(TOPDIR)/scripts/kconfig/conf -y ./config.in |
245 | @touch .config.stamp | 248 | @touch .config.stamp |
246 | 249 | ||
247 | allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 250 | allnoconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
248 | $(TOPDIR)/scripts/kconfig/conf -n ./config.in | 251 | $(TOPDIR)/scripts/kconfig/conf -n ./config.in |
249 | @touch .config.stamp | 252 | @touch .config.stamp |
250 | 253 | ||
251 | defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in | 254 | defconfig: $(TOPDIR)/scripts/kconfig/conf ./config.in |
252 | $(TOPDIR)/scripts/kconfig/conf -d ./config.in | 255 | $(TOPDIR)/scripts/kconfig/conf -d ./config.in |
253 | @touch .config.stamp | 256 | @touch .config.stamp |
254 | 257 | ||
255 | $(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default | 258 | $(TOPDIR)/qmake/qmake : $(TOPDIR)/mkspecs/default |
256 | 259 | ||
257 | $(TOPDIR)/mkspecs/default : | 260 | $(TOPDIR)/mkspecs/default : |
258 | ln -sf linux-g++ $@ | 261 | ln -sf linux-g++ $@ |
259 | 262 | ||
260 | $(TOPDIR)/scripts/subst : force | 263 | $(TOPDIR)/scripts/subst : force |
261 | @( \ | 264 | @( \ |
262 | echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ | 265 | echo 's,\$$QPE_VERSION,$(QPE_VERSION),g'; \ |
263 | echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ | 266 | echo 's,\$$OPIE_VERSION,$(OPIE_VERSION),g'; \ |
264 | echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ | 267 | echo 's,\$$QTE_VERSION,$(QTE_VERSION),g'; \ |
265 | echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ | 268 | echo 's,\$$QTE_REVISION,$(QTE_REVISION),g'; \ |
266 | echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ | 269 | echo 's,\$$SUB_VERSION,$(SUB_VERSION),g'; \ |
267 | echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \ | 270 | echo 's,\$$EXTRAVERSION,$(EXTRAVERSION),g'; \ |
268 | echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \ | 271 | echo 's,\$$QTE_BASEVERSION,$(QTE_BASEVERSION),g'; \ |
269 | ) > $@ || ( rm -f $@; exit 1 ) | 272 | ) > $@ || ( rm -f $@; exit 1 ) |
270 | 273 | ||
271 | $(TOPDIR)/scripts/filesubst : force | 274 | $(TOPDIR)/scripts/filesubst : force |
272 | @( \ | 275 | @( \ |
273 | echo 's,\$$OPIEDIR/root/,/,g'; \ | 276 | echo 's,\$$OPIEDIR/root/,/,g'; \ |
274 | echo 's,$(OPIEDIR)/root/,/,g'; \ | 277 | echo 's,$(OPIEDIR)/root/,/,g'; \ |
275 | echo 's,\$$OPIEDIR,$(prefix),g'; \ | 278 | echo 's,\$$OPIEDIR,$(prefix),g'; \ |
276 | echo 's,$(OPIEDIR),$(prefix),g'; \ | 279 | echo 's,$(OPIEDIR),$(prefix),g'; \ |
277 | echo 's,\$$QTDIR,$(prefix),g'; \ | 280 | echo 's,\$$QTDIR,$(prefix),g'; \ |
278 | echo 's,$(QTDIR),$(prefix),g'; \ | 281 | echo 's,$(QTDIR),$(prefix),g'; \ |
279 | echo 's,^\(\./\)*root/,/,g'; \ | 282 | echo 's,^\(\./\)*root/,/,g'; \ |
280 | echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \ | 283 | echo 's,^\(\./\)*etc/,$(prefix)/etc/,g'; \ |
281 | echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \ | 284 | echo 's,^\(\./\)*lib/,$(prefix)/lib/,g'; \ |
282 | echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \ | 285 | echo 's,^\(\./\)*bin/,$(prefix)/bin/,g'; \ |
283 | echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \ | 286 | echo 's,^\(\./\)*pics/,$(prefix)/pics/,g'; \ |
284 | echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \ | 287 | echo 's,^\(\./\)*sounds/,$(prefix)/sounds/,g'; \ |
285 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ | 288 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ |
286 | echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \ | 289 | echo 's,^\(\./\)*plugins/,$(prefix)/plugins/,g'; \ |
287 | echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \ | 290 | echo 's,^\(\./\)*apps/,$(prefix)/apps/,g'; \ |
288 | echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \ | 291 | echo 's,^\(\./\)*share/,$(prefix)/share/,g'; \ |
289 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ | 292 | echo 's,^\(\./\)*i18n/,$(prefix)/i18n/,g'; \ |
290 | echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \ | 293 | echo 's,^\(\./\)*help/,$(prefix)/help/,g'; \ |
291 | ) > $@ || ( rm -f $@; exit 1 ) | 294 | ) > $@ || ( rm -f $@; exit 1 ) |
292 | 295 | ||
293 | ## general rules ## | 296 | ## general rules ## |
294 | 297 | ||
295 | define descend | 298 | define descend |
296 | $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) | 299 | $(MAKE) $(if $(QMAKE),QMAKE=$(QMAKE)) -C $(1) $(2) |
297 | endef | 300 | endef |
298 | 301 | ||
299 | define makefilegen | 302 | define makefilegen |
300 | cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ | 303 | cd $(if $(1),$(shell dirname $(1))); $(TOPDIR)/qmake/qmake $(3) -o $(if $(1),$(shell basename $(1))) `cat $(OPIEDIR)/packages | grep " \`echo $(1)|sed -e 's,/Makefile$$,,'\`" | \ |
301 | head -1 | awk '{print $$3}'` | 304 | head -1 | awk '{print $$3}'` |
302 | endef | 305 | endef |
303 | 306 | ||
304 | define makecfg | 307 | define makecfg |
305 | $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) | 308 | $(TOPDIR)/scripts/makecfg.pl $1 $(OPIEDIR) |
306 | endef | 309 | endef |
@@ -1,259 +1,264 @@ | |||
1 | mainmenu "Opie Configuration" | 1 | mainmenu "Opie Configuration" |
2 | 2 | ||
3 | menu "Build Parameters" | 3 | menu "Build Parameters" |
4 | 4 | ||
5 | choice | 5 | choice |
6 | prompt "Target Machine" | 6 | prompt "Target Machine" |
7 | default TARGET_X86 | 7 | default TARGET_X86 |
8 | help | 8 | help |
9 | Please select the architecture of the machine you will be | 9 | Please select the architecture of the machine you will be |
10 | building the OpenZaurus buildroot for. | 10 | building the OpenZaurus buildroot for. |
11 | 11 | ||
12 | config TARGET_X86 | 12 | config TARGET_X86 |
13 | boolean "Intel X86" | 13 | boolean "Intel X86" |
14 | 14 | ||
15 | config TARGET_MACOSX | 15 | config TARGET_MACOSX |
16 | boolean "Mac OS X (DARWIN)" | 16 | boolean "Mac OS X (DARWIN)" |
17 | 17 | ||
18 | config TARGET_SHARP | 18 | config TARGET_SHARP |
19 | boolean "Sharp Zaurus w/ SA1100 (5000 and 5500)" | 19 | boolean "Sharp Zaurus w/ SA1100 (5000 and 5500)" |
20 | 20 | ||
21 | config TARGET_C700 | 21 | config TARGET_C700 |
22 | boolean "Sharp Zaurus w/ PXA25x (5600, C7x0, C8x0)" | 22 | boolean "Sharp Zaurus w/ PXA25x (5600, C7x0, C8x0)" |
23 | 23 | ||
24 | config TARGET_IPAQ | 24 | config TARGET_IPAQ |
25 | boolean "iPAQ" | 25 | boolean "iPAQ" |
26 | 26 | ||
27 | config TARGET_RAMSES | 27 | config TARGET_RAMSES |
28 | boolean "Ramses" | 28 | boolean "Ramses" |
29 | 29 | ||
30 | config TARGET_SIMPAD | 30 | config TARGET_SIMPAD |
31 | boolean "SIMpad" | 31 | boolean "SIMpad" |
32 | 32 | ||
33 | config TARGET_YOPY | 33 | config TARGET_YOPY |
34 | boolean "Yopy 3500/3700" | 34 | boolean "Yopy 3500/3700" |
35 | 35 | ||
36 | endchoice | 36 | endchoice |
37 | 37 | ||
38 | config OPTIMIZE | 38 | config OPTIMIZE |
39 | boolean "Use optimizations" | 39 | boolean "Use optimizations" |
40 | default "y" if ! TARGET_X86 | 40 | default "y" if ! TARGET_X86 |
41 | 41 | ||
42 | config THREADED | 42 | config THREADED |
43 | boolean "Enable threaded build" | 43 | boolean "Enable threaded build" |
44 | default "n" | 44 | default "n" |
45 | 45 | ||
46 | config STATIC | 46 | config STATIC |
47 | boolean "Build static libraries" | 47 | boolean "Build static libraries" |
48 | default "n" | 48 | default "n" |
49 | 49 | ||
50 | config DEBUG | 50 | config DEBUG |
51 | boolean "Enable debug builds" | 51 | boolean "Enable debug builds" |
52 | default n | 52 | default n |
53 | 53 | ||
54 | config RELEASE | 54 | config RELEASE |
55 | bool | 55 | bool |
56 | default y | 56 | default y |
57 | depends !DEBUG | 57 | depends !DEBUG |
58 | 58 | ||
59 | config QUICK_LAUNCH | 59 | config QUICK_LAUNCH |
60 | boolean "Enable Quick Launch" | 60 | boolean "Enable Quick Launch" |
61 | default n if TARGET_X86 | 61 | default n if TARGET_X86 |
62 | default y if ! TARGET_X86 | 62 | default y if ! TARGET_X86 |
63 | 63 | ||
64 | config QUICKLAUNCH_PATH | 64 | config QUICKLAUNCH_PATH |
65 | string "Path to quicklauncher" | 65 | string "Path to quicklauncher" |
66 | default "./quicklauncher" if TARGET_X86 | 66 | default "./quicklauncher" if TARGET_X86 |
67 | default "/opt/QtPalmtop/bin/quicklauncher" if ! TARGET_X86 | 67 | default "/opt/QtPalmtop/bin/quicklauncher" if ! TARGET_X86 |
68 | 68 | ||
69 | config SPECFILE | 69 | config SPECFILE |
70 | string | 70 | string |
71 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) | 71 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) |
72 | default "linux-g++" if TARGET_X86 && X11 | 72 | default "linux-g++" if TARGET_X86 && X11 |
73 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) | 73 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) |
74 | default "linux-g++" if TARGET_SHARP && X11 | 74 | default "linux-g++" if TARGET_SHARP && X11 |
75 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) | 75 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) |
76 | default "linux-g++" if TARGET_IPAQ && X11 | 76 | default "linux-g++" if TARGET_IPAQ && X11 |
77 | default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) | 77 | default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) |
78 | default "linux-g++" if TARGET_RAMSES && X11 | 78 | default "linux-g++" if TARGET_RAMSES && X11 |
79 | default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11) | 79 | default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11) |
80 | default "linux-g++" if TARGET_SIMPAD && X11 | 80 | default "linux-g++" if TARGET_SIMPAD && X11 |
81 | default "qws/linux-yopy-g++" if TARGET_YOPY && (! X11) | 81 | default "qws/linux-yopy-g++" if TARGET_YOPY && (! X11) |
82 | default "qws/macx-generic-g++" if TARGET_MACOSX && (! X11) | 82 | default "qws/macx-generic-g++" if TARGET_MACOSX && (! X11) |
83 | 83 | ||
84 | config CUSTOMFILE | 84 | config CUSTOMFILE |
85 | string | 85 | string |
86 | default "custom-ipaq.h" if TARGET_IPAQ | 86 | default "custom-ipaq.h" if TARGET_IPAQ |
87 | default "custom-sharp.h" if TARGET_SHARP | 87 | default "custom-sharp.h" if TARGET_SHARP |
88 | default "custom-ramses.h" if TARGET_RAMSES | 88 | default "custom-ramses.h" if TARGET_RAMSES |
89 | default "custom-ipaq.h" if TARGET_SIMPAD | 89 | default "custom-ipaq.h" if TARGET_SIMPAD |
90 | default "custom-yopy.h" if TARGET_YOPY | 90 | default "custom-yopy.h" if TARGET_YOPY |
91 | 91 | ||
92 | config OPTIMIZATIONS | 92 | config OPTIMIZATIONS |
93 | string "Optimization flags" | 93 | string "Optimization flags" |
94 | depends OPTIMIZE | 94 | depends OPTIMIZE |
95 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ | 95 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ |
96 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_YOPY | 96 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_YOPY |
97 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP | 97 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP |
98 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES | 98 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES |
99 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD | 99 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD |
100 | default "-march=armv5te -mtune=xscale -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_C700 | 100 | default "-march=armv5te -mtune=xscale -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_C700 |
101 | 101 | ||
102 | config EXPERIMENTAL | 102 | config EXPERIMENTAL |
103 | bool "Prompt for development and/or incomplete items" | 103 | bool "Prompt for development and/or incomplete items" |
104 | default y | 104 | default y |
105 | 105 | ||
106 | endmenu | 106 | endmenu |
107 | 107 | ||
108 | menu "Configuration" | 108 | menu "Configuration" |
109 | config OPIE_NO_OVERRIDE_QT | 109 | config OPIE_NO_OVERRIDE_QT |
110 | boolean "Build Opie against an unpatched version of Qt" | 110 | boolean "Build Opie against an unpatched version of Qt" |
111 | default n | 111 | default n |
112 | 112 | ||
113 | config OPIE_NO_ERASERECT_FIX | 113 | config OPIE_NO_ERASERECT_FIX |
114 | boolean "Disable Fixup eraseRect for HancomMobileWord,neocal.. to make libopiecore work on Sharps libqpe" | 114 | boolean "Disable Fixup eraseRect for HancomMobileWord,neocal.. to make libopiecore work on Sharps libqpe" |
115 | default n | 115 | default n |
116 | 116 | ||
117 | config OPIE_NO_BUILTIN_SHUTDOWN | 117 | config OPIE_NO_BUILTIN_SHUTDOWN |
118 | boolean "Disable the built in shutdown application" | 118 | boolean "Disable the built in shutdown application" |
119 | default y | 119 | default y |
120 | 120 | ||
121 | config OPIE_NO_BUILTIN_CALIBRATE | 121 | config OPIE_NO_BUILTIN_CALIBRATE |
122 | boolean "Disable the built in calibrate application" | 122 | boolean "Disable the built in calibrate application" |
123 | default y if TARGET_YOPY | 123 | default y if TARGET_YOPY |
124 | default n if ! TARGET_YOPY | 124 | default n if ! TARGET_YOPY |
125 | 125 | ||
126 | config OPIE_SOUND_FRAGMENT_SHIFT | 126 | config OPIE_SOUND_FRAGMENT_SHIFT |
127 | string "The sound fragment used in Opie Player I" | 127 | string "The sound fragment used in Opie Player I" |
128 | default "14" if TARGET_IPAQ | 128 | default "14" if TARGET_IPAQ |
129 | default "16" if ! TARGET_IPAQ | 129 | default "16" if ! TARGET_IPAQ |
130 | 130 | ||
131 | config USE_REALTIME_AUDIO_THREAD | 131 | config USE_REALTIME_AUDIO_THREAD |
132 | boolean "Use a realtime thread in Opie Player I" | 132 | boolean "Use a realtime thread in Opie Player I" |
133 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP | 133 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP |
134 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 134 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
135 | 135 | ||
136 | config QT_QWS_ALLOW_OVERCLOCK | 136 | config QT_QWS_ALLOW_OVERCLOCK |
137 | boolean "Allow the user to overclock the device" | 137 | boolean "Allow the user to overclock the device" |
138 | depends TARGET_RAMSES | 138 | depends TARGET_RAMSES |
139 | default n | 139 | default n |
140 | 140 | ||
141 | config USE_FILE_NOTIFICATION | 141 | config USE_FILE_NOTIFICATION |
142 | boolean "Substitute (some) polling interfaces with OFileNotifier" | 142 | boolean "Substitute (some) polling interfaces with OFileNotifier" |
143 | default y | 143 | default y |
144 | 144 | ||
145 | config OPIE_NEW_ALLOC | 145 | config OPIE_NEW_ALLOC |
146 | boolean "Use malloc and free for the implementation" | 146 | boolean "Use malloc and free for the implementation" |
147 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP | 147 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP |
148 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 148 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
149 | 149 | ||
150 | config OPIE_TASKBAR_LOCK_KEY_STATE | ||
151 | boolean "Have a KeyLock state indicator on the taskbar" | ||
152 | default y if TARGET_SHARP | ||
153 | default n if !TARGET_SHARP | ||
154 | |||
150 | config OPIE_NO_SOUND_PCM_READ_BITS | 155 | config OPIE_NO_SOUND_PCM_READ_BITS |
151 | boolean "There is not a pcm_read_bits io control" | 156 | boolean "There is not a pcm_read_bits io control" |
152 | default y if TARGET_SHARP | 157 | default y if TARGET_SHARP |
153 | default n if ! TARGET_SHARP | 158 | default n if ! TARGET_SHARP |
154 | endmenu | 159 | endmenu |
155 | 160 | ||
156 | menu "Dependencies" | 161 | menu "Dependencies" |
157 | source dependencies.in | 162 | source dependencies.in |
158 | endmenu | 163 | endmenu |
159 | 164 | ||
160 | menu "Base" | 165 | menu "Base" |
161 | choice | 166 | choice |
162 | prompt "Qpe Library Selection" | 167 | prompt "Qpe Library Selection" |
163 | default LIBQPE | 168 | default LIBQPE |
164 | source library/config.in | 169 | source library/config.in |
165 | source x11/config.in | 170 | source x11/config.in |
166 | endchoice | 171 | endchoice |
167 | source libopie/config.in | 172 | source libopie/config.in |
168 | 173 | ||
169 | source libopie2/config.in | 174 | source libopie2/config.in |
170 | source libqtaux/config.in | 175 | source libqtaux/config.in |
171 | source rsync/config.in | 176 | source rsync/config.in |
172 | source core/opie-login/config.in | 177 | source core/opie-login/config.in |
173 | source core/opiealarm/config.in | 178 | source core/opiealarm/config.in |
174 | source core/tools/quicklauncher/config.in | 179 | source core/tools/quicklauncher/config.in |
175 | source core/launcher/config.in | 180 | source core/launcher/config.in |
176 | source core/symlinker/config.in | 181 | source core/symlinker/config.in |
177 | endmenu | 182 | endmenu |
178 | 183 | ||
179 | comment "" | 184 | comment "" |
180 | 185 | ||
181 | menu "Applets" | 186 | menu "Applets" |
182 | source core/applets/config.in | 187 | source core/applets/config.in |
183 | source noncore/applets/config.in | 188 | source noncore/applets/config.in |
184 | endmenu | 189 | endmenu |
185 | 190 | ||
186 | menu "Apps" | 191 | menu "Apps" |
187 | source core/apps/config.in | 192 | source core/apps/config.in |
188 | source noncore/apps/config.in | 193 | source noncore/apps/config.in |
189 | endmenu | 194 | endmenu |
190 | 195 | ||
191 | menu "Communications and Networking" | 196 | menu "Communications and Networking" |
192 | source noncore/comm/config.in | 197 | source noncore/comm/config.in |
193 | source noncore/net/config.in | 198 | source noncore/net/config.in |
194 | endmenu | 199 | endmenu |
195 | 200 | ||
196 | menu "Games" | 201 | menu "Games" |
197 | source noncore/games/config.in | 202 | source noncore/games/config.in |
198 | endmenu | 203 | endmenu |
199 | 204 | ||
200 | menu "Graphics and Multimedia" | 205 | menu "Graphics and Multimedia" |
201 | source freetype/config.in | 206 | source freetype/config.in |
202 | source noncore/graphics/config.in | 207 | source noncore/graphics/config.in |
203 | source core/multimedia/config.in | 208 | source core/multimedia/config.in |
204 | source noncore/multimedia/config.in | 209 | source noncore/multimedia/config.in |
205 | endmenu | 210 | endmenu |
206 | 211 | ||
207 | menu "Input methods" | 212 | menu "Input methods" |
208 | source inputmethods/config.in | 213 | source inputmethods/config.in |
209 | endmenu | 214 | endmenu |
210 | 215 | ||
211 | menu "Pim" | 216 | menu "Pim" |
212 | source core/obex/config.in | 217 | source core/obex/config.in |
213 | source core/pim/config.in | 218 | source core/pim/config.in |
214 | comment "Today Plugins ---" | 219 | comment "Today Plugins ---" |
215 | source noncore/todayplugins/config.in | 220 | source noncore/todayplugins/config.in |
216 | source core/pim/today/plugins/config.in | 221 | source core/pim/today/plugins/config.in |
217 | endmenu | 222 | endmenu |
218 | 223 | ||
219 | menu "Settings" | 224 | menu "Settings" |
220 | source core/settings/config.in | 225 | source core/settings/config.in |
221 | source noncore/settings/config.in | 226 | source noncore/settings/config.in |
222 | source noncore/securityplugins/config.in | 227 | source noncore/securityplugins/config.in |
223 | endmenu | 228 | endmenu |
224 | 229 | ||
225 | menu "Theming" | 230 | menu "Theming" |
226 | comment "Decorations ---" | 231 | comment "Decorations ---" |
227 | source noncore/decorations/config.in | 232 | source noncore/decorations/config.in |
228 | comment "Styles ---" | 233 | comment "Styles ---" |
229 | source noncore/styles/config.in | 234 | source noncore/styles/config.in |
230 | endmenu | 235 | endmenu |
231 | 236 | ||
232 | menu "Tools" | 237 | menu "Tools" |
233 | source noncore/tools/config.in | 238 | source noncore/tools/config.in |
234 | endmenu | 239 | endmenu |
235 | 240 | ||
236 | menu "Development" | 241 | menu "Development" |
237 | source development/keyview/config.in | 242 | source development/keyview/config.in |
238 | #source development/debugviewer/config.in | 243 | #source development/debugviewer/config.in |
239 | endmenu | 244 | endmenu |
240 | 245 | ||
241 | menu "Examples" | 246 | menu "Examples" |
242 | config EXAMPLES | 247 | config EXAMPLES |
243 | boolean "Compile Example Application" | 248 | boolean "Compile Example Application" |
244 | source examples/config.in | 249 | source examples/config.in |
245 | endmenu | 250 | endmenu |
246 | 251 | ||
247 | comment "" | 252 | comment "" |
248 | 253 | ||
249 | menu "Unsupported / Unmaintained" | 254 | menu "Unsupported / Unmaintained" |
250 | source noncore/unsupported/config.in | 255 | source noncore/unsupported/config.in |
251 | endmenu | 256 | endmenu |
252 | 257 | ||
253 | comment "" | 258 | comment "" |
254 | depends on EXPERIMENTAL | 259 | depends on EXPERIMENTAL |
255 | menu "Experimental" | 260 | menu "Experimental" |
256 | depends on EXPERIMENTAL | 261 | depends on EXPERIMENTAL |
257 | source libslcompat/config.in | 262 | source libslcompat/config.in |
258 | source core/qws/config.in | 263 | source core/qws/config.in |
259 | endmenu | 264 | endmenu |
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 87a54bf..aa357ca 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -1,801 +1,781 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "startmenu.h" | 21 | #include "startmenu.h" |
22 | #include "taskbar.h" | 22 | #include "taskbar.h" |
23 | #include "serverinterface.h" | 23 | #include "serverinterface.h" |
24 | #include "launcherview.h" | 24 | #include "launcherview.h" |
25 | #include "launcher.h" | 25 | #include "launcher.h" |
26 | #include "server.h" | 26 | #include "server.h" |
27 | 27 | ||
28 | /* OPIE */ | 28 | /* OPIE */ |
29 | #include <opie2/odebug.h> | 29 | #include <opie2/odebug.h> |
30 | #include <qtopia/global.h> | 30 | #include <qtopia/global.h> |
31 | #ifdef Q_WS_QWS | 31 | #ifdef Q_WS_QWS |
32 | #include <qtopia/qcopenvelope_qws.h> | 32 | #include <qtopia/qcopenvelope_qws.h> |
33 | #endif | 33 | #endif |
34 | #include <qtopia/resource.h> | 34 | #include <qtopia/resource.h> |
35 | #include <qtopia/applnk.h> | 35 | #include <qtopia/applnk.h> |
36 | #include <qtopia/config.h> | 36 | #include <qtopia/config.h> |
37 | #include <qtopia/qpeapplication.h> | 37 | #include <qtopia/qpeapplication.h> |
38 | #include <qtopia/mimetype.h> | 38 | #include <qtopia/mimetype.h> |
39 | #include <qtopia/private/categories.h> | 39 | #include <qtopia/private/categories.h> |
40 | #define QTOPIA_INTERNAL_FSLP | 40 | #define QTOPIA_INTERNAL_FSLP |
41 | #include <qtopia/lnkproperties.h> | 41 | #include <qtopia/lnkproperties.h> |
42 | 42 | ||
43 | /* QT */ | 43 | /* QT */ |
44 | #include <qdir.h> | 44 | #include <qdir.h> |
45 | #ifdef Q_WS_QWS | 45 | #ifdef Q_WS_QWS |
46 | #include <qkeyboard_qws.h> | 46 | #include <qkeyboard_qws.h> |
47 | #include <qwindowsystem_qws.h> | 47 | #include <qwindowsystem_qws.h> |
48 | #endif | 48 | #endif |
49 | #include <qtimer.h> | 49 | #include <qtimer.h> |
50 | #include <qcombobox.h> | 50 | #include <qcombobox.h> |
51 | #include <qvbox.h> | 51 | #include <qvbox.h> |
52 | #include <qlayout.h> | 52 | #include <qlayout.h> |
53 | #include <qstyle.h> | 53 | #include <qstyle.h> |
54 | #include <qpushbutton.h> | 54 | #include <qpushbutton.h> |
55 | #include <qtabbar.h> | 55 | #include <qtabbar.h> |
56 | #include <qwidgetstack.h> | 56 | #include <qwidgetstack.h> |
57 | #include <qregexp.h> | 57 | #include <qregexp.h> |
58 | #include <qmessagebox.h> | 58 | #include <qmessagebox.h> |
59 | #include <qframe.h> | 59 | #include <qframe.h> |
60 | #include <qpainter.h> | 60 | #include <qpainter.h> |
61 | #include <qlabel.h> | 61 | #include <qlabel.h> |
62 | #include <qtextstream.h> | 62 | #include <qtextstream.h> |
63 | #include <qpopupmenu.h> | 63 | #include <qpopupmenu.h> |
64 | 64 | ||
65 | /* STD */ | 65 | /* STD */ |
66 | #include <stdlib.h> | 66 | #include <stdlib.h> |
67 | #include <assert.h> | 67 | #include <assert.h> |
68 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 68 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
69 | #include <unistd.h> | 69 | #include <unistd.h> |
70 | #include <stdio.h> | 70 | #include <stdio.h> |
71 | #include <sys/vfs.h> | 71 | #include <sys/vfs.h> |
72 | #include <mntent.h> | 72 | #include <mntent.h> |
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | 75 | ||
76 | static bool isVisibleWindow( int ); | 76 | static bool isVisibleWindow( int ); |
77 | //=========================================================================== | 77 | //=========================================================================== |
78 | 78 | ||
79 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : | 79 | LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : |
80 | QVBox( parent ), docview( 0 ) | 80 | QVBox( parent ), docview( 0 ) |
81 | { | 81 | { |
82 | docLoadingWidgetEnabled = false; | 82 | docLoadingWidgetEnabled = false; |
83 | docLoadingWidget = 0; | 83 | docLoadingWidget = 0; |
84 | docLoadingWidgetProgress = 0; | 84 | docLoadingWidgetProgress = 0; |
85 | launcher = parent; | 85 | launcher = parent; |
86 | categoryBar = new LauncherTabBar( this ); | 86 | categoryBar = new LauncherTabBar( this ); |
87 | QPalette pal = categoryBar->palette(); | 87 | QPalette pal = categoryBar->palette(); |
88 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 88 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
89 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 89 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
90 | categoryBar->setPalette( pal ); | 90 | categoryBar->setPalette( pal ); |
91 | stack = new QWidgetStack(this); | 91 | stack = new QWidgetStack(this); |
92 | connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) ); | 92 | connect( categoryBar, SIGNAL(selected(int)), this, SLOT(raiseTabWidget()) ); |
93 | categoryBar->show(); | 93 | categoryBar->show(); |
94 | stack->show(); | 94 | stack->show(); |
95 | 95 | ||
96 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 96 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
97 | QCopChannel *channel = new QCopChannel( "QPE/Launcher", this ); | 97 | QCopChannel *channel = new QCopChannel( "QPE/Launcher", this ); |
98 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 98 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
99 | this, SLOT(launcherMessage(const QCString&,const QByteArray&)) ); | 99 | this, SLOT(launcherMessage(const QCString&,const QByteArray&)) ); |
100 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), | 100 | connect( qApp, SIGNAL(appMessage(const QCString&,const QByteArray&)), |
101 | this, SLOT(appMessage(const QCString&,const QByteArray&))); | 101 | this, SLOT(appMessage(const QCString&,const QByteArray&))); |
102 | #endif | 102 | #endif |
103 | 103 | ||
104 | createDocLoadingWidget(); | 104 | createDocLoadingWidget(); |
105 | } | 105 | } |
106 | 106 | ||
107 | void LauncherTabWidget::createDocLoadingWidget() | 107 | void LauncherTabWidget::createDocLoadingWidget() |
108 | { | 108 | { |
109 | // Construct the 'doc loading widget' shown when finding documents | 109 | // Construct the 'doc loading widget' shown when finding documents |
110 | 110 | ||
111 | // ### LauncherView class needs changing to be more generic so | 111 | // ### LauncherView class needs changing to be more generic so |
112 | // this widget can change its background similar to the iconviews | 112 | // this widget can change its background similar to the iconviews |
113 | // so the background for this matches | 113 | // so the background for this matches |
114 | docLoadingWidget = new LauncherView( stack ); | 114 | docLoadingWidget = new LauncherView( stack ); |
115 | docLoadingWidget->hideIcons(); | 115 | docLoadingWidget->hideIcons(); |
116 | QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); | 116 | QVBox *docLoadingVBox = new QVBox( docLoadingWidget ); |
117 | 117 | ||
118 | docLoadingVBox->setSpacing( 20 ); | 118 | docLoadingVBox->setSpacing( 20 ); |
119 | docLoadingVBox->setMargin( 10 ); | 119 | docLoadingVBox->setMargin( 10 ); |
120 | 120 | ||
121 | QWidget *space1 = new QWidget( docLoadingVBox ); | 121 | QWidget *space1 = new QWidget( docLoadingVBox ); |
122 | docLoadingVBox->setStretchFactor( space1, 1 ); | 122 | docLoadingVBox->setStretchFactor( space1, 1 ); |
123 | 123 | ||
124 | QLabel *waitPixmap = new QLabel( docLoadingVBox ); | 124 | QLabel *waitPixmap = new QLabel( docLoadingVBox ); |
125 | waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); | 125 | waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); |
126 | waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); | 126 | waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); |
127 | waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); | 127 | waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); |
128 | 128 | ||
129 | Config cfg( "Launcher" ); | 129 | Config cfg( "Launcher" ); |
130 | cfg.setGroup( "DocTab" ); | 130 | cfg.setGroup( "DocTab" ); |
131 | bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); | 131 | bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); |
132 | 132 | ||
133 | QLabel *textLabel = new QLabel( docLoadingVBox ); | 133 | QLabel *textLabel = new QLabel( docLoadingVBox ); |
134 | textLabel->setAlignment( int( QLabel::AlignCenter ) ); | 134 | textLabel->setAlignment( int( QLabel::AlignCenter ) ); |
135 | docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); | 135 | docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); |
136 | docLoadingWidgetProgress->setProgress( 0 ); | 136 | docLoadingWidgetProgress->setProgress( 0 ); |
137 | docLoadingWidgetProgress->setCenterIndicator( TRUE ); | 137 | docLoadingWidgetProgress->setCenterIndicator( TRUE ); |
138 | docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker | 138 | docLoadingWidgetProgress->setBackgroundMode( NoBackground ); // No flicker |
139 | setProgressStyle(); | 139 | setProgressStyle(); |
140 | 140 | ||
141 | if ( docTabEnabled ) | 141 | if ( docTabEnabled ) |
142 | { | 142 | { |
143 | textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); | 143 | textLabel->setText( tr( "<b>Finding Documents...</b>" ) ); |
144 | } | 144 | } |
145 | else | 145 | else |
146 | { | 146 | { |
147 | textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" | 147 | textLabel->setText( tr( "<b>The Documents Tab<p>has been disabled.<p>" |
148 | "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); | 148 | "Use Settings->Launcher->DocTab<p>to reenable it.</b></center>" ) ); |
149 | docLoadingWidgetProgress->hide(); | 149 | docLoadingWidgetProgress->hide(); |
150 | docLoadingWidgetEnabled = true; | 150 | docLoadingWidgetEnabled = true; |
151 | } | 151 | } |
152 | 152 | ||
153 | QWidget *space2 = new QWidget( docLoadingVBox ); | 153 | QWidget *space2 = new QWidget( docLoadingVBox ); |
154 | docLoadingVBox->setStretchFactor( space2, 1 ); | 154 | docLoadingVBox->setStretchFactor( space2, 1 ); |
155 | 155 | ||
156 | cfg.setGroup( "Tab Documents" ); // No tr | 156 | cfg.setGroup( "Tab Documents" ); // No tr |
157 | setTabViewAppearance( docLoadingWidget, cfg ); | 157 | setTabViewAppearance( docLoadingWidget, cfg ); |
158 | 158 | ||
159 | stack->addWidget( docLoadingWidget, 0 ); | 159 | stack->addWidget( docLoadingWidget, 0 ); |
160 | } | 160 | } |
161 | 161 | ||
162 | void LauncherTabWidget::initLayout() | 162 | void LauncherTabWidget::initLayout() |
163 | { | 163 | { |
164 | layout()->activate(); | 164 | layout()->activate(); |
165 | docView()->setFocus(); | 165 | docView()->setFocus(); |
166 | categoryBar->showTab("Documents"); | 166 | categoryBar->showTab("Documents"); |
167 | } | 167 | } |
168 | 168 | ||
169 | void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&) | 169 | void LauncherTabWidget::appMessage(const QCString& message, const QByteArray&) |
170 | { | 170 | { |
171 | if ( message == "nextView()" ) | 171 | if ( message == "nextView()" ) |
172 | categoryBar->nextTab(); | 172 | categoryBar->nextTab(); |
173 | } | 173 | } |
174 | 174 | ||
175 | void LauncherTabWidget::raiseTabWidget() | 175 | void LauncherTabWidget::raiseTabWidget() |
176 | { | 176 | { |
177 | if ( categoryBar->currentView() == docView() | 177 | if ( categoryBar->currentView() == docView() |
178 | && docLoadingWidgetEnabled ) { | 178 | && docLoadingWidgetEnabled ) { |
179 | stack->raiseWidget( docLoadingWidget ); | 179 | stack->raiseWidget( docLoadingWidget ); |
180 | docLoadingWidget->updateGeometry(); | 180 | docLoadingWidget->updateGeometry(); |
181 | } else { | 181 | } else { |
182 | stack->raiseWidget( categoryBar->currentView() ); | 182 | stack->raiseWidget( categoryBar->currentView() ); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | 185 | ||
186 | void LauncherTabWidget::tabProperties() | 186 | void LauncherTabWidget::tabProperties() |
187 | { | 187 | { |
188 | LauncherView *view = categoryBar->currentView(); | 188 | LauncherView *view = categoryBar->currentView(); |
189 | QPopupMenu *m = new QPopupMenu( this ); | 189 | QPopupMenu *m = new QPopupMenu( this ); |
190 | m->insertItem( tr("Icon View"), LauncherView::Icon ); | 190 | m->insertItem( tr("Icon View"), LauncherView::Icon ); |
191 | m->insertItem( tr("List View"), LauncherView::List ); | 191 | m->insertItem( tr("List View"), LauncherView::List ); |
192 | m->setItemChecked( (int)view->viewMode(), TRUE ); | 192 | m->setItemChecked( (int)view->viewMode(), TRUE ); |
193 | int rv = m->exec( QCursor::pos() ); | 193 | int rv = m->exec( QCursor::pos() ); |
194 | if ( rv >= 0 && rv != view->viewMode() ) { | 194 | if ( rv >= 0 && rv != view->viewMode() ) { |
195 | view->setViewMode( (LauncherView::ViewMode)rv ); | 195 | view->setViewMode( (LauncherView::ViewMode)rv ); |
196 | } | 196 | } |
197 | 197 | ||
198 | delete m; | 198 | delete m; |
199 | } | 199 | } |
200 | 200 | ||
201 | void LauncherTabWidget::deleteView( const QString& id ) | 201 | void LauncherTabWidget::deleteView( const QString& id ) |
202 | { | 202 | { |
203 | LauncherTab *t = categoryBar->launcherTab(id); | 203 | LauncherTab *t = categoryBar->launcherTab(id); |
204 | if ( t ) { | 204 | if ( t ) { |
205 | stack->removeWidget( t->view ); | 205 | stack->removeWidget( t->view ); |
206 | delete t->view; | 206 | delete t->view; |
207 | categoryBar->removeTab( t ); | 207 | categoryBar->removeTab( t ); |
208 | } | 208 | } |
209 | } | 209 | } |
210 | 210 | ||
211 | LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) | 211 | LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm, const QString& label ) |
212 | { | 212 | { |
213 | LauncherView* view = new LauncherView( stack ); | 213 | LauncherView* view = new LauncherView( stack ); |
214 | connect( view, SIGNAL(clicked(const AppLnk*)), | 214 | connect( view, SIGNAL(clicked(const AppLnk*)), |
215 | this, SIGNAL(clicked(const AppLnk*))); | 215 | this, SIGNAL(clicked(const AppLnk*))); |
216 | connect( view, SIGNAL(rightPressed(AppLnk*)), | 216 | connect( view, SIGNAL(rightPressed(AppLnk*)), |
217 | this, SIGNAL(rightPressed(AppLnk*))); | 217 | this, SIGNAL(rightPressed(AppLnk*))); |
218 | 218 | ||
219 | int n = categoryBar->count(); | 219 | int n = categoryBar->count(); |
220 | stack->addWidget( view, n ); | 220 | stack->addWidget( view, n ); |
221 | 221 | ||
222 | LauncherTab *tab = new LauncherTab( id, view, pm, label ); | 222 | LauncherTab *tab = new LauncherTab( id, view, pm, label ); |
223 | categoryBar->insertTab( tab, n-1 ); | 223 | categoryBar->insertTab( tab, n-1 ); |
224 | 224 | ||
225 | if ( id == "Documents" ) | 225 | if ( id == "Documents" ) |
226 | docview = view; | 226 | docview = view; |
227 | 227 | ||
228 | odebug << "inserting " << id << " at " << n-1 << "" << oendl; | 228 | odebug << "inserting " << id << " at " << n-1 << "" << oendl; |
229 | 229 | ||
230 | Config cfg("Launcher"); | 230 | Config cfg("Launcher"); |
231 | setTabAppearance( tab, cfg ); | 231 | setTabAppearance( tab, cfg ); |
232 | 232 | ||
233 | cfg.setGroup( "GUI" ); | 233 | cfg.setGroup( "GUI" ); |
234 | view->setBusyIndicatorType( cfg.readEntry( "BusyType", QString::null ) ); | 234 | view->setBusyIndicatorType( cfg.readEntry( "BusyType", QString::null ) ); |
235 | 235 | ||
236 | return view; | 236 | return view; |
237 | } | 237 | } |
238 | 238 | ||
239 | LauncherView *LauncherTabWidget::view( const QString &id ) | 239 | LauncherView *LauncherTabWidget::view( const QString &id ) |
240 | { | 240 | { |
241 | LauncherTab *t = categoryBar->launcherTab(id); | 241 | LauncherTab *t = categoryBar->launcherTab(id); |
242 | if ( !t ) | 242 | if ( !t ) |
243 | return 0; | 243 | return 0; |
244 | return t->view; | 244 | return t->view; |
245 | } | 245 | } |
246 | 246 | ||
247 | LauncherView *LauncherTabWidget::docView() | 247 | LauncherView *LauncherTabWidget::docView() |
248 | { | 248 | { |
249 | return docview; | 249 | return docview; |
250 | } | 250 | } |
251 | 251 | ||
252 | void LauncherTabWidget::setLoadingWidgetEnabled( bool v ) | 252 | void LauncherTabWidget::setLoadingWidgetEnabled( bool v ) |
253 | { | 253 | { |
254 | if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { | 254 | if ( v != docLoadingWidgetEnabled && docLoadingWidget ) { |
255 | docLoadingWidgetEnabled = v; | 255 | docLoadingWidgetEnabled = v; |
256 | raiseTabWidget(); | 256 | raiseTabWidget(); |
257 | } | 257 | } |
258 | } | 258 | } |
259 | 259 | ||
260 | void LauncherTabWidget::setLoadingProgress( int percent ) | 260 | void LauncherTabWidget::setLoadingProgress( int percent ) |
261 | { | 261 | { |
262 | docLoadingWidgetProgress->setProgress( (percent / 4) * 4 ); | 262 | docLoadingWidgetProgress->setProgress( (percent / 4) * 4 ); |
263 | } | 263 | } |
264 | 264 | ||
265 | // ### this function could more to LauncherView | 265 | // ### this function could more to LauncherView |
266 | void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) | 266 | void LauncherTabWidget::setTabViewAppearance( LauncherView *v, Config &cfg ) |
267 | { | 267 | { |
268 | // View | 268 | // View |
269 | QString view = cfg.readEntry( "View", "Icon" ); | 269 | QString view = cfg.readEntry( "View", "Icon" ); |
270 | if ( view == "List" ) // No tr | 270 | if ( view == "List" ) // No tr |
271 | v->setViewMode( LauncherView::List ); | 271 | v->setViewMode( LauncherView::List ); |
272 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); | 272 | QString bgType = cfg.readEntry( "BackgroundType", "Image" ); |
273 | if ( bgType == "Image" ) { // No tr | 273 | if ( bgType == "Image" ) { // No tr |
274 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); | 274 | QString pm = cfg.readEntry( "BackgroundImage", "launcher/opie-background" ); |
275 | v->setBackgroundType( LauncherView::Image, pm ); | 275 | v->setBackgroundType( LauncherView::Image, pm ); |
276 | } else if ( bgType == "SolidColor" ) { | 276 | } else if ( bgType == "SolidColor" ) { |
277 | QString c = cfg.readEntry( "BackgroundColor" ); | 277 | QString c = cfg.readEntry( "BackgroundColor" ); |
278 | v->setBackgroundType( LauncherView::SolidColor, c ); | 278 | v->setBackgroundType( LauncherView::SolidColor, c ); |
279 | } else { | 279 | } else { |
280 | v->setBackgroundType( LauncherView::Ruled, QString::null ); | 280 | v->setBackgroundType( LauncherView::Ruled, QString::null ); |
281 | } | 281 | } |
282 | QString textCol = cfg.readEntry( "TextColor" ); | 282 | QString textCol = cfg.readEntry( "TextColor" ); |
283 | if ( textCol.isEmpty() ) | 283 | if ( textCol.isEmpty() ) |
284 | v->setTextColor( QColor() ); | 284 | v->setTextColor( QColor() ); |
285 | else | 285 | else |
286 | v->setTextColor( QColor(textCol) ); | 286 | v->setTextColor( QColor(textCol) ); |
287 | // bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); | 287 | // bool customFont = cfg.readBoolEntry( "CustomFont", FALSE ); |
288 | 288 | ||
289 | 289 | ||
290 | QStringList font = cfg.readListEntry( "Font", ',' ); | 290 | QStringList font = cfg.readListEntry( "Font", ',' ); |
291 | if ( font.count() == 4 ) | 291 | if ( font.count() == 4 ) |
292 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); | 292 | v->setViewFont( QFont(font[0], font[1].toInt(), font[2].toInt(), font[3].toInt()!=0) ); |
293 | 293 | ||
294 | // ### FIXME TabColor TabTextColor | 294 | // ### FIXME TabColor TabTextColor |
295 | 295 | ||
296 | } | 296 | } |
297 | 297 | ||
298 | // ### Could move to LauncherTab | 298 | // ### Could move to LauncherTab |
299 | void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg ) | 299 | void LauncherTabWidget::setTabAppearance( LauncherTab *tab, Config &cfg ) |
300 | { | 300 | { |
301 | cfg.setGroup( QString( "Tab %1" ).arg(tab->type) ); // No tr | 301 | cfg.setGroup( QString( "Tab %1" ).arg(tab->type) ); // No tr |
302 | 302 | ||
303 | setTabViewAppearance( tab->view, cfg ); | 303 | setTabViewAppearance( tab->view, cfg ); |
304 | 304 | ||
305 | // Tabs | 305 | // Tabs |
306 | QString tabCol = cfg.readEntry( "TabColor" ); | 306 | QString tabCol = cfg.readEntry( "TabColor" ); |
307 | if ( tabCol.isEmpty() ) | 307 | if ( tabCol.isEmpty() ) |
308 | tab->bgColor = QColor(); | 308 | tab->bgColor = QColor(); |
309 | else | 309 | else |
310 | tab->bgColor = QColor(tabCol); | 310 | tab->bgColor = QColor(tabCol); |
311 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); | 311 | QString tabTextCol = cfg.readEntry( "TabTextColor" ); |
312 | if ( tabTextCol.isEmpty() ) | 312 | if ( tabTextCol.isEmpty() ) |
313 | tab->fgColor = QColor(); | 313 | tab->fgColor = QColor(); |
314 | else | 314 | else |
315 | tab->fgColor = QColor(tabTextCol); | 315 | tab->fgColor = QColor(tabTextCol); |
316 | } | 316 | } |
317 | 317 | ||
318 | void LauncherTabWidget::paletteChange( const QPalette &p ) | 318 | void LauncherTabWidget::paletteChange( const QPalette &p ) |
319 | { | 319 | { |
320 | QVBox::paletteChange( p ); | 320 | QVBox::paletteChange( p ); |
321 | QPalette pal = palette(); | 321 | QPalette pal = palette(); |
322 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); | 322 | pal.setColor( QColorGroup::Light, pal.color(QPalette::Active,QColorGroup::Shadow) ); |
323 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); | 323 | pal.setColor( QColorGroup::Background, pal.active().background().light(110) ); |
324 | categoryBar->setPalette( pal ); | 324 | categoryBar->setPalette( pal ); |
325 | categoryBar->update(); | 325 | categoryBar->update(); |
326 | } | 326 | } |
327 | 327 | ||
328 | void LauncherTabWidget::styleChange( QStyle & ) | 328 | void LauncherTabWidget::styleChange( QStyle & ) |
329 | { | 329 | { |
330 | QTimer::singleShot( 0, this, SLOT(setProgressStyle()) ); | 330 | QTimer::singleShot( 0, this, SLOT(setProgressStyle()) ); |
331 | } | 331 | } |
332 | 332 | ||
333 | void LauncherTabWidget::setProgressStyle() | 333 | void LauncherTabWidget::setProgressStyle() |
334 | { | 334 | { |
335 | if (docLoadingWidgetProgress) { | 335 | if (docLoadingWidgetProgress) { |
336 | docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); | 336 | docLoadingWidgetProgress->setFrameShape( QProgressBar::Box ); |
337 | docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); | 337 | docLoadingWidgetProgress->setFrameShadow( QProgressBar::Plain ); |
338 | docLoadingWidgetProgress->setMargin( 1 ); | 338 | docLoadingWidgetProgress->setMargin( 1 ); |
339 | docLoadingWidgetProgress->setLineWidth( 1 ); | 339 | docLoadingWidgetProgress->setLineWidth( 1 ); |
340 | } | 340 | } |
341 | } | 341 | } |
342 | 342 | ||
343 | /* | 343 | /* |
344 | * FIXME | 344 | * FIXME |
345 | * The following NULL check is triggered by inserting, then removing a tab on the fly | 345 | * The following NULL check is triggered by inserting, then removing a tab on the fly |
346 | * as you would if you had removable media (which I do). Without this check | 346 | * as you would if you had removable media (which I do). Without this check |
347 | * the first app launched after a tab removal causes qpe to Segfault. | 347 | * the first app launched after a tab removal causes qpe to Segfault. |
348 | * This obviously has a more sinister cause, but this works around it with no | 348 | * This obviously has a more sinister cause, but this works around it with no |
349 | * obvious adverse effects. Please FIXME | 349 | * obvious adverse effects. Please FIXME |
350 | * bkc - 17/6/2004 | 350 | * bkc - 17/6/2004 |
351 | * | 351 | * |
352 | */ | 352 | */ |
353 | 353 | ||
354 | void LauncherTabWidget::setBusy(bool on) | 354 | void LauncherTabWidget::setBusy(bool on) |
355 | { | 355 | { |
356 | if ( on ) | 356 | if ( on ) |
357 | currentView()->setBusy(TRUE); | 357 | currentView()->setBusy(TRUE); |
358 | else { | 358 | else { |
359 | for ( int i = 0; i < categoryBar->count(); i++ ) { | 359 | for ( int i = 0; i < categoryBar->count(); i++ ) { |
360 | if (categoryBar->tab(i)) { | 360 | if (categoryBar->tab(i)) { |
361 | LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; | 361 | LauncherView *view = ((LauncherTab *)categoryBar->tab(i))->view; |
362 | view->setBusy( FALSE ); | 362 | view->setBusy( FALSE ); |
363 | } else { | 363 | } else { |
364 | odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl; | 364 | odebug << "Averting Disaster with tab " << i << " == NULL! " << oendl; |
365 | } | 365 | } |
366 | } | 366 | } |
367 | } | 367 | } |
368 | } | 368 | } |
369 | 369 | ||
370 | void LauncherTabWidget::setBusyIndicatorType( const QString& str ) { | 370 | void LauncherTabWidget::setBusyIndicatorType( const QString& str ) { |
371 | for (int i = 0; i < categoryBar->count(); i++ ) { | 371 | for (int i = 0; i < categoryBar->count(); i++ ) { |
372 | LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view; | 372 | LauncherView* view = static_cast<LauncherTab*>( categoryBar->tab(i) )->view; |
373 | view->setBusyIndicatorType( str ); | 373 | view->setBusyIndicatorType( str ); |
374 | } | 374 | } |
375 | } | 375 | } |
376 | 376 | ||
377 | LauncherView *LauncherTabWidget::currentView(void) | 377 | LauncherView *LauncherTabWidget::currentView(void) |
378 | { | 378 | { |
379 | return (LauncherView*)stack->visibleWidget(); | 379 | return (LauncherView*)stack->visibleWidget(); |
380 | } | 380 | } |
381 | 381 | ||
382 | 382 | ||
383 | 383 | ||
384 | void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &data) | 384 | void LauncherTabWidget::launcherMessage( const QCString &msg, const QByteArray &data) |
385 | { | 385 | { |
386 | QDataStream stream( data, IO_ReadOnly ); | 386 | QDataStream stream( data, IO_ReadOnly ); |
387 | if ( msg == "setTabView(QString,int)" ) { | 387 | if ( msg == "setTabView(QString,int)" ) { |
388 | QString id; | 388 | QString id; |
389 | stream >> id; | 389 | stream >> id; |
390 | int mode; | 390 | int mode; |
391 | stream >> mode; | 391 | stream >> mode; |
392 | if ( view(id) ) | 392 | if ( view(id) ) |
393 | view(id)->setViewMode( (LauncherView::ViewMode)mode ); | 393 | view(id)->setViewMode( (LauncherView::ViewMode)mode ); |
394 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { | 394 | } else if ( msg == "setTabBackground(QString,int,QString)" ) { |
395 | QString id; | 395 | QString id; |
396 | stream >> id; | 396 | stream >> id; |
397 | int mode; | 397 | int mode; |
398 | stream >> mode; | 398 | stream >> mode; |
399 | QString pixmapOrColor; | 399 | QString pixmapOrColor; |
400 | stream >> pixmapOrColor; | 400 | stream >> pixmapOrColor; |
401 | if ( view(id) ) | 401 | if ( view(id) ) |
402 | view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 402 | view(id)->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
403 | if ( id == "Documents" ) | 403 | if ( id == "Documents" ) |
404 | docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); | 404 | docLoadingWidget->setBackgroundType( (LauncherView::BackgroundType)mode, pixmapOrColor ); |
405 | } else if ( msg == "setTextColor(QString,QString)" ) { | 405 | } else if ( msg == "setTextColor(QString,QString)" ) { |
406 | QString id; | 406 | QString id; |
407 | stream >> id; | 407 | stream >> id; |
408 | QString color; | 408 | QString color; |
409 | stream >> color; | 409 | stream >> color; |
410 | if ( view(id) ) | 410 | if ( view(id) ) |
411 | view(id)->setTextColor( QColor(color) ); | 411 | view(id)->setTextColor( QColor(color) ); |
412 | if ( id == "Documents" ) | 412 | if ( id == "Documents" ) |
413 | docLoadingWidget->setTextColor( QColor(color) ); | 413 | docLoadingWidget->setTextColor( QColor(color) ); |
414 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { | 414 | } else if ( msg == "setFont(QString,QString,int,int,int)" ) { |
415 | QString id; | 415 | QString id; |
416 | stream >> id; | 416 | stream >> id; |
417 | QString fam; | 417 | QString fam; |
418 | stream >> fam; | 418 | stream >> fam; |
419 | int size; | 419 | int size; |
420 | stream >> size; | 420 | stream >> size; |
421 | int weight; | 421 | int weight; |
422 | stream >> weight; | 422 | stream >> weight; |
423 | int italic; | 423 | int italic; |
424 | stream >> italic; | 424 | stream >> italic; |
425 | if ( view(id) ) { | 425 | if ( view(id) ) { |
426 | if ( !fam.isEmpty() ) { | 426 | if ( !fam.isEmpty() ) { |
427 | view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); | 427 | view(id)->setViewFont( QFont(fam, size, weight, italic!=0) ); |
428 | odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl; | 428 | odebug << "setFont: " << fam << ", " << size << ", " << weight << ", " << italic << "" << oendl; |
429 | } else { | 429 | } else { |
430 | view(id)->clearViewFont(); | 430 | view(id)->clearViewFont(); |
431 | } | 431 | } |
432 | } | 432 | } |
433 | }else if ( msg == "setBusyIndicatorType(QString)" ) { | 433 | }else if ( msg == "setBusyIndicatorType(QString)" ) { |
434 | QString type; | 434 | QString type; |
435 | stream >> type; | 435 | stream >> type; |
436 | setBusyIndicatorType( type ); | 436 | setBusyIndicatorType( type ); |
437 | }else if ( msg == "home()" ) { | 437 | }else if ( msg == "home()" ) { |
438 | if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { | 438 | if ( isVisibleWindow( static_cast<QWidget*>(parent())->winId() ) ) { |
439 | if (categoryBar) | 439 | if (categoryBar) |
440 | categoryBar->nextTab(); | 440 | categoryBar->nextTab(); |
441 | }else | 441 | }else |
442 | static_cast<QWidget*>(parent())->raise(); | 442 | static_cast<QWidget*>(parent())->raise(); |
443 | } | 443 | } |
444 | } | 444 | } |
445 | 445 | ||
446 | 446 | ||
447 | 447 | ||
448 | //--------------------------------------------------------------------------- | 448 | //--------------------------------------------------------------------------- |
449 | 449 | ||
450 | Launcher::Launcher() | 450 | Launcher::Launcher() |
451 | : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader ) | 451 | : QMainWindow( 0, "PDA User Interface", QWidget::WStyle_Customize | QWidget::WGroupLeader ) |
452 | { | 452 | { |
453 | tabs = 0; | 453 | tabs = 0; |
454 | tb = 0; | 454 | tb = 0; |
455 | Config cfg( "Launcher" ); | 455 | Config cfg( "Launcher" ); |
456 | cfg.setGroup( "DocTab" ); | 456 | cfg.setGroup( "DocTab" ); |
457 | docTabEnabled = cfg.readBoolEntry( "Enable", true ); | 457 | docTabEnabled = cfg.readBoolEntry( "Enable", true ); |
458 | } | 458 | } |
459 | 459 | ||
460 | void Launcher::createGUI() | 460 | void Launcher::createGUI() |
461 | { | 461 | { |
462 | setCaption( tr("Launcher") ); | 462 | setCaption( tr("Launcher") ); |
463 | 463 | ||
464 | // we have a pretty good idea how big we'll be | 464 | // we have a pretty good idea how big we'll be |
465 | setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); | 465 | setGeometry( 0, 0, qApp->desktop()->width(), qApp->desktop()->height() ); |
466 | 466 | ||
467 | tb = new TaskBar; | 467 | tb = new TaskBar; |
468 | tabs = new LauncherTabWidget( this ); | 468 | tabs = new LauncherTabWidget( this ); |
469 | setCentralWidget( tabs ); | 469 | setCentralWidget( tabs ); |
470 | 470 | ||
471 | ServerInterface::dockWidget( tb, ServerInterface::Bottom ); | 471 | ServerInterface::dockWidget( tb, ServerInterface::Bottom ); |
472 | tb->show(); | 472 | tb->show(); |
473 | 473 | ||
474 | qApp->installEventFilter( this ); | 474 | qApp->installEventFilter( this ); |
475 | 475 | ||
476 | |||
477 | connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); | ||
478 | connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); | ||
479 | connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); | ||
480 | |||
481 | connect( tb, SIGNAL(tabSelected(const QString&)), | 476 | connect( tb, SIGNAL(tabSelected(const QString&)), |
482 | this, SLOT(showTab(const QString&)) ); | 477 | this, SLOT(showTab(const QString&)) ); |
483 | connect( tabs, SIGNAL(selected(const QString&)), | 478 | connect( tabs, SIGNAL(selected(const QString&)), |
484 | this, SLOT(viewSelected(const QString&)) ); | 479 | this, SLOT(viewSelected(const QString&)) ); |
485 | connect( tabs, SIGNAL(clicked(const AppLnk*)), | 480 | connect( tabs, SIGNAL(clicked(const AppLnk*)), |
486 | this, SLOT(select(const AppLnk*))); | 481 | this, SLOT(select(const AppLnk*))); |
487 | connect( tabs, SIGNAL(rightPressed(AppLnk*)), | 482 | connect( tabs, SIGNAL(rightPressed(AppLnk*)), |
488 | this, SLOT(properties(AppLnk*))); | 483 | this, SLOT(properties(AppLnk*))); |
489 | 484 | ||
490 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 485 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
491 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); | 486 | QCopChannel* sysChannel = new QCopChannel( "QPE/System", this ); |
492 | connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), | 487 | connect( sysChannel, SIGNAL(received(const QCString&,const QByteArray&)), |
493 | this, SLOT(systemMessage(const QCString&,const QByteArray&)) ); | 488 | this, SLOT(systemMessage(const QCString&,const QByteArray&)) ); |
494 | #endif | 489 | #endif |
495 | 490 | ||
496 | // all documents | 491 | // all documents |
497 | QImage img( Resource::loadImage( "DocsIcon" ) ); | 492 | QImage img( Resource::loadImage( "DocsIcon" ) ); |
498 | QPixmap pm; | 493 | QPixmap pm; |
499 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | 494 | pm = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); |
500 | // It could add this itself if it handles docs | 495 | // It could add this itself if it handles docs |
501 | 496 | ||
502 | tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); | 497 | tabs->newView("Documents", pm, tr("Documents") )->setToolsEnabled( TRUE ); |
503 | 498 | ||
504 | QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); | 499 | QTimer::singleShot( 0, tabs, SLOT( initLayout() ) ); |
505 | qApp->setMainWidget( this ); | 500 | qApp->setMainWidget( this ); |
506 | QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); | 501 | QTimer::singleShot( 500, this, SLOT( makeVisible() ) ); |
507 | } | 502 | } |
508 | 503 | ||
509 | Launcher::~Launcher() | 504 | Launcher::~Launcher() |
510 | { | 505 | { |
511 | if ( tb ) | 506 | if ( tb ) |
512 | destroyGUI(); | 507 | destroyGUI(); |
513 | } | 508 | } |
514 | 509 | ||
515 | bool Launcher::requiresDocuments() const | 510 | bool Launcher::requiresDocuments() const |
516 | { | 511 | { |
517 | Config cfg( "Launcher" ); | 512 | Config cfg( "Launcher" ); |
518 | cfg.setGroup( "DocTab" ); | 513 | cfg.setGroup( "DocTab" ); |
519 | return cfg.readBoolEntry( "Enable", true ); | 514 | return cfg.readBoolEntry( "Enable", true ); |
520 | } | 515 | } |
521 | 516 | ||
522 | void Launcher::makeVisible() | 517 | void Launcher::makeVisible() |
523 | { | 518 | { |
524 | showMaximized(); | 519 | showMaximized(); |
525 | } | 520 | } |
526 | 521 | ||
527 | void Launcher::destroyGUI() | 522 | void Launcher::destroyGUI() |
528 | { | 523 | { |
529 | delete tb; | 524 | delete tb; |
530 | tb = 0; | 525 | tb = 0; |
531 | delete tabs; | 526 | delete tabs; |
532 | tabs =0; | 527 | tabs =0; |
533 | } | 528 | } |
534 | 529 | ||
535 | bool Launcher::eventFilter( QObject*, QEvent *ev ) | 530 | bool Launcher::eventFilter( QObject*, QEvent *ev ) |
536 | { | 531 | { |
537 | #ifdef QT_QWS_CUSTOM | 532 | #ifdef QT_QWS_CUSTOM |
538 | if ( ev->type() == QEvent::KeyPress ) { | 533 | if ( ev->type() == QEvent::KeyPress ) { |
539 | QKeyEvent *ke = (QKeyEvent *)ev; | 534 | QKeyEvent *ke = (QKeyEvent *)ev; |
540 | if ( ke->key() == Qt::Key_F11 ) { // menu key | 535 | if ( ke->key() == Qt::Key_F11 ) { // menu key |
541 | QWidget *active = qApp->activeWindow(); | 536 | QWidget *active = qApp->activeWindow(); |
542 | if ( active && active->isPopup() ) | 537 | if ( active && active->isPopup() ) |
543 | active->close(); | 538 | active->close(); |
544 | else { | 539 | else { |
545 | Global::terminateBuiltin("calibrate"); // No tr | 540 | Global::terminateBuiltin("calibrate"); // No tr |
546 | tb->launchStartMenu(); | 541 | tb->launchStartMenu(); |
547 | } | 542 | } |
548 | return TRUE; | 543 | return TRUE; |
549 | } | 544 | } |
550 | } | 545 | } |
551 | #else | 546 | #else |
552 | Q_UNUSED(ev); | 547 | Q_UNUSED(ev); |
553 | #endif | 548 | #endif |
554 | return FALSE; | 549 | return FALSE; |
555 | } | 550 | } |
556 | 551 | ||
557 | void Launcher::toggleSymbolInput() | ||
558 | { | ||
559 | tb->toggleSymbolInput(); | ||
560 | } | ||
561 | |||
562 | void Launcher::toggleNumLockState() | ||
563 | { | ||
564 | tb->toggleNumLockState(); | ||
565 | } | ||
566 | |||
567 | void Launcher::toggleCapsLockState() | ||
568 | { | ||
569 | tb->toggleCapsLockState(); | ||
570 | } | ||
571 | |||
572 | static bool isVisibleWindow(int wid) | 552 | static bool isVisibleWindow(int wid) |
573 | { | 553 | { |
574 | #ifdef Q_WS_QWS | 554 | #ifdef Q_WS_QWS |
575 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | 555 | const QList<QWSWindow> &list = qwsServer->clientWindows(); |
576 | QWSWindow* w; | 556 | QWSWindow* w; |
577 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | 557 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { |
578 | if ( w->winId() == wid ) | 558 | if ( w->winId() == wid ) |
579 | return !w->isFullyObscured(); | 559 | return !w->isFullyObscured(); |
580 | } | 560 | } |
581 | #endif | 561 | #endif |
582 | return FALSE; | 562 | return FALSE; |
583 | } | 563 | } |
584 | 564 | ||
585 | void Launcher::viewSelected(const QString& s) | 565 | void Launcher::viewSelected(const QString& s) |
586 | { | 566 | { |
587 | setCaption( s + tr(" - Launcher") ); | 567 | setCaption( s + tr(" - Launcher") ); |
588 | } | 568 | } |
589 | 569 | ||
590 | void Launcher::showTab(const QString& id) | 570 | void Launcher::showTab(const QString& id) |
591 | { | 571 | { |
592 | tabs->categoryBar->showTab(id); | 572 | tabs->categoryBar->showTab(id); |
593 | raise(); | 573 | raise(); |
594 | } | 574 | } |
595 | 575 | ||
596 | void Launcher::select( const AppLnk *appLnk ) | 576 | void Launcher::select( const AppLnk *appLnk ) |
597 | { | 577 | { |
598 | if ( appLnk->type() == "Folder" ) { // No tr | 578 | if ( appLnk->type() == "Folder" ) { // No tr |
599 | // Not supported: flat is simpler for the user | 579 | // Not supported: flat is simpler for the user |
600 | } else { | 580 | } else { |
601 | if ( appLnk->exec().isNull() ) { | 581 | if ( appLnk->exec().isNull() ) { |
602 | int i = QMessageBox::information(this,tr("No application"), | 582 | int i = QMessageBox::information(this,tr("No application"), |
603 | tr("<p>No application is defined for this document." | 583 | tr("<p>No application is defined for this document." |
604 | "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); | 584 | "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); |
605 | 585 | ||
606 | /* ### Fixme */ | 586 | /* ### Fixme */ |
607 | if ( i == 1 ) | 587 | if ( i == 1 ) |
608 | Global::execute("textedit",appLnk->file()); | 588 | Global::execute("textedit",appLnk->file()); |
609 | 589 | ||
610 | return; | 590 | return; |
611 | } | 591 | } |
612 | tabs->setBusy(TRUE); | 592 | tabs->setBusy(TRUE); |
613 | emit executing( appLnk ); | 593 | emit executing( appLnk ); |
614 | appLnk->execute(); | 594 | appLnk->execute(); |
615 | } | 595 | } |
616 | } | 596 | } |
617 | 597 | ||
618 | void Launcher::properties( AppLnk *appLnk ) | 598 | void Launcher::properties( AppLnk *appLnk ) |
619 | { | 599 | { |
620 | if ( appLnk->type() == "Folder" ) { // No tr | 600 | if ( appLnk->type() == "Folder" ) { // No tr |
621 | // Not supported: flat is simpler for the user | 601 | // Not supported: flat is simpler for the user |
622 | } else { | 602 | } else { |
623 | /* ### libqtopia FIXME also moving docLnks... */ | 603 | /* ### libqtopia FIXME also moving docLnks... */ |
624 | LnkProperties prop(appLnk,0 ); | 604 | LnkProperties prop(appLnk,0 ); |
625 | 605 | ||
626 | QPEApplication::execDialog( &prop ); | 606 | QPEApplication::execDialog( &prop ); |
627 | } | 607 | } |
628 | } | 608 | } |
629 | 609 | ||
630 | void Launcher::storageChanged( const QList<FileSystem> &fs ) | 610 | void Launcher::storageChanged( const QList<FileSystem> &fs ) |
631 | { | 611 | { |
632 | // ### update combo boxes if we had a combo box for the storage type | 612 | // ### update combo boxes if we had a combo box for the storage type |
633 | } | 613 | } |
634 | 614 | ||
635 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | 615 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) |
636 | { | 616 | { |
637 | QDataStream stream( data, IO_ReadOnly ); | 617 | QDataStream stream( data, IO_ReadOnly ); |
638 | if ( msg == "busy()" ) { | 618 | if ( msg == "busy()" ) { |
639 | tb->startWait(); | 619 | tb->startWait(); |
640 | } else if ( msg == "notBusy(QString)" ) { | 620 | } else if ( msg == "notBusy(QString)" ) { |
641 | QString app; | 621 | QString app; |
642 | stream >> app; | 622 | stream >> app; |
643 | tabs->setBusy(FALSE); | 623 | tabs->setBusy(FALSE); |
644 | tb->stopWait(app); | 624 | tb->stopWait(app); |
645 | } else if (msg == "applyStyle()") { | 625 | } else if (msg == "applyStyle()") { |
646 | tabs->currentView()->relayout(); | 626 | tabs->currentView()->relayout(); |
647 | } | 627 | } |
648 | } | 628 | } |
649 | 629 | ||
650 | // These are the update functions from the server | 630 | // These are the update functions from the server |
651 | void Launcher::typeAdded( const QString& type, const QString& name, | 631 | void Launcher::typeAdded( const QString& type, const QString& name, |
652 | const QPixmap& pixmap, const QPixmap& ) | 632 | const QPixmap& pixmap, const QPixmap& ) |
653 | { | 633 | { |
654 | tabs->newView( type, pixmap, name ); | 634 | tabs->newView( type, pixmap, name ); |
655 | ids.append( type ); | 635 | ids.append( type ); |
656 | /* this will be called in applicationScanningProgress with value 100! */ | 636 | /* this will be called in applicationScanningProgress with value 100! */ |
657 | // tb->refreshStartMenu(); | 637 | // tb->refreshStartMenu(); |
658 | 638 | ||
659 | static bool first = TRUE; | 639 | static bool first = TRUE; |
660 | if ( first ) { | 640 | if ( first ) { |
661 | first = FALSE; | 641 | first = FALSE; |
662 | tabs->categoryBar->showTab(type); | 642 | tabs->categoryBar->showTab(type); |
663 | } | 643 | } |
664 | 644 | ||
665 | tabs->view( type )->setUpdatesEnabled( FALSE ); | 645 | tabs->view( type )->setUpdatesEnabled( FALSE ); |
666 | tabs->view( type )->setSortEnabled( FALSE ); | 646 | tabs->view( type )->setSortEnabled( FALSE ); |
667 | } | 647 | } |
668 | 648 | ||
669 | void Launcher::typeRemoved( const QString& type ) | 649 | void Launcher::typeRemoved( const QString& type ) |
670 | { | 650 | { |
671 | tabs->view( type )->removeAllItems(); | 651 | tabs->view( type )->removeAllItems(); |
672 | tabs->deleteView( type ); | 652 | tabs->deleteView( type ); |
673 | ids.remove( type ); | 653 | ids.remove( type ); |
674 | /* this will be called in applicationScanningProgress with value 100! */ | 654 | /* this will be called in applicationScanningProgress with value 100! */ |
675 | // tb->refreshStartMenu(); | 655 | // tb->refreshStartMenu(); |
676 | } | 656 | } |
677 | 657 | ||
678 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) | 658 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) |
679 | { | 659 | { |
680 | if ( app.type() == "Separator" ) // No tr | 660 | if ( app.type() == "Separator" ) // No tr |
681 | return; | 661 | return; |
682 | 662 | ||
683 | LauncherView *view = tabs->view( type ); | 663 | LauncherView *view = tabs->view( type ); |
684 | if ( view ) | 664 | if ( view ) |
685 | view->addItem( new AppLnk( app ), FALSE ); | 665 | view->addItem( new AppLnk( app ), FALSE ); |
686 | else | 666 | else |
687 | owarn << "addAppLnk: No view for type " << type.latin1() << ". Can't add app " | 667 | owarn << "addAppLnk: No view for type " << type.latin1() << ". Can't add app " |
688 | << app.name().latin1() << "!", | 668 | << app.name().latin1() << "!", |
689 | 669 | ||
690 | MimeType::registerApp( app ); | 670 | MimeType::registerApp( app ); |
691 | } | 671 | } |
692 | 672 | ||
693 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) | 673 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) |
694 | { | 674 | { |
695 | LauncherView *view = tabs->view( type ); | 675 | LauncherView *view = tabs->view( type ); |
696 | if ( view ) | 676 | if ( view ) |
697 | view->removeLink( app.linkFile() ); | 677 | view->removeLink( app.linkFile() ); |
698 | else | 678 | else |
699 | owarn << "removeAppLnk: No view for " << type << "!" << oendl; | 679 | owarn << "removeAppLnk: No view for " << type << "!" << oendl; |
700 | } | 680 | } |
701 | 681 | ||
702 | void Launcher::allApplicationsRemoved() | 682 | void Launcher::allApplicationsRemoved() |
703 | { | 683 | { |
704 | MimeType::clear(); | 684 | MimeType::clear(); |
705 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) | 685 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) |
706 | tabs->view( (*it) )->removeAllItems(); | 686 | tabs->view( (*it) )->removeAllItems(); |
707 | } | 687 | } |
708 | 688 | ||
709 | void Launcher::documentAdded( const DocLnk& doc ) | 689 | void Launcher::documentAdded( const DocLnk& doc ) |
710 | { | 690 | { |
711 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); | 691 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); |
712 | } | 692 | } |
713 | 693 | ||
714 | void Launcher::aboutToAddBegin() | 694 | void Launcher::aboutToAddBegin() |
715 | { | 695 | { |
716 | tabs->docView()->setUpdatesEnabled( false ); | 696 | tabs->docView()->setUpdatesEnabled( false ); |
717 | } | 697 | } |
718 | 698 | ||
719 | void Launcher::aboutToAddEnd() | 699 | void Launcher::aboutToAddEnd() |
720 | { | 700 | { |
721 | tabs->docView()->setUpdatesEnabled( true ); | 701 | tabs->docView()->setUpdatesEnabled( true ); |
722 | } | 702 | } |
723 | 703 | ||
724 | void Launcher::showLoadingDocs() | 704 | void Launcher::showLoadingDocs() |
725 | { | 705 | { |
726 | tabs->docView()->hide(); | 706 | tabs->docView()->hide(); |
727 | } | 707 | } |
728 | 708 | ||
729 | void Launcher::showDocTab() | 709 | void Launcher::showDocTab() |
730 | { | 710 | { |
731 | if ( tabs->categoryBar->currentView() == tabs->docView() ) | 711 | if ( tabs->categoryBar->currentView() == tabs->docView() ) |
732 | tabs->docView()->show(); | 712 | tabs->docView()->show(); |
733 | } | 713 | } |
734 | 714 | ||
735 | void Launcher::documentRemoved( const DocLnk& doc ) | 715 | void Launcher::documentRemoved( const DocLnk& doc ) |
736 | { | 716 | { |
737 | tabs->docView()->removeLink( doc.linkFile() ); | 717 | tabs->docView()->removeLink( doc.linkFile() ); |
738 | } | 718 | } |
739 | 719 | ||
740 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) | 720 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) |
741 | { | 721 | { |
742 | documentRemoved( oldDoc ); | 722 | documentRemoved( oldDoc ); |
743 | documentAdded( newDoc ); | 723 | documentAdded( newDoc ); |
744 | } | 724 | } |
745 | 725 | ||
746 | void Launcher::allDocumentsRemoved() | 726 | void Launcher::allDocumentsRemoved() |
747 | { | 727 | { |
748 | tabs->docView()->removeAllItems(); | 728 | tabs->docView()->removeAllItems(); |
749 | } | 729 | } |
750 | 730 | ||
751 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) | 731 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) |
752 | { | 732 | { |
753 | tb->setApplicationState( name, state ); | 733 | tb->setApplicationState( name, state ); |
754 | } | 734 | } |
755 | 735 | ||
756 | void Launcher::applicationScanningProgress( int percent ) | 736 | void Launcher::applicationScanningProgress( int percent ) |
757 | { | 737 | { |
758 | switch ( percent ) { | 738 | switch ( percent ) { |
759 | case 0: { | 739 | case 0: { |
760 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 740 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
761 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); | 741 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); |
762 | tabs->view( (*it) )->setSortEnabled( FALSE ); | 742 | tabs->view( (*it) )->setSortEnabled( FALSE ); |
763 | } | 743 | } |
764 | break; | 744 | break; |
765 | } | 745 | } |
766 | case 100: { | 746 | case 100: { |
767 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 747 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
768 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); | 748 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); |
769 | tabs->view( (*it) )->setSortEnabled( TRUE ); | 749 | tabs->view( (*it) )->setSortEnabled( TRUE ); |
770 | } | 750 | } |
771 | tb->refreshStartMenu(); | 751 | tb->refreshStartMenu(); |
772 | break; | 752 | break; |
773 | } | 753 | } |
774 | default: | 754 | default: |
775 | break; | 755 | break; |
776 | } | 756 | } |
777 | } | 757 | } |
778 | 758 | ||
779 | void Launcher::documentScanningProgress( int percent ) | 759 | void Launcher::documentScanningProgress( int percent ) |
780 | { | 760 | { |
781 | switch ( percent ) { | 761 | switch ( percent ) { |
782 | case 0: { | 762 | case 0: { |
783 | tabs->setLoadingProgress( 0 ); | 763 | tabs->setLoadingProgress( 0 ); |
784 | tabs->setLoadingWidgetEnabled( TRUE ); | 764 | tabs->setLoadingWidgetEnabled( TRUE ); |
785 | tabs->docView()->setUpdatesEnabled( FALSE ); | 765 | tabs->docView()->setUpdatesEnabled( FALSE ); |
786 | tabs->docView()->setSortEnabled( FALSE ); | 766 | tabs->docView()->setSortEnabled( FALSE ); |
787 | break; | 767 | break; |
788 | } | 768 | } |
789 | case 100: { | 769 | case 100: { |
790 | tabs->docView()->updateTools(); | 770 | tabs->docView()->updateTools(); |
791 | tabs->docView()->setSortEnabled( TRUE ); | 771 | tabs->docView()->setSortEnabled( TRUE ); |
792 | tabs->docView()->setUpdatesEnabled( TRUE ); | 772 | tabs->docView()->setUpdatesEnabled( TRUE ); |
793 | tabs->setLoadingWidgetEnabled( FALSE ); | 773 | tabs->setLoadingWidgetEnabled( FALSE ); |
794 | break; | 774 | break; |
795 | } | 775 | } |
796 | default: | 776 | default: |
797 | tabs->setLoadingProgress( percent ); | 777 | tabs->setLoadingProgress( percent ); |
798 | break; | 778 | break; |
799 | } | 779 | } |
800 | } | 780 | } |
801 | 781 | ||
diff --git a/core/launcher/launcher.h b/core/launcher/launcher.h index 29bd7db..2eaf77c 100644 --- a/core/launcher/launcher.h +++ b/core/launcher/launcher.h | |||
@@ -1,159 +1,156 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef LAUNCHER_H | 20 | #ifndef LAUNCHER_H |
21 | #define LAUNCHER_H | 21 | #define LAUNCHER_H |
22 | 22 | ||
23 | #include <qtopia/config.h> | 23 | #include <qtopia/config.h> |
24 | #include <qtopia/storage.h> | 24 | #include <qtopia/storage.h> |
25 | #include <qtopia/applnk.h> | 25 | #include <qtopia/applnk.h> |
26 | #include <qmainwindow.h> | 26 | #include <qmainwindow.h> |
27 | #include <qstringlist.h> | 27 | #include <qstringlist.h> |
28 | #include <qprogressbar.h> | 28 | #include <qprogressbar.h> |
29 | #include <qvbox.h> | 29 | #include <qvbox.h> |
30 | #include <qlist.h> | 30 | #include <qlist.h> |
31 | #include <qdict.h> | 31 | #include <qdict.h> |
32 | #include "launcherview.h" | 32 | #include "launcherview.h" |
33 | #include "launchertab.h" | 33 | #include "launchertab.h" |
34 | #include "serverinterface.h" | 34 | #include "serverinterface.h" |
35 | 35 | ||
36 | class QWidgetStack; | 36 | class QWidgetStack; |
37 | class TaskBar; | 37 | class TaskBar; |
38 | class Launcher; | 38 | class Launcher; |
39 | 39 | ||
40 | class LauncherTabWidget : public QVBox { | 40 | class LauncherTabWidget : public QVBox { |
41 | // can't use a QTabWidget, since it won't let us set the frame style. | 41 | // can't use a QTabWidget, since it won't let us set the frame style. |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | public: | 43 | public: |
44 | LauncherTabWidget( Launcher* parent ); | 44 | LauncherTabWidget( Launcher* parent ); |
45 | 45 | ||
46 | void updateDocs(AppLnkSet* docFolder); | 46 | void updateDocs(AppLnkSet* docFolder); |
47 | void setBusy(bool on); | 47 | void setBusy(bool on); |
48 | LauncherView *currentView(void); | 48 | LauncherView *currentView(void); |
49 | 49 | ||
50 | LauncherView* newView( const QString&, const QPixmap& pm, const QString& label ); | 50 | LauncherView* newView( const QString&, const QPixmap& pm, const QString& label ); |
51 | void deleteView( const QString& ); | 51 | void deleteView( const QString& ); |
52 | void setTabViewAppearance( LauncherView *v, Config &cfg ); | 52 | void setTabViewAppearance( LauncherView *v, Config &cfg ); |
53 | void setTabAppearance( LauncherTab *, Config &cfg ); | 53 | void setTabAppearance( LauncherTab *, Config &cfg ); |
54 | 54 | ||
55 | LauncherView *view( const QString & ); | 55 | LauncherView *view( const QString & ); |
56 | LauncherView *docView(); | 56 | LauncherView *docView(); |
57 | 57 | ||
58 | void createDocLoadingWidget(); | 58 | void createDocLoadingWidget(); |
59 | void setLoadingWidgetEnabled( bool v ); | 59 | void setLoadingWidgetEnabled( bool v ); |
60 | void setLoadingProgress( int percent ); | 60 | void setLoadingProgress( int percent ); |
61 | 61 | ||
62 | LauncherTabBar* categoryBar; | 62 | LauncherTabBar* categoryBar; |
63 | 63 | ||
64 | void setBusyIndicatorType( const QString& type ); | 64 | void setBusyIndicatorType( const QString& type ); |
65 | 65 | ||
66 | signals: | 66 | signals: |
67 | void selected(const QString&); | 67 | void selected(const QString&); |
68 | void clicked(const AppLnk*); | 68 | void clicked(const AppLnk*); |
69 | void rightPressed(AppLnk*); | 69 | void rightPressed(AppLnk*); |
70 | 70 | ||
71 | protected slots: | 71 | protected slots: |
72 | void raiseTabWidget(); | 72 | void raiseTabWidget(); |
73 | void tabProperties(); | 73 | void tabProperties(); |
74 | void initLayout(); | 74 | void initLayout(); |
75 | 75 | ||
76 | private slots: | 76 | private slots: |
77 | void launcherMessage( const QCString &, const QByteArray &); | 77 | void launcherMessage( const QCString &, const QByteArray &); |
78 | void appMessage( const QCString &, const QByteArray &); | 78 | void appMessage( const QCString &, const QByteArray &); |
79 | void setProgressStyle(); | 79 | void setProgressStyle(); |
80 | 80 | ||
81 | protected: | 81 | protected: |
82 | void paletteChange( const QPalette &p ); | 82 | void paletteChange( const QPalette &p ); |
83 | void styleChange( QStyle & ); | 83 | void styleChange( QStyle & ); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | Launcher *launcher; | 86 | Launcher *launcher; |
87 | LauncherView *docview; | 87 | LauncherView *docview; |
88 | 88 | ||
89 | QWidgetStack *stack; | 89 | QWidgetStack *stack; |
90 | LauncherView *docLoadingWidget; | 90 | LauncherView *docLoadingWidget; |
91 | QProgressBar *docLoadingWidgetProgress; | 91 | QProgressBar *docLoadingWidgetProgress; |
92 | bool docLoadingWidgetEnabled; | 92 | bool docLoadingWidgetEnabled; |
93 | }; | 93 | }; |
94 | 94 | ||
95 | class Launcher : public QMainWindow, public ServerInterface | 95 | class Launcher : public QMainWindow, public ServerInterface |
96 | { | 96 | { |
97 | Q_OBJECT | 97 | Q_OBJECT |
98 | public: | 98 | public: |
99 | Launcher(); | 99 | Launcher(); |
100 | ~Launcher(); | 100 | ~Launcher(); |
101 | 101 | ||
102 | // implementing ServerInterface | 102 | // implementing ServerInterface |
103 | void createGUI(); | 103 | void createGUI(); |
104 | void destroyGUI(); | 104 | void destroyGUI(); |
105 | void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ); | 105 | void typeAdded( const QString& type, const QString& name, const QPixmap& pixmap, const QPixmap& bgPixmap ); |
106 | void typeRemoved( const QString& type ); | 106 | void typeRemoved( const QString& type ); |
107 | void applicationAdded( const QString& type, const AppLnk& doc ); | 107 | void applicationAdded( const QString& type, const AppLnk& doc ); |
108 | void applicationRemoved( const QString& type, const AppLnk& doc ); | 108 | void applicationRemoved( const QString& type, const AppLnk& doc ); |
109 | void allApplicationsRemoved(); | 109 | void allApplicationsRemoved(); |
110 | void applicationStateChanged( const QString& name, ApplicationState state ); | 110 | void applicationStateChanged( const QString& name, ApplicationState state ); |
111 | void documentAdded( const DocLnk& doc ); | 111 | void documentAdded( const DocLnk& doc ); |
112 | void documentRemoved( const DocLnk& doc ); | 112 | void documentRemoved( const DocLnk& doc ); |
113 | void aboutToAddBegin(); | 113 | void aboutToAddBegin(); |
114 | void aboutToAddEnd(); | 114 | void aboutToAddEnd(); |
115 | void allDocumentsRemoved(); | 115 | void allDocumentsRemoved(); |
116 | void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ); | 116 | void documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ); |
117 | void storageChanged( const QList<FileSystem> & ); | 117 | void storageChanged( const QList<FileSystem> & ); |
118 | void applicationScanningProgress( int percent ); | 118 | void applicationScanningProgress( int percent ); |
119 | void documentScanningProgress( int percent ); | 119 | void documentScanningProgress( int percent ); |
120 | bool requiresApplications() const { return TRUE; } | 120 | bool requiresApplications() const { return TRUE; } |
121 | bool requiresDocuments() const; | 121 | bool requiresDocuments() const; |
122 | void showLoadingDocs(); | 122 | void showLoadingDocs(); |
123 | void showDocTab(); | 123 | void showDocTab(); |
124 | 124 | ||
125 | QStringList idList() const { return ids; } | 125 | QStringList idList() const { return ids; } |
126 | 126 | ||
127 | public slots: | 127 | public slots: |
128 | void viewSelected(const QString&); | 128 | void viewSelected(const QString&); |
129 | void showTab(const QString&); | 129 | void showTab(const QString&); |
130 | void select( const AppLnk * ); | 130 | void select( const AppLnk * ); |
131 | void properties( AppLnk * ); | 131 | void properties( AppLnk * ); |
132 | void makeVisible(); | 132 | void makeVisible(); |
133 | 133 | ||
134 | signals: | 134 | signals: |
135 | void executing( const AppLnk * ); | 135 | void executing( const AppLnk * ); |
136 | 136 | ||
137 | private slots: | 137 | private slots: |
138 | void systemMessage( const QCString &, const QByteArray &); | 138 | void systemMessage( const QCString &, const QByteArray &); |
139 | void toggleSymbolInput(); | ||
140 | void toggleNumLockState(); | ||
141 | void toggleCapsLockState(); | ||
142 | 139 | ||
143 | protected: | 140 | protected: |
144 | bool eventFilter( QObject *o, QEvent *ev ); | 141 | bool eventFilter( QObject *o, QEvent *ev ); |
145 | 142 | ||
146 | private: | 143 | private: |
147 | void updateApps(); | 144 | void updateApps(); |
148 | void loadDocs(); | 145 | void loadDocs(); |
149 | void updateDocs(); | 146 | void updateDocs(); |
150 | void updateTabs(); | 147 | void updateTabs(); |
151 | 148 | ||
152 | LauncherTabWidget *tabs; | 149 | LauncherTabWidget *tabs; |
153 | QStringList ids; | 150 | QStringList ids; |
154 | TaskBar *tb; | 151 | TaskBar *tb; |
155 | 152 | ||
156 | bool docTabEnabled; | 153 | bool docTabEnabled; |
157 | }; | 154 | }; |
158 | 155 | ||
159 | #endif // LAUNCHERVIEW_H | 156 | #endif // LAUNCHERVIEW_H |
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 86e0d0d..abe238f 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -1,380 +1,380 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "startmenu.h" | 21 | #include "startmenu.h" |
22 | #include "inputmethods.h" | 22 | #include "inputmethods.h" |
23 | #include "runningappbar.h" | 23 | #include "runningappbar.h" |
24 | #include "systray.h" | 24 | #include "systray.h" |
25 | #include "wait.h" | 25 | #include "wait.h" |
26 | #include "appicons.h" | 26 | #include "appicons.h" |
27 | 27 | ||
28 | #include "taskbar.h" | 28 | #include "taskbar.h" |
29 | #include "server.h" | 29 | #include "server.h" |
30 | 30 | ||
31 | /* OPIE */ | 31 | /* OPIE */ |
32 | #include <opie2/odebug.h> | 32 | #include <opie2/odebug.h> |
33 | #include <qtopia/config.h> | 33 | #include <qtopia/config.h> |
34 | #include <qtopia/qpeapplication.h> | 34 | #include <qtopia/qpeapplication.h> |
35 | #ifdef QWS | 35 | #ifdef QWS |
36 | #include <qtopia/qcopenvelope_qws.h> | 36 | #include <qtopia/qcopenvelope_qws.h> |
37 | #endif | 37 | #endif |
38 | #include <qtopia/global.h> | 38 | #include <qtopia/global.h> |
39 | using namespace Opie::Core; | 39 | using namespace Opie::Core; |
40 | 40 | ||
41 | /* QT */ | 41 | /* QT */ |
42 | #include <qlabel.h> | 42 | #include <qlabel.h> |
43 | #include <qlayout.h> | 43 | #include <qlayout.h> |
44 | #include <qtimer.h> | 44 | #include <qtimer.h> |
45 | #ifdef QWS | 45 | #ifdef QWS |
46 | #include <qwindowsystem_qws.h> | 46 | #include <qwindowsystem_qws.h> |
47 | #endif | 47 | #endif |
48 | #include <qwidgetstack.h> | 48 | #include <qwidgetstack.h> |
49 | 49 | ||
50 | #if defined( Q_WS_QWS ) | 50 | #if defined( Q_WS_QWS ) |
51 | #include <qwsdisplay_qws.h> | 51 | #include <qwsdisplay_qws.h> |
52 | #include <qgfx_qws.h> | 52 | #include <qgfx_qws.h> |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | 55 | ||
56 | static bool initNumLock() | 56 | static bool initNumLock() |
57 | { | 57 | { |
58 | #ifdef QPE_INITIAL_NUMLOCK_STATE | 58 | #ifdef QPE_INITIAL_NUMLOCK_STATE |
59 | QPE_INITIAL_NUMLOCK_STATE | 59 | QPE_INITIAL_NUMLOCK_STATE |
60 | #endif | 60 | #endif |
61 | return FALSE; | 61 | return FALSE; |
62 | } | 62 | } |
63 | 63 | ||
64 | //--------------------------------------------------------------------------- | 64 | //--------------------------------------------------------------------------- |
65 | 65 | ||
66 | class SafeMode : public QWidget | 66 | class SafeMode : public QWidget |
67 | { | 67 | { |
68 | Q_OBJECT | 68 | Q_OBJECT |
69 | public: | 69 | public: |
70 | SafeMode( QWidget *parent ) : QWidget( parent ), menu(0) | 70 | SafeMode( QWidget *parent ) : QWidget( parent ), menu(0) |
71 | { | 71 | { |
72 | message = tr("Safe Mode"); | 72 | message = tr("Safe Mode"); |
73 | QFont f( font() ); | 73 | QFont f( font() ); |
74 | f.setWeight( QFont::Bold ); | 74 | f.setWeight( QFont::Bold ); |
75 | setFont( f ); | 75 | setFont( f ); |
76 | } | 76 | } |
77 | 77 | ||
78 | void mousePressEvent( QMouseEvent *); | 78 | void mousePressEvent( QMouseEvent *); |
79 | QSize sizeHint() const; | 79 | QSize sizeHint() const; |
80 | void paintEvent( QPaintEvent* ); | 80 | void paintEvent( QPaintEvent* ); |
81 | 81 | ||
82 | private slots: | 82 | private slots: |
83 | void action(int i); | 83 | void action(int i); |
84 | 84 | ||
85 | private: | 85 | private: |
86 | QString message; | 86 | QString message; |
87 | QPopupMenu *menu; | 87 | QPopupMenu *menu; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | void SafeMode::mousePressEvent( QMouseEvent *) | 90 | void SafeMode::mousePressEvent( QMouseEvent *) |
91 | { | 91 | { |
92 | if ( !menu ) { | 92 | if ( !menu ) { |
93 | menu = new QPopupMenu(this); | 93 | menu = new QPopupMenu(this); |
94 | menu->insertItem( tr("Plugin Manager..."), 0 ); | 94 | menu->insertItem( tr("Plugin Manager..."), 0 ); |
95 | menu->insertItem( tr("Restart Qtopia"), 1 ); | 95 | menu->insertItem( tr("Restart Qtopia"), 1 ); |
96 | menu->insertItem( tr("Help..."), 2 ); | 96 | menu->insertItem( tr("Help..."), 2 ); |
97 | connect(menu, SIGNAL(activated(int)), this, SLOT(action(int))); | 97 | connect(menu, SIGNAL(activated(int)), this, SLOT(action(int))); |
98 | } | 98 | } |
99 | QPoint curPos = mapToGlobal( QPoint(0,0) ); | 99 | QPoint curPos = mapToGlobal( QPoint(0,0) ); |
100 | QSize sh = menu->sizeHint(); | 100 | QSize sh = menu->sizeHint(); |
101 | menu->popup( curPos-QPoint((sh.width()-width())/2,sh.height()) ); | 101 | menu->popup( curPos-QPoint((sh.width()-width())/2,sh.height()) ); |
102 | } | 102 | } |
103 | 103 | ||
104 | void SafeMode::action(int i) | 104 | void SafeMode::action(int i) |
105 | { | 105 | { |
106 | switch (i) { | 106 | switch (i) { |
107 | case 0: | 107 | case 0: |
108 | Global::execute( "pluginmanager" ); | 108 | Global::execute( "pluginmanager" ); |
109 | break; | 109 | break; |
110 | case 1: | 110 | case 1: |
111 | Global::restart(); | 111 | Global::restart(); |
112 | break; | 112 | break; |
113 | case 2: | 113 | case 2: |
114 | Global::execute( "helpbrowser", "safemode.html" ); | 114 | Global::execute( "helpbrowser", "safemode.html" ); |
115 | break; | 115 | break; |
116 | } | 116 | } |
117 | } | 117 | } |
118 | 118 | ||
119 | QSize SafeMode::sizeHint() const | 119 | QSize SafeMode::sizeHint() const |
120 | { | 120 | { |
121 | QFontMetrics fm = fontMetrics(); | 121 | QFontMetrics fm = fontMetrics(); |
122 | 122 | ||
123 | return QSize( fm.width(message), fm.height() ); | 123 | return QSize( fm.width(message), fm.height() ); |
124 | } | 124 | } |
125 | 125 | ||
126 | void SafeMode::paintEvent( QPaintEvent* ) | 126 | void SafeMode::paintEvent( QPaintEvent* ) |
127 | { | 127 | { |
128 | QPainter p(this); | 128 | QPainter p(this); |
129 | p.drawText( rect(), AlignCenter, message ); | 129 | p.drawText( rect(), AlignCenter, message ); |
130 | } | 130 | } |
131 | 131 | ||
132 | //--------------------------------------------------------------------------- | 132 | //--------------------------------------------------------------------------- |
133 | 133 | ||
134 | class LockKeyState : public QWidget | 134 | class LockKeyState : public QWidget |
135 | { | 135 | { |
136 | public: | 136 | public: |
137 | LockKeyState( QWidget *parent ) : | 137 | LockKeyState( QWidget *parent ) : |
138 | QWidget(parent), | 138 | QWidget(parent), |
139 | nl(initNumLock()), cl(FALSE) | 139 | nl(initNumLock()), cl(FALSE) |
140 | { | 140 | { |
141 | nl_pm = Resource::loadPixmap("numlock"); | 141 | nl_pm = Resource::loadPixmap("numlock"); |
142 | cl_pm = Resource::loadPixmap("capslock"); | 142 | cl_pm = Resource::loadPixmap("capslock"); |
143 | } | 143 | } |
144 | QSize sizeHint() const | 144 | QSize sizeHint() const |
145 | { | 145 | { |
146 | return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); | 146 | return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); |
147 | } | 147 | } |
148 | void toggleNumLockState() | 148 | void toggleNumLockState() |
149 | { | 149 | { |
150 | nl = !nl; repaint(); | 150 | nl = !nl; repaint(); |
151 | } | 151 | } |
152 | void toggleCapsLockState() | 152 | void toggleCapsLockState() |
153 | { | 153 | { |
154 | cl = !cl; repaint(); | 154 | cl = !cl; repaint(); |
155 | } | 155 | } |
156 | void paintEvent( QPaintEvent * ) | 156 | void paintEvent( QPaintEvent * ) |
157 | { | 157 | { |
158 | int y = (height()-sizeHint().height())/2; | 158 | int y = (height()-sizeHint().height())/2; |
159 | QPainter p(this); | 159 | QPainter p(this); |
160 | if ( nl ) | 160 | if ( nl ) |
161 | p.drawPixmap(1,y,nl_pm); | 161 | p.drawPixmap(1,y,nl_pm); |
162 | if ( cl ) | 162 | if ( cl ) |
163 | p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); | 163 | p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); |
164 | } | 164 | } |
165 | private: | 165 | private: |
166 | QPixmap nl_pm, cl_pm; | 166 | QPixmap nl_pm, cl_pm; |
167 | bool nl, cl; | 167 | bool nl, cl; |
168 | }; | 168 | }; |
169 | 169 | ||
170 | //--------------------------------------------------------------------------- | 170 | //--------------------------------------------------------------------------- |
171 | 171 | ||
172 | TaskBar::~TaskBar() | 172 | TaskBar::~TaskBar() |
173 | { | 173 | { |
174 | } | 174 | } |
175 | 175 | ||
176 | 176 | ||
177 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) | 177 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) |
178 | { | 178 | { |
179 | Config cfg( "Launcher" ); | 179 | Config cfg( "Launcher" ); |
180 | cfg.setGroup( "InputMethods" ); | 180 | cfg.setGroup( "InputMethods" ); |
181 | resizeRunningApp = cfg.readBoolEntry( "Resize", true ); | 181 | resizeRunningApp = cfg.readBoolEntry( "Resize", true ); |
182 | 182 | ||
183 | sm = new StartMenu( this ); | 183 | sm = new StartMenu( this ); |
184 | connect( sm, SIGNAL(tabSelected(const QString&)), this, | 184 | connect( sm, SIGNAL(tabSelected(const QString&)), this, |
185 | SIGNAL(tabSelected(const QString&)) ); | 185 | SIGNAL(tabSelected(const QString&)) ); |
186 | 186 | ||
187 | inputMethods = new InputMethods( this ); | 187 | inputMethods = new InputMethods( this ); |
188 | connect( inputMethods, SIGNAL(inputToggled(bool)), | 188 | connect( inputMethods, SIGNAL(inputToggled(bool)), |
189 | this, SLOT(calcMaxWindowRect()) ); | 189 | this, SLOT(calcMaxWindowRect()) ); |
190 | 190 | ||
191 | stack = new QWidgetStack( this ); | 191 | stack = new QWidgetStack( this ); |
192 | stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); | 192 | stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); |
193 | label = new QLabel(stack); | 193 | label = new QLabel(stack); |
194 | 194 | ||
195 | runningAppBar = new RunningAppBar(stack); | 195 | runningAppBar = new RunningAppBar(stack); |
196 | stack->raiseWidget(runningAppBar); | 196 | stack->raiseWidget(runningAppBar); |
197 | 197 | ||
198 | waitIcon = new Wait( this ); | 198 | waitIcon = new Wait( this ); |
199 | (void) new AppIcons( this ); | 199 | (void) new AppIcons( this ); |
200 | 200 | ||
201 | sysTray = new SysTray( this ); | 201 | sysTray = new SysTray( this ); |
202 | 202 | ||
203 | /* ### FIXME plugin loader and safe mode */ | 203 | /* ### FIXME plugin loader and safe mode */ |
204 | #if 0 | 204 | #if 0 |
205 | if (PluginLoader::inSafeMode()) | 205 | if (PluginLoader::inSafeMode()) |
206 | (void)new SafeMode( this ); | 206 | (void)new SafeMode( this ); |
207 | #endif | 207 | #endif |
208 | 208 | ||
209 | // ## make customizable in some way? | 209 | // ## make customizable in some way? |
210 | #ifdef QT_QWS_CUSTOM | 210 | #ifdef OPIE_TASKBAR_LOCK_KEY_STATE |
211 | lockState = new LockKeyState( this ); | 211 | lockState = new LockKeyState( this ); |
212 | #else | 212 | #else |
213 | lockState = 0; | 213 | lockState = 0; |
214 | #endif | 214 | #endif |
215 | 215 | ||
216 | #if defined(Q_WS_QWS) | 216 | #if defined(Q_WS_QWS) |
217 | #if !defined(QT_NO_COP) | 217 | #if !defined(QT_NO_COP) |
218 | QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this ); | 218 | QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this ); |
219 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 219 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
220 | this, SLOT(receive(const QCString&,const QByteArray&)) ); | 220 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
221 | #endif | 221 | #endif |
222 | #endif | 222 | #endif |
223 | waitTimer = new QTimer( this ); | 223 | waitTimer = new QTimer( this ); |
224 | connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); | 224 | connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); |
225 | clearer = new QTimer( this ); | 225 | clearer = new QTimer( this ); |
226 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); | 226 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); |
227 | 227 | ||
228 | connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); | 228 | connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); |
229 | connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); | 229 | connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); |
230 | connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); | 230 | connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); |
231 | } | 231 | } |
232 | 232 | ||
233 | void TaskBar::setStatusMessage( const QString &text ) | 233 | void TaskBar::setStatusMessage( const QString &text ) |
234 | { | 234 | { |
235 | if ( !text.isEmpty() ) { | 235 | if ( !text.isEmpty() ) { |
236 | label->setText( text ); | 236 | label->setText( text ); |
237 | stack->raiseWidget( label ); | 237 | stack->raiseWidget( label ); |
238 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) | 238 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) |
239 | sysTray->hide(); | 239 | sysTray->hide(); |
240 | clearer->start( 3000, TRUE ); | 240 | clearer->start( 3000, TRUE ); |
241 | } else { | 241 | } else { |
242 | clearStatusBar(); | 242 | clearStatusBar(); |
243 | } | 243 | } |
244 | } | 244 | } |
245 | 245 | ||
246 | void TaskBar::clearStatusBar() | 246 | void TaskBar::clearStatusBar() |
247 | { | 247 | { |
248 | label->clear(); | 248 | label->clear(); |
249 | stack->raiseWidget(runningAppBar); | 249 | stack->raiseWidget(runningAppBar); |
250 | if ( sysTray ) | 250 | if ( sysTray ) |
251 | sysTray->show(); | 251 | sysTray->show(); |
252 | // stack->raiseWidget( mru ); | 252 | // stack->raiseWidget( mru ); |
253 | } | 253 | } |
254 | 254 | ||
255 | void TaskBar::startWait() | 255 | void TaskBar::startWait() |
256 | { | 256 | { |
257 | waitIcon->setWaiting( true ); | 257 | waitIcon->setWaiting( true ); |
258 | // a catchall stop after 10 seconds... | 258 | // a catchall stop after 10 seconds... |
259 | waitTimer->start( 10 * 1000, true ); | 259 | waitTimer->start( 10 * 1000, true ); |
260 | } | 260 | } |
261 | 261 | ||
262 | void TaskBar::stopWait(const QString&) | 262 | void TaskBar::stopWait(const QString&) |
263 | { | 263 | { |
264 | waitTimer->stop(); | 264 | waitTimer->stop(); |
265 | waitIcon->setWaiting( false ); | 265 | waitIcon->setWaiting( false ); |
266 | } | 266 | } |
267 | 267 | ||
268 | void TaskBar::stopWait() | 268 | void TaskBar::stopWait() |
269 | { | 269 | { |
270 | waitTimer->stop(); | 270 | waitTimer->stop(); |
271 | waitIcon->setWaiting( false ); | 271 | waitIcon->setWaiting( false ); |
272 | } | 272 | } |
273 | 273 | ||
274 | /* | 274 | /* |
275 | * This resizeEvent will be captured by | 275 | * This resizeEvent will be captured by |
276 | * the ServerInterface and it'll layout | 276 | * the ServerInterface and it'll layout |
277 | * and calc rect. Now if we go from bigger | 277 | * and calc rect. Now if we go from bigger |
278 | * to smaller screen the SysTray is out of | 278 | * to smaller screen the SysTray is out of |
279 | * bounds and repaint() won't trigger an Event | 279 | * bounds and repaint() won't trigger an Event |
280 | */ | 280 | */ |
281 | void TaskBar::resizeEvent( QResizeEvent *e ) | 281 | void TaskBar::resizeEvent( QResizeEvent *e ) |
282 | { | 282 | { |
283 | if ( sysTray ) | 283 | if ( sysTray ) |
284 | sysTray->hide(); | 284 | sysTray->hide(); |
285 | 285 | ||
286 | QHBox::resizeEvent( e ); | 286 | QHBox::resizeEvent( e ); |
287 | 287 | ||
288 | if ( sysTray ) | 288 | if ( sysTray ) |
289 | sysTray->show(); | 289 | sysTray->show(); |
290 | 290 | ||
291 | owarn << "TaskBar::resize event" << oendl; | 291 | owarn << "TaskBar::resize event" << oendl; |
292 | } | 292 | } |
293 | 293 | ||
294 | void TaskBar::styleChange( QStyle &s ) | 294 | void TaskBar::styleChange( QStyle &s ) |
295 | { | 295 | { |
296 | QHBox::styleChange( s ); | 296 | QHBox::styleChange( s ); |
297 | calcMaxWindowRect(); | 297 | calcMaxWindowRect(); |
298 | } | 298 | } |
299 | 299 | ||
300 | void TaskBar::calcMaxWindowRect() | 300 | void TaskBar::calcMaxWindowRect() |
301 | { | 301 | { |
302 | if ( resizeRunningApp ) | 302 | if ( resizeRunningApp ) |
303 | { | 303 | { |
304 | #if defined(Q_WS_QWS) | 304 | #if defined(Q_WS_QWS) |
305 | QRect wr; | 305 | QRect wr; |
306 | int displayWidth = qApp->desktop()->width(); | 306 | int displayWidth = qApp->desktop()->width(); |
307 | QRect ir = inputMethods->inputRect(); | 307 | QRect ir = inputMethods->inputRect(); |
308 | if ( ir.isValid() ) { | 308 | if ( ir.isValid() ) { |
309 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); | 309 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); |
310 | } else { | 310 | } else { |
311 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); | 311 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); |
312 | } | 312 | } |
313 | #if QT_VERSION < 0x030000 | 313 | #if QT_VERSION < 0x030000 |
314 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); | 314 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); |
315 | #else | 315 | #else |
316 | QWSServer::setMaxWindowRect( wr ); | 316 | QWSServer::setMaxWindowRect( wr ); |
317 | #endif | 317 | #endif |
318 | #endif | 318 | #endif |
319 | } | 319 | } |
320 | } | 320 | } |
321 | 321 | ||
322 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) | 322 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) |
323 | { | 323 | { |
324 | QDataStream stream( data, IO_ReadOnly ); | 324 | QDataStream stream( data, IO_ReadOnly ); |
325 | if ( msg == "message(QString)" ) { | 325 | if ( msg == "message(QString)" ) { |
326 | QString text; | 326 | QString text; |
327 | stream >> text; | 327 | stream >> text; |
328 | setStatusMessage( text ); | 328 | setStatusMessage( text ); |
329 | } else if ( msg == "hideInputMethod()" ) { | 329 | } else if ( msg == "hideInputMethod()" ) { |
330 | inputMethods->hideInputMethod(); | 330 | inputMethods->hideInputMethod(); |
331 | } else if ( msg == "showInputMethod()" ) { | 331 | } else if ( msg == "showInputMethod()" ) { |
332 | inputMethods->showInputMethod(); | 332 | inputMethods->showInputMethod(); |
333 | } else if ( msg == "showInputMethod(QString)" ) { | 333 | } else if ( msg == "showInputMethod(QString)" ) { |
334 | QString name; | 334 | QString name; |
335 | stream >> name; | 335 | stream >> name; |
336 | inputMethods->showInputMethod(name); | 336 | inputMethods->showInputMethod(name); |
337 | } else if ( msg == "reloadInputMethods()" ) { | 337 | } else if ( msg == "reloadInputMethods()" ) { |
338 | inputMethods->loadInputMethods(); | 338 | inputMethods->loadInputMethods(); |
339 | } else if ( msg == "reloadApplets()" ) { | 339 | } else if ( msg == "reloadApplets()" ) { |
340 | sysTray->clearApplets(); | 340 | sysTray->clearApplets(); |
341 | sm->createMenu(); | 341 | sm->createMenu(); |
342 | sysTray->addApplets(); | 342 | sysTray->addApplets(); |
343 | }else if ( msg == "toggleMenu()" ) { | 343 | }else if ( msg == "toggleMenu()" ) { |
344 | if ( sm-> launchMenu-> isVisible() ) | 344 | if ( sm-> launchMenu-> isVisible() ) |
345 | sm-> launch(); | 345 | sm-> launch(); |
346 | else | 346 | else |
347 | QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); | 347 | QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); |
348 | }else if ( msg == "toggleStartMenu()" ) | 348 | }else if ( msg == "toggleStartMenu()" ) |
349 | sm->launch(); | 349 | sm->launch(); |
350 | } | 350 | } |
351 | 351 | ||
352 | void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) | 352 | void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) |
353 | { | 353 | { |
354 | if ( state == ServerInterface::Launching ) | 354 | if ( state == ServerInterface::Launching ) |
355 | runningAppBar->applicationLaunched( name ); | 355 | runningAppBar->applicationLaunched( name ); |
356 | else if ( state == ServerInterface::Terminated ) | 356 | else if ( state == ServerInterface::Terminated ) |
357 | runningAppBar->applicationTerminated( name ); | 357 | runningAppBar->applicationTerminated( name ); |
358 | } | 358 | } |
359 | 359 | ||
360 | void TaskBar::toggleNumLockState() | 360 | void TaskBar::toggleNumLockState() |
361 | { | 361 | { |
362 | if ( lockState ) lockState->toggleNumLockState(); | 362 | if ( lockState ) lockState->toggleNumLockState(); |
363 | } | 363 | } |
364 | 364 | ||
365 | void TaskBar::toggleCapsLockState() | 365 | void TaskBar::toggleCapsLockState() |
366 | { | 366 | { |
367 | if ( lockState ) lockState->toggleCapsLockState(); | 367 | if ( lockState ) lockState->toggleCapsLockState(); |
368 | } | 368 | } |
369 | 369 | ||
370 | void TaskBar::toggleSymbolInput() | 370 | void TaskBar::toggleSymbolInput() |
371 | { | 371 | { |
372 | QString unicodeInput = qApp->translate( "InputMethods", "Unicode" ); | 372 | QString unicodeInput = qApp->translate( "InputMethods", "Unicode" ); |
373 | if ( inputMethods->currentShown() == unicodeInput ) { | 373 | if ( inputMethods->currentShown() == unicodeInput ) { |
374 | inputMethods->hideInputMethod(); | 374 | inputMethods->hideInputMethod(); |
375 | } else { | 375 | } else { |
376 | inputMethods->showInputMethod( unicodeInput ); | 376 | inputMethods->showInputMethod( unicodeInput ); |
377 | } | 377 | } |
378 | } | 378 | } |
379 | 379 | ||
380 | #include "taskbar.moc" | 380 | #include "taskbar.moc" |