-rw-r--r-- | Rules.make | 6 | ||||
-rw-r--r-- | config.in | 8 | ||||
-rw-r--r-- | library/library.pro | 6 | ||||
-rw-r--r-- | library/qpeapplication.cpp | 40 | ||||
-rw-r--r-- | library/qpeapplication.h | 5 | ||||
-rw-r--r-- | library/qt_override.cpp | 170 | ||||
-rw-r--r-- | library/qt_override_p.h | 25 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.cpp | 210 | ||||
-rw-r--r-- | noncore/settings/appearance2/appearance.h | 8 |
9 files changed, 5 insertions, 473 deletions
@@ -1,132 +1,126 @@ | |||
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 | # added for auto stripped build | 15 | # added for auto stripped build |
16 | ifneq ($(CONFIG_STRIP),) | 16 | ifneq ($(CONFIG_STRIP),) |
17 | echo CONFIG += strip >> $@ | 17 | echo CONFIG += strip >> $@ |
18 | endif | 18 | endif |
19 | ifneq ($(CONFIG_DEBUG),) | 19 | ifneq ($(CONFIG_DEBUG),) |
20 | echo CONFIG += debug >> $@ | 20 | echo CONFIG += debug >> $@ |
21 | echo CONFIG -= release >> $@ | 21 | echo CONFIG -= release >> $@ |
22 | echo DEFINES += "QT_COMPONENT_DEBUG=2" >> $@ | 22 | echo DEFINES += "QT_COMPONENT_DEBUG=2" >> $@ |
23 | echo DEFINES += QT_DEBUG >> $@ | 23 | echo DEFINES += QT_DEBUG >> $@ |
24 | else | 24 | else |
25 | echo CONFIG -= debug >> $@ | 25 | echo CONFIG -= debug >> $@ |
26 | echo CONFIG += release >> $@ | 26 | echo CONFIG += release >> $@ |
27 | echo DEFINES += "OPIE_NO_DEBUG" >> $@ | 27 | echo DEFINES += "OPIE_NO_DEBUG" >> $@ |
28 | endif | 28 | endif |
29 | ifeq ($(CONFIG_STATIC),y) | 29 | ifeq ($(CONFIG_STATIC),y) |
30 | echo !contains\( TARGET,qpe \) \{ >> $@ | 30 | echo !contains\( TARGET,qpe \) \{ >> $@ |
31 | echo CONFIG += staticlib >> $@ | 31 | echo CONFIG += staticlib >> $@ |
32 | echo \} >> $@ | 32 | echo \} >> $@ |
33 | endif | 33 | endif |
34 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 | 34 | ifeq ($(filter 3.%,$(QTE_VERSION)),) # not qt3 |
35 | echo CONFIG -= qt3 >> $@ | 35 | echo CONFIG -= qt3 >> $@ |
36 | else | 36 | else |
37 | echo CONFIG += qt3 >> $@ | 37 | echo CONFIG += qt3 >> $@ |
38 | endif | 38 | endif |
39 | ifneq ($(CONFIG_QUICK_LAUNCH),) | 39 | ifneq ($(CONFIG_QUICK_LAUNCH),) |
40 | echo contains\( CONFIG, quick-app \) \{ >> $@ | 40 | echo contains\( CONFIG, quick-app \) \{ >> $@ |
41 | echo CONFIG -= staticlib >> $@ | 41 | echo CONFIG -= staticlib >> $@ |
42 | echo CONFIG -= quick-app >> $@ | 42 | echo CONFIG -= quick-app >> $@ |
43 | echo CONFIG += quick-app-lib >> $@ | 43 | echo CONFIG += quick-app-lib >> $@ |
44 | echo QUICKLAUNCH_PATH = $(CONFIG_QUICKLAUNCH_PATH) >> $@ | 44 | echo QUICKLAUNCH_PATH = $(CONFIG_QUICKLAUNCH_PATH) >> $@ |
45 | echo \} >> $@ | 45 | echo \} >> $@ |
46 | else | 46 | else |
47 | echo contains\( CONFIG, quick-app \) \{ >> $@ | 47 | echo contains\( CONFIG, quick-app \) \{ >> $@ |
48 | echo CONFIG -= quick-app >> $@ | 48 | echo CONFIG -= quick-app >> $@ |
49 | echo CONFIG += quick-app-bin >> $@ | 49 | echo CONFIG += quick-app-bin >> $@ |
50 | echo \} >> $@ | 50 | echo \} >> $@ |
51 | endif | 51 | endif |
52 | ifeq ($(CONFIG_SQL_PIM_BACKEND),y) | 52 | ifeq ($(CONFIG_SQL_PIM_BACKEND),y) |
53 | echo ENABLE_SQL_PIM_BACKEND=$(CONFIG_SQL_PIM_BACKEND) >> $@ | 53 | echo ENABLE_SQL_PIM_BACKEND=$(CONFIG_SQL_PIM_BACKEND) >> $@ |
54 | else | 54 | else |
55 | echo ENABLE_SQL_PIM_BACKEND=n >> $@ | 55 | echo ENABLE_SQL_PIM_BACKEND=n >> $@ |
56 | endif | 56 | endif |
57 | ifeq ($(CONFIG_OPIE_NO_OVERRIDE_QT),y) | ||
58 | echo CONFIG += no-override >> $@ | ||
59 | endif | ||
60 | ifeq ($(CONFIG_OPIELOGIN_USEPAM),y) | 57 | ifeq ($(CONFIG_OPIELOGIN_USEPAM),y) |
61 | echo CONFIG += OPIELOGIN_USEPAM >> $@ | 58 | echo CONFIG += OPIELOGIN_USEPAM >> $@ |
62 | endif | 59 | endif |
63 | ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y) | 60 | ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y) |
64 | echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@ | 61 | echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@ |
65 | endif | 62 | endif |
66 | ifeq ($(CONFIG_OPIE_NO_ERASERECT_FIX),y) | ||
67 | echo DEFINES += OPIE_NO_ERASE_RECT_HACKFIX >> $@ | ||
68 | endif | ||
69 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) | 63 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) |
70 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ | 64 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ |
71 | endif | 65 | endif |
72 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) | 66 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) |
73 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ | 67 | echo DEFINES += OPIE_NO_BUILTIN_CALIBRATE >> $@ |
74 | endif | 68 | endif |
75 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) | 69 | ifeq ($(CONFIG_USE_REALTIME_AUDIO_THREAD),y) |
76 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ | 70 | echo DEFINES += USE_REALTIME_AUDIO_THREAD >> $@ |
77 | endif | 71 | endif |
78 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) | 72 | ifeq ($(CONFIG_USE_FILE_NOTIFICATION),y) |
79 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ | 73 | echo DEFINES += USE_FILE_NOTIFICATION >> $@ |
80 | endif | 74 | endif |
81 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) | 75 | ifeq ($(CONFIG_QT_QWS_ALLOW_CLOCK),y) |
82 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ | 76 | echo DEFINES += QT_QWS_ALLOW_OVERCLOCK >> $@ |
83 | endif | 77 | endif |
84 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) | 78 | ifeq ($(CONFIG_OPIE_NEW_ALLOC),y) |
85 | echo DEFINES += OPIE_NEW_MALLOC >> $@ | 79 | echo DEFINES += OPIE_NEW_MALLOC >> $@ |
86 | endif | 80 | endif |
87 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) | 81 | ifeq ($(CONFIG_OPIE_NO_SOUND_PCM_READ_BITS),y) |
88 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ | 82 | echo DEFINES += OPIE_NO_SOUND_PCM_READ_BITS >> $@ |
89 | endif | 83 | endif |
90 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ | 84 | echo DEFINES += OPIE_SOUND_FRAGMENT_SHIFT=$(CONFIG_OPIE_SOUND_FRAGMENT_SHIFT) >> $@ |
91 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) | 85 | ifeq ($(CONFIG_OPIE_WE_VERSION_OVERRIDE),y) |
92 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ | 86 | echo DEFINES += OPIE_WE_VERSION=$(CONFIG_OPIE_WE_VERSION) >> $@ |
93 | endif | 87 | endif |
94 | ifeq ($(CONFIG_OPIE_TASKBAR_LOCK_KEY_STATE),y) | 88 | ifeq ($(CONFIG_OPIE_TASKBAR_LOCK_KEY_STATE),y) |
95 | echo DEFINES += OPIE_TASKBAR_LOCK_KEY_STATE >> $@ | 89 | echo DEFINES += OPIE_TASKBAR_LOCK_KEY_STATE >> $@ |
96 | endif | 90 | endif |
97 | # Write LIB dirs and INC dirs... | 91 | # Write LIB dirs and INC dirs... |
98 | ifeq ($(CONFIG_LIBETPAN_DEP),y) | 92 | ifeq ($(CONFIG_LIBETPAN_DEP),y) |
99 | echo LIBETPAN_LIB_DIR = $(CONFIG_LIBETPAN_LIB_DIR) >> $@ | 93 | echo LIBETPAN_LIB_DIR = $(CONFIG_LIBETPAN_LIB_DIR) >> $@ |
100 | echo LIBETPAN_INC_DIR = $(CONFIG_LIBETPAN_INC_DIR) >> $@ | 94 | echo LIBETPAN_INC_DIR = $(CONFIG_LIBETPAN_INC_DIR) >> $@ |
101 | endif | 95 | endif |
102 | ifeq ($(CONFIG_LIBPCAP_DEP),y) | 96 | ifeq ($(CONFIG_LIBPCAP_DEP),y) |
103 | echo LIBPCAP_LIB_DIR = $(CONFIG_LIBPCAP_LIB_DIR) >> $@ | 97 | echo LIBPCAP_LIB_DIR = $(CONFIG_LIBPCAP_LIB_DIR) >> $@ |
104 | echo LIBPCAP_INC_DIR = $(CONFIG_LIBPCAP_INC_DIR) >> $@ | 98 | echo LIBPCAP_INC_DIR = $(CONFIG_LIBPCAP_INC_DIR) >> $@ |
105 | endif | 99 | endif |
106 | ifeq ($(CONFIG_LIBSQLITE_DEP),y) | 100 | ifeq ($(CONFIG_LIBSQLITE_DEP),y) |
107 | echo LIBSQLITE_LIB_DIR = $(CONFIG_LIBSQLITE_LIB_DIR) >> $@ | 101 | echo LIBSQLITE_LIB_DIR = $(CONFIG_LIBSQLITE_LIB_DIR) >> $@ |
108 | echo LIBSQLITE_INC_DIR = $(CONFIG_LIBSQLITE_INC_DIR) >> $@ | 102 | echo LIBSQLITE_INC_DIR = $(CONFIG_LIBSQLITE_INC_DIR) >> $@ |
109 | endif | 103 | endif |
110 | ifeq ($(CONFIG_LIBXINE_DEP),y) | 104 | ifeq ($(CONFIG_LIBXINE_DEP),y) |
111 | echo LIBXINE_LIB_DIR = $(CONFIG_LIBXINE_LIB_DIR) >> $@ | 105 | echo LIBXINE_LIB_DIR = $(CONFIG_LIBXINE_LIB_DIR) >> $@ |
112 | echo LIBXINE_INC_DIR = $(CONFIG_LIBXINE_INC_DIR) >> $@ | 106 | echo LIBXINE_INC_DIR = $(CONFIG_LIBXINE_INC_DIR) >> $@ |
113 | endif | 107 | endif |
114 | ifeq ($(CONFIG_LIBBLUEZ_DEP),y) | 108 | ifeq ($(CONFIG_LIBBLUEZ_DEP),y) |
115 | echo LIBBLUEZ_LIB_DIR = $(CONFIG_LIBBLUEZ_LIB_DIR) >> $@ | 109 | echo LIBBLUEZ_LIB_DIR = $(CONFIG_LIBBLUEZ_LIB_DIR) >> $@ |
116 | echo LIBBLUEZ_INC_DIR = $(CONFIG_LIBBLUEZ_INC_DIR) >> $@ | 110 | echo LIBBLUEZ_INC_DIR = $(CONFIG_LIBBLUEZ_INC_DIR) >> $@ |
117 | endif | 111 | endif |
118 | ifeq ($(CONFIG_LIBIPK_DEP),y) | 112 | ifeq ($(CONFIG_LIBIPK_DEP),y) |
119 | echo LIBIPK_LIB_DIR = $(CONFIG_LIBIPK_LIB_DIR) >> $@ | 113 | echo LIBIPK_LIB_DIR = $(CONFIG_LIBIPK_LIB_DIR) >> $@ |
120 | echo LIBIPK_INC_DIR = $(CONFIG_LIBIPK_INC_DIR) >> $@ | 114 | echo LIBIPK_INC_DIR = $(CONFIG_LIBIPK_INC_DIR) >> $@ |
121 | endif | 115 | endif |
122 | ifeq ($(CONFIG_LIBSDK_DEP),y) | 116 | ifeq ($(CONFIG_LIBSDK_DEP),y) |
123 | echo LIBSDL_LIB_DIR = $(CONFIG_LIBSDL_LIB_DIR) >> $@ | 117 | echo LIBSDL_LIB_DIR = $(CONFIG_LIBSDL_LIB_DIR) >> $@ |
124 | echo LIBSDL_INC_DIR = $(CONFIG_LIBSDL_INC_DIR) >> $@ | 118 | echo LIBSDL_INC_DIR = $(CONFIG_LIBSDL_INC_DIR) >> $@ |
125 | endif | 119 | endif |
126 | ifeq ($(CONFIG_LIBSWORD_DEP),y) | 120 | ifeq ($(CONFIG_LIBSWORD_DEP),y) |
127 | echo LIBSWORD_LIB_DIR = $(CONFIG_LIBSWORD_LIB_DIR) >> $@ | 121 | echo LIBSWORD_LIB_DIR = $(CONFIG_LIBSWORD_LIB_DIR) >> $@ |
128 | echo LIBSWORD_INC_DIR = $(CONFIG_LIBSWORD_INC_DIR) >> $@ | 122 | echo LIBSWORD_INC_DIR = $(CONFIG_LIBSWORD_INC_DIR) >> $@ |
129 | endif | 123 | endif |
130 | ifeq ($(CONFIG_LIBFREETYPE2_DEP),y) | 124 | ifeq ($(CONFIG_LIBFREETYPE2_DEP),y) |
131 | echo LIBFREETYPE2_INC_DIR = $(CONFIG_LIBFREETYPE2_INC_DIR) >> $@ | 125 | echo LIBFREETYPE2_INC_DIR = $(CONFIG_LIBFREETYPE2_INC_DIR) >> $@ |
132 | endif | 126 | endif |
@@ -62,136 +62,128 @@ config STATIC | |||
62 | config DEBUG | 62 | config DEBUG |
63 | boolean "Enable debug builds" | 63 | boolean "Enable debug builds" |
64 | default n | 64 | default n |
65 | 65 | ||
66 | config RELEASE | 66 | config RELEASE |
67 | bool | 67 | bool |
68 | default y | 68 | default y |
69 | depends !DEBUG | 69 | depends !DEBUG |
70 | 70 | ||
71 | config QUICK_LAUNCH | 71 | config QUICK_LAUNCH |
72 | boolean "Enable Quick Launch" | 72 | boolean "Enable Quick Launch" |
73 | default n if TARGET_X86 | 73 | default n if TARGET_X86 |
74 | default y if ! TARGET_X86 | 74 | default y if ! TARGET_X86 |
75 | 75 | ||
76 | config QUICKLAUNCH_PATH | 76 | config QUICKLAUNCH_PATH |
77 | string "Path to quicklauncher" | 77 | string "Path to quicklauncher" |
78 | default "./quicklauncher" if TARGET_X86 | 78 | default "./quicklauncher" if TARGET_X86 |
79 | default "/opt/QtPalmtop/bin/quicklauncher" if ! TARGET_X86 | 79 | default "/opt/QtPalmtop/bin/quicklauncher" if ! TARGET_X86 |
80 | 80 | ||
81 | config SPECFILE | 81 | config SPECFILE |
82 | string | 82 | string |
83 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) | 83 | default "qws/linux-generic-g++" if TARGET_X86 && (! X11) |
84 | default "linux-g++" if TARGET_X86 && X11 | 84 | default "linux-g++" if TARGET_X86 && X11 |
85 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) | 85 | default "qws/linux-sharp-g++" if TARGET_SHARP && (! X11) |
86 | default "linux-g++" if TARGET_SHARP && X11 | 86 | default "linux-g++" if TARGET_SHARP && X11 |
87 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) | 87 | default "qws/linux-ipaq-g++" if TARGET_IPAQ && (! X11) |
88 | default "linux-g++" if TARGET_IPAQ && X11 | 88 | default "linux-g++" if TARGET_IPAQ && X11 |
89 | default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) | 89 | default "qws/linux-ramses-g++" if TARGET_RAMSES && (! X11) |
90 | default "linux-g++" if TARGET_RAMSES && X11 | 90 | default "linux-g++" if TARGET_RAMSES && X11 |
91 | default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11) | 91 | default "qws/linux-simpad-g++" if TARGET_SIMPAD && (! X11) |
92 | default "linux-g++" if TARGET_SIMPAD && X11 | 92 | default "linux-g++" if TARGET_SIMPAD && X11 |
93 | default "qws/linux-yopy-g++" if TARGET_YOPY && (! X11) | 93 | default "qws/linux-yopy-g++" if TARGET_YOPY && (! X11) |
94 | default "qws/macx-generic-g++" if TARGET_MACOSX && (! X11) | 94 | default "qws/macx-generic-g++" if TARGET_MACOSX && (! X11) |
95 | default "qws/linux-oe-g++" if TARGET_OE && (!X11) | 95 | default "qws/linux-oe-g++" if TARGET_OE && (!X11) |
96 | 96 | ||
97 | config CUSTOMFILE | 97 | config CUSTOMFILE |
98 | string | 98 | string |
99 | default "custom-ipaq.h" if TARGET_IPAQ | 99 | default "custom-ipaq.h" if TARGET_IPAQ |
100 | default "custom-sharp.h" if TARGET_SHARP | 100 | default "custom-sharp.h" if TARGET_SHARP |
101 | default "custom-ramses.h" if TARGET_RAMSES | 101 | default "custom-ramses.h" if TARGET_RAMSES |
102 | default "custom-ipaq.h" if TARGET_SIMPAD | 102 | default "custom-ipaq.h" if TARGET_SIMPAD |
103 | default "custom-yopy.h" if TARGET_YOPY | 103 | default "custom-yopy.h" if TARGET_YOPY |
104 | 104 | ||
105 | config OPTIMIZATIONS | 105 | config OPTIMIZATIONS |
106 | string "Optimization flags" | 106 | string "Optimization flags" |
107 | depends OPTIMIZE | 107 | depends OPTIMIZE |
108 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ | 108 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_IPAQ |
109 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_YOPY | 109 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_YOPY |
110 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP | 110 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SHARP |
111 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES | 111 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_RAMSES |
112 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD | 112 | default "-march=armv4 -mtune=strongarm1100 -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_SIMPAD |
113 | default "-march=armv5te -mtune=xscale -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_C700 | 113 | default "-march=armv5te -mtune=xscale -mapcs-32 -fexpensive-optimizations -fomit-frame-pointer -O2" if TARGET_C700 |
114 | 114 | ||
115 | config EXPERIMENTAL | 115 | config EXPERIMENTAL |
116 | bool "Prompt for development and/or incomplete items" | 116 | bool "Prompt for development and/or incomplete items" |
117 | default y | 117 | default y |
118 | 118 | ||
119 | config USE_CCACHE | 119 | config USE_CCACHE |
120 | bool "Use ccache, if available?" | 120 | bool "Use ccache, if available?" |
121 | default y | 121 | default y |
122 | 122 | ||
123 | endmenu | 123 | endmenu |
124 | 124 | ||
125 | menu "Configuration" | 125 | menu "Configuration" |
126 | config OPIE_NO_OVERRIDE_QT | ||
127 | boolean "Build Opie against an unpatched version of Qt" | ||
128 | default n | ||
129 | |||
130 | config OPIE_NO_ERASERECT_FIX | ||
131 | boolean "Disable Fixup eraseRect for HancomMobileWord,neocal.. to make libopiecore work on Sharps libqpe" | ||
132 | default n | ||
133 | |||
134 | config OPIE_NO_BUILTIN_SHUTDOWN | 126 | config OPIE_NO_BUILTIN_SHUTDOWN |
135 | boolean "Disable the built in shutdown application" | 127 | boolean "Disable the built in shutdown application" |
136 | default y | 128 | default y |
137 | 129 | ||
138 | config OPIE_NO_BUILTIN_CALIBRATE | 130 | config OPIE_NO_BUILTIN_CALIBRATE |
139 | boolean "Disable the built in calibrate application" | 131 | boolean "Disable the built in calibrate application" |
140 | default y if TARGET_YOPY | 132 | default y if TARGET_YOPY |
141 | default n if ! TARGET_YOPY | 133 | default n if ! TARGET_YOPY |
142 | 134 | ||
143 | config OPIE_SOUND_FRAGMENT_SHIFT | 135 | config OPIE_SOUND_FRAGMENT_SHIFT |
144 | string "The sound fragment used in Opie Player I" | 136 | string "The sound fragment used in Opie Player I" |
145 | default "14" if TARGET_IPAQ | 137 | default "14" if TARGET_IPAQ |
146 | default "16" if ! TARGET_IPAQ | 138 | default "16" if ! TARGET_IPAQ |
147 | 139 | ||
148 | config USE_REALTIME_AUDIO_THREAD | 140 | config USE_REALTIME_AUDIO_THREAD |
149 | boolean "Use a realtime thread in Opie Player I" | 141 | boolean "Use a realtime thread in Opie Player I" |
150 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP | 142 | default y if TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP |
151 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 143 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
152 | 144 | ||
153 | config QT_QWS_ALLOW_OVERCLOCK | 145 | config QT_QWS_ALLOW_OVERCLOCK |
154 | boolean "Allow the user to overclock the device" | 146 | boolean "Allow the user to overclock the device" |
155 | depends TARGET_RAMSES | 147 | depends TARGET_RAMSES |
156 | default n | 148 | default n |
157 | 149 | ||
158 | config USE_FILE_NOTIFICATION | 150 | config USE_FILE_NOTIFICATION |
159 | boolean "Substitute (some) polling interfaces with OFileNotifier" | 151 | boolean "Substitute (some) polling interfaces with OFileNotifier" |
160 | default y | 152 | default y |
161 | 153 | ||
162 | config OPIE_NEW_ALLOC | 154 | config OPIE_NEW_ALLOC |
163 | boolean "Use malloc and free for the implementation" | 155 | boolean "Use malloc and free for the implementation" |
164 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP | 156 | default y if TARGET_RAMSES || TARGET_IPAQ || TARGET_SIMPAD || TARGET_SHARP |
165 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) | 157 | default n if ! (TARGET_IPAQ || TARGET_SIMPAD || TARGET_RAMSES || TARGET_SHARP) |
166 | 158 | ||
167 | config OPIE_TASKBAR_LOCK_KEY_STATE | 159 | config OPIE_TASKBAR_LOCK_KEY_STATE |
168 | boolean "Have a KeyLock state indicator on the taskbar" | 160 | boolean "Have a KeyLock state indicator on the taskbar" |
169 | default y if TARGET_SHARP | 161 | default y if TARGET_SHARP |
170 | default n if !TARGET_SHARP | 162 | default n if !TARGET_SHARP |
171 | 163 | ||
172 | config LIBQPE_WITHROHFEEDBACK | 164 | config LIBQPE_WITHROHFEEDBACK |
173 | boolean "Build libqpe with Right-On-Hold feedback" | 165 | boolean "Build libqpe with Right-On-Hold feedback" |
174 | default y | 166 | default y |
175 | 167 | ||
176 | config OPIE_NO_SOUND_PCM_READ_BITS | 168 | config OPIE_NO_SOUND_PCM_READ_BITS |
177 | boolean "There is not a pcm_read_bits io control" | 169 | boolean "There is not a pcm_read_bits io control" |
178 | default y if TARGET_SHARP | 170 | default y if TARGET_SHARP |
179 | default n if ! TARGET_SHARP | 171 | default n if ! TARGET_SHARP |
180 | endmenu | 172 | endmenu |
181 | 173 | ||
182 | menu "Dependencies" | 174 | menu "Dependencies" |
183 | source dependencies.in | 175 | source dependencies.in |
184 | endmenu | 176 | endmenu |
185 | 177 | ||
186 | menu "Base" | 178 | menu "Base" |
187 | choice | 179 | choice |
188 | prompt "Qpe Library Selection" | 180 | prompt "Qpe Library Selection" |
189 | default LIBQPE | 181 | default LIBQPE |
190 | source library/config.in | 182 | source library/config.in |
191 | source x11/config.in | 183 | source x11/config.in |
192 | endchoice | 184 | endchoice |
193 | source libopie2/config.in | 185 | source libopie2/config.in |
194 | source libqtaux/config.in | 186 | source libqtaux/config.in |
195 | source rsync/config.in | 187 | source rsync/config.in |
196 | source core/opie-login/config.in | 188 | source core/opie-login/config.in |
197 | source core/opiealarm/config.in | 189 | source core/opiealarm/config.in |
diff --git a/library/library.pro b/library/library.pro index 04e125f..95c18a2 100644 --- a/library/library.pro +++ b/library/library.pro | |||
@@ -1,145 +1,139 @@ | |||
1 | TEMPLATE= lib | 1 | TEMPLATE= lib |
2 | #CONFIG += qt warn_on release | 2 | #CONFIG += qt warn_on release |
3 | CONFIG += qt warn_on debug | 3 | CONFIG += qt warn_on debug |
4 | HEADERS= calendar.h \ | 4 | HEADERS= calendar.h \ |
5 | global.h \ | 5 | global.h \ |
6 | resource.h \ | 6 | resource.h \ |
7 | xmlreader.h \ | 7 | xmlreader.h \ |
8 | mimetype.h \ | 8 | mimetype.h \ |
9 | menubutton.h \ | 9 | menubutton.h \ |
10 | network.h \ | 10 | network.h \ |
11 | networkinterface.h \ | 11 | networkinterface.h \ |
12 | filemanager.h \ | 12 | filemanager.h \ |
13 | fontmanager.h \ | 13 | fontmanager.h \ |
14 | qdawg.h \ | 14 | qdawg.h \ |
15 | datebookmonth.h \ | 15 | datebookmonth.h \ |
16 | fileselector.h \ | 16 | fileselector.h \ |
17 | fileselector_p.h \ | 17 | fileselector_p.h \ |
18 | imageedit.h \ | 18 | imageedit.h \ |
19 | qcopenvelope_qws.h \ | 19 | qcopenvelope_qws.h \ |
20 | qpedecoration_qws.h \ | 20 | qpedecoration_qws.h \ |
21 | qpeapplication.h \ | 21 | qpeapplication.h \ |
22 | qpestyle.h \ | 22 | qpestyle.h \ |
23 | qpedialog.h \ | 23 | qpedialog.h \ |
24 | lightstyle.h \ | 24 | lightstyle.h \ |
25 | config.h \ | 25 | config.h \ |
26 | applnk.h \ | 26 | applnk.h \ |
27 | sound.h \ | 27 | sound.h \ |
28 | tzselect.h \ | 28 | tzselect.h \ |
29 | qmath.h \ | 29 | qmath.h \ |
30 | datebookdb.h \ | 30 | datebookdb.h \ |
31 | alarmserver.h \ | 31 | alarmserver.h \ |
32 | process.h \ | 32 | process.h \ |
33 | password.h \ | 33 | password.h \ |
34 | timestring.h \ | 34 | timestring.h \ |
35 | fontfactoryinterface.h \ | 35 | fontfactoryinterface.h \ |
36 | fontdatabase.h \ | 36 | fontdatabase.h \ |
37 | power.h \ | 37 | power.h \ |
38 | storage.h \ | 38 | storage.h \ |
39 | qpemessagebox.h \ | 39 | qpemessagebox.h \ |
40 | timeconversion.h \ | 40 | timeconversion.h \ |
41 | qpedebug.h \ | 41 | qpedebug.h \ |
42 | qpemenubar.h \ | 42 | qpemenubar.h \ |
43 | qpetoolbar.h \ | 43 | qpetoolbar.h \ |
44 | backend/categories.h \ | 44 | backend/categories.h \ |
45 | stringutil.h \ | 45 | stringutil.h \ |
46 | backend/palmtoprecord.h \ | 46 | backend/palmtoprecord.h \ |
47 | backend/task.h \ | 47 | backend/task.h \ |
48 | backend/event.h \ | 48 | backend/event.h \ |
49 | backend/contact.h\ | 49 | backend/contact.h\ |
50 | categorymenu.h \ | 50 | categorymenu.h \ |
51 | categoryedit_p.h \ | 51 | categoryedit_p.h \ |
52 | categoryselect.h \ | 52 | categoryselect.h \ |
53 | categorywidget.h \ | 53 | categorywidget.h \ |
54 | ir.h \ | 54 | ir.h \ |
55 | backend/vobject_p.h \ | 55 | backend/vobject_p.h \ |
56 | findwidget_p.h \ | 56 | findwidget_p.h \ |
57 | finddialog.h \ | 57 | finddialog.h \ |
58 | lnkproperties.h \ | 58 | lnkproperties.h \ |
59 | windowdecorationinterface.h \ | 59 | windowdecorationinterface.h \ |
60 | textcodecinterface.h \ | 60 | textcodecinterface.h \ |
61 | imagecodecinterface.h \ | 61 | imagecodecinterface.h \ |
62 | qt_override_p.h \ | ||
63 | qpeglobal.h | 62 | qpeglobal.h |
64 | 63 | ||
65 | SOURCES= calendar.cpp \ | 64 | SOURCES= calendar.cpp \ |
66 | global.cpp \ | 65 | global.cpp \ |
67 | xmlreader.cpp \ | 66 | xmlreader.cpp \ |
68 | mimetype.cpp \ | 67 | mimetype.cpp \ |
69 | menubutton.cpp \ | 68 | menubutton.cpp \ |
70 | network.cpp \ | 69 | network.cpp \ |
71 | networkinterface.cpp \ | 70 | networkinterface.cpp \ |
72 | filemanager.cpp \ | 71 | filemanager.cpp \ |
73 | fontmanager.cpp \ | 72 | fontmanager.cpp \ |
74 | qdawg.cpp \ | 73 | qdawg.cpp \ |
75 | datebookmonth.cpp \ | 74 | datebookmonth.cpp \ |
76 | fileselector.cpp \ | 75 | fileselector.cpp \ |
77 | imageedit.cpp \ | 76 | imageedit.cpp \ |
78 | resource.cpp \ | 77 | resource.cpp \ |
79 | qpedecoration_qws.cpp \ | 78 | qpedecoration_qws.cpp \ |
80 | qcopenvelope_qws.cpp \ | 79 | qcopenvelope_qws.cpp \ |
81 | qpeapplication.cpp \ | 80 | qpeapplication.cpp \ |
82 | qpestyle.cpp \ | 81 | qpestyle.cpp \ |
83 | qpedialog.cpp \ | 82 | qpedialog.cpp \ |
84 | lightstyle.cpp \ | 83 | lightstyle.cpp \ |
85 | config.cpp \ | 84 | config.cpp \ |
86 | applnk.cpp \ | 85 | applnk.cpp \ |
87 | sound.cpp \ | 86 | sound.cpp \ |
88 | tzselect.cpp \ | 87 | tzselect.cpp \ |
89 | qmath.c \ | 88 | qmath.c \ |
90 | datebookdb.cpp \ | 89 | datebookdb.cpp \ |
91 | alarmserver.cpp \ | 90 | alarmserver.cpp \ |
92 | password.cpp \ | 91 | password.cpp \ |
93 | process.cpp \ | 92 | process.cpp \ |
94 | process_unix.cpp \ | 93 | process_unix.cpp \ |
95 | timestring.cpp \ | 94 | timestring.cpp \ |
96 | fontdatabase.cpp \ | 95 | fontdatabase.cpp \ |
97 | power.cpp \ | 96 | power.cpp \ |
98 | storage.cpp \ | 97 | storage.cpp \ |
99 | qpemessagebox.cpp \ | 98 | qpemessagebox.cpp \ |
100 | backend/timeconversion.cpp \ | 99 | backend/timeconversion.cpp \ |
101 | qpedebug.cpp \ | 100 | qpedebug.cpp \ |
102 | qpemenubar.cpp \ | 101 | qpemenubar.cpp \ |
103 | qpetoolbar.cpp \ | 102 | qpetoolbar.cpp \ |
104 | backend/categories.cpp \ | 103 | backend/categories.cpp \ |
105 | backend/stringutil.cpp \ | 104 | backend/stringutil.cpp \ |
106 | backend/palmtoprecord.cpp \ | 105 | backend/palmtoprecord.cpp \ |
107 | backend/task.cpp \ | 106 | backend/task.cpp \ |
108 | backend/event.cpp \ | 107 | backend/event.cpp \ |
109 | backend/contact.cpp \ | 108 | backend/contact.cpp \ |
110 | categorymenu.cpp \ | 109 | categorymenu.cpp \ |
111 | categoryedit_p.cpp \ | 110 | categoryedit_p.cpp \ |
112 | categoryselect.cpp \ | 111 | categoryselect.cpp \ |
113 | categorywidget.cpp \ | 112 | categorywidget.cpp \ |
114 | ir.cpp \ | 113 | ir.cpp \ |
115 | backend/vcc_yacc.cpp \ | 114 | backend/vcc_yacc.cpp \ |
116 | backend/vobject.cpp \ | 115 | backend/vobject.cpp \ |
117 | findwidget_p.cpp \ | 116 | findwidget_p.cpp \ |
118 | finddialog.cpp \ | 117 | finddialog.cpp \ |
119 | lnkproperties.cpp \ | 118 | lnkproperties.cpp \ |
120 | qt_override.cpp \ | ||
121 | widget_showing.cpp | 119 | widget_showing.cpp |
122 | 120 | ||
123 | 121 | ||
124 | 122 | ||
125 | # Qt 3 compatibility | 123 | # Qt 3 compatibility |
126 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h | 124 | HEADERS += quuid.h qcom.h qlibrary.h qlibrary_p.h |
127 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp | 125 | SOURCES += quuid.cpp qlibrary.cpp qlibrary_unix.cpp |
128 | INCLUDEPATH += $(OPIEDIR)/include backend | 126 | INCLUDEPATH += $(OPIEDIR)/include backend |
129 | LIBS += -ldl -lcrypt -lm | 127 | LIBS += -ldl -lcrypt -lm |
130 | INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui | 128 | INTERFACES = passwordbase_p.ui categoryeditbase_p.ui findwidgetbase_p.ui lnkpropertiesbase_p.ui |
131 | TARGET = qpe | 129 | TARGET = qpe |
132 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) | 130 | DESTDIR = $(OPIEDIR)/lib$(PROJMAK) |
133 | VERSION = 1.5.0.1 | 131 | VERSION = 1.5.0.1 |
134 | 132 | ||
135 | include( $(OPIEDIR)/include.pro ) | 133 | include( $(OPIEDIR)/include.pro ) |
136 | 134 | ||
137 | contains( CONFIG, no-override ){ | ||
138 | DEFINES += OPIE_NO_OVERRIDE_QT | ||
139 | } | ||
140 | |||
141 | contains( CONFIG, LIBQPE_WITHROHFEEDBACK ){ | 135 | contains( CONFIG, LIBQPE_WITHROHFEEDBACK ){ |
142 | DEFINES += OPIE_WITHROHFEEDBACK | 136 | DEFINES += OPIE_WITHROHFEEDBACK |
143 | SOURCES += backend/rohfeedback.cpp | 137 | SOURCES += backend/rohfeedback.cpp |
144 | HEADERS += backend/rohfeedback.h | 138 | HEADERS += backend/rohfeedback.h |
145 | } | 139 | } |
diff --git a/library/qpeapplication.cpp b/library/qpeapplication.cpp index 1c5ced3..2bd7cbe 100644 --- a/library/qpeapplication.cpp +++ b/library/qpeapplication.cpp | |||
@@ -35,129 +35,128 @@ | |||
35 | #else | 35 | #else |
36 | #include "qcopenvelope_qws.h" | 36 | #include "qcopenvelope_qws.h" |
37 | #endif | 37 | #endif |
38 | #endif | 38 | #endif |
39 | #include <qwindowsystem_qws.h> | 39 | #include <qwindowsystem_qws.h> |
40 | #endif | 40 | #endif |
41 | #include <qtextstream.h> | 41 | #include <qtextstream.h> |
42 | #include <qpalette.h> | 42 | #include <qpalette.h> |
43 | #include <qbuffer.h> | 43 | #include <qbuffer.h> |
44 | #include <qptrdict.h> | 44 | #include <qptrdict.h> |
45 | #include <qregexp.h> | 45 | #include <qregexp.h> |
46 | #include <qdir.h> | 46 | #include <qdir.h> |
47 | #include <qlabel.h> | 47 | #include <qlabel.h> |
48 | #include <qdialog.h> | 48 | #include <qdialog.h> |
49 | #include <qdragobject.h> | 49 | #include <qdragobject.h> |
50 | #include <qtextcodec.h> | 50 | #include <qtextcodec.h> |
51 | #include <qevent.h> | 51 | #include <qevent.h> |
52 | #include <qtooltip.h> | 52 | #include <qtooltip.h> |
53 | #include <qsignal.h> | 53 | #include <qsignal.h> |
54 | #include <qmainwindow.h> | 54 | #include <qmainwindow.h> |
55 | #include <qwidgetlist.h> | 55 | #include <qwidgetlist.h> |
56 | #include <qpixmapcache.h> | 56 | #include <qpixmapcache.h> |
57 | 57 | ||
58 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 58 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
59 | #define QTOPIA_INTERNAL_INITAPP | 59 | #define QTOPIA_INTERNAL_INITAPP |
60 | #include "qpeapplication.h" | 60 | #include "qpeapplication.h" |
61 | #include "qpestyle.h" | 61 | #include "qpestyle.h" |
62 | #include "styleinterface.h" | 62 | #include "styleinterface.h" |
63 | #if QT_VERSION >= 0x030000 | 63 | #if QT_VERSION >= 0x030000 |
64 | #include <qstylefactory.h> | 64 | #include <qstylefactory.h> |
65 | #else | 65 | #else |
66 | #include <qplatinumstyle.h> | 66 | #include <qplatinumstyle.h> |
67 | #include <qwindowsstyle.h> | 67 | #include <qwindowsstyle.h> |
68 | #include <qmotifstyle.h> | 68 | #include <qmotifstyle.h> |
69 | #include <qmotifplusstyle.h> | 69 | #include <qmotifplusstyle.h> |
70 | #include "lightstyle.h" | 70 | #include "lightstyle.h" |
71 | 71 | ||
72 | #include <qpe/qlibrary.h> | 72 | #include <qpe/qlibrary.h> |
73 | #endif | 73 | #endif |
74 | #include "global.h" | 74 | #include "global.h" |
75 | #include "resource.h" | 75 | #include "resource.h" |
76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) | 76 | #if QT_VERSION <= 230 && defined(QT_NO_CODECS) |
77 | #include "qutfcodec.h" | 77 | #include "qutfcodec.h" |
78 | #endif | 78 | #endif |
79 | #include "config.h" | 79 | #include "config.h" |
80 | #include "network.h" | 80 | #include "network.h" |
81 | #ifdef QWS | 81 | #ifdef QWS |
82 | #include "fontmanager.h" | 82 | #include "fontmanager.h" |
83 | #include "fontdatabase.h" | 83 | #include "fontdatabase.h" |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #include "alarmserver.h" | 86 | #include "alarmserver.h" |
87 | #include "applnk.h" | 87 | #include "applnk.h" |
88 | #include "qpemenubar.h" | 88 | #include "qpemenubar.h" |
89 | #include "textcodecinterface.h" | 89 | #include "textcodecinterface.h" |
90 | #include "imagecodecinterface.h" | 90 | #include "imagecodecinterface.h" |
91 | #include <qtopia/qpeglobal.h> | 91 | #include <qtopia/qpeglobal.h> |
92 | 92 | ||
93 | #include <unistd.h> | 93 | #include <unistd.h> |
94 | #include <sys/file.h> | 94 | #include <sys/file.h> |
95 | #include <sys/ioctl.h> | 95 | #include <sys/ioctl.h> |
96 | #ifndef QT_NO_SOUND | 96 | #ifndef QT_NO_SOUND |
97 | #include <sys/soundcard.h> | 97 | #include <sys/soundcard.h> |
98 | #endif | 98 | #endif |
99 | #include "qt_override_p.h" | ||
100 | 99 | ||
101 | #include <backend/rohfeedback.h> | 100 | #include <backend/rohfeedback.h> |
102 | 101 | ||
103 | 102 | ||
104 | static bool useBigPixmaps = 0; | 103 | static bool useBigPixmaps = 0; |
105 | 104 | ||
106 | class HackWidget : public QWidget | 105 | class HackWidget : public QWidget |
107 | { | 106 | { |
108 | public: | 107 | public: |
109 | bool needsOk() | 108 | bool needsOk() |
110 | { return (getWState() & WState_Reserved1 ); } | 109 | { return (getWState() & WState_Reserved1 ); } |
111 | 110 | ||
112 | QRect normalGeometry() | 111 | QRect normalGeometry() |
113 | { return topData()->normalGeometry; }; | 112 | { return topData()->normalGeometry; }; |
114 | }; | 113 | }; |
115 | 114 | ||
116 | class QPEApplicationData | 115 | class QPEApplicationData |
117 | { | 116 | { |
118 | public: | 117 | public: |
119 | QPEApplicationData ( ) : | 118 | QPEApplicationData ( ) : |
120 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), | 119 | presstimer( 0 ), presswidget( 0 ), rightpressed( false ), kbgrabbed( false ), |
121 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), | 120 | notbusysent( false ), preloaded( false ), forceshow( false ), nomaximize( false ), |
122 | keep_running( true ), qcopQok( false ), | 121 | keep_running( true ), qcopQok( false ), |
123 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), | 122 | fontFamily( "Vera" ), fontSize( 10 ), smallIconSize( 14 ), |
124 | bigIconSize( 32 ), qpe_main_widget( 0 ) | 123 | bigIconSize( 32 ), qpe_main_widget( 0 ) |
125 | { | 124 | { |
126 | Config cfg( "qpe" ); | 125 | Config cfg( "qpe" ); |
127 | cfg.setGroup( "Appearance" ); | 126 | cfg.setGroup( "Appearance" ); |
128 | useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false ); | 127 | useBigPixmaps = cfg.readBoolEntry( "useBigPixmaps", false ); |
129 | fontFamily = cfg.readEntry( "FontFamily", "Vera" ); | 128 | fontFamily = cfg.readEntry( "FontFamily", "Vera" ); |
130 | fontSize = cfg.readNumEntry( "FontSize", 10 ); | 129 | fontSize = cfg.readNumEntry( "FontSize", 10 ); |
131 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); | 130 | smallIconSize = cfg.readNumEntry( "SmallIconSize", 14 ); |
132 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); | 131 | bigIconSize = cfg.readNumEntry( "BigIconSize", 32 ); |
133 | #ifdef OPIE_WITHROHFEEDBACK | 132 | #ifdef OPIE_WITHROHFEEDBACK |
134 | RoH = 0; | 133 | RoH = 0; |
135 | #endif | 134 | #endif |
136 | } | 135 | } |
137 | 136 | ||
138 | int presstimer; | 137 | int presstimer; |
139 | QWidget* presswidget; | 138 | QWidget* presswidget; |
140 | QPoint presspos; | 139 | QPoint presspos; |
141 | #ifdef OPIE_WITHROHFEEDBACK | 140 | #ifdef OPIE_WITHROHFEEDBACK |
142 | Opie::Internal::RoHFeedback *RoH; | 141 | Opie::Internal::RoHFeedback *RoH; |
143 | #endif | 142 | #endif |
144 | 143 | ||
145 | bool rightpressed : 1; | 144 | bool rightpressed : 1; |
146 | bool kbgrabbed : 1; | 145 | bool kbgrabbed : 1; |
147 | bool notbusysent : 1; | 146 | bool notbusysent : 1; |
148 | bool preloaded : 1; | 147 | bool preloaded : 1; |
149 | bool forceshow : 1; | 148 | bool forceshow : 1; |
150 | bool nomaximize : 1; | 149 | bool nomaximize : 1; |
151 | bool keep_running : 1; | 150 | bool keep_running : 1; |
152 | bool qcopQok : 1; | 151 | bool qcopQok : 1; |
153 | 152 | ||
154 | QCString fontFamily; | 153 | QCString fontFamily; |
155 | int fontSize; | 154 | int fontSize; |
156 | int smallIconSize; | 155 | int smallIconSize; |
157 | int bigIconSize; | 156 | int bigIconSize; |
158 | 157 | ||
159 | QString appName; | 158 | QString appName; |
160 | struct QCopRec | 159 | struct QCopRec |
161 | { | 160 | { |
162 | QCopRec( const QCString &ch, const QCString &msg, | 161 | QCopRec( const QCString &ch, const QCString &msg, |
163 | const QByteArray &d ) : | 162 | const QByteArray &d ) : |
@@ -1291,210 +1290,171 @@ void QPEApplication::setDefaultRotation( int r ) | |||
1291 | } | 1290 | } |
1292 | else { | 1291 | else { |
1293 | #ifndef QT_NO_COP | 1292 | #ifndef QT_NO_COP |
1294 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); | 1293 | { QCopEnvelope e( "QPE/System", "setDefaultRotation(int)" ); |
1295 | e << r; | 1294 | e << r; |
1296 | } | 1295 | } |
1297 | #endif | 1296 | #endif |
1298 | 1297 | ||
1299 | } | 1298 | } |
1300 | } | 1299 | } |
1301 | 1300 | ||
1302 | #include <qgfx_qws.h> | 1301 | #include <qgfx_qws.h> |
1303 | #include <qwindowsystem_qws.h> | 1302 | #include <qwindowsystem_qws.h> |
1304 | 1303 | ||
1305 | #if QT_VERSION > 236 | 1304 | #if QT_VERSION > 236 |
1306 | extern void qws_clearLoadedFonts(); | 1305 | extern void qws_clearLoadedFonts(); |
1307 | #endif | 1306 | #endif |
1308 | 1307 | ||
1309 | void QPEApplication::setCurrentMode( int x, int y, int depth ) | 1308 | void QPEApplication::setCurrentMode( int x, int y, int depth ) |
1310 | { | 1309 | { |
1311 | // Reset the caches | 1310 | // Reset the caches |
1312 | #if QT_VERSION > 236 | 1311 | #if QT_VERSION > 236 |
1313 | qws_clearLoadedFonts(); | 1312 | qws_clearLoadedFonts(); |
1314 | #endif | 1313 | #endif |
1315 | QPixmapCache::clear(); | 1314 | QPixmapCache::clear(); |
1316 | 1315 | ||
1317 | // Change the screen mode | 1316 | // Change the screen mode |
1318 | qt_screen->setMode(x, y, depth); | 1317 | qt_screen->setMode(x, y, depth); |
1319 | 1318 | ||
1320 | if ( qApp->type() == GuiServer ) { | 1319 | if ( qApp->type() == GuiServer ) { |
1321 | #if QT_VERSION > 236 | 1320 | #if QT_VERSION > 236 |
1322 | // Reconfigure the GuiServer | 1321 | // Reconfigure the GuiServer |
1323 | qwsServer->beginDisplayReconfigure(); | 1322 | qwsServer->beginDisplayReconfigure(); |
1324 | qwsServer->endDisplayReconfigure(); | 1323 | qwsServer->endDisplayReconfigure(); |
1325 | #endif | 1324 | #endif |
1326 | // Get all the running apps to reset | 1325 | // Get all the running apps to reset |
1327 | QCopEnvelope env( "QPE/System", "reset()" ); | 1326 | QCopEnvelope env( "QPE/System", "reset()" ); |
1328 | } | 1327 | } |
1329 | } | 1328 | } |
1330 | 1329 | ||
1331 | void QPEApplication::reset() { | 1330 | void QPEApplication::reset() { |
1332 | // Reconnect to the screen | 1331 | // Reconnect to the screen |
1333 | qt_screen->disconnect(); | 1332 | qt_screen->disconnect(); |
1334 | qt_screen->connect( QString::null ); | 1333 | qt_screen->connect( QString::null ); |
1335 | 1334 | ||
1336 | // Redraw everything | 1335 | // Redraw everything |
1337 | applyStyle(); | 1336 | applyStyle(); |
1338 | } | 1337 | } |
1339 | 1338 | ||
1340 | #if (QT_VERSION < 238) && defined Q_OS_MACX | 1339 | #if (QT_VERSION < 238) && defined Q_OS_MACX |
1341 | bool qt_left_hand_scrollbars = false; | 1340 | bool qt_left_hand_scrollbars = false; |
1342 | #else | 1341 | #else |
1343 | extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL; | 1342 | extern bool qt_left_hand_scrollbars QPE_WEAK_SYMBOL; |
1344 | #endif | 1343 | #endif |
1345 | 1344 | ||
1346 | /*! | 1345 | /*! |
1347 | \internal | 1346 | \internal |
1348 | */ | 1347 | */ |
1349 | void QPEApplication::applyStyle() | 1348 | void QPEApplication::applyStyle() |
1350 | { | 1349 | { |
1351 | Config config( "qpe" ); | 1350 | Config config( "qpe" ); |
1352 | config.setGroup( "Appearance" ); | 1351 | config.setGroup( "Appearance" ); |
1353 | 1352 | ||
1354 | #if QT_VERSION > 233 | 1353 | #if QT_VERSION > 233 |
1355 | #if !defined(OPIE_NO_OVERRIDE_QT) | ||
1356 | // don't block ourselves ... | ||
1357 | Opie::force_appearance = 0; | ||
1358 | |||
1359 | static QString appname = Opie::binaryName ( ); | ||
1360 | |||
1361 | QStringList ex = config. readListEntry ( "NoStyle", ';' ); | ||
1362 | int nostyle = 0; | ||
1363 | for ( QStringList::Iterator it = ex. begin ( ); it != ex. end ( ); ++it ) { | ||
1364 | if ( QRegExp (( *it ). mid ( 1 ), false, true ). find ( appname, 0 ) >= 0 ) { | ||
1365 | nostyle = ( *it ). left ( 1 ). toInt ( 0, 32 ); | ||
1366 | break; | ||
1367 | } | ||
1368 | } | ||
1369 | #else | ||
1370 | int nostyle = 0; | ||
1371 | #endif | ||
1372 | |||
1373 | // Widget style | 1354 | // Widget style |
1374 | QString style = config.readEntry( "Style", "FlatStyle" ); | 1355 | QString style = config.readEntry( "Style", "FlatStyle" ); |
1375 | 1356 | ||
1376 | // don't set a custom style | ||
1377 | if ( nostyle & Opie::Force_Style ) | ||
1378 | style = "FlatStyle"; | ||
1379 | |||
1380 | internalSetStyle ( style ); | 1357 | internalSetStyle ( style ); |
1381 | 1358 | ||
1382 | // Colors - from /etc/colors/Liquid.scheme | 1359 | // Colors - from /etc/colors/Liquid.scheme |
1383 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); | 1360 | QColor bgcolor( config.readEntry( "Background", "#E0E0E0" ) ); |
1384 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); | 1361 | QColor btncolor( config.readEntry( "Button", "#96c8fa" ) ); |
1385 | QPalette pal( btncolor, bgcolor ); | 1362 | QPalette pal( btncolor, bgcolor ); |
1386 | QString color = config.readEntry( "Highlight", "#73adef" ); | 1363 | QString color = config.readEntry( "Highlight", "#73adef" ); |
1387 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); | 1364 | pal.setColor( QColorGroup::Highlight, QColor( color ) ); |
1388 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); | 1365 | color = config.readEntry( "HighlightedText", "#FFFFFF" ); |
1389 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); | 1366 | pal.setColor( QColorGroup::HighlightedText, QColor( color ) ); |
1390 | color = config.readEntry( "Text", "#000000" ); | 1367 | color = config.readEntry( "Text", "#000000" ); |
1391 | pal.setColor( QColorGroup::Text, QColor( color ) ); | 1368 | pal.setColor( QColorGroup::Text, QColor( color ) ); |
1392 | color = config.readEntry( "ButtonText", "#000000" ); | 1369 | color = config.readEntry( "ButtonText", "#000000" ); |
1393 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); | 1370 | pal.setColor( QPalette::Active, QColorGroup::ButtonText, QColor( color ) ); |
1394 | color = config.readEntry( "Base", "#FFFFFF" ); | 1371 | color = config.readEntry( "Base", "#FFFFFF" ); |
1395 | pal.setColor( QColorGroup::Base, QColor( color ) ); | 1372 | pal.setColor( QColorGroup::Base, QColor( color ) ); |
1396 | 1373 | ||
1397 | pal.setColor( QPalette::Disabled, QColorGroup::Text, | 1374 | pal.setColor( QPalette::Disabled, QColorGroup::Text, |
1398 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); | 1375 | pal.color( QPalette::Active, QColorGroup::Background ).dark() ); |
1399 | 1376 | ||
1400 | setPalette( pal, TRUE ); | 1377 | setPalette( pal, TRUE ); |
1401 | 1378 | ||
1402 | 1379 | ||
1403 | // Set the ScrollBar on the 'right' side but only if the weak symbol is present | 1380 | // Set the ScrollBar on the 'right' side but only if the weak symbol is present |
1404 | if (&qt_left_hand_scrollbars ) | 1381 | if (&qt_left_hand_scrollbars ) |
1405 | qt_left_hand_scrollbars = config.readBoolEntry( "LeftHand", false ); | 1382 | qt_left_hand_scrollbars = config.readBoolEntry( "LeftHand", false ); |
1406 | 1383 | ||
1407 | // Window Decoration | 1384 | // Window Decoration |
1408 | QString dec = config.readEntry( "Decoration", "Flat" ); | 1385 | QString dec = config.readEntry( "Decoration", "Flat" ); |
1409 | 1386 | ||
1410 | // don't set a custom deco | ||
1411 | if ( nostyle & Opie::Force_Decoration ) | ||
1412 | dec = ""; | ||
1413 | |||
1414 | |||
1415 | if ( dec != d->decorationName ) { | 1387 | if ( dec != d->decorationName ) { |
1416 | qwsSetDecoration( new QPEDecoration( dec ) ); | 1388 | qwsSetDecoration( new QPEDecoration( dec ) ); |
1417 | d->decorationName = dec; | 1389 | d->decorationName = dec; |
1418 | } | 1390 | } |
1419 | 1391 | ||
1420 | // Font | 1392 | // Font |
1421 | QString ff = config.readEntry( "FontFamily", font().family() ); | 1393 | QString ff = config.readEntry( "FontFamily", font().family() ); |
1422 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); | 1394 | int fs = config.readNumEntry( "FontSize", font().pointSize() ); |
1423 | 1395 | ||
1424 | // don't set a custom font | ||
1425 | if ( nostyle & Opie::Force_Font ) { | ||
1426 | ff = "Vera"; | ||
1427 | fs = 10; | ||
1428 | } | ||
1429 | |||
1430 | setFont ( QFont ( ff, fs ), true ); | 1396 | setFont ( QFont ( ff, fs ), true ); |
1431 | |||
1432 | #if !defined(OPIE_NO_OVERRIDE_QT) | ||
1433 | // revert to global blocking policy ... | ||
1434 | Opie::force_appearance = config. readBoolEntry ( "ForceStyle", false ) ? Opie::Force_All : Opie::Force_None; | ||
1435 | Opie::force_appearance &= ~nostyle; | ||
1436 | #endif | ||
1437 | #endif | 1397 | #endif |
1438 | } | 1398 | } |
1439 | 1399 | ||
1440 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) | 1400 | void QPEApplication::systemMessage( const QCString& msg, const QByteArray& data ) |
1441 | { | 1401 | { |
1442 | #ifdef Q_WS_QWS | 1402 | #ifdef Q_WS_QWS |
1443 | QDataStream stream( data, IO_ReadOnly ); | 1403 | QDataStream stream( data, IO_ReadOnly ); |
1444 | if ( msg == "applyStyle()" ) { | 1404 | if ( msg == "applyStyle()" ) { |
1445 | applyStyle(); | 1405 | applyStyle(); |
1446 | } | 1406 | } |
1447 | else if ( msg == "toggleApplicationMenu()" ) { | 1407 | else if ( msg == "toggleApplicationMenu()" ) { |
1448 | QWidget *active = activeWindow ( ); | 1408 | QWidget *active = activeWindow ( ); |
1449 | 1409 | ||
1450 | if ( active ) { | 1410 | if ( active ) { |
1451 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); | 1411 | QPEMenuToolFocusManager *man = QPEMenuToolFocusManager::manager ( ); |
1452 | bool oldactive = man-> isActive ( ); | 1412 | bool oldactive = man-> isActive ( ); |
1453 | 1413 | ||
1454 | man-> setActive( !man-> isActive() ); | 1414 | man-> setActive( !man-> isActive() ); |
1455 | 1415 | ||
1456 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu | 1416 | if ( !oldactive && !man-> isActive ( )) { // no menubar to toggle -> try O-Menu |
1457 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); | 1417 | QCopEnvelope e ( "QPE/TaskBar", "toggleStartMenu()" ); |
1458 | } | 1418 | } |
1459 | } | 1419 | } |
1460 | } | 1420 | } |
1461 | else if ( msg == "setDefaultRotation(int)" ) { | 1421 | else if ( msg == "setDefaultRotation(int)" ) { |
1462 | if ( type() == GuiServer ) { | 1422 | if ( type() == GuiServer ) { |
1463 | int r; | 1423 | int r; |
1464 | stream >> r; | 1424 | stream >> r; |
1465 | setDefaultRotation( r ); | 1425 | setDefaultRotation( r ); |
1466 | } | 1426 | } |
1467 | } | 1427 | } |
1468 | else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> | 1428 | else if ( msg == "setCurrentMode(int,int,int)" ) { // Added: 2003-06-11 by Tim Ansell <mithro@mithis.net> |
1469 | if ( type() == GuiServer ) { | 1429 | if ( type() == GuiServer ) { |
1470 | int x, y, depth; | 1430 | int x, y, depth; |
1471 | stream >> x; | 1431 | stream >> x; |
1472 | stream >> y; | 1432 | stream >> y; |
1473 | stream >> depth; | 1433 | stream >> depth; |
1474 | setCurrentMode( x, y, depth ); | 1434 | setCurrentMode( x, y, depth ); |
1475 | } | 1435 | } |
1476 | } | 1436 | } |
1477 | else if ( msg == "reset()" ) { | 1437 | else if ( msg == "reset()" ) { |
1478 | if ( type() != GuiServer ) | 1438 | if ( type() != GuiServer ) |
1479 | reset(); | 1439 | reset(); |
1480 | } | 1440 | } |
1481 | else if ( msg == "setCurrentRotation(int)" ) { | 1441 | else if ( msg == "setCurrentRotation(int)" ) { |
1482 | int r; | 1442 | int r; |
1483 | stream >> r; | 1443 | stream >> r; |
1484 | setCurrentRotation( r ); | 1444 | setCurrentRotation( r ); |
1485 | } | 1445 | } |
1486 | else if ( msg == "shutdown()" ) { | 1446 | else if ( msg == "shutdown()" ) { |
1487 | if ( type() == GuiServer ) | 1447 | if ( type() == GuiServer ) |
1488 | shutdown(); | 1448 | shutdown(); |
1489 | } | 1449 | } |
1490 | else if ( msg == "quit()" ) { | 1450 | else if ( msg == "quit()" ) { |
1491 | if ( type() != GuiServer ) | 1451 | if ( type() != GuiServer ) |
1492 | tryQuit(); | 1452 | tryQuit(); |
1493 | } | 1453 | } |
1494 | else if ( msg == "forceQuit()" ) { | 1454 | else if ( msg == "forceQuit()" ) { |
1495 | if ( type() != GuiServer ) | 1455 | if ( type() != GuiServer ) |
1496 | quit(); | 1456 | quit(); |
1497 | } | 1457 | } |
1498 | else if ( msg == "restart()" ) { | 1458 | else if ( msg == "restart()" ) { |
1499 | if ( type() == GuiServer ) | 1459 | if ( type() == GuiServer ) |
1500 | restart(); | 1460 | restart(); |
diff --git a/library/qpeapplication.h b/library/qpeapplication.h index 849d5b3..167fe69 100644 --- a/library/qpeapplication.h +++ b/library/qpeapplication.h | |||
@@ -105,133 +105,128 @@ public: | |||
105 | 105 | ||
106 | enum InputMethodHint { | 106 | enum InputMethodHint { |
107 | Normal, | 107 | Normal, |
108 | AlwaysOff, | 108 | AlwaysOff, |
109 | AlwaysOn | 109 | AlwaysOn |
110 | }; | 110 | }; |
111 | 111 | ||
112 | enum screenSaverHint { | 112 | enum screenSaverHint { |
113 | Disable = 0, | 113 | Disable = 0, |
114 | DisableLightOff = 1, | 114 | DisableLightOff = 1, |
115 | DisableSuspend = 2, | 115 | DisableSuspend = 2, |
116 | Enable = 100 | 116 | Enable = 100 |
117 | }; | 117 | }; |
118 | 118 | ||
119 | static void setInputMethodHint( QWidget *, InputMethodHint ); | 119 | static void setInputMethodHint( QWidget *, InputMethodHint ); |
120 | static InputMethodHint inputMethodHint( QWidget * ); | 120 | static InputMethodHint inputMethodHint( QWidget * ); |
121 | 121 | ||
122 | void showMainWidget( QWidget*, bool nomax=FALSE ); | 122 | void showMainWidget( QWidget*, bool nomax=FALSE ); |
123 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); | 123 | void showMainDocumentWidget( QWidget*, bool nomax=FALSE ); |
124 | 124 | ||
125 | static void showDialog( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; | 125 | static void showDialog( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; |
126 | static int execDialog ( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; | 126 | static int execDialog ( QDialog*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; |
127 | static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; | 127 | static void showWidget( QWidget*, bool nomax=FALSE ) QPE_WEAK_SYMBOL; |
128 | /* Merge setTempScreenSaverMode */ | 128 | /* Merge setTempScreenSaverMode */ |
129 | #ifdef QTOPIA_INTERNAL_INITAPP | 129 | #ifdef QTOPIA_INTERNAL_INITAPP |
130 | void initApp( int argv, char **argv ); | 130 | void initApp( int argv, char **argv ); |
131 | #endif | 131 | #endif |
132 | 132 | ||
133 | static void setKeepRunning(); | 133 | static void setKeepRunning(); |
134 | bool keepRunning() const; | 134 | bool keepRunning() const; |
135 | 135 | ||
136 | bool keyboardGrabbed() const; | 136 | bool keyboardGrabbed() const; |
137 | 137 | ||
138 | int exec(); | 138 | int exec(); |
139 | 139 | ||
140 | signals: | 140 | signals: |
141 | void clientMoused(); | 141 | void clientMoused(); |
142 | void timeChanged(); | 142 | void timeChanged(); |
143 | void clockChanged( bool pm ); | 143 | void clockChanged( bool pm ); |
144 | void micChanged( bool muted ); | 144 | void micChanged( bool muted ); |
145 | void volumeChanged( bool muted ); | 145 | void volumeChanged( bool muted ); |
146 | void appMessage( const QCString& msg, const QByteArray& data); | 146 | void appMessage( const QCString& msg, const QByteArray& data); |
147 | void weekChanged( bool startOnMonday ); | 147 | void weekChanged( bool startOnMonday ); |
148 | void dateFormatChanged( DateFormat ); | 148 | void dateFormatChanged( DateFormat ); |
149 | void flush(); | 149 | void flush(); |
150 | void reload(); | 150 | void reload(); |
151 | /* linkChanged signal */ | 151 | /* linkChanged signal */ |
152 | 152 | ||
153 | private slots: | 153 | private slots: |
154 | void systemMessage( const QCString &msg, const QByteArray &data ); | 154 | void systemMessage( const QCString &msg, const QByteArray &data ); |
155 | void pidMessage( const QCString &msg, const QByteArray &data ); | 155 | void pidMessage( const QCString &msg, const QByteArray &data ); |
156 | void removeSenderFromStylusDict(); | 156 | void removeSenderFromStylusDict(); |
157 | void hideOrQuit(); | 157 | void hideOrQuit(); |
158 | 158 | ||
159 | protected: | 159 | protected: |
160 | bool qwsEventFilter( QWSEvent * ); | 160 | bool qwsEventFilter( QWSEvent * ); |
161 | void internalSetStyle( const QString &style ); | 161 | void internalSetStyle( const QString &style ); |
162 | void prepareForTermination(bool willrestart); | 162 | void prepareForTermination(bool willrestart); |
163 | virtual void restart(); | 163 | virtual void restart(); |
164 | virtual void shutdown(); | 164 | virtual void shutdown(); |
165 | bool eventFilter( QObject *, QEvent * ); | 165 | bool eventFilter( QObject *, QEvent * ); |
166 | void timerEvent( QTimerEvent * ); | 166 | void timerEvent( QTimerEvent * ); |
167 | bool raiseAppropriateWindow(); | 167 | bool raiseAppropriateWindow(); |
168 | virtual void tryQuit(); | 168 | virtual void tryQuit(); |
169 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | ||
170 | #if QT_VERSION > 233 | ||
171 | virtual void polish ( QWidget * ); // this is actually implemented in qt_override.cpp (!) | ||
172 | #endif | ||
173 | #endif | ||
174 | private: | 169 | private: |
175 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); | 170 | void mapToDefaultAction( QWSKeyEvent *ke, int defKey ); |
176 | void processQCopFile(); | 171 | void processQCopFile(); |
177 | 172 | ||
178 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) | 173 | #if defined(Q_WS_QWS) && !defined(QT_NO_COP) |
179 | QCopChannel *sysChannel; | 174 | QCopChannel *sysChannel; |
180 | QCopChannel *pidChannel; | 175 | QCopChannel *pidChannel; |
181 | #endif | 176 | #endif |
182 | QPEApplicationData *d; | 177 | QPEApplicationData *d; |
183 | 178 | ||
184 | bool reserved_sh; | 179 | bool reserved_sh; |
185 | 180 | ||
186 | }; | 181 | }; |
187 | 182 | ||
188 | 183 | ||
189 | 184 | ||
190 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ | 185 | enum Transformation { Rot0, Rot90, Rot180, Rot270 }; /* from qgfxtransformed_qws.cpp */ |
191 | 186 | ||
192 | inline int TransToDeg ( Transformation t ) | 187 | inline int TransToDeg ( Transformation t ) |
193 | { | 188 | { |
194 | int d = static_cast<int>( t ); | 189 | int d = static_cast<int>( t ); |
195 | return d * 90; | 190 | return d * 90; |
196 | } | 191 | } |
197 | 192 | ||
198 | inline Transformation DegToTrans ( int d ) | 193 | inline Transformation DegToTrans ( int d ) |
199 | { | 194 | { |
200 | Transformation t = static_cast<Transformation>( d / 90 ); | 195 | Transformation t = static_cast<Transformation>( d / 90 ); |
201 | return t; | 196 | return t; |
202 | } | 197 | } |
203 | 198 | ||
204 | /* | 199 | /* |
205 | * Set current rotation of Opie, and rotation for newly started apps. | 200 | * Set current rotation of Opie, and rotation for newly started apps. |
206 | * Differs from setDefaultRotation in that 1) it rotates currently running apps, | 201 | * Differs from setDefaultRotation in that 1) it rotates currently running apps, |
207 | * and 2) does not set deforient or save orientation to qpe.conf. | 202 | * and 2) does not set deforient or save orientation to qpe.conf. |
208 | */ | 203 | */ |
209 | 204 | ||
210 | inline void QPEApplication::setCurrentRotation( int r ) | 205 | inline void QPEApplication::setCurrentRotation( int r ) |
211 | { | 206 | { |
212 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots | 207 | // setTransformation has been introduced in Qt/Embedded 2.3.4 snapshots |
213 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() | 208 | // for compatibility with the SharpROM use fallback to setDefaultTransformation() |
214 | #if QT_VERSION > 233 | 209 | #if QT_VERSION > 233 |
215 | Transformation e = DegToTrans( r ); | 210 | Transformation e = DegToTrans( r ); |
216 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); | 211 | ::setenv( "QWS_DISPLAY", QString( "Transformed:Rot%1:0" ).arg( r ).latin1(), 1 ); |
217 | qApp->desktop()->qwsDisplay()->setTransformation( e ); | 212 | qApp->desktop()->qwsDisplay()->setTransformation( e ); |
218 | #else | 213 | #else |
219 | setDefaultRotation( r ); | 214 | setDefaultRotation( r ); |
220 | #endif | 215 | #endif |
221 | } | 216 | } |
222 | 217 | ||
223 | /* | 218 | /* |
224 | * Qtopia 1.7 SDK compatibility macros | 219 | * Qtopia 1.7 SDK compatibility macros |
225 | * FIXME: Support Opie Quicklaunch Interface | 220 | * FIXME: Support Opie Quicklaunch Interface |
226 | */ | 221 | */ |
227 | #define QTOPIA_ADD_APPLICATION(NAME,IMPLEMENTATION) \ | 222 | #define QTOPIA_ADD_APPLICATION(NAME,IMPLEMENTATION) \ |
228 | int main( int argc, char** argv ) \ | 223 | int main( int argc, char** argv ) \ |
229 | { \ | 224 | { \ |
230 | QPEApplication app = QPEApplication( argc, argv );\ | 225 | QPEApplication app = QPEApplication( argc, argv );\ |
231 | IMPLEMENTATION* mw = new IMPLEMENTATION(); \ | 226 | IMPLEMENTATION* mw = new IMPLEMENTATION(); \ |
232 | app.showMainWidget( mw ); \ | 227 | app.showMainWidget( mw ); \ |
233 | app.exec(); \ | 228 | app.exec(); \ |
234 | } | 229 | } |
235 | #define QTOPIA_MAIN // Bee-Bop-Alula | 230 | #define QTOPIA_MAIN // Bee-Bop-Alula |
236 | 231 | ||
237 | /* | 232 | /* |
diff --git a/library/qt_override.cpp b/library/qt_override.cpp deleted file mode 100644 index a0d753b..0000000 --- a/library/qt_override.cpp +++ b/dev/null | |||
@@ -1,170 +0,0 @@ | |||
1 | |||
2 | #include <qpe/qpeapplication.h> | ||
3 | #include <qfontdatabase.h> | ||
4 | |||
5 | #include <unistd.h> | ||
6 | #include <stdlib.h> | ||
7 | #include <stdio.h> | ||
8 | #include <limits.h> | ||
9 | #include <sys/param.h> // for toolchains with old libc headers | ||
10 | |||
11 | #include <qtopia/qpeglobal.h> | ||
12 | #include "qt_override_p.h" | ||
13 | |||
14 | #if QT_VERSION > 233 | ||
15 | |||
16 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | ||
17 | struct color_fix_t { | ||
18 | char *m_app; | ||
19 | char *m_class; | ||
20 | char *m_name; | ||
21 | QColorGroup::ColorRole m_set; | ||
22 | QColorGroup::ColorRole m_get; | ||
23 | }; | ||
24 | |||
25 | |||
26 | |||
27 | static const color_fix_t apps_that_need_special_colors [] = { | ||
28 | { "HancomMobileWord", "HTextEdit", 0, QColorGroup::Background, QColorGroup::Base }, | ||
29 | { "neocal", "Display", 0, QColorGroup::Background, QColorGroup::Base }, | ||
30 | |||
31 | { 0, 0, 0, QColorGroup::Base, QColorGroup::Base } | ||
32 | }; | ||
33 | |||
34 | #endif | ||
35 | |||
36 | #ifndef OPIE_NO_OVERRIDE_QT | ||
37 | |||
38 | static const char * const apps_that_need_pointsizes_times_10 [] = { | ||
39 | "HancomMobileWord", | ||
40 | "hancomsheet", | ||
41 | "HancomPresenterViewer", | ||
42 | |||
43 | 0 | ||
44 | }; | ||
45 | |||
46 | |||
47 | |||
48 | |||
49 | int Opie::force_appearance = 0; | ||
50 | |||
51 | |||
52 | // Return the *real* name of the binary - not just a quick guess | ||
53 | // by looking at argv [0] (which could be anything) | ||
54 | |||
55 | static void binaryNameFree ( ) | ||
56 | { | ||
57 | ::free ((void *) Opie::binaryName ( )); // we need to cast away the const here | ||
58 | } | ||
59 | |||
60 | const char *Opie::binaryName ( ) | ||
61 | { | ||
62 | static const char *appname = 0; | ||
63 | |||
64 | if ( !appname ) { | ||
65 | char dst [PATH_MAX + 1]; | ||
66 | int l = ::readlink ( "/proc/self/exe", dst, PATH_MAX ); | ||
67 | |||
68 | if ( l <= 0 ) | ||
69 | l = 0; | ||
70 | |||
71 | dst [l] = 0; | ||
72 | const char *b = ::strrchr ( dst, '/' ); | ||
73 | appname = ::strdup ( b ? b + 1 : dst ); | ||
74 | |||
75 | ::atexit ( binaryNameFree ); | ||
76 | } | ||
77 | return appname; | ||
78 | } | ||
79 | |||
80 | #else | ||
81 | int Opie::force_appearance = 0; | ||
82 | #endif | ||
83 | |||
84 | // Fix for a toolchain incompatibility (binaries compiled with | ||
85 | // old tcs using shared libs compiled with newer tcs) | ||
86 | |||
87 | extern "C" { | ||
88 | |||
89 | extern void __gmon_start__ ( ) QPE_WEAK_SYMBOL; | ||
90 | extern void __gmon_start__ ( ) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | } | ||
95 | |||
96 | |||
97 | #ifndef OPIE_NO_ERASE_RECT_HACKFIX | ||
98 | // Fix for apps, that use QPainter::eraseRect() which doesn't work with styles | ||
99 | // that set a background pixmap (it would be easier to fix eraseRect(), but | ||
100 | // TT made it an inline ...) | ||
101 | |||
102 | void QPEApplication::polish ( QWidget *w ) | ||
103 | { | ||
104 | #ifndef OPIE_NO_OVERRIDE_QT | ||
105 | for ( const color_fix_t *ptr = apps_that_need_special_colors; ptr-> m_app; ptr++ ) { | ||
106 | if (( ::strcmp ( Opie::binaryName ( ), ptr-> m_app ) == 0 ) && | ||
107 | ( ptr-> m_class ? w-> inherits ( ptr-> m_class ) : true ) && | ||
108 | ( ptr-> m_name ? ( ::strcmp ( w-> name ( ), ptr-> m_name ) == 0 ) : true )) { | ||
109 | QPalette pal = w-> palette ( ); | ||
110 | pal. setColor ( ptr-> m_set, pal. color ( QPalette::Active, ptr-> m_get )); | ||
111 | w-> setPalette ( pal ); | ||
112 | } | ||
113 | } | ||
114 | #endif | ||
115 | QApplication::polish ( w ); | ||
116 | } | ||
117 | #endif | ||
118 | |||
119 | |||
120 | #ifndef OPIE_NO_OVERRIDE_QT | ||
121 | // Fix for the binary incompatibility that TT introduced in Qt/E 2.3.4 -- point sizes | ||
122 | // were multiplied by 10 (which was incorrect) | ||
123 | |||
124 | QValueList <int> QFontDatabase::pointSizes ( QString const &family, QString const &style, QString const &charset ) | ||
125 | { | ||
126 | QValueList <int> sl = pointSizes_NonWeak ( family, style, charset ); | ||
127 | |||
128 | for ( const char * const *ptr = apps_that_need_pointsizes_times_10; *ptr; ptr++ ) { | ||
129 | if ( ::strcmp ( Opie::binaryName ( ), *ptr ) == 0 ) { | ||
130 | for ( QValueList <int>::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | ||
131 | *it *= 10; | ||
132 | } | ||
133 | } | ||
134 | return sl; | ||
135 | } | ||
136 | |||
137 | |||
138 | // Various style/font/color related overrides for weak symbols in Qt/E, | ||
139 | // which allows us to force the usage of the global Opie appearance. | ||
140 | |||
141 | void QApplication::setStyle ( QStyle *style ) | ||
142 | { | ||
143 | if ( Opie::force_appearance & Opie::Force_Style ) | ||
144 | delete style; | ||
145 | else | ||
146 | QApplication::setStyle_NonWeak ( style ); | ||
147 | } | ||
148 | |||
149 | void QApplication::setPalette ( const QPalette &pal, bool informWidgets, const char *className ) | ||
150 | { | ||
151 | if (!( Opie::force_appearance & Opie::Force_Style )) | ||
152 | QApplication::setPalette_NonWeak ( pal, informWidgets, className ); | ||
153 | } | ||
154 | |||
155 | void QApplication::setFont ( const QFont &fnt, bool informWidgets, const char *className ) | ||
156 | { | ||
157 | if (!( Opie::force_appearance & Opie::Force_Font )) | ||
158 | QApplication::setFont_NonWeak ( fnt, informWidgets, className ); | ||
159 | } | ||
160 | |||
161 | |||
162 | void QApplication::qwsSetDecoration ( QWSDecoration *deco ) | ||
163 | { | ||
164 | if ( Opie::force_appearance & Opie::Force_Decoration ) | ||
165 | delete deco; | ||
166 | else | ||
167 | QApplication::qwsSetDecoration_NonWeak ( deco ); | ||
168 | } | ||
169 | #endif | ||
170 | #endif | ||
diff --git a/library/qt_override_p.h b/library/qt_override_p.h deleted file mode 100644 index cb05d15..0000000 --- a/library/qt_override_p.h +++ b/dev/null | |||
@@ -1,25 +0,0 @@ | |||
1 | #ifndef __QT_OVERRIDE_H__ | ||
2 | #define __QT_OVERRIDE_H__ | ||
3 | |||
4 | #if QT_VERSION > 233 | ||
5 | |||
6 | namespace Opie { | ||
7 | |||
8 | enum ForceAppearance { | ||
9 | Force_Style = 0x01, | ||
10 | Force_Font = 0x02, | ||
11 | Force_Decoration = 0x04, | ||
12 | |||
13 | Force_All = 0xff, | ||
14 | Force_None = 0x00, | ||
15 | }; | ||
16 | |||
17 | extern const char *binaryName ( ); | ||
18 | |||
19 | extern int force_appearance; | ||
20 | |||
21 | } | ||
22 | |||
23 | #endif // (QT_VERSION >233) | ||
24 | |||
25 | #endif | ||
diff --git a/noncore/settings/appearance2/appearance.cpp b/noncore/settings/appearance2/appearance.cpp index 088171c..d649ed6 100644 --- a/noncore/settings/appearance2/appearance.cpp +++ b/noncore/settings/appearance2/appearance.cpp | |||
@@ -232,419 +232,328 @@ QWidget *Appearance::createFontTab ( QWidget *parent, Config &cfg ) | |||
232 | QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); | 232 | QWhatsThis::add( m_fontselect, tr( "Select the desired name, style and size of the default font applications will use." ) ); |
233 | 233 | ||
234 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), | 234 | connect( m_fontselect, SIGNAL( fontSelected(const QFont&)), |
235 | this, SLOT( fontClicked(const QFont&))); | 235 | this, SLOT( fontClicked(const QFont&))); |
236 | 236 | ||
237 | return m_fontselect; | 237 | return m_fontselect; |
238 | } | 238 | } |
239 | 239 | ||
240 | QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) | 240 | QWidget *Appearance::createColorTab ( QWidget *parent, Config &cfg ) |
241 | { | 241 | { |
242 | QWidget *tab = new QWidget( parent, "ColorTab" ); | 242 | QWidget *tab = new QWidget( parent, "ColorTab" ); |
243 | QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 ); | 243 | QGridLayout *gridLayout = new QGridLayout( tab, 0, 0, 3, 3 ); |
244 | gridLayout->setRowStretch ( 3, 10 ); | 244 | gridLayout->setRowStretch ( 3, 10 ); |
245 | 245 | ||
246 | m_color_list = new QListBox ( tab ); | 246 | m_color_list = new QListBox ( tab ); |
247 | gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); | 247 | gridLayout->addMultiCellWidget ( m_color_list, 0, 3, 0, 0 ); |
248 | connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) ); | 248 | connect( m_color_list, SIGNAL( highlighted(int) ), this, SLOT( colorClicked(int) ) ); |
249 | QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) ); | 249 | QWhatsThis::add( m_color_list, tr( "Color schemes are a collection of colors which are used for various parts of the display.\n\nClick here to select an available scheme." ) ); |
250 | 250 | ||
251 | m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg )); | 251 | m_color_list-> insertItem ( new ColorListItem ( tr( "Current scheme" ), cfg )); |
252 | 252 | ||
253 | QString path = QPEApplication::qpeDir ( ); | 253 | QString path = QPEApplication::qpeDir ( ); |
254 | path.append( "/etc/colors/" ); | 254 | path.append( "/etc/colors/" ); |
255 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); | 255 | QStringList sl = QDir ( path ). entryList ( "*.scheme" ); |
256 | 256 | ||
257 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | 257 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) |
258 | { | 258 | { |
259 | QString name = (*it). left ((*it). find ( ".scheme" )); | 259 | QString name = (*it). left ((*it). find ( ".scheme" )); |
260 | QString pathstr = path; | 260 | QString pathstr = path; |
261 | pathstr.append( *it ); | 261 | pathstr.append( *it ); |
262 | Config config ( pathstr, Config::File ); | 262 | Config config ( pathstr, Config::File ); |
263 | config. setGroup ( "Colors" ); | 263 | config. setGroup ( "Colors" ); |
264 | 264 | ||
265 | m_color_list-> insertItem ( new ColorListItem ( name, config )); | 265 | m_color_list-> insertItem ( new ColorListItem ( name, config )); |
266 | } | 266 | } |
267 | 267 | ||
268 | m_color_list-> setCurrentItem ( 0 ); | 268 | m_color_list-> setCurrentItem ( 0 ); |
269 | 269 | ||
270 | QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" ); | 270 | QPushButton* tempButton = new QPushButton( tab, "editSchemeButton" ); |
271 | tempButton->setText( tr( "Edit..." ) ); | 271 | tempButton->setText( tr( "Edit..." ) ); |
272 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) ); | 272 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( editSchemeClicked() ) ); |
273 | gridLayout->addWidget( tempButton, 0, 1 ); | 273 | gridLayout->addWidget( tempButton, 0, 1 ); |
274 | QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) ); | 274 | QWhatsThis::add( tempButton, tr( "Click here to change the colors in the current color scheme." ) ); |
275 | 275 | ||
276 | tempButton = new QPushButton( tab, "deleteSchemeButton" ); | 276 | tempButton = new QPushButton( tab, "deleteSchemeButton" ); |
277 | tempButton->setText( tr( "Delete" ) ); | 277 | tempButton->setText( tr( "Delete" ) ); |
278 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) ); | 278 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( deleteSchemeClicked() ) ); |
279 | gridLayout->addWidget( tempButton, 1, 1 ); | 279 | gridLayout->addWidget( tempButton, 1, 1 ); |
280 | QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) ); | 280 | QWhatsThis::add( tempButton, tr( "Click here to delete the color scheme selected in the list to the left." ) ); |
281 | 281 | ||
282 | tempButton = new QPushButton( tab, "saveSchemeButton" ); | 282 | tempButton = new QPushButton( tab, "saveSchemeButton" ); |
283 | tempButton->setText( tr( "Save" ) ); | 283 | tempButton->setText( tr( "Save" ) ); |
284 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) ); | 284 | connect( tempButton, SIGNAL( clicked() ), this, SLOT( saveSchemeClicked() ) ); |
285 | gridLayout->addWidget( tempButton, 2, 1 ); | 285 | gridLayout->addWidget( tempButton, 2, 1 ); |
286 | QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) ); | 286 | QWhatsThis::add( tempButton, tr( "Click here to name and save the current color scheme." ) ); |
287 | 287 | ||
288 | return tab; | 288 | return tab; |
289 | } | 289 | } |
290 | 290 | ||
291 | QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) | 291 | QWidget *Appearance::createAdvancedTab ( QWidget *parent, Config &cfg ) |
292 | { | 292 | { |
293 | QWidget *tab = new QWidget ( parent ); | 293 | QWidget *tab = new QWidget ( parent ); |
294 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); | 294 | QVBoxLayout *vertLayout = new QVBoxLayout( tab, 3, 3 ); |
295 | 295 | ||
296 | QGridLayout *lay = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); | ||
297 | |||
298 | m_force = new QCheckBox ( tr( "Force styling for all applications." ), tab ); | ||
299 | m_force-> setChecked ( cfg. readBoolEntry ( "ForceStyle" )); | ||
300 | lay-> addMultiCellWidget ( m_force, 0, 0, 0, 1 ); | ||
301 | QWhatsThis::add( m_force, tr( "Click here to allow all applications to use global appearance settings." ) ); | ||
302 | |||
303 | QLabel *l = new QLabel ( tab ); | ||
304 | l-> setText ( QString ( "<p>%1</p>" ). arg ( tr( "Disable styling for these applications ( <b>*</b> can be used as a wildcard):" ))); | ||
305 | lay-> addMultiCellWidget ( l, 1, 1, 0, 1 ); | ||
306 | QWhatsThis::add( l, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); | ||
307 | |||
308 | m_except = new QListView ( tab ); | ||
309 | m_except-> addColumn ( Resource::loadIconSet ( "appearance" ), "", 24 ); | ||
310 | m_except-> addColumn ( Resource::loadIconSet ( "font" ), "", 24 ); | ||
311 | m_except-> addColumn ( Resource::loadIconSet ( "appearance/deco" ), "", 24 ); | ||
312 | m_except-> addColumn ( tr( "Binary file(s)" )); | ||
313 | m_except-> setColumnAlignment ( 0, AlignCenter ); | ||
314 | m_except-> setColumnAlignment ( 1, AlignCenter ); | ||
315 | m_except-> setColumnAlignment ( 2, AlignCenter ); | ||
316 | m_except-> setAllColumnsShowFocus ( true ); | ||
317 | m_except-> setMinimumHeight ( 30 ); | ||
318 | m_except-> header ( )-> setClickEnabled ( false ); | ||
319 | m_except-> header ( )-> setResizeEnabled ( false ); | ||
320 | m_except-> header ( )-> setMovingEnabled ( false ); | ||
321 | m_except-> setSorting ( -1 ); | ||
322 | lay-> addMultiCellWidget ( m_except, 2, 6, 0, 0 ); | ||
323 | QWhatsThis::add( m_except, tr( "If some applications do not display correctly with the global appearance settings, certain features can be turned off for that application.\n\nThis area allows you to select an application and which settings you wish to disable." ) ); | ||
324 | |||
325 | connect ( m_except, SIGNAL( clicked(QListViewItem*,const QPoint&,int)), this, SLOT( clickedExcept(QListViewItem*,const QPoint&,int))); | ||
326 | |||
327 | QToolButton *tb = new QToolButton ( tab ); | ||
328 | tb-> setIconSet ( Resource::loadIconSet ( "appearance/add" )); | ||
329 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | ||
330 | lay-> addWidget ( tb, 2, 1 ); | ||
331 | connect ( tb, SIGNAL( clicked()), this, SLOT( addExcept())); | ||
332 | QWhatsThis::add( tb, tr( "Click here to add an application to the list above." ) ); | ||
333 | |||
334 | tb = new QToolButton ( tab ); | ||
335 | tb-> setIconSet ( Resource::loadIconSet ( "editdelete" )); | ||
336 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | ||
337 | lay-> addWidget ( tb, 3, 1 ); | ||
338 | connect ( tb, SIGNAL( clicked()), this, SLOT( delExcept())); | ||
339 | QWhatsThis::add( tb, tr( "Click here to delete the currently selected application." ) ); | ||
340 | |||
341 | tb = new QToolButton ( tab ); | ||
342 | tb-> setIconSet ( Resource::loadIconSet ( "up" )); | ||
343 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | ||
344 | lay-> addWidget ( tb, 4, 1 ); | ||
345 | connect ( tb, SIGNAL( clicked()), this, SLOT( upExcept())); | ||
346 | QWhatsThis::add( tb, tr( "Click here to move the currently selected application up in the list." ) ); | ||
347 | |||
348 | tb = new QToolButton ( tab ); | ||
349 | tb-> setIconSet ( Resource::loadIconSet ( "down" )); | ||
350 | tb-> setFocusPolicy ( QWidget::StrongFocus ); | ||
351 | lay-> addWidget ( tb, 5, 1 ); | ||
352 | connect ( tb, SIGNAL( clicked()), this, SLOT( downExcept())); | ||
353 | QWhatsThis::add( tb, tr( "Click here to move the currently selected application down in the list." ) ); | ||
354 | |||
355 | lay-> setRowStretch ( 6, 10 ); | ||
356 | lay-> setColStretch ( 0, 10 ); | ||
357 | |||
358 | QStringList sl = cfg. readListEntry ( "NoStyle", ';' ); | ||
359 | QListViewItem *lvit = 0; | ||
360 | for ( QStringList::Iterator it = sl. begin ( ); it != sl. end ( ); ++it ) | ||
361 | { | ||
362 | int fl = ( *it ). left ( 1 ). toInt ( 0, 32 ); | ||
363 | |||
364 | lvit = new ExceptListItem ( m_except, lvit, ( *it ). mid ( 1 ), fl & 0x01, fl & 0x02, fl & 0x04 ); | ||
365 | } | ||
366 | |||
367 | |||
368 | vertLayout-> addSpacing ( 3 ); | ||
369 | QFrame *f = new QFrame ( tab ); | ||
370 | f-> setFrameStyle ( QFrame::HLine | QFrame::Sunken ); | ||
371 | vertLayout-> addWidget ( f ); | ||
372 | vertLayout-> addSpacing ( 3 ); | ||
373 | |||
374 | |||
375 | QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); | 296 | QGridLayout* gridLayout = new QGridLayout ( vertLayout, 0, 0, 3, 0 ); |
376 | 297 | ||
377 | int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; | 298 | int style = cfg. readNumEntry ( "TabStyle", 2 ) - 1; |
378 | bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); | 299 | bool tabtop = ( cfg. readEntry ( "TabPosition", "Top" ) == "Top" ); |
379 | 300 | ||
380 | QLabel* label = new QLabel( tr( "Tab style:" ), tab ); | 301 | QLabel* label = new QLabel( tr( "Tab style:" ), tab ); |
381 | gridLayout-> addWidget ( label, 0, 0 ); | 302 | gridLayout-> addWidget ( label, 0, 0 ); |
382 | QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); | 303 | QWhatsThis::add( label, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); |
383 | 304 | ||
384 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); | 305 | QButtonGroup* btngrp = new QButtonGroup( tab, "buttongroup" ); |
385 | btngrp-> hide ( ); | 306 | btngrp-> hide ( ); |
386 | btngrp-> setExclusive ( true ); | 307 | btngrp-> setExclusive ( true ); |
387 | 308 | ||
388 | m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); | 309 | m_tabstyle_list = new QComboBox ( false, tab, "tabstyle" ); |
389 | m_tabstyle_list-> insertItem ( tr( "Tabs" )); | 310 | m_tabstyle_list-> insertItem ( tr( "Tabs" )); |
390 | m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); | 311 | m_tabstyle_list-> insertItem ( tr( "Tabs w/icons" )); |
391 | m_tabstyle_list-> insertItem ( tr( "Drop down list" )); | 312 | m_tabstyle_list-> insertItem ( tr( "Drop down list" )); |
392 | m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); | 313 | m_tabstyle_list-> insertItem ( tr( "Drop down list w/icons" )); |
393 | m_tabstyle_list-> setCurrentItem ( style ); | 314 | m_tabstyle_list-> setCurrentItem ( style ); |
394 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); | 315 | gridLayout-> addMultiCellWidget ( m_tabstyle_list, 0, 0, 1, 2 ); |
395 | QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); | 316 | QWhatsThis::add( m_tabstyle_list, tr( "Click here to select a desired style for tabbed dialogs (such as this application). The styles available are:\n\n1. Tabs - normal tabs with text labels only\n2. Tabs w/icons - tabs with icons for each tab, text label only appears on current tab\n3. Drop down list - a vertical listing of tabs\n4. Drop down list w/icons - a vertical listing of tabs with icons" ) ); |
396 | 317 | ||
397 | m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); | 318 | m_tabstyle_top = new QRadioButton( tr( "Top" ), tab, "tabpostop" ); |
398 | btngrp-> insert ( m_tabstyle_top ); | 319 | btngrp-> insert ( m_tabstyle_top ); |
399 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); | 320 | gridLayout-> addWidget( m_tabstyle_top, 1, 1 ); |
400 | QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); | 321 | QWhatsThis::add( m_tabstyle_top, tr( "Click here so that tabs appear at the top of the window." ) ); |
401 | 322 | ||
402 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); | 323 | m_tabstyle_bottom = new QRadioButton( tr( "Bottom" ), tab, "tabposbottom" ); |
403 | btngrp-> insert ( m_tabstyle_bottom ); | 324 | btngrp-> insert ( m_tabstyle_bottom ); |
404 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); | 325 | gridLayout-> addWidget( m_tabstyle_bottom, 1, 2 ); |
405 | QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); | 326 | QWhatsThis::add( m_tabstyle_bottom, tr( "Click here so that tabs appear at the bottom of the window." ) ); |
406 | 327 | ||
407 | m_tabstyle_top-> setChecked ( tabtop ); | 328 | m_tabstyle_top-> setChecked ( tabtop ); |
408 | m_tabstyle_bottom-> setChecked ( !tabtop ); | 329 | m_tabstyle_bottom-> setChecked ( !tabtop ); |
409 | 330 | ||
410 | m_original_tabstyle = style; | 331 | m_original_tabstyle = style; |
411 | m_original_tabpos = tabtop; | 332 | m_original_tabpos = tabtop; |
412 | 333 | ||
413 | vertLayout-> addSpacing ( 3 ); | 334 | vertLayout-> addSpacing ( 3 ); |
414 | QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); | 335 | QHBoxLayout *rotLay = new QHBoxLayout ( vertLayout, 3 ); |
415 | 336 | ||
416 | QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); | 337 | QLabel* rotlabel = new QLabel( tr( "Rotation direction:" ), tab ); |
417 | m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); | 338 | m_rotdir_cw = new QRadioButton( tab, "rotdir_cw" ); |
418 | QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( ); | 339 | QPixmap cw1 = Resource::loadIconSet("redo"). pixmap( ); |
419 | m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); | 340 | m_rotdir_ccw = new QRadioButton( tab, "rotdir_ccw" ); |
420 | QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 ); | 341 | QImage ccwImage = cw1. convertToImage( ). mirror( 1, 0 ); |
421 | QPixmap ccw1; | 342 | QPixmap ccw1; |
422 | m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); | 343 | m_rotdir_flip = new QRadioButton( tab, "rotdir_flip" ); |
423 | QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( ); | 344 | QPixmap flip1 = Resource::loadIconSet("pass"). pixmap( ); |
424 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); | 345 | QButtonGroup* rotbtngrp = new QButtonGroup( tab, "rotbuttongroup" ); |
425 | 346 | ||
426 | rotbtngrp-> hide ( ); | 347 | rotbtngrp-> hide ( ); |
427 | rotbtngrp-> setExclusive ( true ); | 348 | rotbtngrp-> setExclusive ( true ); |
428 | rotbtngrp-> insert ( m_rotdir_cw ); | 349 | rotbtngrp-> insert ( m_rotdir_cw ); |
429 | rotbtngrp-> insert ( m_rotdir_ccw ); | 350 | rotbtngrp-> insert ( m_rotdir_ccw ); |
430 | rotbtngrp-> insert ( m_rotdir_flip ); | 351 | rotbtngrp-> insert ( m_rotdir_flip ); |
431 | 352 | ||
432 | ccw1. convertFromImage( ccwImage ); | 353 | ccw1. convertFromImage( ccwImage ); |
433 | m_rotdir_cw-> setPixmap( cw1 ); | 354 | m_rotdir_cw-> setPixmap( cw1 ); |
434 | m_rotdir_ccw-> setPixmap( ccw1 ); | 355 | m_rotdir_ccw-> setPixmap( ccw1 ); |
435 | m_rotdir_flip-> setPixmap( flip1 ); | 356 | m_rotdir_flip-> setPixmap( flip1 ); |
436 | 357 | ||
437 | rotLay-> addWidget ( rotlabel, 0 ); | 358 | rotLay-> addWidget ( rotlabel, 0 ); |
438 | rotLay-> addWidget ( m_rotdir_cw, 0 ); | 359 | rotLay-> addWidget ( m_rotdir_cw, 0 ); |
439 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); | 360 | rotLay-> addWidget ( m_rotdir_ccw, 0 ); |
440 | rotLay-> addWidget ( m_rotdir_flip, 0 ); | 361 | rotLay-> addWidget ( m_rotdir_flip, 0 ); |
441 | 362 | ||
442 | int rotDirection = cfg.readNumEntry( "rotatedir" ); | 363 | int rotDirection = cfg.readNumEntry( "rotatedir" ); |
443 | ODirection rot = CW; | 364 | ODirection rot = CW; |
444 | 365 | ||
445 | if (rotDirection == -1) | 366 | if (rotDirection == -1) |
446 | { | 367 | { |
447 | rot = ODevice::inst ( )-> direction ( ); | 368 | rot = ODevice::inst ( )-> direction ( ); |
448 | } | 369 | } |
449 | else | 370 | else |
450 | { | 371 | { |
451 | rot = (ODirection)rotDirection; | 372 | rot = (ODirection)rotDirection; |
452 | } | 373 | } |
453 | 374 | ||
454 | m_rotdir_cw-> setChecked ( rot == CW ); | 375 | m_rotdir_cw-> setChecked ( rot == CW ); |
455 | m_rotdir_ccw-> setChecked ( rot == CCW ); | 376 | m_rotdir_ccw-> setChecked ( rot == CCW ); |
456 | m_rotdir_flip-> setChecked ( rot == Flip ); | 377 | m_rotdir_flip-> setChecked ( rot == Flip ); |
457 | 378 | ||
379 | |||
380 | /* | ||
381 | * add a spacing | ||
382 | */ | ||
383 | vertLayout->addItem( new QSpacerItem( 1, 1, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); | ||
458 | return tab; | 384 | return tab; |
459 | } | 385 | } |
460 | 386 | ||
461 | 387 | ||
462 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) | 388 | Appearance::Appearance( QWidget* parent, const char* name, WFlags ) |
463 | : QDialog ( parent, name, true, WStyle_ContextHelp ) | 389 | : QDialog ( parent, name, true, WStyle_ContextHelp ) |
464 | { | 390 | { |
465 | setCaption( tr( "Appearance Settings" ) ); | 391 | setCaption( tr( "Appearance Settings" ) ); |
466 | 392 | ||
467 | Config config( "qpe" ); | 393 | Config config( "qpe" ); |
468 | config.setGroup( "Appearance" ); | 394 | config.setGroup( "Appearance" ); |
469 | 395 | ||
470 | QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); | 396 | QVBoxLayout *top = new QVBoxLayout ( this, 3, 3 ); |
471 | 397 | ||
472 | m_sample = new SampleWindow ( this ); | 398 | m_sample = new SampleWindow ( this ); |
473 | 399 | ||
474 | m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); | 400 | m_sample-> setDecoration ( new DefaultWindowDecoration ( ) ); |
475 | QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); | 401 | QWhatsThis::add( m_sample, tr( "This is a preview window. Look here to see your new appearance as options are changed." ) ); |
476 | 402 | ||
477 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); | 403 | OTabWidget* tw = new OTabWidget ( this, "tabwidget", OTabWidget::Global, OTabWidget::Bottom ); |
478 | QWidget *styletab; | 404 | QWidget *styletab; |
479 | 405 | ||
480 | m_color_list = 0; | 406 | m_color_list = 0; |
481 | 407 | ||
482 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); | 408 | tw-> addTab ( styletab = createStyleTab ( tw, config ), "appearance", tr( "Style" )); |
483 | tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); | 409 | tw-> addTab ( createFontTab ( tw, config ), "font", tr( "Font" )); |
484 | tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); | 410 | tw-> addTab ( createColorTab ( tw, config ), "appearance/color", tr( "Colors" ) ); |
485 | tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); | 411 | tw-> addTab ( createDecoTab ( tw, config ), "appearance/deco", tr( "Windows" ) ); |
486 | tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); | 412 | tw-> addTab ( m_advtab = createAdvancedTab ( tw, config ), "SettingsIcon", tr( "Advanced" ) ); |
487 | 413 | ||
488 | top-> addWidget ( tw, 10 ); | 414 | top-> addWidget ( tw, 10 ); |
489 | top-> addWidget ( m_sample, 1 ); | 415 | top-> addWidget ( m_sample, 1 ); |
490 | 416 | ||
491 | tw-> setCurrentTab ( styletab ); | 417 | tw-> setCurrentTab ( styletab ); |
492 | connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*))); | 418 | connect ( tw, SIGNAL( currentChanged(QWidget*)), this, SLOT( tabChanged(QWidget*))); |
493 | 419 | ||
494 | m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; | 420 | m_style_changed = m_font_changed = m_color_changed = m_deco_changed = false; |
495 | } | 421 | } |
496 | 422 | ||
497 | Appearance::~Appearance() | 423 | Appearance::~Appearance() |
498 | {} | 424 | {} |
499 | 425 | ||
500 | void Appearance::tabChanged ( QWidget *w ) | 426 | void Appearance::tabChanged ( QWidget *w ) |
501 | { | 427 | { |
502 | if ( w == m_advtab ) | 428 | if ( w == m_advtab ) |
503 | { | 429 | { |
504 | m_sample-> hide ( ); | 430 | m_sample-> hide ( ); |
505 | updateGeometry ( ); // shouldn't be necessary ... | 431 | updateGeometry ( ); // shouldn't be necessary ... |
506 | } | 432 | } |
507 | else | 433 | else |
508 | m_sample-> show ( ); | 434 | m_sample-> show ( ); |
509 | } | 435 | } |
510 | 436 | ||
511 | void Appearance::accept ( ) | 437 | void Appearance::accept ( ) |
512 | { | 438 | { |
513 | bool newtabpos = m_tabstyle_top-> isChecked ( ); | 439 | bool newtabpos = m_tabstyle_top-> isChecked ( ); |
514 | int newtabstyle = m_tabstyle_list-> currentItem ( ); | 440 | int newtabstyle = m_tabstyle_list-> currentItem ( ); |
515 | 441 | ||
516 | Config config ( "qpe" ); | 442 | Config config ( "qpe" ); |
517 | config. setGroup ( "Appearance" ); | 443 | config. setGroup ( "Appearance" ); |
518 | 444 | ||
519 | if ( m_style_changed ) | 445 | if ( m_style_changed ) |
520 | { | 446 | { |
521 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 447 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
522 | if ( item ) | 448 | if ( item ) |
523 | config.writeEntry( "Style", item-> key ( )); | 449 | config.writeEntry( "Style", item-> key ( )); |
524 | } | 450 | } |
525 | 451 | ||
526 | if ( m_deco_changed ) | 452 | if ( m_deco_changed ) |
527 | { | 453 | { |
528 | DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); | 454 | DecoListItem *item = (DecoListItem *) m_deco_list-> item ( m_deco_list-> currentItem ( )); |
529 | if ( item ) | 455 | if ( item ) |
530 | config.writeEntry( "Decoration", item-> key ( )); | 456 | config.writeEntry( "Decoration", item-> key ( )); |
531 | } | 457 | } |
532 | 458 | ||
533 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) | 459 | if (( newtabstyle != m_original_tabstyle ) || ( newtabpos != m_original_tabpos )) |
534 | { | 460 | { |
535 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); | 461 | config. writeEntry ( "TabStyle", newtabstyle + 1 ); |
536 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); | 462 | config. writeEntry ( "TabPosition", newtabpos ? "Top" : "Bottom" ); |
537 | } | 463 | } |
538 | 464 | ||
539 | if ( m_font_changed ) | 465 | if ( m_font_changed ) |
540 | { | 466 | { |
541 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); | 467 | config. writeEntry ( "FontFamily", m_fontselect-> fontFamily ( )); |
542 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); | 468 | config. writeEntry ( "FontStyle", m_fontselect-> fontStyle ( )); |
543 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); | 469 | config. writeEntry ( "FontSize", m_fontselect-> fontSize ( )); |
544 | } | 470 | } |
545 | 471 | ||
546 | 472 | ||
547 | if ( m_color_changed ) | 473 | if ( m_color_changed ) |
548 | { | 474 | { |
549 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 475 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
550 | 476 | ||
551 | if ( item ) | 477 | if ( item ) |
552 | item-> save ( config ); | 478 | item-> save ( config ); |
553 | } | 479 | } |
554 | 480 | ||
555 | ODirection rot; | 481 | ODirection rot; |
556 | if (m_rotdir_ccw-> isChecked ( )) | 482 | if (m_rotdir_ccw-> isChecked ( )) |
557 | { | 483 | { |
558 | rot = CCW; | 484 | rot = CCW; |
559 | } | 485 | } |
560 | else if (m_rotdir_cw-> isChecked ( )) | 486 | else if (m_rotdir_cw-> isChecked ( )) |
561 | { | 487 | { |
562 | rot = CW; | 488 | rot = CW; |
563 | } | 489 | } |
564 | else | 490 | else |
565 | { | 491 | { |
566 | rot = Flip; | 492 | rot = Flip; |
567 | } | 493 | } |
568 | config. writeEntry ( "rotatedir", (int)rot ); | 494 | config. writeEntry ( "rotatedir", (int)rot ); |
569 | 495 | ||
570 | m_except-> setFocus ( ); // if the focus was on the embedded line-edit, we have to move it away first, so the contents are updated | ||
571 | |||
572 | QStringList sl; | ||
573 | QString exceptstr; | ||
574 | for ( ExceptListItem *it = (ExceptListItem *) m_except-> firstChild ( ); it; it = (ExceptListItem *) it-> nextSibling ( )) | ||
575 | { | ||
576 | int fl = 0; | ||
577 | fl |= ( it-> noStyle ( ) ? 0x01 : 0 ); | ||
578 | fl |= ( it-> noFont ( ) ? 0x02 : 0 ); | ||
579 | fl |= ( it-> noDeco ( ) ? 0x04 : 0 ); | ||
580 | exceptstr = QString::number ( fl, 32 ); | ||
581 | exceptstr.append( it-> pattern ( )); | ||
582 | sl << exceptstr; | ||
583 | } | ||
584 | config. writeEntry ( "NoStyle", sl, ';' ); | ||
585 | config. writeEntry ( "ForceStyle", m_force-> isChecked ( )); | ||
586 | |||
587 | config. write ( ); // need to flush the config info first | 496 | config. write ( ); // need to flush the config info first |
588 | Global::applyStyle ( ); | 497 | Global::applyStyle ( ); |
589 | 498 | ||
590 | QDialog::accept ( ); | 499 | QDialog::accept ( ); |
591 | } | 500 | } |
592 | 501 | ||
593 | void Appearance::done ( int r ) | 502 | void Appearance::done ( int r ) |
594 | { | 503 | { |
595 | QDialog::done ( r ); | 504 | QDialog::done ( r ); |
596 | close ( ); | 505 | close ( ); |
597 | } | 506 | } |
598 | 507 | ||
599 | 508 | ||
600 | void Appearance::styleClicked ( int index ) | 509 | void Appearance::styleClicked ( int index ) |
601 | { | 510 | { |
602 | StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index ); | 511 | StyleListItem *sli = (StyleListItem *) m_style_list-> item ( index ); |
603 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); | 512 | m_style_settings-> setEnabled ( sli ? sli-> hasSettings ( ) : false ); |
604 | 513 | ||
605 | if ( m_sample && sli && sli-> style ( )) | 514 | if ( m_sample && sli && sli-> style ( )) |
606 | { | 515 | { |
607 | int ci = m_color_list ? m_color_list-> currentItem ( ) : -1; | 516 | int ci = m_color_list ? m_color_list-> currentItem ( ) : -1; |
608 | 517 | ||
609 | m_sample-> setStyle2 ( sli-> style ( ), ci < 0 ? palette ( ) : ((ColorListItem *) m_color_list-> item ( ci ))-> palette ( )); | 518 | m_sample-> setStyle2 ( sli-> style ( ), ci < 0 ? palette ( ) : ((ColorListItem *) m_color_list-> item ( ci ))-> palette ( )); |
610 | } | 519 | } |
611 | 520 | ||
612 | m_style_changed |= ( index != m_original_style ); | 521 | m_style_changed |= ( index != m_original_style ); |
613 | } | 522 | } |
614 | 523 | ||
615 | void Appearance::styleSettingsClicked ( ) | 524 | void Appearance::styleSettingsClicked ( ) |
616 | { | 525 | { |
617 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); | 526 | StyleListItem *item = (StyleListItem *) m_style_list-> item ( m_style_list-> currentItem ( )); |
618 | 527 | ||
619 | if ( item && item-> hasSettings ( )) | 528 | if ( item && item-> hasSettings ( )) |
620 | { | 529 | { |
621 | QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); | 530 | QDialog *d = new QDialog ( this, "SETTINGS-DLG", true ); |
622 | QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 ); | 531 | QVBoxLayout *vbox = new QVBoxLayout ( d, 3, 0 ); |
623 | 532 | ||
624 | QWidget *w = item-> settings ( d ); | 533 | QWidget *w = item-> settings ( d ); |
625 | 534 | ||
626 | if ( w ) | 535 | if ( w ) |
627 | { | 536 | { |
628 | vbox-> addWidget ( w ); | 537 | vbox-> addWidget ( w ); |
629 | 538 | ||
630 | d-> setCaption ( w-> caption ( )); | 539 | d-> setCaption ( w-> caption ( )); |
631 | 540 | ||
632 | bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted ); | 541 | bool accepted = ( QPEApplication::execDialog ( d ) == QDialog::Accepted ); |
633 | 542 | ||
634 | if ( item-> setSettings ( accepted )) | 543 | if ( item-> setSettings ( accepted )) |
635 | m_style_changed = true; | 544 | m_style_changed = true; |
636 | } | 545 | } |
637 | delete d; | 546 | delete d; |
638 | } | 547 | } |
639 | } | 548 | } |
640 | 549 | ||
641 | void Appearance::decoClicked ( int index ) | 550 | void Appearance::decoClicked ( int index ) |
642 | { | 551 | { |
643 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); | 552 | DecoListItem *dli = (DecoListItem *) m_deco_list-> item ( index ); |
644 | 553 | ||
645 | if ( m_sample ) | 554 | if ( m_sample ) |
646 | { | 555 | { |
647 | if ( dli && dli-> interface ( )) | 556 | if ( dli && dli-> interface ( )) |
648 | m_sample-> setDecoration ( dli-> interface ( )); | 557 | m_sample-> setDecoration ( dli-> interface ( )); |
649 | else | 558 | else |
650 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); | 559 | m_sample-> setDecoration ( new DefaultWindowDecoration ( )); |
@@ -720,173 +629,64 @@ void Appearance::saveSchemeClicked() | |||
720 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 629 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
721 | 630 | ||
722 | if ( !item ) | 631 | if ( !item ) |
723 | return; | 632 | return; |
724 | 633 | ||
725 | QDialog *d = new QDialog ( this, 0, true ); | 634 | QDialog *d = new QDialog ( this, 0, true ); |
726 | d-> setCaption ( tr( "Save Scheme" )); | 635 | d-> setCaption ( tr( "Save Scheme" )); |
727 | QLineEdit *ed = new QLineEdit ( d ); | 636 | QLineEdit *ed = new QLineEdit ( d ); |
728 | ( new QVBoxLayout ( d, 3, 3 ))-> addWidget ( ed ); | 637 | ( new QVBoxLayout ( d, 3, 3 ))-> addWidget ( ed ); |
729 | ed-> setFocus ( ); | 638 | ed-> setFocus ( ); |
730 | 639 | ||
731 | if ( d-> exec ( ) == QDialog::Accepted ) | 640 | if ( d-> exec ( ) == QDialog::Accepted ) |
732 | { | 641 | { |
733 | QString schemename = ed-> text ( ); | 642 | QString schemename = ed-> text ( ); |
734 | QString filestr = QPEApplication::qpeDir(); | 643 | QString filestr = QPEApplication::qpeDir(); |
735 | filestr.append( "/etc/colors/" ); | 644 | filestr.append( "/etc/colors/" ); |
736 | filestr.append( schemename ); | 645 | filestr.append( schemename ); |
737 | filestr.append( ".scheme" ); | 646 | filestr.append( ".scheme" ); |
738 | QFile file ( filestr ); | 647 | QFile file ( filestr ); |
739 | if ( !file. exists ( )) | 648 | if ( !file. exists ( )) |
740 | { | 649 | { |
741 | QPalette p = item-> palette ( ); | 650 | QPalette p = item-> palette ( ); |
742 | 651 | ||
743 | Config config ( file.name(), Config::File ); | 652 | Config config ( file.name(), Config::File ); |
744 | config. setGroup( "Colors" ); | 653 | config. setGroup( "Colors" ); |
745 | 654 | ||
746 | item-> save ( config ); | 655 | item-> save ( config ); |
747 | 656 | ||
748 | config. write ( ); // need to flush the config info first | 657 | config. write ( ); // need to flush the config info first |
749 | 658 | ||
750 | m_color_list-> insertItem ( new ColorListItem ( schemename, config )); | 659 | m_color_list-> insertItem ( new ColorListItem ( schemename, config )); |
751 | } | 660 | } |
752 | else | 661 | else |
753 | { | 662 | { |
754 | QMessageBox::information ( this, tr( "Save scheme" ), tr( "Scheme does already exist." )); | 663 | QMessageBox::information ( this, tr( "Save scheme" ), tr( "Scheme does already exist." )); |
755 | } | 664 | } |
756 | } | 665 | } |
757 | delete d; | 666 | delete d; |
758 | } | 667 | } |
759 | 668 | ||
760 | void Appearance::deleteSchemeClicked() | 669 | void Appearance::deleteSchemeClicked() |
761 | { | 670 | { |
762 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); | 671 | ColorListItem *item = (ColorListItem *) m_color_list-> item ( m_color_list-> currentItem ( )); |
763 | 672 | ||
764 | if ( !item ) | 673 | if ( !item ) |
765 | return; | 674 | return; |
766 | 675 | ||
767 | if ( m_color_list-> currentItem ( ) > 0 ) | 676 | if ( m_color_list-> currentItem ( ) > 0 ) |
768 | { | 677 | { |
769 | if ( QPEMessageBox::confirmDelete ( this, tr( "Delete scheme" ), item-> text ( ) ) ) | 678 | if ( QPEMessageBox::confirmDelete ( this, tr( "Delete scheme" ), item-> text ( ) ) ) |
770 | { | 679 | { |
771 | QString filestr = QPEApplication::qpeDir ( ); | 680 | QString filestr = QPEApplication::qpeDir ( ); |
772 | filestr.append( "/etc/colors/" ); | 681 | filestr.append( "/etc/colors/" ); |
773 | filestr.append( item-> text ( ) ); | 682 | filestr.append( item-> text ( ) ); |
774 | filestr.append( ".scheme" ); | 683 | filestr.append( ".scheme" ); |
775 | QFile::remove ( filestr ); | 684 | QFile::remove ( filestr ); |
776 | delete item; | 685 | delete item; |
777 | } | 686 | } |
778 | } | 687 | } |
779 | else | 688 | else |
780 | { | 689 | { |
781 | QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." )); | 690 | QMessageBox::information( this, tr( "Delete scheme" ), tr( "Unable to delete current scheme." )); |
782 | } | 691 | } |
783 | } | 692 | } |
784 | |||
785 | |||
786 | void Appearance::addExcept ( ) | ||
787 | { | ||
788 | ExceptListItem *it = new ExceptListItem ( m_except, 0, tr( "<new>" ), true, true, true ); | ||
789 | m_except-> ensureItemVisible ( it ); | ||
790 | m_except-> setSelected ( it, true ); | ||
791 | } | ||
792 | |||
793 | void Appearance::delExcept ( ) | ||
794 | { | ||
795 | if ( m_except-> selectedItem ( )) | ||
796 | { | ||
797 | m_except-> setFocus ( ); | ||
798 | delete m_except-> selectedItem ( ); | ||
799 | } | ||
800 | } | ||
801 | |||
802 | void Appearance::upExcept ( ) | ||
803 | { | ||
804 | ExceptListItem *it = (ExceptListItem *) m_except-> selectedItem ( ); | ||
805 | |||
806 | if ( it && it-> itemAbove ( )) | ||
807 | it-> itemAbove ( )-> moveItem ( it ); | ||
808 | } | ||
809 | |||
810 | void Appearance::downExcept ( ) | ||
811 | { | ||
812 | ExceptListItem *it = (ExceptListItem *) m_except-> selectedItem ( ); | ||
813 | |||
814 | if ( it && it-> itemBelow ( )) | ||
815 | it-> moveItem ( it-> itemBelow ( )); | ||
816 | } | ||
817 | |||
818 | class ExEdit : public QLineEdit | ||
819 | { | ||
820 | public: | ||
821 | ExEdit ( ExceptListItem *item ) | ||
822 | : QLineEdit ( item-> listView ( )-> viewport ( ), "exedit" ), it ( item ) | ||
823 | { | ||
824 | setFrame ( false ); | ||
825 | |||
826 | QRect r = it-> listView ( )-> itemRect ( it ); | ||
827 | |||
828 | int x = it-> listView ( )-> header ( )-> cellPos ( 3 ) - 1; | ||
829 | int y = r. y ( ); | ||
830 | int w = it-> listView ( )-> viewport ( )-> width ( ) - x; | ||
831 | int h = r. height ( ); // + 2; | ||
832 | |||
833 | setText ( it-> pattern ( )); | ||
834 | setGeometry ( x, y, w, h ); | ||
835 | |||
836 | odebug << "ExEdit: [" << it->text(2).latin1() << "] at " | ||
837 | << x << "," << y << " " << w << "," << h << oendl; | ||
838 | |||
839 | m_out = true; | ||
840 | |||
841 | show ( ); | ||
842 | setFocus ( ); | ||
843 | selectAll ( ); | ||
844 | end ( true ); | ||
845 | } | ||
846 | |||
847 | virtual void focusOutEvent ( QFocusEvent * ) | ||
848 | { | ||
849 | hide ( ); | ||
850 | if ( m_out ) | ||
851 | it-> setPattern ( text ( )); | ||
852 | delete this; | ||
853 | } | ||
854 | |||
855 | virtual void keyPressEvent ( QKeyEvent *e ) | ||
856 | { | ||
857 | if ( e-> key ( ) == Key_Return ) | ||
858 | it-> listView ( )-> setFocus ( ); | ||
859 | else if ( e-> key ( ) == Key_Escape ) | ||
860 | { | ||
861 | m_out = false; | ||
862 | it-> listView ( )-> setFocus ( ); | ||
863 | } | ||
864 | else | ||
865 | QLineEdit::keyPressEvent ( e ); | ||
866 | } | ||
867 | |||
868 | private: | ||
869 | ExceptListItem *it; | ||
870 | bool m_out; | ||
871 | }; | ||
872 | |||
873 | void Appearance::clickedExcept ( QListViewItem *item, const QPoint &, int c ) | ||
874 | { | ||
875 | if ( !item || c < 0 || c > 3 ) | ||
876 | return; | ||
877 | |||
878 | ExceptListItem *it = (ExceptListItem *) item; | ||
879 | |||
880 | if ( c == 0 ) | ||
881 | it-> setNoStyle ( !it-> noStyle ( )); | ||
882 | else if ( c == 1 ) | ||
883 | it-> setNoFont ( !it-> noFont ( )); | ||
884 | else if ( c == 2 ) | ||
885 | it-> setNoDeco ( !it-> noDeco ( )); | ||
886 | else if ( c == 3 ) | ||
887 | { | ||
888 | m_except-> ensureItemVisible ( it ); | ||
889 | new ExEdit ( it ); | ||
890 | } | ||
891 | } | ||
892 | |||
diff --git a/noncore/settings/appearance2/appearance.h b/noncore/settings/appearance2/appearance.h index 134a918..de2f1ab 100644 --- a/noncore/settings/appearance2/appearance.h +++ b/noncore/settings/appearance2/appearance.h | |||
@@ -17,116 +17,108 @@ | |||
17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General |
18 | ..}^=.= = ; Public License for more details. | 18 | ..}^=.= = ; Public License for more details. |
19 | ++= -. .` .: | 19 | ++= -. .` .: |
20 | : = ...= . :.=- You should have received a copy of the GNU | 20 | : = ...= . :.=- You should have received a copy of the GNU |
21 | -. .:....=;==+<; General Public License along with this file; | 21 | -. .:....=;==+<; General Public License along with this file; |
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #ifndef APPEARANCESETTINGS_H | 29 | #ifndef APPEARANCESETTINGS_H |
30 | #define APPEARANCESETTINGS_H | 30 | #define APPEARANCESETTINGS_H |
31 | 31 | ||
32 | #include <opie2/ofontselector.h> | 32 | #include <opie2/ofontselector.h> |
33 | 33 | ||
34 | #include <qpe/fontdatabase.h> | 34 | #include <qpe/fontdatabase.h> |
35 | 35 | ||
36 | #include <qdialog.h> | 36 | #include <qdialog.h> |
37 | 37 | ||
38 | using Opie::Ui::OFontSelector; | 38 | using Opie::Ui::OFontSelector; |
39 | 39 | ||
40 | class QCheckBox; | 40 | class QCheckBox; |
41 | class QComboBox; | 41 | class QComboBox; |
42 | class QLabel; | 42 | class QLabel; |
43 | class QLineEdit; | 43 | class QLineEdit; |
44 | class QListBox; | 44 | class QListBox; |
45 | class QMultiLineEdit; | 45 | class QMultiLineEdit; |
46 | class QPushButton; | 46 | class QPushButton; |
47 | class QRadioButton; | 47 | class QRadioButton; |
48 | class QToolButton; | 48 | class QToolButton; |
49 | class SampleWindow; | 49 | class SampleWindow; |
50 | namespace Opie {namespace Ui {class OFontSelector;}} | 50 | namespace Opie {namespace Ui {class OFontSelector;}} |
51 | class QListView; | 51 | class QListView; |
52 | class QListViewItem; | 52 | class QListViewItem; |
53 | class Config; | 53 | class Config; |
54 | 54 | ||
55 | class Appearance : public QDialog | 55 | class Appearance : public QDialog |
56 | { | 56 | { |
57 | Q_OBJECT | 57 | Q_OBJECT |
58 | 58 | ||
59 | public: | 59 | public: |
60 | Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 60 | Appearance( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
61 | ~Appearance(); | 61 | ~Appearance(); |
62 | static QString appName() { return QString::fromLatin1("appearance"); } | 62 | static QString appName() { return QString::fromLatin1("appearance"); } |
63 | 63 | ||
64 | protected: | 64 | protected: |
65 | virtual void accept ( ); | 65 | virtual void accept ( ); |
66 | virtual void done ( int r ); | 66 | virtual void done ( int r ); |
67 | 67 | ||
68 | protected slots: | 68 | protected slots: |
69 | void styleClicked ( int ); | 69 | void styleClicked ( int ); |
70 | void styleSettingsClicked ( ); | 70 | void styleSettingsClicked ( ); |
71 | void decoClicked ( int ); | 71 | void decoClicked ( int ); |
72 | void fontClicked ( const QFont & ); | 72 | void fontClicked ( const QFont & ); |
73 | void colorClicked ( int ); | 73 | void colorClicked ( int ); |
74 | 74 | ||
75 | void editSchemeClicked(); | 75 | void editSchemeClicked(); |
76 | void saveSchemeClicked(); | 76 | void saveSchemeClicked(); |
77 | void deleteSchemeClicked(); | 77 | void deleteSchemeClicked(); |
78 | 78 | ||
79 | void tabChanged ( QWidget * ); | 79 | void tabChanged ( QWidget * ); |
80 | 80 | ||
81 | void addExcept ( ); | ||
82 | void delExcept ( ); | ||
83 | void upExcept ( ); | ||
84 | void downExcept ( ); | ||
85 | void clickedExcept ( QListViewItem *, const QPoint &, int ); | ||
86 | |||
87 | private: | 81 | private: |
88 | void changeText(); | 82 | void changeText(); |
89 | 83 | ||
90 | QWidget *createStyleTab ( QWidget *parent, Config &cfg ); | 84 | QWidget *createStyleTab ( QWidget *parent, Config &cfg ); |
91 | QWidget *createDecoTab ( QWidget *parent, Config &cfg ); | 85 | QWidget *createDecoTab ( QWidget *parent, Config &cfg ); |
92 | QWidget *createFontTab ( QWidget *parent, Config &cfg ); | 86 | QWidget *createFontTab ( QWidget *parent, Config &cfg ); |
93 | QWidget *createColorTab ( QWidget *parent, Config &cfg ); | 87 | QWidget *createColorTab ( QWidget *parent, Config &cfg ); |
94 | QWidget *createAdvancedTab ( QWidget *parent, Config &cfg ); | 88 | QWidget *createAdvancedTab ( QWidget *parent, Config &cfg ); |
95 | 89 | ||
96 | private: | 90 | private: |
97 | bool m_style_changed; | 91 | bool m_style_changed; |
98 | bool m_font_changed; | 92 | bool m_font_changed; |
99 | bool m_scheme_changed; | 93 | bool m_scheme_changed; |
100 | bool m_deco_changed; | 94 | bool m_deco_changed; |
101 | bool m_color_changed; | 95 | bool m_color_changed; |
102 | 96 | ||
103 | int m_original_style; | 97 | int m_original_style; |
104 | int m_original_deco; | 98 | int m_original_deco; |
105 | int m_original_tabstyle; | 99 | int m_original_tabstyle; |
106 | bool m_original_tabpos; | 100 | bool m_original_tabpos; |
107 | 101 | ||
108 | QListBox * m_style_list; | 102 | QListBox * m_style_list; |
109 | QPushButton * m_style_settings; | 103 | QPushButton * m_style_settings; |
110 | 104 | ||
111 | QListBox * m_deco_list; | 105 | QListBox * m_deco_list; |
112 | 106 | ||
113 | QListBox * m_color_list; | 107 | QListBox * m_color_list; |
114 | 108 | ||
115 | Opie::Ui::OFontSelector *m_fontselect; | 109 | Opie::Ui::OFontSelector *m_fontselect; |
116 | 110 | ||
117 | SampleWindow *m_sample; | 111 | SampleWindow *m_sample; |
118 | 112 | ||
119 | QComboBox * m_tabstyle_list; | 113 | QComboBox * m_tabstyle_list; |
120 | QRadioButton *m_tabstyle_top; | 114 | QRadioButton *m_tabstyle_top; |
121 | QRadioButton *m_tabstyle_bottom; | 115 | QRadioButton *m_tabstyle_bottom; |
122 | 116 | ||
123 | QRadioButton *m_rotdir_cw; | 117 | QRadioButton *m_rotdir_cw; |
124 | QRadioButton *m_rotdir_ccw; | 118 | QRadioButton *m_rotdir_ccw; |
125 | QRadioButton *m_rotdir_flip; | 119 | QRadioButton *m_rotdir_flip; |
126 | 120 | ||
127 | QWidget * m_advtab; | 121 | QWidget * m_advtab; |
128 | QListView * m_except; | ||
129 | QCheckBox * m_force; | ||
130 | }; | 122 | }; |
131 | 123 | ||
132 | #endif | 124 | #endif |