summaryrefslogtreecommitdiff
authorwimpie <wimpie>2005-01-06 03:53:17 (UTC)
committer wimpie <wimpie>2005-01-06 03:53:17 (UTC)
commit98dd4c49f5d7a3c0569e3f6ff92f39451734070c (patch) (unidiff)
treecbe132a0ea78b67baa24f61c9fa04f1a3fcc15c9
parent807241b7466840034a5284b0202705b096d41458 (diff)
downloadopie-98dd4c49f5d7a3c0569e3f6ff92f39451734070c.zip
opie-98dd4c49f5d7a3c0569e3f6ff92f39451734070c.tar.gz
opie-98dd4c49f5d7a3c0569e3f6ff92f39451734070c.tar.bz2
Some more changes for NS2
updated toplevel Makefile added new target packages-mt and packages these replaces, render obsolete and dramatically improve : ipks ipks-mt see separate mail
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--Makefile14
-rw-r--r--development/performance/opie-performance.control1
-rw-r--r--noncore/multimedia/powerchord/opie-powerchord.control1
-rw-r--r--noncore/settings/networksettings2/opietooth2/OTMainGUI.ui393
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.cpp32
-rw-r--r--noncore/settings/networksettings2/opietooth2/Opietooth.h31
-rw-r--r--noncore/settings/networksettings2/opietooth2/opietooth2.pro2
-rw-r--r--noncore/settings/packagemanager/opackagemanager.cpp7
8 files changed, 352 insertions, 129 deletions
diff --git a/Makefile b/Makefile
index a1fc32c..89c3470 100644
--- a/Makefile
+++ b/Makefile
@@ -1,136 +1,150 @@
1#!/usr/bin/make -f 1#!/usr/bin/make -f
2 2
3export TOPDIR:=$(OPIEDIR) 3export TOPDIR:=$(OPIEDIR)
4 4
5include $(TOPDIR)/Vars.make 5include $(TOPDIR)/Vars.make
6ifneq ($(wildcard $(TOPDIR)/Vars.local),) 6ifneq ($(wildcard $(TOPDIR)/Vars.local),)
7include $(TOPDIR)/Vars.local 7include $(TOPDIR)/Vars.local
8endif 8endif
9 9
10noconfig_targets := xconfig menuconfig config oldconfig randconfig \ 10noconfig_targets := xconfig menuconfig config oldconfig randconfig \
11 defconfig allyesconfig allnoconfig allmodconfig \ 11 defconfig allyesconfig allnoconfig allmodconfig \
12 clean-configs $(TOPDIR)/scripts/subst $(TOPDIR)/scripts/filesubst \ 12 clean-configs $(TOPDIR)/scripts/subst $(TOPDIR)/scripts/filesubst \
13 ipks 13 ipks
14 14
15configs += $(TOPDIR)/core/applets/config.in $(TOPDIR)/core/apps/config.in $(TOPDIR)/core/multimedia/config.in $(TOPDIR)/core/pim/config.in $(TOPDIR)/core/pim/today/plugins/config.in $(TOPDIR)/core/settings/config.in $(TOPDIR)/development/config.in $(TOPDIR)/inputmethods/config.in $(TOPDIR)/noncore/applets/config.in $(TOPDIR)/noncore/apps/opie-console/test/config.in $(TOPDIR)/noncore/apps/config.in $(TOPDIR)/noncore/comm/config.in $(TOPDIR)/noncore/decorations/config.in $(TOPDIR)/noncore/games/config.in $(TOPDIR)/noncore/graphics/config.in $(TOPDIR)/noncore/multimedia/config.in $(TOPDIR)/noncore/net/config.in $(TOPDIR)/noncore/net/opietooth/config.in $(TOPDIR)/noncore/settings/config.in $(TOPDIR)/noncore/styles/config.in $(TOPDIR)/noncore/tools/config.in $(TOPDIR)/noncore/todayplugins/config.in $(TOPDIR)/examples/config.in $(TOPDIR)/noncore/securityplugins/config.in 15configs += $(TOPDIR)/core/applets/config.in $(TOPDIR)/core/apps/config.in $(TOPDIR)/core/multimedia/config.in $(TOPDIR)/core/pim/config.in $(TOPDIR)/core/pim/today/plugins/config.in $(TOPDIR)/core/settings/config.in $(TOPDIR)/development/config.in $(TOPDIR)/inputmethods/config.in $(TOPDIR)/noncore/applets/config.in $(TOPDIR)/noncore/apps/opie-console/test/config.in $(TOPDIR)/noncore/apps/config.in $(TOPDIR)/noncore/comm/config.in $(TOPDIR)/noncore/decorations/config.in $(TOPDIR)/noncore/games/config.in $(TOPDIR)/noncore/graphics/config.in $(TOPDIR)/noncore/multimedia/config.in $(TOPDIR)/noncore/net/config.in $(TOPDIR)/noncore/net/opietooth/config.in $(TOPDIR)/noncore/settings/config.in $(TOPDIR)/noncore/styles/config.in $(TOPDIR)/noncore/tools/config.in $(TOPDIR)/noncore/todayplugins/config.in $(TOPDIR)/examples/config.in $(TOPDIR)/noncore/securityplugins/config.in
16 16
17# $(TOPDIR)/.config depends on .depends.cfgs, as it depends on $(configs) 17# $(TOPDIR)/.config depends on .depends.cfgs, as it depends on $(configs)
18# in order to have a full set of config.in files. 18# in order to have a full set of config.in files.
19# .depends depends on $(TOPDIR)/.config 19# .depends depends on $(TOPDIR)/.config
20# everything else depends on .depends, to ensure the dependencies are 20# everything else depends on .depends, to ensure the dependencies are
21# intact. 21# intact.
22# 22#
23# NOTE: The order in which things happen in this makefile is 23# NOTE: The order in which things happen in this makefile is
24 # -critical-. Do not rearrange this! 24 # -critical-. Do not rearrange this!
25 25
26all : $(TOPDIR)/.config 26all : $(TOPDIR)/.config
27 27
28# 28#
29# The IPK creation is a very slow process. If you want to only create some 29# The IPK creation is a very slow process. If you want to only create some
30# IPKs, e.g. the ones in library, then do 30# IPKs, e.g. the ones in library, then do
31 #make ipks IPK_START=library 31 #make ipks IPK_START=library
32# and then only the *.control files in this directory will be processed 32# and then only the *.control files in this directory will be processed
33ipks: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config 33ipks: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config
34 @find $(OPIEDIR)/$(IPK_START) -type f -name \*.control | ( for ctrl in `cat`; do \ 34 @find $(OPIEDIR)/$(IPK_START) -type f -name \*.control | ( for ctrl in `cat`; do \
35 prerm=`echo $${ctrl/.control/.prerm}`; \ 35 prerm=`echo $${ctrl/.control/.prerm}`; \
36 preinst=`echo $${ctrl/.control/.preinst}`; \ 36 preinst=`echo $${ctrl/.control/.preinst}`; \
37 postrm=`echo $${ctrl/.control/.postrm}`; \ 37 postrm=`echo $${ctrl/.control/.postrm}`; \
38 postinst=`echo $${ctrl/.control/.postinst}`; \ 38 postinst=`echo $${ctrl/.control/.postinst}`; \
39 echo "Building ipk of $$ctrl"; \ 39 echo "Building ipk of $$ctrl"; \
40 cd $(OPIEDIR); $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$ctrl --prerm=$$prerm --preinst=$$preinst --postrm=$$postrm --postinst=$$postinst --strip=$(STRIP) $(OPIEDIR); \ 40 cd $(OPIEDIR); $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$ctrl --prerm=$$prerm --preinst=$$preinst --postrm=$$postrm --postinst=$$postinst --strip=$(STRIP) $(OPIEDIR); \
41 done ) 41 done )
42 42
43ipks-mt: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config 43ipks-mt: $(OPIEDIR)/scripts/subst $(OPIEDIR)/scripts/filesubst FORCE $(TOPDIR)/.config
44 @> $(OPIEDIR)/AllThreadedPackages 44 @> $(OPIEDIR)/AllThreadedPackages
45 @find $(OPIEDIR)/ -type f -name \*.control | grep -v -- "-mt" | while read ctrl ; do \ 45 @find $(OPIEDIR)/ -type f -name \*.control | grep -v -- "-mt" | while read ctrl ; do \
46 grep "Package[ ]*:" $${ctrl} | sed "s+Package[ ]*:[ ]*++"; \ 46 grep "Package[ ]*:" $${ctrl} | sed "s+Package[ ]*:[ ]*++"; \
47 done | sort | uniq >> $(OPIEDIR)/AllThreadedPackages 47 done | sort | uniq >> $(OPIEDIR)/AllThreadedPackages
48 @find $(OPIEDIR)/ -type f -name \*.control | while read ctrl ; do \ 48 @find $(OPIEDIR)/ -type f -name \*.control | while read ctrl ; do \
49 echo "Converting $$ctrl to -mt package"; \ 49 echo "Converting $$ctrl to -mt package"; \
50 nctrl=`$(OPIEDIR)/scripts/tothreaded $$ctrl $(OPIEDIR)/AllThreadedPackages`; \ 50 nctrl=`$(OPIEDIR)/scripts/tothreaded $$ctrl $(OPIEDIR)/AllThreadedPackages`; \
51 echo "Building ipk of $$ctrl"; \ 51 echo "Building ipk of $$ctrl"; \
52 [ -n $$nctrl ] && cd $(OPIEDIR) && $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$nctrl --prerm=$${nctrl/-mt.control/.prerm} --preinst=$${nctrl/-mt.control/.preinst} --postrm=$${nctrl/-mt.control/.postrm} --postinst=$${nctrl/-mt.control/.postinst} --strip=$(STRIP) $(OPIEDIR); \ 52 [ -n $$nctrl ] && cd $(OPIEDIR) && $(OPIEDIR)/scripts/mkipkg --subst=$(OPIEDIR)/scripts/subst --filesubst=$(OPIEDIR)/scripts/filesubst --control=$$nctrl --prerm=$${nctrl/-mt.control/.prerm} --preinst=$${nctrl/-mt.control/.preinst} --postrm=$${nctrl/-mt.control/.postrm} --postinst=$${nctrl/-mt.control/.postinst} --strip=$(STRIP) $(OPIEDIR); \
53 done 53 done
54 @rm -f $(OPIEDIR)/AllThreadedPackages 54 @rm -f $(OPIEDIR)/AllThreadedPackages
55 55
56FORCE: 56FORCE:
57 57
58$(TOPDIR)/.config : $(TOPDIR)/.depends.cfgs 58$(TOPDIR)/.config : $(TOPDIR)/.depends.cfgs
59 59
60all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(TOPDIR)/.depends.cfgs 60all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(TOPDIR)/.depends.cfgs
61 61
62clean-configs : 62clean-configs :
63 @echo "Wiping generated config.in files..." 63 @echo "Wiping generated config.in files..."
64 @-rm -f $(configs) 64 @-rm -f $(configs)
65 65
66ifneq ($(wildcard $(TOPDIR)/.depends.cfgs),) 66ifneq ($(wildcard $(TOPDIR)/.depends.cfgs),)
67 include $(TOPDIR)/.depends.cfgs 67 include $(TOPDIR)/.depends.cfgs
68endif 68endif
69 69
70all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(configs) 70all menuconfig xconfig oldconfig config randconfig allyesconfig allnoconfig defconfig : $(configs)
71 71
72$(TOPDIR)/.config: $(TOPDIR)/.depends.cfgs $(configs) 72$(TOPDIR)/.config: $(TOPDIR)/.depends.cfgs $(configs)
73 $(call descend,scripts/kconfig,conf) 73 $(call descend,scripts/kconfig,conf)
74 @if [ ! -e $@ ]; then \ 74 @if [ ! -e $@ ]; then \
75 cp $(TOPDIR)/def-configs/opie $@; \ 75 cp $(TOPDIR)/def-configs/opie $@; \
76 fi 76 fi
77 @$(MAKE) -C scripts/kconfig conf 77 @$(MAKE) -C scripts/kconfig conf
78 ./scripts/kconfig/conf -s ./config.in 78 ./scripts/kconfig/conf -s ./config.in
79 79
80export 80export
81 81
82ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),) 82ifeq ($(filter $(noconfig_targets),$(MAKECMDGOALS)),)
83 83
84export include-config := 1 84export include-config := 1
85 85
86-include $(TOPDIR)/.config 86-include $(TOPDIR)/.config
87-include $(TOPDIR)/.depends 87-include $(TOPDIR)/.depends
88endif 88endif
89 89
90-include $(TOPDIR)/.config.cmd 90-include $(TOPDIR)/.config.cmd
91 91
92SUBDIRS = $(subdir-y) 92SUBDIRS = $(subdir-y)
93 93
94all clean install ipk: $(SUBDIRS) 94all clean install ipk: $(SUBDIRS)
95 95
96lupdate lrelease: 96lupdate lrelease:
97 @for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done 97 @for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done
98 98
99opie-lupdate opie-lrelease messages: 99opie-lupdate opie-lrelease messages:
100 @for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done; 100 @for i in $(SUBDIRS); do $(MAKE) -C $$i $@; done;
101 101
102# from kde 102# from kde
103qtmessages: 103qtmessages:
104 cd $(QTDIR)/src ; \ 104 cd $(QTDIR)/src ; \
105 sed -e "s,#define,," xml/qxml.cpp > qxml_clean.cpp ;\ 105 sed -e "s,#define,," xml/qxml.cpp > qxml_clean.cpp ;\
106 find . -name "*.cpp" | grep -v moc_ > list ;\ 106 find . -name "*.cpp" | grep -v moc_ > list ;\
107 for file in qfiledialog qcolordialog qprintdialog \ 107 for file in qfiledialog qcolordialog qprintdialog \
108 qurloperator qftp qhttp qlocal qerrormessage; do \ 108 qurloperator qftp qhttp qlocal qerrormessage; do \
109 grep -v $$file list > list.new && mv list.new list ;\ 109 grep -v $$file list > list.new && mv list.new list ;\
110 done ;\ 110 done ;\
111 xgettext -C -ktr -kQT_TRANSLATE_NOOP -n `cat list` -o $(OPIEDIR)/qt-messages.pot 111 xgettext -C -ktr -kQT_TRANSLATE_NOOP -n `cat list` -o $(OPIEDIR)/qt-messages.pot
112 112
113ifndef CONFIG_TARGET_OE 113ifndef CONFIG_TARGET_OE
114$(subdir-y) : $(if $(CONFIG_LIBQPE),$(QTDIR)/stamp-headers $(OPIEDIR)/stamp-headers) \ 114$(subdir-y) : $(if $(CONFIG_LIBQPE),$(QTDIR)/stamp-headers $(OPIEDIR)/stamp-headers) \
115 $(if $(CONFIG_LIBQPE-X11),$(QTDIR)/stamp-headers-x11 $(OPIEDIR)/stamp-headers-x11 ) \ 115 $(if $(CONFIG_LIBQPE-X11),$(QTDIR)/stamp-headers-x11 $(OPIEDIR)/stamp-headers-x11 ) \
116 $(TOPDIR)/library/custom.h 116 $(TOPDIR)/library/custom.h
117else 117else
118$(subdir-y) : $(if $(CONFIG_LIBQPE),$(OPIEDIR)/stamp-headers) $(TOPDIR)/library/custom.h 118$(subdir-y) : $(if $(CONFIG_LIBQPE),$(OPIEDIR)/stamp-headers) $(TOPDIR)/library/custom.h
119endif 119endif
120 120
121clean : $(TOPDIR)/.config 121clean : $(TOPDIR)/.config
122 make -C bin clean 122 make -C bin clean
123 make -C lib clean 123 make -C lib clean
124 make -C plugins clean 124 make -C plugins clean
125 125
126apidox : 126apidox :
127 doc/generate_apidox 127 doc/generate_apidox
128 128
129mrproper : clean-configs 129mrproper : clean-configs
130 find . -name ".moc"|xargs rm -rf 130 find . -name ".moc"|xargs rm -rf
131 find . -name ".obj"|xargs rm -rf 131 find . -name ".obj"|xargs rm -rf
132 find lib -name "lib*.*"|xargs rm -f 132 find lib -name "lib*.*"|xargs rm -f
133 find plugins -name "lib*.*"|xargs rm -f 133 find plugins -name "lib*.*"|xargs rm -f
134 find . -name "*.pro"|xargs touch 134 find . -name "*.pro"|xargs touch
135 135
136include $(TOPDIR)/Rules.make 136include $(TOPDIR)/Rules.make
137
138# to speed up (avoid include/generation of packaging rules)
139ifneq ($(filter package%,$(MAKECMDGOALS)),)
140
141# packaging requested
142
143$(TOPDIR)/Package.make :
144 @echo "Generating packaging rules"
145 @$(TOPDIR)/scripts/GeneratePackageMake > $(TOPDIR)/Package.make
146
147# load rules to make packages
148-include $(TOPDIR)/Package.make
149
150endif
diff --git a/development/performance/opie-performance.control b/development/performance/opie-performance.control
index 194b378..21c3433 100644
--- a/development/performance/opie-performance.control
+++ b/development/performance/opie-performance.control
@@ -1,10 +1,11 @@
1Package: opie-performance
1Files: plugins/applications/libperformance.so* bin/performance apps/Applications/performance.desktop 2Files: plugins/applications/libperformance.so* bin/performance apps/Applications/performance.desktop
2Priority: optional 3Priority: optional
3Section: opie/other 4Section: opie/other
4Maintainer: Trolltech (www.trolltech.com) 5Maintainer: Trolltech (www.trolltech.com)
5Architecture: $CPU_ARCH 6Architecture: $CPU_ARCH
6Arch: $DEVICE_ARCH 7Arch: $DEVICE_ARCH
7Version: $QPE_VERSION$EXTRAVERSION 8Version: $QPE_VERSION$EXTRAVERSION
8Depends: opie-taskbar 9Depends: opie-taskbar
9Description: Graphics performance tester 10Description: Graphics performance tester
10 Graphics performance tester for Qtopia. 11 Graphics performance tester for Qtopia.
diff --git a/noncore/multimedia/powerchord/opie-powerchord.control b/noncore/multimedia/powerchord/opie-powerchord.control
index 4b5bc88..490e8a2 100644
--- a/noncore/multimedia/powerchord/opie-powerchord.control
+++ b/noncore/multimedia/powerchord/opie-powerchord.control
@@ -1,10 +1,11 @@
1Package: opie-powercord
1Files: plugins/applications/libpowerchord.so* bin/powerchord apps/Applications/powerchord.desktop pics/powerchord share/powerchord 2Files: plugins/applications/libpowerchord.so* bin/powerchord apps/Applications/powerchord.desktop pics/powerchord share/powerchord
2Priority: optional 3Priority: optional
3Section: opie/multimedia 4Section: opie/multimedia
4Maintainer: Camilo Mesias <camilo@mesias.co.uk>, ljp <lpotter@trolltech.com> 5Maintainer: Camilo Mesias <camilo@mesias.co.uk>, ljp <lpotter@trolltech.com>
5Architecture: arm 6Architecture: arm
6Version: $QPE_VERSION$EXTRAVERSION 7Version: $QPE_VERSION$EXTRAVERSION
7Depends: task-opie-minimal 8Depends: task-opie-minimal
8Description: Guitar Chord generator application 9Description: Guitar Chord generator application
9 Allows naming of chords using base note and key. Fretboard diagrams are 10 Allows naming of chords using base note and key. Fretboard diagrams are
10 produced illustrating ways to play the chord. 11 produced illustrating ways to play the chord.
diff --git a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
index d9038ae..5bce0e1 100644
--- a/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
+++ b/noncore/settings/networksettings2/opietooth2/OTMainGUI.ui
@@ -1,668 +1,811 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
2<class>OTMainGUI</class> 2<class>OTMainGUI</class>
3<widget> 3<widget>
4 <class>QWidget</class> 4 <class>QWidget</class>
5 <property stdset="1"> 5 <property stdset="1">
6 <name>name</name> 6 <name>name</name>
7 <cstring>OTMainGUI</cstring> 7 <cstring>OTMainGUI</cstring>
8 </property> 8 </property>
9 <property stdset="1"> 9 <property stdset="1">
10 <name>geometry</name> 10 <name>geometry</name>
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>257</width> 14 <width>225</width>
15 <height>296</height> 15 <height>334</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Bluetooth Manager</string> 20 <string>Bluetooth Manager</string>
21 </property> 21 </property>
22 <property> 22 <property>
23 <name>layoutMargin</name> 23 <name>layoutMargin</name>
24 </property> 24 </property>
25 <property> 25 <property>
26 <name>layoutSpacing</name> 26 <name>layoutSpacing</name>
27 </property> 27 </property>
28 <vbox> 28 <vbox>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>margin</name> 30 <name>margin</name>
31 <number>3</number> 31 <number>3</number>
32 </property> 32 </property>
33 <property stdset="1"> 33 <property stdset="1">
34 <name>spacing</name> 34 <name>spacing</name>
35 <number>0</number> 35 <number>0</number>
36 </property> 36 </property>
37 <spacer>
38 <property>
39 <name>name</name>
40 <cstring>Spacer20</cstring>
41 </property>
42 <property stdset="1">
43 <name>orientation</name>
44 <enum>Vertical</enum>
45 </property>
46 <property stdset="1">
47 <name>sizeType</name>
48 <enum>Expanding</enum>
49 </property>
50 <property>
51 <name>sizeHint</name>
52 <size>
53 <width>20</width>
54 <height>20</height>
55 </size>
56 </property>
57 </spacer>
58 <widget> 37 <widget>
59 <class>QLayoutWidget</class> 38 <class>QLayoutWidget</class>
60 <property stdset="1"> 39 <property stdset="1">
61 <name>name</name> 40 <name>name</name>
62 <cstring>Layout7</cstring> 41 <cstring>Layout7</cstring>
63 </property> 42 </property>
64 <hbox> 43 <hbox>
65 <property stdset="1"> 44 <property stdset="1">
66 <name>margin</name> 45 <name>margin</name>
67 <number>0</number> 46 <number>0</number>
68 </property> 47 </property>
69 <property stdset="1"> 48 <property stdset="1">
70 <name>spacing</name> 49 <name>spacing</name>
71 <number>6</number> 50 <number>6</number>
72 </property> 51 </property>
73 <widget> 52 <widget>
74 <class>QPushButton</class> 53 <class>QPushButton</class>
75 <property stdset="1"> 54 <property stdset="1">
76 <name>name</name> 55 <name>name</name>
77 <cstring>ManageLocalHW_But</cstring> 56 <cstring>ManageLocalHW_But</cstring>
78 </property> 57 </property>
79 <property stdset="1"> 58 <property stdset="1">
80 <name>text</name> 59 <name>text</name>
81 <string>Local Bluetooth hardware</string> 60 <string>Local Bluetooth hardware</string>
82 </property> 61 </property>
83 </widget> 62 </widget>
84 <spacer> 63 <spacer>
85 <property> 64 <property>
86 <name>name</name> 65 <name>name</name>
87 <cstring>Spacer9_2</cstring> 66 <cstring>Spacer9_2</cstring>
88 </property> 67 </property>
89 <property stdset="1"> 68 <property stdset="1">
90 <name>orientation</name> 69 <name>orientation</name>
91 <enum>Horizontal</enum> 70 <enum>Horizontal</enum>
92 </property> 71 </property>
93 <property stdset="1"> 72 <property stdset="1">
94 <name>sizeType</name> 73 <name>sizeType</name>
95 <enum>Expanding</enum> 74 <enum>Expanding</enum>
96 </property> 75 </property>
97 <property> 76 <property>
98 <name>sizeHint</name> 77 <name>sizeHint</name>
99 <size> 78 <size>
100 <width>20</width> 79 <width>20</width>
101 <height>20</height> 80 <height>20</height>
102 </size> 81 </size>
103 </property> 82 </property>
104 </spacer> 83 </spacer>
105 </hbox> 84 </hbox>
106 </widget> 85 </widget>
107 <spacer> 86 <spacer>
108 <property> 87 <property>
109 <name>name</name> 88 <name>name</name>
110 <cstring>Spacer20_3</cstring> 89 <cstring>Spacer20_3</cstring>
111 </property> 90 </property>
112 <property stdset="1"> 91 <property stdset="1">
113 <name>orientation</name> 92 <name>orientation</name>
114 <enum>Vertical</enum> 93 <enum>Vertical</enum>
115 </property> 94 </property>
116 <property stdset="1"> 95 <property stdset="1">
117 <name>sizeType</name> 96 <name>sizeType</name>
118 <enum>Expanding</enum> 97 <enum>Expanding</enum>
119 </property> 98 </property>
120 <property> 99 <property>
121 <name>sizeHint</name> 100 <name>sizeHint</name>
122 <size> 101 <size>
123 <width>20</width> 102 <width>20</width>
124 <height>20</height> 103 <height>20</height>
125 </size> 104 </size>
126 </property> 105 </property>
127 </spacer> 106 </spacer>
128 <widget> 107 <widget>
129 <class>QLayoutWidget</class> 108 <class>QLayoutWidget</class>
130 <property stdset="1"> 109 <property stdset="1">
131 <name>name</name> 110 <name>name</name>
132 <cstring>Layout2</cstring> 111 <cstring>Layout2</cstring>
133 </property> 112 </property>
134 <hbox> 113 <hbox>
135 <property stdset="1"> 114 <property stdset="1">
136 <name>margin</name> 115 <name>margin</name>
137 <number>0</number> 116 <number>0</number>
138 </property> 117 </property>
139 <property stdset="1"> 118 <property stdset="1">
140 <name>spacing</name> 119 <name>spacing</name>
141 <number>6</number> 120 <number>6</number>
142 </property> 121 </property>
143 <spacer> 122 <spacer>
144 <property> 123 <property>
145 <name>name</name> 124 <name>name</name>
146 <cstring>Spacer7</cstring> 125 <cstring>Spacer7</cstring>
147 </property> 126 </property>
148 <property stdset="1"> 127 <property stdset="1">
149 <name>orientation</name> 128 <name>orientation</name>
150 <enum>Horizontal</enum> 129 <enum>Horizontal</enum>
151 </property> 130 </property>
152 <property stdset="1"> 131 <property stdset="1">
153 <name>sizeType</name> 132 <name>sizeType</name>
154 <enum>Fixed</enum> 133 <enum>Fixed</enum>
155 </property> 134 </property>
156 <property> 135 <property>
157 <name>sizeHint</name> 136 <name>sizeHint</name>
158 <size> 137 <size>
159 <width>20</width> 138 <width>20</width>
160 <height>20</height> 139 <height>20</height>
161 </size> 140 </size>
162 </property> 141 </property>
163 </spacer> 142 </spacer>
164 <widget> 143 <widget>
165 <class>QLabel</class> 144 <class>QLabel</class>
166 <property stdset="1"> 145 <property stdset="1">
167 <name>name</name> 146 <name>name</name>
168 <cstring>TextLabel1</cstring> 147 <cstring>TextLabel1</cstring>
169 </property> 148 </property>
170 <property stdset="1"> 149 <property stdset="1">
171 <name>sizePolicy</name> 150 <name>sizePolicy</name>
172 <sizepolicy> 151 <sizepolicy>
173 <hsizetype>7</hsizetype> 152 <hsizetype>7</hsizetype>
174 <vsizetype>1</vsizetype> 153 <vsizetype>1</vsizetype>
175 </sizepolicy> 154 </sizepolicy>
176 </property> 155 </property>
177 <property stdset="1"> 156 <property stdset="1">
178 <name>text</name> 157 <name>text</name>
179 <string>Select to manage your local Bluetooth hardware</string> 158 <string>Manage your local Bluetooth hardware</string>
180 </property> 159 </property>
181 <property stdset="1"> 160 <property stdset="1">
182 <name>alignment</name> 161 <name>alignment</name>
183 <set>WordBreak|AlignVCenter|AlignLeft</set> 162 <set>WordBreak|AlignVCenter|AlignLeft</set>
184 </property> 163 </property>
185 <property> 164 <property>
186 <name>wordwrap</name> 165 <name>wordwrap</name>
187 </property> 166 </property>
188 </widget> 167 </widget>
189 </hbox> 168 </hbox>
190 </widget> 169 </widget>
191 <spacer> 170 <spacer>
192 <property> 171 <property>
193 <name>name</name> 172 <name>name</name>
194 <cstring>Spacer20_2</cstring> 173 <cstring>Spacer20_2</cstring>
195 </property> 174 </property>
196 <property stdset="1"> 175 <property stdset="1">
197 <name>orientation</name> 176 <name>orientation</name>
198 <enum>Vertical</enum> 177 <enum>Vertical</enum>
199 </property> 178 </property>
200 <property stdset="1"> 179 <property stdset="1">
201 <name>sizeType</name> 180 <name>sizeType</name>
202 <enum>Expanding</enum> 181 <enum>Expanding</enum>
203 </property> 182 </property>
204 <property> 183 <property>
205 <name>sizeHint</name> 184 <name>sizeHint</name>
206 <size> 185 <size>
207 <width>20</width> 186 <width>20</width>
208 <height>20</height> 187 <height>20</height>
209 </size> 188 </size>
210 </property> 189 </property>
211 </spacer> 190 </spacer>
212 <widget> 191 <widget>
213 <class>QLayoutWidget</class> 192 <class>QLayoutWidget</class>
214 <property stdset="1"> 193 <property stdset="1">
215 <name>name</name> 194 <name>name</name>
216 <cstring>Layout8</cstring> 195 <cstring>Layout8</cstring>
217 </property> 196 </property>
218 <hbox> 197 <hbox>
219 <property stdset="1"> 198 <property stdset="1">
220 <name>margin</name> 199 <name>margin</name>
221 <number>0</number> 200 <number>0</number>
222 </property> 201 </property>
223 <property stdset="1"> 202 <property stdset="1">
224 <name>spacing</name> 203 <name>spacing</name>
225 <number>6</number> 204 <number>6</number>
226 </property> 205 </property>
227 <widget> 206 <widget>
228 <class>QPushButton</class> 207 <class>QPushButton</class>
229 <property stdset="1"> 208 <property stdset="1">
230 <name>name</name> 209 <name>name</name>
231 <cstring>Scan_But</cstring> 210 <cstring>Scan_But</cstring>
232 </property> 211 </property>
233 <property stdset="1"> 212 <property stdset="1">
234 <name>text</name> 213 <name>text</name>
235 <string>Scan Neighbourhood</string> 214 <string>Scan Neighbourhood</string>
236 </property> 215 </property>
237 </widget> 216 </widget>
238 <spacer> 217 <spacer>
239 <property> 218 <property>
240 <name>name</name> 219 <name>name</name>
241 <cstring>Spacer9</cstring> 220 <cstring>Spacer9</cstring>
242 </property> 221 </property>
243 <property stdset="1"> 222 <property stdset="1">
244 <name>orientation</name> 223 <name>orientation</name>
245 <enum>Horizontal</enum> 224 <enum>Horizontal</enum>
246 </property> 225 </property>
247 <property stdset="1"> 226 <property stdset="1">
248 <name>sizeType</name> 227 <name>sizeType</name>
249 <enum>Expanding</enum> 228 <enum>Expanding</enum>
250 </property> 229 </property>
251 <property> 230 <property>
252 <name>sizeHint</name> 231 <name>sizeHint</name>
253 <size> 232 <size>
254 <width>20</width> 233 <width>20</width>
255 <height>20</height> 234 <height>20</height>
256 </size> 235 </size>
257 </property> 236 </property>
258 </spacer> 237 </spacer>
259 </hbox> 238 </hbox>
260 </widget> 239 </widget>
261 <spacer> 240 <spacer>
262 <property> 241 <property>
263 <name>name</name> 242 <name>name</name>
264 <cstring>Spacer20_4</cstring> 243 <cstring>Spacer20_4</cstring>
265 </property> 244 </property>
266 <property stdset="1"> 245 <property stdset="1">
267 <name>orientation</name> 246 <name>orientation</name>
268 <enum>Vertical</enum> 247 <enum>Vertical</enum>
269 </property> 248 </property>
270 <property stdset="1"> 249 <property stdset="1">
271 <name>sizeType</name> 250 <name>sizeType</name>
272 <enum>Expanding</enum> 251 <enum>Expanding</enum>
273 </property> 252 </property>
274 <property> 253 <property>
275 <name>sizeHint</name> 254 <name>sizeHint</name>
276 <size> 255 <size>
277 <width>20</width> 256 <width>20</width>
278 <height>20</height> 257 <height>20</height>
279 </size> 258 </size>
280 </property> 259 </property>
281 </spacer> 260 </spacer>
282 <widget> 261 <widget>
283 <class>QLayoutWidget</class> 262 <class>QLayoutWidget</class>
284 <property stdset="1"> 263 <property stdset="1">
285 <name>name</name> 264 <name>name</name>
286 <cstring>Layout10</cstring> 265 <cstring>Layout13</cstring>
266 </property>
267 <hbox>
268 <property stdset="1">
269 <name>margin</name>
270 <number>0</number>
271 </property>
272 <property stdset="1">
273 <name>spacing</name>
274 <number>6</number>
275 </property>
276 <spacer>
277 <property>
278 <name>name</name>
279 <cstring>Spacer7_2_2</cstring>
280 </property>
281 <property stdset="1">
282 <name>orientation</name>
283 <enum>Horizontal</enum>
284 </property>
285 <property stdset="1">
286 <name>sizeType</name>
287 <enum>Fixed</enum>
288 </property>
289 <property>
290 <name>sizeHint</name>
291 <size>
292 <width>20</width>
293 <height>20</height>
294 </size>
295 </property>
296 </spacer>
297 <widget>
298 <class>QLabel</class>
299 <property stdset="1">
300 <name>name</name>
301 <cstring>TextLabel5</cstring>
302 </property>
303 <property stdset="1">
304 <name>sizePolicy</name>
305 <sizepolicy>
306 <hsizetype>0</hsizetype>
307 <vsizetype>1</vsizetype>
308 </sizepolicy>
309 </property>
310 <property stdset="1">
311 <name>text</name>
312 <string>Use device :</string>
313 </property>
314 </widget>
315 <widget>
316 <class>QComboBox</class>
317 <property stdset="1">
318 <name>name</name>
319 <cstring>DeviceList_CB</cstring>
320 </property>
321 <property stdset="1">
322 <name>sizePolicy</name>
323 <sizepolicy>
324 <hsizetype>7</hsizetype>
325 <vsizetype>0</vsizetype>
326 </sizepolicy>
327 </property>
328 </widget>
329 <spacer>
330 <property>
331 <name>name</name>
332 <cstring>Spacer16</cstring>
333 </property>
334 <property stdset="1">
335 <name>orientation</name>
336 <enum>Horizontal</enum>
337 </property>
338 <property stdset="1">
339 <name>sizeType</name>
340 <enum>Expanding</enum>
341 </property>
342 <property>
343 <name>sizeHint</name>
344 <size>
345 <width>20</width>
346 <height>20</height>
347 </size>
348 </property>
349 </spacer>
350 </hbox>
351 </widget>
352 <widget>
353 <class>QLayoutWidget</class>
354 <property stdset="1">
355 <name>name</name>
356 <cstring>Layout15</cstring>
287 </property> 357 </property>
288 <hbox> 358 <hbox>
289 <property stdset="1"> 359 <property stdset="1">
290 <name>margin</name> 360 <name>margin</name>
291 <number>0</number> 361 <number>0</number>
292 </property> 362 </property>
293 <property stdset="1"> 363 <property stdset="1">
294 <name>spacing</name> 364 <name>spacing</name>
295 <number>6</number> 365 <number>6</number>
296 </property> 366 </property>
297 <spacer> 367 <spacer>
298 <property> 368 <property>
299 <name>name</name> 369 <name>name</name>
300 <cstring>Spacer7_2</cstring> 370 <cstring>Spacer7_2</cstring>
301 </property> 371 </property>
302 <property stdset="1"> 372 <property stdset="1">
303 <name>orientation</name> 373 <name>orientation</name>
304 <enum>Horizontal</enum> 374 <enum>Horizontal</enum>
305 </property> 375 </property>
306 <property stdset="1"> 376 <property stdset="1">
307 <name>sizeType</name> 377 <name>sizeType</name>
308 <enum>Fixed</enum> 378 <enum>Fixed</enum>
309 </property> 379 </property>
310 <property> 380 <property>
311 <name>sizeHint</name> 381 <name>sizeHint</name>
312 <size> 382 <size>
313 <width>20</width> 383 <width>20</width>
314 <height>20</height> 384 <height>20</height>
315 </size> 385 </size>
316 </property> 386 </property>
317 </spacer> 387 </spacer>
318 <widget> 388 <widget>
319 <class>QLayoutWidget</class> 389 <class>QLabel</class>
320 <property stdset="1"> 390 <property stdset="1">
321 <name>name</name> 391 <name>name</name>
322 <cstring>Layout9</cstring> 392 <cstring>TextLabel1_2</cstring>
323 </property> 393 </property>
324 <grid> 394 <property stdset="1">
325 <property stdset="1"> 395 <name>sizePolicy</name>
326 <name>margin</name> 396 <sizepolicy>
327 <number>0</number> 397 <hsizetype>7</hsizetype>
328 </property> 398 <vsizetype>5</vsizetype>
329 <property stdset="1"> 399 </sizepolicy>
330 <name>spacing</name> 400 </property>
331 <number>6</number> 401 <property stdset="1">
332 </property> 402 <name>text</name>
333 <widget row="0" column="1" > 403 <string>San the bluetooth network neighbourhood using the selected local device</string>
334 <class>QComboBox</class> 404 </property>
335 <property stdset="1"> 405 <property stdset="1">
336 <name>name</name> 406 <name>alignment</name>
337 <cstring>DeviceList_CB</cstring> 407 <set>WordBreak|AlignVCenter|AlignLeft</set>
338 </property> 408 </property>
339 <property stdset="1"> 409 <property>
340 <name>sizePolicy</name> 410 <name>wordwrap</name>
341 <sizepolicy> 411 </property>
342 <hsizetype>7</hsizetype>
343 <vsizetype>0</vsizetype>
344 </sizepolicy>
345 </property>
346 </widget>
347 <spacer row="0" column="2" >
348 <property>
349 <name>name</name>
350 <cstring>Spacer16</cstring>
351 </property>
352 <property stdset="1">
353 <name>orientation</name>
354 <enum>Horizontal</enum>
355 </property>
356 <property stdset="1">
357 <name>sizeType</name>
358 <enum>Expanding</enum>
359 </property>
360 <property>
361 <name>sizeHint</name>
362 <size>
363 <width>20</width>
364 <height>20</height>
365 </size>
366 </property>
367 </spacer>
368 <widget row="1" column="0" rowspan="1" colspan="3" >
369 <class>QLabel</class>
370 <property stdset="1">
371 <name>name</name>
372 <cstring>TextLabel1_2</cstring>
373 </property>
374 <property stdset="1">
375 <name>sizePolicy</name>
376 <sizepolicy>
377 <hsizetype>7</hsizetype>
378 <vsizetype>1</vsizetype>
379 </sizepolicy>
380 </property>
381 <property stdset="1">
382 <name>text</name>
383 <string>Select to scan the bluetooth network for reachable devices using the selected local device</string>
384 </property>
385 <property stdset="1">
386 <name>alignment</name>
387 <set>WordBreak|AlignVCenter|AlignLeft</set>
388 </property>
389 <property>
390 <name>wordwrap</name>
391 </property>
392 </widget>
393 <widget row="0" column="0" >
394 <class>QLabel</class>
395 <property stdset="1">
396 <name>name</name>
397 <cstring>TextLabel5</cstring>
398 </property>
399 <property stdset="1">
400 <name>sizePolicy</name>
401 <sizepolicy>
402 <hsizetype>0</hsizetype>
403 <vsizetype>1</vsizetype>
404 </sizepolicy>
405 </property>
406 <property stdset="1">
407 <name>text</name>
408 <string>Use device :</string>
409 </property>
410 </widget>
411 </grid>
412 </widget> 412 </widget>
413 </hbox> 413 </hbox>
414 </widget> 414 </widget>
415 <spacer> 415 <spacer>
416 <property> 416 <property>
417 <name>name</name> 417 <name>name</name>
418 <cstring>Spacer20_2_2</cstring> 418 <cstring>Spacer20_2_2</cstring>
419 </property> 419 </property>
420 <property stdset="1"> 420 <property stdset="1">
421 <name>orientation</name> 421 <name>orientation</name>
422 <enum>Vertical</enum> 422 <enum>Vertical</enum>
423 </property> 423 </property>
424 <property stdset="1"> 424 <property stdset="1">
425 <name>sizeType</name> 425 <name>sizeType</name>
426 <enum>Expanding</enum> 426 <enum>Expanding</enum>
427 </property> 427 </property>
428 <property> 428 <property>
429 <name>sizeHint</name> 429 <name>sizeHint</name>
430 <size> 430 <size>
431 <width>20</width> 431 <width>20</width>
432 <height>20</height> 432 <height>20</height>
433 </size> 433 </size>
434 </property> 434 </property>
435 </spacer> 435 </spacer>
436 <widget> 436 <widget>
437 <class>QLayoutWidget</class> 437 <class>QLayoutWidget</class>
438 <property stdset="1"> 438 <property stdset="1">
439 <name>name</name> 439 <name>name</name>
440 <cstring>Layout9</cstring> 440 <cstring>Layout9</cstring>
441 </property> 441 </property>
442 <hbox> 442 <hbox>
443 <property stdset="1"> 443 <property stdset="1">
444 <name>margin</name> 444 <name>margin</name>
445 <number>0</number> 445 <number>0</number>
446 </property> 446 </property>
447 <property stdset="1"> 447 <property stdset="1">
448 <name>spacing</name> 448 <name>spacing</name>
449 <number>6</number> 449 <number>6</number>
450 </property> 450 </property>
451 <widget> 451 <widget>
452 <class>QPushButton</class> 452 <class>QPushButton</class>
453 <property stdset="1"> 453 <property stdset="1">
454 <name>name</name> 454 <name>name</name>
455 <cstring>Pairing_But</cstring> 455 <cstring>Pairing_But</cstring>
456 </property> 456 </property>
457 <property stdset="1"> 457 <property stdset="1">
458 <name>text</name> 458 <name>text</name>
459 <string>Manage Pairing</string> 459 <string>Manage Pairing</string>
460 </property> 460 </property>
461 </widget> 461 </widget>
462 <spacer> 462 <spacer>
463 <property> 463 <property>
464 <name>name</name> 464 <name>name</name>
465 <cstring>Spacer9_3</cstring> 465 <cstring>Spacer9_3</cstring>
466 </property> 466 </property>
467 <property stdset="1"> 467 <property stdset="1">
468 <name>orientation</name> 468 <name>orientation</name>
469 <enum>Horizontal</enum> 469 <enum>Horizontal</enum>
470 </property> 470 </property>
471 <property stdset="1"> 471 <property stdset="1">
472 <name>sizeType</name> 472 <name>sizeType</name>
473 <enum>Expanding</enum> 473 <enum>Expanding</enum>
474 </property> 474 </property>
475 <property> 475 <property>
476 <name>sizeHint</name> 476 <name>sizeHint</name>
477 <size> 477 <size>
478 <width>20</width> 478 <width>20</width>
479 <height>20</height> 479 <height>20</height>
480 </size> 480 </size>
481 </property> 481 </property>
482 </spacer> 482 </spacer>
483 </hbox> 483 </hbox>
484 </widget> 484 </widget>
485 <spacer> 485 <spacer>
486 <property> 486 <property>
487 <name>name</name> 487 <name>name</name>
488 <cstring>Spacer20_5</cstring> 488 <cstring>Spacer20_5</cstring>
489 </property> 489 </property>
490 <property stdset="1"> 490 <property stdset="1">
491 <name>orientation</name> 491 <name>orientation</name>
492 <enum>Vertical</enum> 492 <enum>Vertical</enum>
493 </property> 493 </property>
494 <property stdset="1"> 494 <property stdset="1">
495 <name>sizeType</name> 495 <name>sizeType</name>
496 <enum>Expanding</enum> 496 <enum>Expanding</enum>
497 </property> 497 </property>
498 <property> 498 <property>
499 <name>sizeHint</name> 499 <name>sizeHint</name>
500 <size> 500 <size>
501 <width>20</width> 501 <width>20</width>
502 <height>20</height> 502 <height>20</height>
503 </size> 503 </size>
504 </property> 504 </property>
505 </spacer> 505 </spacer>
506 <widget> 506 <widget>
507 <class>QLayoutWidget</class> 507 <class>QLayoutWidget</class>
508 <property stdset="1"> 508 <property stdset="1">
509 <name>name</name> 509 <name>name</name>
510 <cstring>Layout6</cstring> 510 <cstring>Layout6</cstring>
511 </property> 511 </property>
512 <hbox> 512 <hbox>
513 <property stdset="1"> 513 <property stdset="1">
514 <name>margin</name> 514 <name>margin</name>
515 <number>0</number> 515 <number>0</number>
516 </property> 516 </property>
517 <property stdset="1"> 517 <property stdset="1">
518 <name>spacing</name> 518 <name>spacing</name>
519 <number>6</number> 519 <number>6</number>
520 </property> 520 </property>
521 <spacer> 521 <spacer>
522 <property> 522 <property>
523 <name>name</name> 523 <name>name</name>
524 <cstring>Spacer7_3</cstring> 524 <cstring>Spacer7_3</cstring>
525 </property> 525 </property>
526 <property stdset="1"> 526 <property stdset="1">
527 <name>orientation</name> 527 <name>orientation</name>
528 <enum>Horizontal</enum> 528 <enum>Horizontal</enum>
529 </property> 529 </property>
530 <property stdset="1"> 530 <property stdset="1">
531 <name>sizeType</name> 531 <name>sizeType</name>
532 <enum>Fixed</enum> 532 <enum>Fixed</enum>
533 </property> 533 </property>
534 <property> 534 <property>
535 <name>sizeHint</name> 535 <name>sizeHint</name>
536 <size> 536 <size>
537 <width>20</width> 537 <width>20</width>
538 <height>20</height> 538 <height>20</height>
539 </size> 539 </size>
540 </property> 540 </property>
541 </spacer> 541 </spacer>
542 <widget> 542 <widget>
543 <class>QLabel</class> 543 <class>QLabel</class>
544 <property stdset="1"> 544 <property stdset="1">
545 <name>name</name> 545 <name>name</name>
546 <cstring>TextLabel1_2_2</cstring> 546 <cstring>TextLabel1_2_2</cstring>
547 </property> 547 </property>
548 <property stdset="1"> 548 <property stdset="1">
549 <name>sizePolicy</name> 549 <name>sizePolicy</name>
550 <sizepolicy> 550 <sizepolicy>
551 <hsizetype>7</hsizetype> 551 <hsizetype>7</hsizetype>
552 <vsizetype>1</vsizetype> 552 <vsizetype>1</vsizetype>
553 </sizepolicy> 553 </sizepolicy>
554 </property> 554 </property>
555 <property stdset="1"> 555 <property stdset="1">
556 <name>text</name> 556 <name>text</name>
557 <string>Select to manage all pairings known on the local device to any remote device regardless if it is currently reachable or not</string> 557 <string>Manage device pairings to or from the local device</string>
558 </property> 558 </property>
559 <property stdset="1"> 559 <property stdset="1">
560 <name>alignment</name> 560 <name>alignment</name>
561 <set>WordBreak|AlignVCenter|AlignLeft</set> 561 <set>WordBreak|AlignVCenter|AlignLeft</set>
562 </property> 562 </property>
563 <property> 563 <property>
564 <name>wordwrap</name> 564 <name>wordwrap</name>
565 </property> 565 </property>
566 </widget> 566 </widget>
567 </hbox> 567 </hbox>
568 </widget> 568 </widget>
569 <spacer> 569 <spacer>
570 <property> 570 <property>
571 <name>name</name> 571 <name>name</name>
572 <cstring>Spacer20_2_2_2</cstring> 572 <cstring>Spacer20_2_2_2</cstring>
573 </property> 573 </property>
574 <property stdset="1"> 574 <property stdset="1">
575 <name>orientation</name> 575 <name>orientation</name>
576 <enum>Vertical</enum> 576 <enum>Vertical</enum>
577 </property> 577 </property>
578 <property stdset="1"> 578 <property stdset="1">
579 <name>sizeType</name> 579 <name>sizeType</name>
580 <enum>Expanding</enum> 580 <enum>Expanding</enum>
581 </property> 581 </property>
582 <property> 582 <property>
583 <name>sizeHint</name> 583 <name>sizeHint</name>
584 <size> 584 <size>
585 <width>20</width> 585 <width>20</width>
586 <height>20</height> 586 <height>20</height>
587 </size> 587 </size>
588 </property> 588 </property>
589 </spacer> 589 </spacer>
590 <widget> 590 <widget>
591 <class>QLayoutWidget</class> 591 <class>QLayoutWidget</class>
592 <property stdset="1"> 592 <property stdset="1">
593 <name>name</name> 593 <name>name</name>
594 <cstring>Layout2</cstring> 594 <cstring>Layout9_2</cstring>
595 </property> 595 </property>
596 <hbox> 596 <hbox>
597 <property stdset="1"> 597 <property stdset="1">
598 <name>margin</name> 598 <name>margin</name>
599 <number>0</number> 599 <number>0</number>
600 </property> 600 </property>
601 <property stdset="1"> 601 <property stdset="1">
602 <name>spacing</name> 602 <name>spacing</name>
603 <number>6</number> 603 <number>6</number>
604 </property> 604 </property>
605 <widget> 605 <widget>
606 <class>QCheckBox</class> 606 <class>QPushButton</class>
607 <property stdset="1">
608 <name>name</name>
609 <cstring>BTSniffing_But</cstring>
610 </property>
611 <property stdset="1">
612 <name>text</name>
613 <string>Sniffing</string>
614 </property>
615 </widget>
616 <spacer>
617 <property>
618 <name>name</name>
619 <cstring>Spacer9_3_2</cstring>
620 </property>
621 <property stdset="1">
622 <name>orientation</name>
623 <enum>Horizontal</enum>
624 </property>
625 <property stdset="1">
626 <name>sizeType</name>
627 <enum>Expanding</enum>
628 </property>
629 <property>
630 <name>sizeHint</name>
631 <size>
632 <width>20</width>
633 <height>20</height>
634 </size>
635 </property>
636 </spacer>
637 </hbox>
638 </widget>
639 <widget>
640 <class>QLayoutWidget</class>
641 <property stdset="1">
642 <name>name</name>
643 <cstring>Layout6_2</cstring>
644 </property>
645 <hbox>
646 <property stdset="1">
647 <name>margin</name>
648 <number>0</number>
649 </property>
650 <property stdset="1">
651 <name>spacing</name>
652 <number>6</number>
653 </property>
654 <spacer>
655 <property>
656 <name>name</name>
657 <cstring>Spacer7_3_2</cstring>
658 </property>
659 <property stdset="1">
660 <name>orientation</name>
661 <enum>Horizontal</enum>
662 </property>
663 <property stdset="1">
664 <name>sizeType</name>
665 <enum>Fixed</enum>
666 </property>
667 <property>
668 <name>sizeHint</name>
669 <size>
670 <width>20</width>
671 <height>20</height>
672 </size>
673 </property>
674 </spacer>
675 <widget>
676 <class>QLabel</class>
607 <property stdset="1"> 677 <property stdset="1">
608 <name>name</name> 678 <name>name</name>
609 <cstring>EnableTracing_CB</cstring> 679 <cstring>TextLabel1_2_2_2</cstring>
680 </property>
681 <property stdset="1">
682 <name>sizePolicy</name>
683 <sizepolicy>
684 <hsizetype>7</hsizetype>
685 <vsizetype>1</vsizetype>
686 </sizepolicy>
610 </property> 687 </property>
611 <property stdset="1"> 688 <property stdset="1">
612 <name>text</name> 689 <name>text</name>
613 <string>Trace Bluetooth</string> 690 <string>Sniff the bluetooth network</string>
691 </property>
692 <property stdset="1">
693 <name>alignment</name>
694 <set>WordBreak|AlignVCenter|AlignLeft</set>
695 </property>
696 <property>
697 <name>wordwrap</name>
614 </property> 698 </property>
615 </widget> 699 </widget>
700 </hbox>
701 </widget>
702 <spacer>
703 <property>
704 <name>name</name>
705 <cstring>Spacer20_2_2_2_3</cstring>
706 </property>
707 <property stdset="1">
708 <name>orientation</name>
709 <enum>Vertical</enum>
710 </property>
711 <property stdset="1">
712 <name>sizeType</name>
713 <enum>Expanding</enum>
714 </property>
715 <property>
716 <name>sizeHint</name>
717 <size>
718 <width>20</width>
719 <height>20</height>
720 </size>
721 </property>
722 </spacer>
723 <widget>
724 <class>QLayoutWidget</class>
725 <property stdset="1">
726 <name>name</name>
727 <cstring>Layout11</cstring>
728 </property>
729 <hbox>
730 <property stdset="1">
731 <name>margin</name>
732 <number>0</number>
733 </property>
734 <property stdset="1">
735 <name>spacing</name>
736 <number>6</number>
737 </property>
738 <spacer>
739 <property>
740 <name>name</name>
741 <cstring>Spacer21</cstring>
742 </property>
743 <property stdset="1">
744 <name>orientation</name>
745 <enum>Horizontal</enum>
746 </property>
747 <property stdset="1">
748 <name>sizeType</name>
749 <enum>Expanding</enum>
750 </property>
751 <property>
752 <name>sizeHint</name>
753 <size>
754 <width>20</width>
755 <height>20</height>
756 </size>
757 </property>
758 </spacer>
616 <widget> 759 <widget>
617 <class>QCheckBox</class> 760 <class>QCheckBox</class>
618 <property stdset="1"> 761 <property stdset="1">
619 <name>name</name> 762 <name>name</name>
620 <cstring>MustBeEnabled_CB</cstring> 763 <cstring>MustBeEnabled_CB</cstring>
621 </property> 764 </property>
622 <property stdset="1"> 765 <property stdset="1">
623 <name>text</name> 766 <name>text</name>
624 <string>Bluetooth Enabled</string> 767 <string>Bluetooth Enabled</string>
625 </property> 768 </property>
626 </widget> 769 </widget>
627 </hbox> 770 </hbox>
628 </widget> 771 </widget>
629 </vbox> 772 </vbox>
630</widget> 773</widget>
631<connections> 774<connections>
632 <connection> 775 <connection>
633 <sender>ManageLocalHW_But</sender> 776 <sender>ManageLocalHW_But</sender>
634 <signal>clicked()</signal> 777 <signal>clicked()</signal>
635 <receiver>OTMainGUI</receiver> 778 <receiver>OTMainGUI</receiver>
636 <slot>SLOT_Manage()</slot> 779 <slot>SLOT_Manage()</slot>
637 </connection> 780 </connection>
638 <connection> 781 <connection>
639 <sender>Scan_But</sender> 782 <sender>Scan_But</sender>
640 <signal>clicked()</signal> 783 <signal>clicked()</signal>
641 <receiver>OTMainGUI</receiver> 784 <receiver>OTMainGUI</receiver>
642 <slot>SLOT_Scan()</slot> 785 <slot>SLOT_Scan()</slot>
643 </connection> 786 </connection>
644 <connection> 787 <connection>
645 <sender>MustBeEnabled_CB</sender> 788 <sender>MustBeEnabled_CB</sender>
646 <signal>toggled(bool)</signal> 789 <signal>toggled(bool)</signal>
647 <receiver>OTMainGUI</receiver> 790 <receiver>OTMainGUI</receiver>
648 <slot>SLOT_EnableBluetooth(bool)</slot> 791 <slot>SLOT_EnableBluetooth(bool)</slot>
649 </connection> 792 </connection>
650 <connection> 793 <connection>
651 <sender>Pairing_But</sender> 794 <sender>Pairing_But</sender>
652 <signal>clicked()</signal> 795 <signal>clicked()</signal>
653 <receiver>OTMainGUI</receiver> 796 <receiver>OTMainGUI</receiver>
654 <slot>SLOT_Pairing()</slot> 797 <slot>SLOT_Pairing()</slot>
655 </connection> 798 </connection>
656 <connection> 799 <connection>
657 <sender>EnableTracing_CB</sender> 800 <sender>BTSniffing_But</sender>
658 <signal>toggled(bool)</signal> 801 <signal>clicked()</signal>
659 <receiver>OTMainGUI</receiver> 802 <receiver>OTMainGUI</receiver>
660 <slot>SLOT_EnableTracing( bool )</slot> 803 <slot>SLOT_Sniffing()</slot>
661 </connection> 804 </connection>
662 <slot access="public">SLOT_EnableBluetooth(bool)</slot> 805 <slot access="public">SLOT_EnableBluetooth(bool)</slot>
806 <slot access="public">SLOT_Sniffing()</slot>
663 <slot access="public">SLOT_Manage()</slot> 807 <slot access="public">SLOT_Manage()</slot>
664 <slot access="public">SLOT_Pairing()</slot> 808 <slot access="public">SLOT_Pairing()</slot>
665 <slot access="public">SLOT_Scan()</slot> 809 <slot access="public">SLOT_Scan()</slot>
666 <slot access="public">SLOT_EnableTracing( bool )</slot>
667</connections> 810</connections>
668</UI> 811</UI>
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
index 8ea3a48..2d4885c 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.cpp
@@ -1,1005 +1,1037 @@
1#include <opie2/odebug.h> 1#include <opie2/odebug.h>
2#include <opie2/oledbox.h> 2#include <opie2/oledbox.h>
3using namespace Opie::Core; 3using namespace Opie::Core;
4using namespace Opie::Ui; 4using namespace Opie::Ui;
5 5
6#include <qpe/resource.h> 6#include <qpe/resource.h>
7#include <qcheckbox.h> 7#include <qcheckbox.h>
8#include <qgroupbox.h> 8#include <qgroupbox.h>
9#include <qlabel.h> 9#include <qlabel.h>
10#include <qprogressbar.h> 10#include <qprogressbar.h>
11#include <qheader.h> 11#include <qheader.h>
12#include <qmessagebox.h> 12#include <qmessagebox.h>
13#include <qapplication.h> 13#include <qapplication.h>
14#include <qlistbox.h> 14#include <qlistbox.h>
15#include <qdialog.h> 15#include <qdialog.h>
16#include <qlayout.h> 16#include <qlayout.h>
17#include <qcombobox.h> 17#include <qcombobox.h>
18#include <qlabel.h> 18#include <qlabel.h>
19#include <qlistview.h> 19#include <qlistview.h>
20#include <qpushbutton.h> 20#include <qpushbutton.h>
21 21
22#include <Opietooth.h> 22#include <Opietooth.h>
23#include <OTDriver.h> 23#include <OTDriver.h>
24#include <OTPeer.h> 24#include <OTPeer.h>
25#include <OTGateway.h> 25#include <OTGateway.h>
26#include <OTSDPAttribute.h> 26#include <OTSDPAttribute.h>
27#include <OTSDPService.h> 27#include <OTSDPService.h>
28#include <OTInquiry.h> 28#include <OTInquiry.h>
29 29
30using namespace Opietooth2; 30using namespace Opietooth2;
31 31
32namespace Opietooth2 { 32namespace Opietooth2 {
33 33
34class PeerLVI : public QListViewItem { 34class PeerLVI : public QListViewItem {
35 35
36public : 36public :
37 37
38 PeerLVI( OTPeer * P, QListView * it ) : QListViewItem (it) { 38 PeerLVI( OTPeer * P, QListView * it ) : QListViewItem (it) {
39 Peer = P; 39 Peer = P;
40 } 40 }
41 ~PeerLVI( void ) { 41 ~PeerLVI( void ) {
42 } 42 }
43 43
44 inline OTPeer * peer( void ) 44 inline OTPeer * peer( void )
45 { return Peer; } 45 { return Peer; }
46 46
47private : 47private :
48 48
49 OTPeer * Peer; 49 OTPeer * Peer;
50}; 50};
51 51
52class ChannelLVI : public QListViewItem { 52class ChannelLVI : public QListViewItem {
53 53
54public : 54public :
55 55
56 ChannelLVI( int Ch, QListViewItem * it ) : QListViewItem (it) { 56 ChannelLVI( int Ch, QListViewItem * it ) : QListViewItem (it) {
57 Channel = Ch; 57 Channel = Ch;
58 } 58 }
59 ~ChannelLVI( void ) { 59 ~ChannelLVI( void ) {
60 } 60 }
61 61
62 inline int channel( void ) 62 inline int channel( void )
63 { return Channel; } 63 { return Channel; }
64 64
65private : 65private :
66 66
67 int Channel; 67 int Channel;
68}; 68};
69 69
70class DriverLVI : public QListViewItem { 70class DriverLVI : public QListViewItem {
71 71
72public : 72public :
73 73
74 DriverLVI( OTDriver * P, QListView * it ) : QListViewItem (it) { 74 DriverLVI( OTDriver * P, QListView * it ) : QListViewItem (it) {
75 Driver = P; 75 Driver = P;
76 } 76 }
77 ~DriverLVI( void ) { 77 ~DriverLVI( void ) {
78 } 78 }
79 79
80 inline OTDriver * driver( void ) 80 inline OTDriver * driver( void )
81 { return Driver; } 81 { return Driver; }
82 82
83private : 83private :
84 84
85 OTDriver * Driver; 85 OTDriver * Driver;
86}; 86};
87 87
88class LinkKeyLVI : public QListViewItem { 88class LinkKeyLVI : public QListViewItem {
89 89
90public : 90public :
91 91
92 LinkKeyLVI( int Ch, QListView * it ) : QListViewItem (it) { 92 LinkKeyLVI( int Ch, QListView * it ) : QListViewItem (it) {
93 LinkKey = Ch; 93 LinkKey = Ch;
94 } 94 }
95 ~LinkKeyLVI( void ) { 95 ~LinkKeyLVI( void ) {
96 } 96 }
97 97
98 inline int index( void ) 98 inline int index( void )
99 { return LinkKey; } 99 { return LinkKey; }
100 100
101private : 101private :
102 102
103 int LinkKey; 103 int LinkKey;
104}; 104};
105}; 105};
106 106
107// 107//
108// 108//
109// 109//
110// 110//
111// 111//
112 112
113OTSniffing::OTSniffing( QWidget * parent ) : OTSniffGUI( parent ) {
114
115 OT = OTGateway::getOTGateway();
116
117}
118
119OTSniffing::~OTSniffing() {
120}
121
122void OTSniffing::SLOT_Trace( void ) {
123}
124
125void OTSniffing::SLOT_ClearLog( void ) {
126}
127
128//
129//
130//
131//
132//
133
113OTPairing::OTPairing( QWidget * parent, OTIcons * _IC ) : 134OTPairing::OTPairing( QWidget * parent, OTIcons * _IC ) :
114 OTPairingGUI( parent ) { 135 OTPairingGUI( parent ) {
115 136
116 OT = OTGateway::getOTGateway(); 137 OT = OTGateway::getOTGateway();
117 Icons = (_IC ) ? _IC : new OTIcons(); 138 Icons = (_IC ) ? _IC : new OTIcons();
118 MyIcons = (_IC == 0 ); 139 MyIcons = (_IC == 0 );
119 140
120 // unpairing can only be done if bluetooth is disabled 141 // unpairing can only be done if bluetooth is disabled
121 Unpair_But->setEnabled( ! OT->isEnabled() ); 142 Unpair_But->setEnabled( ! OT->isEnabled() );
122 if( ! OT->isEnabled() ) { 143 if( ! OT->isEnabled() ) {
123 Unpair_LBL->hide(); 144 Unpair_LBL->hide();
124 } else { 145 } else {
125 Unpair_LBL->show(); 146 Unpair_LBL->show();
126 } 147 }
127 148
128 // open linkkey file and load pairs 149 // open linkkey file and load pairs
129 LinkKeyArray Keys = OT->getLinkKeys(); 150 LinkKeyArray Keys = OT->getLinkKeys();
130 LinkKeyLVI * it; 151 LinkKeyLVI * it;
131 OTPeer * P; 152 OTPeer * P;
132 OTDriver * D; 153 OTDriver * D;
133 154
134 for( unsigned int i = 0 ; 155 for( unsigned int i = 0 ;
135 i < Keys.count(); 156 i < Keys.count();
136 i ++ ) { 157 i ++ ) {
137 158
138 it = new LinkKeyLVI( i, Pairs_LV ); 159 it = new LinkKeyLVI( i, Pairs_LV );
139 160
140 P = 0; 161 P = 0;
141 D = OT->findDriver( Keys[i].from() ); 162 D = OT->findDriver( Keys[i].from() );
142 163
143 if( D ) { 164 if( D ) {
144 it->setText( 0, D->devname() ); 165 it->setText( 0, D->devname() );
145 166
146 // we are source 167 // we are source
147 P = OT->findPeer( Keys[i].to() ); 168 P = OT->findPeer( Keys[i].to() );
148 169
149 if( P ) { 170 if( P ) {
150 // put name 171 // put name
151 it->setText( 1, P->name() ); 172 it->setText( 1, P->name() );
152 } else { 173 } else {
153 // unknown 174 // unknown
154 it->setText( 1, Keys[i].to().toString() ); 175 it->setText( 1, Keys[i].to().toString() );
155 } 176 }
156 177
157 // and put address as sub 178 // and put address as sub
158 QListViewItem * Sub = new QListViewItem( it ); 179 QListViewItem * Sub = new QListViewItem( it );
159 Sub->setText( 0, D->address().toString() ); 180 Sub->setText( 0, D->address().toString() );
160 Sub->setText( 1, Keys[i].to().toString() ); 181 Sub->setText( 1, Keys[i].to().toString() );
161 } else { 182 } else {
162 // perhaps we are destination 183 // perhaps we are destination
163 D = OT->findDriver( Keys[i].to() ); 184 D = OT->findDriver( Keys[i].to() );
164 185
165 if( D ) { 186 if( D ) {
166 it->setText( 1, D->devname() ); 187 it->setText( 1, D->devname() );
167 188
168 // we are source 189 // we are source
169 P = OT->findPeer( Keys[i].from() ); 190 P = OT->findPeer( Keys[i].from() );
170 191
171 if( P ) { 192 if( P ) {
172 // put name 193 // put name
173 it->setText( 0, P->name() ); 194 it->setText( 0, P->name() );
174 } else { 195 } else {
175 // unknown 196 // unknown
176 it->setText( 0, Keys[i].from().toString() ); 197 it->setText( 0, Keys[i].from().toString() );
177 } 198 }
178 199
179 // and put address as sub 200 // and put address as sub
180 QListViewItem * Sub = new QListViewItem( it ); 201 QListViewItem * Sub = new QListViewItem( it );
181 Sub->setText( 0, Keys[i].from().toString() ); 202 Sub->setText( 0, Keys[i].from().toString() );
182 Sub->setText( 1, D->address().toString() ); 203 Sub->setText( 1, D->address().toString() );
183 } else { 204 } else {
184 // nor source nor destination -> unknown 205 // nor source nor destination -> unknown
185 it->setText( 0, Keys[i].from().toString() ); 206 it->setText( 0, Keys[i].from().toString() );
186 it->setText( 1, Keys[i].to().toString() ); 207 it->setText( 1, Keys[i].to().toString() );
187 } 208 }
188 } 209 }
189 } 210 }
190} 211}
191 212
192 213
193OTPairing::~OTPairing() { 214OTPairing::~OTPairing() {
194 if( MyIcons ) 215 if( MyIcons )
195 delete Icons; 216 delete Icons;
196 OTGateway::releaseOTGateway(); 217 OTGateway::releaseOTGateway();
197} 218}
198 219
199void OTPairing::SLOT_Unpair( ) { 220void OTPairing::SLOT_Unpair( ) {
200 // find selected pair 221 // find selected pair
201 222
202 QListViewItem * it = Pairs_LV->firstChild(); 223 QListViewItem * it = Pairs_LV->firstChild();
203 while( it ) { 224 while( it ) {
204 if( it->isSelected() ) { 225 if( it->isSelected() ) {
205 // confirm ? 226 // confirm ?
206 if( QMessageBox::warning(0, 227 if( QMessageBox::warning(0,
207 tr("Break pairing"), 228 tr("Break pairing"),
208 tr("Sure ?"), 229 tr("Sure ?"),
209 tr("Yes, break"), 230 tr("Yes, break"),
210 tr("No, don't break") ) == 0 ) { 231 tr("No, don't break") ) == 0 ) {
211 LinkKeyLVI * KPIt = (LinkKeyLVI *)it; 232 LinkKeyLVI * KPIt = (LinkKeyLVI *)it;
212 // break 233 // break
213 OT->removeLinkKey( KPIt->index() ); 234 OT->removeLinkKey( KPIt->index() );
214 delete KPIt; 235 delete KPIt;
215 } 236 }
216 return; 237 return;
217 } 238 }
218 it= it->nextSibling(); 239 it= it->nextSibling();
219 } 240 }
220} 241}
221 242
222// 243//
223// 244//
224// 245//
225// 246//
226// 247//
227 248
228OTScan::OTScan( QWidget * parent, OTIcons * _IC ) : 249OTScan::OTScan( QWidget * parent, OTIcons * _IC ) :
229 OTScanGUI( parent ), Filter() { 250 OTScanGUI( parent ), Filter() {
230 251
231 OT = OTGateway::getOTGateway(); 252 OT = OTGateway::getOTGateway();
232 Icons = (_IC ) ? _IC : new OTIcons(); 253 Icons = (_IC ) ? _IC : new OTIcons();
233 MyIcons = (_IC == 0 ); 254 MyIcons = (_IC == 0 );
234 DetectedPeers_LV->header()->hide(); 255 DetectedPeers_LV->header()->hide();
235 Current = 0; 256 Current = 0;
236 SelectedPeer = 0; 257 SelectedPeer = 0;
237 SelectedChannel = 0; 258 SelectedChannel = 0;
238 259
239 StrengthTimer = new QTimer( this ); 260 StrengthTimer = new QTimer( this );
240 connect( StrengthTimer, 261 connect( StrengthTimer,
241 SIGNAL( timeout()), 262 SIGNAL( timeout()),
242 this, 263 this,
243 SLOT( SLOT_UpdateStrength()) 264 SLOT( SLOT_UpdateStrength())
244 ); 265 );
245 266
246 connect( OT, 267 connect( OT,
247 SIGNAL( detectedPeer( OTPeer *, bool )), 268 SIGNAL( detectedPeer( OTPeer *, bool )),
248 this, 269 this,
249 SLOT( SLOT_NewPeer( OTPeer *, bool )) 270 SLOT( SLOT_NewPeer( OTPeer *, bool ))
250 ); 271 );
251 connect( OT, 272 connect( OT,
252 SIGNAL( finishedDetecting()), 273 SIGNAL( finishedDetecting()),
253 this, 274 this,
254 SLOT( SLOT_FinishedDetecting()) 275 SLOT( SLOT_FinishedDetecting())
255 ); 276 );
256 277
257 // populate with peers we already know about 278 // populate with peers we already know about
258 const PeerVector & P = OT->peers(); 279 const PeerVector & P = OT->peers();
259 for( unsigned int i = 0; 280 for( unsigned int i = 0;
260 i < P.count(); 281 i < P.count();
261 i ++ ) { 282 i ++ ) {
262 SLOT_NewPeer( P[i], TRUE ); 283 SLOT_NewPeer( P[i], TRUE );
263 } 284 }
264 285
265 // populate State fram 286 // populate State fram
266 { QHBoxLayout * H =new QHBoxLayout( State_Frm ); 287 { QHBoxLayout * H =new QHBoxLayout( State_Frm );
267 288
268 Paired_Led = new OLedBox( green, State_Frm ); 289 Paired_Led = new OLedBox( green, State_Frm );
269 QLabel * L1 = new QLabel( tr( "Paired" ), State_Frm ); 290 QLabel * L1 = new QLabel( tr( "Paired" ), State_Frm );
270 291
271 H->addWidget( Paired_Led ); 292 H->addWidget( Paired_Led );
272 H->addWidget( L1 ); 293 H->addWidget( L1 );
273 H->addStretch( 1 ); 294 H->addStretch( 1 );
274 } 295 }
275} 296}
276 297
277OTScan::~OTScan() { 298OTScan::~OTScan() {
278 if( MyIcons ) 299 if( MyIcons )
279 delete Icons; 300 delete Icons;
280 OTGateway::releaseOTGateway(); 301 OTGateway::releaseOTGateway();
281 302
282 // send all peers that we do not care about states 303 // send all peers that we do not care about states
283 QListViewItem * Lit = DetectedPeers_LV->firstChild(); 304 QListViewItem * Lit = DetectedPeers_LV->firstChild();
284 while( Lit ) { 305 while( Lit ) {
285 ((PeerLVI *)Lit)->peer()->stopFindingOutState( ); 306 ((PeerLVI *)Lit)->peer()->stopFindingOutState( );
286 Lit = Lit->nextSibling(); 307 Lit = Lit->nextSibling();
287 } 308 }
288} 309}
289 310
290// static scan dialog function 311// static scan dialog function
291int OTScan::getDevice( OTPeer *& Peer, 312int OTScan::getDevice( OTPeer *& Peer,
292 int & Channel, 313 int & Channel,
293 OTGateway * OT, 314 OTGateway * OT,
294 const UUIDVector & Filter, 315 const UUIDVector & Filter,
295 QWidget* Parent ) { 316 QWidget* Parent ) {
296 bool IsUp = 0; 317 bool IsUp = 0;
297 unsigned int i; 318 unsigned int i;
298 319
299 // check if bluetooth is up 320 // check if bluetooth is up
300 OTDriverList & DL = OT->getDriverList(); 321 OTDriverList & DL = OT->getDriverList();
301 for( i = 0; 322 for( i = 0;
302 i < DL.count(); 323 i < DL.count();
303 i ++ ) { 324 i ++ ) {
304 if( DL[i]->isUp() ) { 325 if( DL[i]->isUp() ) {
305 // one device that is up found 326 // one device that is up found
306 IsUp = 1; 327 IsUp = 1;
307 break; 328 break;
308 } 329 }
309 } 330 }
310 331
311 // use this driver 332 // use this driver
312 OT->setScanWith( OT->driver(i) ); 333 OT->setScanWith( OT->driver(i) );
313 334
314 // create dialog 335 // create dialog
315 QDialog * Dlg = new QDialog( Parent, 0, TRUE ); 336 QDialog * Dlg = new QDialog( Parent, 0, TRUE );
316 QVBoxLayout * V = new QVBoxLayout( Dlg ); 337 QVBoxLayout * V = new QVBoxLayout( Dlg );
317 OTScan * Scn = new OTScan( Dlg ); 338 OTScan * Scn = new OTScan( Dlg );
318 339
319 connect( Scn, 340 connect( Scn,
320 SIGNAL( selected() ), 341 SIGNAL( selected() ),
321 Dlg, 342 Dlg,
322 SLOT( accept() ) 343 SLOT( accept() )
323 ); 344 );
324 345
325 if( Filter ) { 346 if( Filter ) {
326 Scn->setScanFilter( Filter ); 347 Scn->setScanFilter( Filter );
327 } 348 }
328 349
329 V->addWidget( Scn ); 350 V->addWidget( Scn );
330 Dlg->setCaption( tr("Scan Neighbourhood" ) ); 351 Dlg->setCaption( tr("Scan Neighbourhood" ) );
331 Dlg->showMaximized(); 352 Dlg->showMaximized();
332 int rv = Dlg->exec(); 353 int rv = Dlg->exec();
333 354
334 if( rv == QDialog::Accepted ) { 355 if( rv == QDialog::Accepted ) {
335 // get peer 356 // get peer
336 Peer = Scn->selectedPeer(); 357 Peer = Scn->selectedPeer();
337 if( Peer == 0 ) { 358 if( Peer == 0 ) {
338 // no peer selected 359 // no peer selected
339 rv = QDialog::Rejected; 360 rv = QDialog::Rejected;
340 } else { 361 } else {
341 Channel = Scn->selectedChannel(); 362 Channel = Scn->selectedChannel();
342 } 363 }
343 } 364 }
344 365
345 delete Dlg; 366 delete Dlg;
346 367
347 return rv; 368 return rv;
348} 369}
349 370
350void OTScan::setScanFilter( const UUIDVector & V ) { 371void OTScan::setScanFilter( const UUIDVector & V ) {
351 Filter = V; 372 Filter = V;
352} 373}
353 374
354void OTScan::resetScanFilter( void ) { 375void OTScan::resetScanFilter( void ) {
355 Filter.truncate(0); 376 Filter.truncate(0);
356} 377}
357 378
358void OTScan::SLOT_DoScan( bool DoIt ) { 379void OTScan::SLOT_DoScan( bool DoIt ) {
359 if( DoIt ) { 380 if( DoIt ) {
360 OT->scanNeighbourhood(); 381 OT->scanNeighbourhood();
361 } else { 382 } else {
362 OT->stopScanOfNeighbourhood(); 383 OT->stopScanOfNeighbourhood();
363 } 384 }
364 385
365 scanMode( DoIt ); 386 scanMode( DoIt );
366} 387}
367 388
368// double clicked on a device 389// double clicked on a device
369void OTScan::SLOT_Selected( QListViewItem * it ) { 390void OTScan::SLOT_Selected( QListViewItem * it ) {
370 if( ! it ) 391 if( ! it )
371 return; 392 return;
372 393
373 if( Filter.count() > 0 ) { 394 if( Filter.count() > 0 ) {
374 // filter on service 395 // filter on service
375 if( it->depth() == 0 ) { 396 if( it->depth() == 0 ) {
376 // select a service and not a device 397 // select a service and not a device
377 return; 398 return;
378 } 399 }
379 400
380 // store result 401 // store result
381 SelectedPeer = ((PeerLVI *)it->parent())->peer(); 402 SelectedPeer = ((PeerLVI *)it->parent())->peer();
382 SelectedChannel = ((ChannelLVI *)it)->channel(); 403 SelectedChannel = ((ChannelLVI *)it)->channel();
383 } else { 404 } else {
384 // click on device 405 // click on device
385 if( it->depth() != 0 ) { 406 if( it->depth() != 0 ) {
386 return; 407 return;
387 } 408 }
388 409
389 SelectedPeer = ((PeerLVI *)it)->peer(); 410 SelectedPeer = ((PeerLVI *)it)->peer();
390 SelectedChannel = 0; 411 SelectedChannel = 0;
391 } 412 }
392 owarn << "Selected " << SelectedPeer->address().toString() << 413 owarn << "Selected " << SelectedPeer->address().toString() <<
393 " Channel " << SelectedChannel << oendl; 414 " Channel " << SelectedChannel << oendl;
394 emit selected(); 415 emit selected();
395} 416}
396 417
397void OTScan::SLOT_FinishedDetecting( ) { 418void OTScan::SLOT_FinishedDetecting( ) {
398 scanMode( false ); 419 scanMode( false );
399} 420}
400 421
401void OTScan::SLOT_CleanupOld( ) { 422void OTScan::SLOT_CleanupOld( ) {
402 423
403 // iterate over all peers and find those that 424 // iterate over all peers and find those that
404 // are down and have no pairing info 425 // are down and have no pairing info
405 OTPeer * TheP; 426 OTPeer * TheP;
406 const LinkKeyArray & Keys = OT->getLinkKeys(); 427 const LinkKeyArray & Keys = OT->getLinkKeys();
407 428
408 QListViewItem * Lit = DetectedPeers_LV->firstChild(); 429 QListViewItem * Lit = DetectedPeers_LV->firstChild();
409 while( Lit ) { 430 while( Lit ) {
410 TheP = ((PeerLVI *)Lit)->peer(); 431 TheP = ((PeerLVI *)Lit)->peer();
411 if( TheP->state() == OTPeer::Peer_Down ) { 432 if( TheP->state() == OTPeer::Peer_Down ) {
412 unsigned int k; 433 unsigned int k;
413 434
414 // what about linkkeys ? 435 // what about linkkeys ?
415 for( k = 0; k < Keys.count(); k ++ ) { 436 for( k = 0; k < Keys.count(); k ++ ) {
416 if( TheP->address() == Keys[k].to() || 437 if( TheP->address() == Keys[k].to() ||
417 TheP->address() == Keys[k].from() 438 TheP->address() == Keys[k].from()
418 ) { 439 ) {
419 // part of linkkey 440 // part of linkkey
420 owarn << "LINKKEY " << TheP->address().toString() << oendl; 441 owarn << "LINKKEY " << TheP->address().toString() << oendl;
421 break; 442 break;
422 } 443 }
423 } 444 }
424 445
425 if( k == Keys.count() ) { 446 if( k == Keys.count() ) {
426 owarn << "RM LINKKEY " << TheP->address().toString() << oendl; 447 owarn << "RM LINKKEY " << TheP->address().toString() << oendl;
427 // not found -> remember to remove this peer 448 // not found -> remember to remove this peer
428 QListViewItem * Nit; 449 QListViewItem * Nit;
429 OT->removePeer( TheP ); 450 OT->removePeer( TheP );
430 Nit = Lit->nextSibling(); 451 Nit = Lit->nextSibling();
431 delete Lit; 452 delete Lit;
432 Lit = Nit; 453 Lit = Nit;
433 continue; 454 continue;
434 } 455 }
435 } else { 456 } else {
436 owarn << "NODOWN " << TheP->address().toString() << oendl; 457 owarn << "NODOWN " << TheP->address().toString() << oendl;
437 } 458 }
438 459
439 Lit = Lit->nextSibling(); 460 Lit = Lit->nextSibling();
440 } 461 }
441} 462}
442 463
443void OTScan::SLOT_NewPeer( OTPeer * P, bool IsNew ){ 464void OTScan::SLOT_NewPeer( OTPeer * P, bool IsNew ){
444 PeerLVI * it = 0; 465 PeerLVI * it = 0;
445 466
446 if( IsNew ) { 467 if( IsNew ) {
447 it = new PeerLVI( P, DetectedPeers_LV ); 468 it = new PeerLVI( P, DetectedPeers_LV );
448 } else { 469 } else {
449 // find peer in table 470 // find peer in table
450 QListViewItem * Lit = DetectedPeers_LV->firstChild(); 471 QListViewItem * Lit = DetectedPeers_LV->firstChild();
451 while( Lit ) { 472 while( Lit ) {
452 if( ((PeerLVI *)Lit)->peer() == P ) { 473 if( ((PeerLVI *)Lit)->peer() == P ) {
453 // this item 474 // this item
454 it = (PeerLVI *)Lit; 475 it = (PeerLVI *)Lit;
455 break; 476 break;
456 } 477 }
457 Lit = Lit->nextSibling(); 478 Lit = Lit->nextSibling();
458 } 479 }
459 480
460 if( ! it ) { 481 if( ! it ) {
461 owarn << "Should not occur" << oendl; 482 owarn << "Should not occur" << oendl;
462 return; 483 return;
463 } 484 }
464 } 485 }
465 486
466 // update/show info 487 // update/show info
467 it->setText( 0, P->name() ); 488 it->setText( 0, P->name() );
468 it->setPixmap(0, Icons->deviceIcon( 489 it->setPixmap(0, Icons->deviceIcon(
469 OT->deviceTypeToName( P->deviceClass() ) ) ); 490 OT->deviceTypeToName( P->deviceClass() ) ) );
470 491
471 // tell peer to report its state async 492 // tell peer to report its state async
472 connect( P, 493 connect( P,
473 SIGNAL( peerStateReport( OTPeer *)), 494 SIGNAL( peerStateReport( OTPeer *)),
474 this, 495 this,
475 SLOT( SLOT_PeerState( OTPeer *)) 496 SLOT( SLOT_PeerState( OTPeer *))
476 ); 497 );
477 498
478 if( IsNew ) { 499 if( IsNew ) {
479 // find state 500 // find state
480 refreshState( (PeerLVI *)it, 1 ); 501 refreshState( (PeerLVI *)it, 1 );
481 } else { 502 } else {
482 // update staet 503 // update staet
483 SLOT_PeerState( P ); 504 SLOT_PeerState( P );
484 } 505 }
485} 506}
486 507
487void OTScan::SLOT_PeerState( OTPeer * P ) { 508void OTScan::SLOT_PeerState( OTPeer * P ) {
488 PeerLVI * it = (PeerLVI *)DetectedPeers_LV->firstChild(); 509 PeerLVI * it = (PeerLVI *)DetectedPeers_LV->firstChild();
489 while( it ) { 510 while( it ) {
490 if( it->peer() == P ) { 511 if( it->peer() == P ) {
491 break; 512 break;
492 } 513 }
493 it = (PeerLVI * )it->nextSibling(); 514 it = (PeerLVI * )it->nextSibling();
494 } 515 }
495 516
496 if( ! it ) 517 if( ! it )
497 return; 518 return;
498 519
499 switch( P->state() ) { 520 switch( P->state() ) {
500 case OTPeer::Peer_Unknown : 521 case OTPeer::Peer_Unknown :
501 case OTPeer::Peer_Down : 522 case OTPeer::Peer_Down :
502 it->setPixmap( 1, 0 ); 523 it->setPixmap( 1, 0 );
503 break; 524 break;
504 case OTPeer::Peer_Up : 525 case OTPeer::Peer_Up :
505 it->setPixmap( 1, Icons->loadPixmap( 526 it->setPixmap( 1, Icons->loadPixmap(
506 ( P->connectedTo() ) ? "connected" : "notconnected" ) ); 527 ( P->connectedTo() ) ? "connected" : "notconnected" ) );
507 if( it == Current && ! StrengthTimer->isActive() ) { 528 if( it == Current && ! StrengthTimer->isActive() ) {
508 // start showing strength 529 // start showing strength
509 StrengthTimer->start( 1000, FALSE ); 530 StrengthTimer->start( 1000, FALSE );
510 SLOT_UpdateStrength(); 531 SLOT_UpdateStrength();
511 } 532 }
512 break; 533 break;
513 } 534 }
514} 535}
515 536
516void OTScan::SLOT_RefreshState( void ) { 537void OTScan::SLOT_RefreshState( void ) {
517 538
518 QListViewItem * it = DetectedPeers_LV->firstChild(); 539 QListViewItem * it = DetectedPeers_LV->firstChild();
519 while( it ) { 540 while( it ) {
520 if( it->isSelected() ) { 541 if( it->isSelected() ) {
521 break; 542 break;
522 } 543 }
523 it = it->nextSibling(); 544 it = it->nextSibling();
524 } 545 }
525 546
526 if( ! it ) 547 if( ! it )
527 return; 548 return;
528 549
529 refreshState( (PeerLVI *)it, 1 ); 550 refreshState( (PeerLVI *)it, 1 );
530} 551}
531 552
532void OTScan::refreshState( PeerLVI * it, bool Force ) { 553void OTScan::refreshState( PeerLVI * it, bool Force ) {
533 it->setPixmap( 1, Icons->loadPixmap( "find" ) ); 554 it->setPixmap( 1, Icons->loadPixmap( "find" ) );
534 it->peer()->findOutState( 30, Force ); 555 it->peer()->findOutState( 30, Force );
535} 556}
536 557
537void OTScan::SLOT_Show( QListViewItem * it ) { 558void OTScan::SLOT_Show( QListViewItem * it ) {
538 559
539 if( ! it || it->depth() > 0 ) 560 if( ! it || it->depth() > 0 )
540 return; 561 return;
541 562
542 QString S; 563 QString S;
543 564
544 Current = (PeerLVI *)it; 565 Current = (PeerLVI *)it;
545 566
546 Strength_PB->setProgress( 0 ); // reset 567 Strength_PB->setProgress( 0 ); // reset
547 Address_LBL->setText( Current->peer()->address().toString() ); 568 Address_LBL->setText( Current->peer()->address().toString() );
548 Peer_GB->setTitle( Current->peer()->name() ); 569 Peer_GB->setTitle( Current->peer()->name() );
549 570
550 const LinkKeyArray & Keys = OT->getLinkKeys(); 571 const LinkKeyArray & Keys = OT->getLinkKeys();
551 572
552 Paired_Led->setOn( FALSE ); 573 Paired_Led->setOn( FALSE );
553 for( unsigned int i = 0; 574 for( unsigned int i = 0;
554 i < Keys.count(); 575 i < Keys.count();
555 i ++ ) { 576 i ++ ) {
556 if( Current->peer()->address() == Keys[i].to() ) { 577 if( Current->peer()->address() == Keys[i].to() ) {
557 Paired_Led->setOn( TRUE ); 578 Paired_Led->setOn( TRUE );
558 break; 579 break;
559 } 580 }
560 } 581 }
561 582
562 if( Current->peer()->state() == OTPeer::Peer_Up ) { 583 if( Current->peer()->state() == OTPeer::Peer_Up ) {
563 RefreshServices_But->setEnabled( TRUE ); 584 RefreshServices_But->setEnabled( TRUE );
564 StrengthTimer->start( 1000, FALSE ); 585 StrengthTimer->start( 1000, FALSE );
565 SLOT_UpdateStrength(); 586 SLOT_UpdateStrength();
566 } else { 587 } else {
567 RefreshServices_But->setEnabled( FALSE ); 588 RefreshServices_But->setEnabled( FALSE );
568 } 589 }
569 590
570} 591}
571 592
572void OTScan::SLOT_UpdateStrength( void ) { 593void OTScan::SLOT_UpdateStrength( void ) {
573 OTDriver * D = Current->peer()->connectedTo(); 594 OTDriver * D = Current->peer()->connectedTo();
574 595
575 if( D ) { 596 if( D ) {
576 long Q = D->getLinkQuality( Current->peer()->address() ); 597 long Q = D->getLinkQuality( Current->peer()->address() );
577 Strength_PB->setProgress( Q ); 598 Strength_PB->setProgress( Q );
578 if( ! Q ) { 599 if( ! Q ) {
579 // no quality 600 // no quality
580 Strength_PB->setEnabled( TRUE ); 601 Strength_PB->setEnabled( TRUE );
581 StrengthTimer->stop(); 602 StrengthTimer->stop();
582 } 603 }
583 } else { 604 } else {
584 Strength_PB->setEnabled( FALSE ); 605 Strength_PB->setEnabled( FALSE );
585 Strength_PB->setProgress( 0 ); 606 Strength_PB->setProgress( 0 );
586 // no point in continuing 607 // no point in continuing
587 StrengthTimer->stop(); 608 StrengthTimer->stop();
588 } 609 }
589} 610}
590 611
591void OTScan::SLOT_RefreshServices( void ) { 612void OTScan::SLOT_RefreshServices( void ) {
592 613
593 QListViewItem * it = DetectedPeers_LV->firstChild(); 614 QListViewItem * it = DetectedPeers_LV->firstChild();
594 while( it ) { 615 while( it ) {
595 if( it->isSelected() ) { 616 if( it->isSelected() ) {
596 break; 617 break;
597 } 618 }
598 it = it->nextSibling(); 619 it = it->nextSibling();
599 } 620 }
600 621
601 if( ! it ) 622 if( ! it )
602 return; 623 return;
603 624
604 QString S; 625 QString S;
605 PeerLVI * PI = (PeerLVI *)it; 626 PeerLVI * PI = (PeerLVI *)it;
606 627
607 scanMode( true ); 628 scanMode( true );
608 qApp->processEvents(0); 629 qApp->processEvents(0);
609 630
610 ServiceVector & V = PI->peer()->services(); 631 ServiceVector & V = PI->peer()->services();
611 632
612 while( PI->firstChild() ) { 633 while( PI->firstChild() ) {
613 // remove children 634 // remove children
614 delete PI->firstChild(); 635 delete PI->firstChild();
615 } 636 }
616 637
617 for( unsigned int i = 0 ; 638 for( unsigned int i = 0 ;
618 i < V.count(); 639 i < V.count();
619 i ++ ) { 640 i ++ ) {
620 QString S; 641 QString S;
621 S = V[i]->name(); 642 S = V[i]->name();
622 643
623 if( S.isEmpty() ) { 644 if( S.isEmpty() ) {
624 continue; 645 continue;
625 } 646 }
626 647
627 { QListViewItem * SIt; 648 { QListViewItem * SIt;
628 UUIDVector UIDV; 649 UUIDVector UIDV;
629 QPixmap Pm; 650 QPixmap Pm;
630 bool Done = 0; 651 bool Done = 0;
631 bool R; 652 bool R;
632 short ID; 653 short ID;
633 654
634 SIt = 0; 655 SIt = 0;
635 656
636 UIDV = V[i]->classIDList(); 657 UIDV = V[i]->classIDList();
637 // first all UUID ! 1200 12ff (Genericprofiles) 658 // first all UUID ! 1200 12ff (Genericprofiles)
638 for( unsigned int j = 0; 659 for( unsigned int j = 0;
639 j < UIDV.count(); 660 j < UIDV.count();
640 j ++ ) { 661 j ++ ) {
641 662
642 if( Filter.count() ) { 663 if( Filter.count() ) {
643 bool FilterOut = 1; 664 bool FilterOut = 1;
644 // filter out if not in list 665 // filter out if not in list
645 for( unsigned int ff = 0; 666 for( unsigned int ff = 0;
646 ff < Filter.count(); 667 ff < Filter.count();
647 ff ++ ) { 668 ff ++ ) {
648 if( UIDV[j] == Filter[ff] ) { 669 if( UIDV[j] == Filter[ff] ) {
649 FilterOut = 0; 670 FilterOut = 0;
650 break; 671 break;
651 } 672 }
652 } 673 }
653 674
654 if( FilterOut ) { 675 if( FilterOut ) {
655 // not in filter list 676 // not in filter list
656 continue; 677 continue;
657 } 678 }
658 } // else show 679 } // else show
659 680
660 ID = UIDV[j].toShort(); 681 ID = UIDV[j].toShort();
661 if( ID < 0x1200 || ID > 0x12ff ) { 682 if( ID < 0x1200 || ID > 0x12ff ) {
662 // use this profile 683 // use this profile
663 if( R ) { 684 if( R ) {
664 unsigned int ch; 685 unsigned int ch;
665 bool has; 686 bool has;
666 has = V[i]->rfcommChannel( ch ); 687 has = V[i]->rfcommChannel( ch );
667 SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI ); 688 SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI );
668 SIt->setText(0, V[i]->name() ); 689 SIt->setText(0, V[i]->name() );
669 690
670 Pm = Icons->serviceIcon( ID, R ); 691 Pm = Icons->serviceIcon( ID, R );
671 SIt->setPixmap(0, Pm ); 692 SIt->setPixmap(0, Pm );
672 Done = 1; 693 Done = 1;
673 break; 694 break;
674 } 695 }
675 } 696 }
676 } 697 }
677 698
678 if( ! Done ) { 699 if( ! Done ) {
679 // check other range too 700 // check other range too
680 for( unsigned int j = 0; 701 for( unsigned int j = 0;
681 j < UIDV.count(); 702 j < UIDV.count();
682 j ++ ) { 703 j ++ ) {
683 704
684 if( Filter.count() ) { 705 if( Filter.count() ) {
685 bool FilterOut = 1; 706 bool FilterOut = 1;
686 // filter out if not in list 707 // filter out if not in list
687 for( unsigned int ff = 0; 708 for( unsigned int ff = 0;
688 ff < Filter.count(); 709 ff < Filter.count();
689 ff ++ ) { 710 ff ++ ) {
690 if( UIDV[j] == Filter[ff] ) { 711 if( UIDV[j] == Filter[ff] ) {
691 FilterOut = 0; 712 FilterOut = 0;
692 break; 713 break;
693 } 714 }
694 } 715 }
695 716
696 if( FilterOut ) { 717 if( FilterOut ) {
697 // not in filter list 718 // not in filter list
698 continue; 719 continue;
699 } 720 }
700 } // else show 721 } // else show
701 722
702 ID = UIDV[j].toShort(); 723 ID = UIDV[j].toShort();
703 if( ID >= 0x1200 && ID <= 0x12ff ) { 724 if( ID >= 0x1200 && ID <= 0x12ff ) {
704 // use this profile 725 // use this profile
705 unsigned int ch; 726 unsigned int ch;
706 bool has; 727 bool has;
707 has = V[i]->rfcommChannel( ch ); 728 has = V[i]->rfcommChannel( ch );
708 SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI ); 729 SIt = new ChannelLVI( (has) ? (int)ch : -1 , PI );
709 SIt->setText(0, V[i]->name() ); 730 SIt->setText(0, V[i]->name() );
710 731
711 Pm = Icons->serviceIcon( ID, R ); 732 Pm = Icons->serviceIcon( ID, R );
712 SIt->setPixmap(0, Pm ); 733 SIt->setPixmap(0, Pm );
713 734
714 break; 735 break;
715 } 736 }
716 } 737 }
717 } 738 }
718 739
719 } 740 }
720 } 741 }
721 742
722 scanMode( false ); 743 scanMode( false );
723} 744}
724 745
725void OTScan::scanMode( bool M ) { 746void OTScan::scanMode( bool M ) {
726 // avoid infinite loop because it triggers DoScan 747 // avoid infinite loop because it triggers DoScan
727 Detect_But->blockSignals( TRUE ); 748 Detect_But->blockSignals( TRUE );
728 Detect_But->setOn( M ); 749 Detect_But->setOn( M );
729 Detect_But->setText( (M) ? tr("Scanning") : tr("Scan") ); 750 Detect_But->setText( (M) ? tr("Scanning") : tr("Scan") );
730 Detect_But->blockSignals( FALSE ); 751 Detect_But->blockSignals( FALSE );
731} 752}
732 753
733// 754//
734// 755//
735// 756//
736// 757//
737// 758//
738 759
739OTManage::OTManage( QWidget * parent, OTIcons * _IC ) : 760OTManage::OTManage( QWidget * parent, OTIcons * _IC ) :
740 OTManageGUI( parent ) { 761 OTManageGUI( parent ) {
741 762
742 OT = OTGateway::getOTGateway(); 763 OT = OTGateway::getOTGateway();
743 764
744 Icons = (_IC ) ? _IC : new OTIcons(); 765 Icons = (_IC ) ? _IC : new OTIcons();
745 MyIcons = (_IC == 0 ); 766 MyIcons = (_IC == 0 );
746 AllDrivers_LV->setSorting(-1); 767 AllDrivers_LV->setSorting(-1);
747 768
748 connect( OT, 769 connect( OT,
749 SIGNAL( driverListChanged() ), 770 SIGNAL( driverListChanged() ),
750 this, 771 this,
751 SLOT( SLOT_DriverListChanged() ) 772 SLOT( SLOT_DriverListChanged() )
752 ); 773 );
753 connect( OT, 774 connect( OT,
754 SIGNAL( stateChange( OTDriver *, bool ) ), 775 SIGNAL( stateChange( OTDriver *, bool ) ),
755 this, 776 this,
756 SLOT( SLOT_StateChange( OTDriver *, bool ) ) 777 SLOT( SLOT_StateChange( OTDriver *, bool ) )
757 ); 778 );
758 779
759 SLOT_DriverListChanged(); 780 SLOT_DriverListChanged();
760 781
761 AllDrivers_LV->header()->hide(); 782 AllDrivers_LV->header()->hide();
762} 783}
763 784
764OTManage::~OTManage() { 785OTManage::~OTManage() {
765 if( MyIcons ) 786 if( MyIcons )
766 delete Icons; 787 delete Icons;
767 OTGateway::releaseOTGateway(); 788 OTGateway::releaseOTGateway();
768} 789}
769 790
770void OTManage::SLOT_ShowDriver( QListViewItem * It ) { 791void OTManage::SLOT_ShowDriver( QListViewItem * It ) {
771 if( It == 0 || It->depth() > 0 ) 792 if( It == 0 || It->depth() > 0 )
772 // not toplevel 793 // not toplevel
773 return; 794 return;
774 795
775 DriverLVI * it = (DriverLVI *) It; 796 DriverLVI * it = (DriverLVI *) It;
776 DriverIsUp_CB->setChecked( it->driver()->isUp() ); 797 DriverIsUp_CB->setChecked( it->driver()->isUp() );
777} 798}
778 799
779void OTManage::SLOT_UpDriver( bool Up ) { 800void OTManage::SLOT_UpDriver( bool Up ) {
780 QListViewItem * it = AllDrivers_LV->firstChild(); 801 QListViewItem * it = AllDrivers_LV->firstChild();
781 while( it ) { 802 while( it ) {
782 if( it->isSelected() ) { 803 if( it->isSelected() ) {
783 OTDriver * D = ((DriverLVI *)it)->driver(); 804 OTDriver * D = ((DriverLVI *)it)->driver();
784 owarn << "UP driver " << D->devname() << oendl; 805 owarn << "UP driver " << D->devname() << oendl;
785 // this 806 // this
786 D->setUp( Up ); 807 D->setUp( Up );
787 return; 808 return;
788 } 809 }
789 it = it->nextSibling(); 810 it = it->nextSibling();
790 } 811 }
791} 812}
792 813
793void OTManage::SLOT_StateChange( OTDriver * D, bool Up ) { 814void OTManage::SLOT_StateChange( OTDriver * D, bool Up ) {
794 QListViewItem * it = AllDrivers_LV->firstChild(); 815 QListViewItem * it = AllDrivers_LV->firstChild();
795 while( it ) { 816 while( it ) {
796 if( ((DriverLVI *)it)->driver() == D ) { 817 if( ((DriverLVI *)it)->driver() == D ) {
797 it->setPixmap( 0, 818 it->setPixmap( 0,
798 Icons->loadPixmap( ( Up ) ? "bluezon" : "bluezoff" ) ); 819 Icons->loadPixmap( ( Up ) ? "bluezon" : "bluezoff" ) );
799 return; 820 return;
800 } 821 }
801 it = it->nextSibling(); 822 it = it->nextSibling();
802 } 823 }
803} 824}
804 825
805void OTManage::SLOT_DriverListChanged( ) { 826void OTManage::SLOT_DriverListChanged( ) {
806 DriverLVI * It; 827 DriverLVI * It;
807 QListViewItem * Sub; 828 QListViewItem * Sub;
808 QListViewItem * First = 0; 829 QListViewItem * First = 0;
809 OTDriver* D; 830 OTDriver* D;
810 OTDriverList & DL = OT->getDriverList(); 831 OTDriverList & DL = OT->getDriverList();
811 832
812 AllDrivers_LV->clear(); 833 AllDrivers_LV->clear();
813 for( unsigned int i = 0; 834 for( unsigned int i = 0;
814 i < DL.count(); 835 i < DL.count();
815 i ++ ) { 836 i ++ ) {
816 D = DL[i]; 837 D = DL[i];
817 It = new DriverLVI( D, AllDrivers_LV ); 838 It = new DriverLVI( D, AllDrivers_LV );
818 839
819 if( ! First ) 840 if( ! First )
820 First = It; 841 First = It;
821 842
822 It->setText( 0, D->devname() ); 843 It->setText( 0, D->devname() );
823 It->setPixmap( 0, 844 It->setPixmap( 0,
824 Icons->loadPixmap( (D->isUp()) ? 845 Icons->loadPixmap( (D->isUp()) ?
825 "bluezon" : "bluezoff" ) ); 846 "bluezon" : "bluezoff" ) );
826 847
827 Sub = new QListViewItem( It ); 848 Sub = new QListViewItem( It );
828 Sub->setText( 0, tr( "Name" ) ); 849 Sub->setText( 0, tr( "Name" ) );
829 Sub->setText( 1, D->name() ); 850 Sub->setText( 1, D->name() );
830 851
831 Sub = new QListViewItem( It ); 852 Sub = new QListViewItem( It );
832 Sub->setText( 0, tr( "Address" ) ); 853 Sub->setText( 0, tr( "Address" ) );
833 Sub->setText( 1, D->address().toString() ); 854 Sub->setText( 1, D->address().toString() );
834 855
835 Sub = new QListViewItem( It ); 856 Sub = new QListViewItem( It );
836 Sub->setText( 0, tr( "Revision" ) ); 857 Sub->setText( 0, tr( "Revision" ) );
837 Sub->setText( 1, D->revision() ); 858 Sub->setText( 1, D->revision() );
838 859
839 Sub = new QListViewItem( It ); 860 Sub = new QListViewItem( It );
840 Sub->setText( 0, tr( "Manufacturer" ) ); 861 Sub->setText( 0, tr( "Manufacturer" ) );
841 Sub->setText( 1, D->manufacturer() ); 862 Sub->setText( 1, D->manufacturer() );
842 863
843 QString Service, Device; 864 QString Service, Device;
844 D->getClass( Service, Device ); 865 D->getClass( Service, Device );
845 866
846 Sub = new QListViewItem( It ); 867 Sub = new QListViewItem( It );
847 Sub->setText( 0, tr( "Service classes" ) ); 868 Sub->setText( 0, tr( "Service classes" ) );
848 Sub->setText( 1, Service ); 869 Sub->setText( 1, Service );
849 Sub = new QListViewItem( It ); 870 Sub = new QListViewItem( It );
850 Sub->setText( 0, tr( "Device class" ) ); 871 Sub->setText( 0, tr( "Device class" ) );
851 Sub->setText( 1, Device ); 872 Sub->setText( 1, Device );
852 } 873 }
853 874
854 if( DL.count() ) { 875 if( DL.count() ) {
855 AllDrivers_LV->setCurrentItem( First ); 876 AllDrivers_LV->setCurrentItem( First );
856 DriverIsUp_CB->setEnabled( TRUE ); 877 DriverIsUp_CB->setEnabled( TRUE );
857 } else { 878 } else {
858 DriverIsUp_CB->setChecked( FALSE ); 879 DriverIsUp_CB->setChecked( FALSE );
859 DriverIsUp_CB->setEnabled( FALSE ); 880 DriverIsUp_CB->setEnabled( FALSE );
860 } 881 }
861} 882}
862 883
863void OTManage::SLOT_SetRefreshTimer( int v ) { 884void OTManage::SLOT_SetRefreshTimer( int v ) {
864 OT->setRefreshTimer( v * 1000 ); 885 OT->setRefreshTimer( v * 1000 );
865} 886}
866 887
867// 888//
868// 889//
869// 890//
870// 891//
871// 892//
872 893
873OTMain::OTMain( QWidget * parent ) : OTMainGUI( parent ) { 894OTMain::OTMain( QWidget * parent ) : OTMainGUI( parent ) {
874 895
875 Icons = new OTIcons(); 896 Icons = new OTIcons();
897 SnifWindow = 0;
876 OT = OTGateway::getOTGateway(); 898 OT = OTGateway::getOTGateway();
877 899
878 connect( OT, 900 connect( OT,
879 SIGNAL( deviceEnabled( bool ) ), 901 SIGNAL( deviceEnabled( bool ) ),
880 this, 902 this,
881 SLOT( SLOT_DeviceIsEnabled( bool ) ) 903 SLOT( SLOT_DeviceIsEnabled( bool ) )
882 ); 904 );
883 connect( OT, 905 connect( OT,
884 SIGNAL( driverListChanged() ), 906 SIGNAL( driverListChanged() ),
885 this, 907 this,
886 SLOT( SLOT_DriverListChanged() ) 908 SLOT( SLOT_DriverListChanged() )
887 ); 909 );
888 connect( OT, 910 connect( OT,
889 SIGNAL( stateChange( OTDriver *, bool ) ), 911 SIGNAL( stateChange( OTDriver *, bool ) ),
890 this, 912 this,
891 SLOT( SLOT_StateChange( OTDriver *, bool ) ) 913 SLOT( SLOT_StateChange( OTDriver *, bool ) )
892 ); 914 );
893 915
894 if( ! OT->needsEnabling() ) { 916 if( ! OT->needsEnabling() ) {
895 MustBeEnabled_CB->hide(); 917 MustBeEnabled_CB->hide();
896 } else { 918 } else {
897 // detect current state 919 // detect current state
898 MustBeEnabled_CB->setChecked( 920 MustBeEnabled_CB->setChecked(
899 OT->isEnabled() ); 921 OT->isEnabled() );
900 } 922 }
901 923
902 SLOT_DriverListChanged(); 924 SLOT_DriverListChanged();
903} 925}
904 926
905OTMain::~OTMain() { 927OTMain::~OTMain() {
906 OTGateway::releaseOTGateway(); 928 OTGateway::releaseOTGateway();
907 delete Icons; 929 delete Icons;
908} 930}
909 931
910void OTMain::SLOT_DriverListChanged() { 932void OTMain::SLOT_DriverListChanged() {
911 OTDriver * D; 933 OTDriver * D;
912 OTDriverList & DL = OT->getDriverList(); 934 OTDriverList & DL = OT->getDriverList();
913 935
914 DeviceList_CB->clear(); 936 DeviceList_CB->clear();
915 for( unsigned int i = 0; 937 for( unsigned int i = 0;
916 i < DL.count(); 938 i < DL.count();
917 i ++ ) { 939 i ++ ) {
918 D = DL[i]; 940 D = DL[i];
919 DeviceList_CB->insertItem( 941 DeviceList_CB->insertItem(
920 Icons->loadPixmap( (D->isUp()) ? 942 Icons->loadPixmap( (D->isUp()) ?
921 "bluezon" : "bluezoff" ), 943 "bluezon" : "bluezoff" ),
922 D->devname() ); 944 D->devname() );
923 if( D == OT->scanWith() ) { 945 if( D == OT->scanWith() ) {
924 DeviceList_CB->setCurrentItem( i ); 946 DeviceList_CB->setCurrentItem( i );
925 } 947 }
926 } 948 }
927 949
928 Scan_But->setEnabled( OT->getDriverList().count() > 0 ); 950 Scan_But->setEnabled( OT->getDriverList().count() > 0 );
929 DeviceList_CB->setEnabled( OT->getDriverList().count() > 0 ); 951 DeviceList_CB->setEnabled( OT->getDriverList().count() > 0 );
930} 952}
931 953
932void OTMain::SLOT_EnableBluetooth( bool Up ) { 954void OTMain::SLOT_EnableBluetooth( bool Up ) {
933 OT->SLOT_SetEnabled( Up ); 955 OT->SLOT_SetEnabled( Up );
934} 956}
935 957
936void OTMain::SLOT_DeviceIsEnabled( bool Up ) { 958void OTMain::SLOT_DeviceIsEnabled( bool Up ) {
937 MustBeEnabled_CB->blockSignals( TRUE ); 959 MustBeEnabled_CB->blockSignals( TRUE );
938 MustBeEnabled_CB->setChecked( Up ); 960 MustBeEnabled_CB->setChecked( Up );
939 MustBeEnabled_CB->blockSignals( FALSE ); 961 MustBeEnabled_CB->blockSignals( FALSE );
940} 962}
941 963
942void OTMain::SLOT_Manage( void ) { 964void OTMain::SLOT_Manage( void ) {
943 QDialog * Dlg = new QDialog( this, 0, TRUE ); 965 QDialog * Dlg = new QDialog( this, 0, TRUE );
944 QVBoxLayout * V = new QVBoxLayout( Dlg ); 966 QVBoxLayout * V = new QVBoxLayout( Dlg );
945 OTManage * Mng = new OTManage( Dlg, Icons ); 967 OTManage * Mng = new OTManage( Dlg, Icons );
946 968
947 V->addWidget( Mng ); 969 V->addWidget( Mng );
948 970
949 Dlg->setCaption( tr("Manage local devices" ) ); 971 Dlg->setCaption( tr("Manage local devices" ) );
950 Dlg->showMaximized(); 972 Dlg->showMaximized();
951 Dlg->exec(); 973 Dlg->exec();
952 delete Dlg; 974 delete Dlg;
953} 975}
954 976
955void OTMain::SLOT_Scan( void ) { 977void OTMain::SLOT_Scan( void ) {
956 OTDriverList & DL = OT->getDriverList(); 978 OTDriverList & DL = OT->getDriverList();
957 for( unsigned int i = 0; 979 for( unsigned int i = 0;
958 i < DL.count(); 980 i < DL.count();
959 i ++ ) { 981 i ++ ) {
960 if( DL[i]->isUp() && 982 if( DL[i]->isUp() &&
961 DL[i]->devname() == DeviceList_CB->currentText() 983 DL[i]->devname() == DeviceList_CB->currentText()
962 ) { 984 ) {
963 QDialog * Dlg = new QDialog( this, 0, TRUE ); 985 QDialog * Dlg = new QDialog( this, 0, TRUE );
964 QVBoxLayout * V = new QVBoxLayout( Dlg ); 986 QVBoxLayout * V = new QVBoxLayout( Dlg );
965 OTScan * Scn = new OTScan( Dlg, Icons ); 987 OTScan * Scn = new OTScan( Dlg, Icons );
966 988
967 OT->setScanWith( OT->driver(i) ); 989 OT->setScanWith( OT->driver(i) );
968 V->addWidget( Scn ); 990 V->addWidget( Scn );
969 Dlg->setCaption( tr("Scan Neighbourhood" ) ); 991 Dlg->setCaption( tr("Scan Neighbourhood" ) );
970 Dlg->showMaximized(); 992 Dlg->showMaximized();
971 Dlg->exec(); 993 Dlg->exec();
972 994
973 delete Dlg; 995 delete Dlg;
974 return; 996 return;
975 } 997 }
976 } 998 }
977 999
978} 1000}
979 1001
980void OTMain::SLOT_StateChange( OTDriver * D, bool Up ) { 1002void OTMain::SLOT_StateChange( OTDriver * D, bool Up ) {
981 for( int i = 0; 1003 for( int i = 0;
982 i < DeviceList_CB->count(); 1004 i < DeviceList_CB->count();
983 i ++ ) { 1005 i ++ ) {
984 if( DeviceList_CB->text(i) == D->devname() ) { 1006 if( DeviceList_CB->text(i) == D->devname() ) {
985 DeviceList_CB->changeItem( 1007 DeviceList_CB->changeItem(
986 Icons->loadPixmap( (Up) ? "bluezon" : "bluezoff" ), 1008 Icons->loadPixmap( (Up) ? "bluezon" : "bluezoff" ),
987 D->devname(), 1009 D->devname(),
988 i ); 1010 i );
989 return; 1011 return;
990 } 1012 }
991 } 1013 }
992} 1014}
993 1015
994void OTMain::SLOT_Pairing( void ) { 1016void OTMain::SLOT_Pairing( void ) {
995 QDialog * Dlg = new QDialog( this, 0, TRUE ); 1017 QDialog * Dlg = new QDialog( this, 0, TRUE );
996 QVBoxLayout * V = new QVBoxLayout( Dlg ); 1018 QVBoxLayout * V = new QVBoxLayout( Dlg );
997 OTPairing * Pair = new OTPairing( Dlg, Icons ); 1019 OTPairing * Pair = new OTPairing( Dlg, Icons );
998 1020
999 V->addWidget( Pair ); 1021 V->addWidget( Pair );
1000 Dlg->showMaximized(); 1022 Dlg->showMaximized();
1001 Dlg->setCaption( tr("Manage pairing" ) ); 1023 Dlg->setCaption( tr("Manage pairing" ) );
1002 Dlg->exec(); 1024 Dlg->exec();
1003 1025
1004 delete Dlg; 1026 delete Dlg;
1005} 1027}
1028
1029void OTMain::SLOT_Sniffing( void ) {
1030
1031 if( SnifWindow == 0 ) {
1032 SnifWindow = new OTSniffing( this );
1033 }
1034
1035 SnifWindow->showMaximized();
1036 SnifWindow->show();
1037}
diff --git a/noncore/settings/networksettings2/opietooth2/Opietooth.h b/noncore/settings/networksettings2/opietooth2/Opietooth.h
index 16a22d6..211ae65 100644
--- a/noncore/settings/networksettings2/opietooth2/Opietooth.h
+++ b/noncore/settings/networksettings2/opietooth2/Opietooth.h
@@ -1,194 +1,223 @@
1#ifndef OPIETOOTH_H 1#ifndef OPIETOOTH_H
2#define OPIETOOTH_H 2#define OPIETOOTH_H
3 3
4#include <OTIcons.h> 4#include <OTIcons.h>
5 5
6#include <OTPairingGUI.h>
7namespace Opie { namespace Ui { class OLedBox; }; }; 6namespace Opie { namespace Ui { class OLedBox; }; };
8 7
8#include <OTSniffGUI.h>
9namespace Opietooth2 { 9namespace Opietooth2 {
10 10
11class OTGateway; 11class OTGateway;
12class OTDriver; 12class OTDriver;
13class OTInquiry; 13class OTInquiry;
14class OTPeer; 14class OTPeer;
15class PeerLVI; 15class PeerLVI;
16 16
17class OTSniffing : public OTSniffGUI {
18
19 Q_OBJECT
20
21public :
22
23 OTSniffing( QWidget * parent );
24 ~OTSniffing();
25
26private slots :
27
28 void SLOT_Trace( void );
29 void SLOT_ClearLog( void );
30
31signals :
32
33protected :
34
35private :
36
37 OTGateway * OT;
38};
39};
40
41#include <OTPairingGUI.h>
42
43namespace Opietooth2 {
17class OTPairing : public OTPairingGUI { 44class OTPairing : public OTPairingGUI {
18 45
19 Q_OBJECT 46 Q_OBJECT
20 47
21public : 48public :
22 49
23 OTPairing( QWidget * parent, 50 OTPairing( QWidget * parent,
24 OTIcons * _Ic = 0 ); 51 OTIcons * _Ic = 0 );
25 ~OTPairing(); 52 ~OTPairing();
26 53
27private slots : 54private slots :
28 55
29 void SLOT_Unpair( void ); 56 void SLOT_Unpair( void );
30 57
31signals : 58signals :
32 59
33protected : 60protected :
34 61
35private : 62private :
36 63
37 bool MyIcons; 64 bool MyIcons;
38 OTIcons * Icons; 65 OTIcons * Icons;
39 OTGateway * OT; 66 OTGateway * OT;
40}; 67};
41}; 68};
42 69
43#include <OTScanGUI.h> 70#include <OTScanGUI.h>
44 71
45namespace Opietooth2 { 72namespace Opietooth2 {
46 73
47class OTGateway; 74class OTGateway;
48class OTDriver; 75class OTDriver;
49class OTInquiry; 76class OTInquiry;
50class OTPeer; 77class OTPeer;
51 78
52class OTScan : public OTScanGUI { 79class OTScan : public OTScanGUI {
53 80
54 Q_OBJECT 81 Q_OBJECT
55 82
56public : 83public :
57 84
58 OTScan( QWidget * parent, 85 OTScan( QWidget * parent,
59 OTIcons * _Ic = 0 ); 86 OTIcons * _Ic = 0 );
60 ~OTScan(); 87 ~OTScan();
61 88
62 // static function to return a device and a channel 89 // static function to return a device and a channel
63 static int getDevice( OTPeer *& Peer, 90 static int getDevice( OTPeer *& Peer,
64 int & Channel, 91 int & Channel,
65 OTGateway * OT, 92 OTGateway * OT,
66 const UUIDVector & Filter = 0, 93 const UUIDVector & Filter = 0,
67 QWidget* Parent = 0); 94 QWidget* Parent = 0);
68 95
69 // show only services that match any of the filter 96 // show only services that match any of the filter
70 void setScanFilter( const UUIDVector & Filter ); 97 void setScanFilter( const UUIDVector & Filter );
71 void resetScanFilter( void ); 98 void resetScanFilter( void );
72 99
73 inline OTPeer * selectedPeer( void ) 100 inline OTPeer * selectedPeer( void )
74 { return SelectedPeer; } 101 { return SelectedPeer; }
75 inline int selectedChannel( void ) 102 inline int selectedChannel( void )
76 { return SelectedChannel; } 103 { return SelectedChannel; }
77 104
78public slots : 105public slots :
79 106
80private slots : 107private slots :
81 108
82 void SLOT_DoScan( bool ); 109 void SLOT_DoScan( bool );
83 void SLOT_NewPeer( OTPeer *, bool ); 110 void SLOT_NewPeer( OTPeer *, bool );
84 void SLOT_FinishedDetecting(); 111 void SLOT_FinishedDetecting();
85 void SLOT_Show( QListViewItem *); 112 void SLOT_Show( QListViewItem *);
86 void SLOT_RefreshServices( void ); 113 void SLOT_RefreshServices( void );
87 void SLOT_RefreshState( void ); 114 void SLOT_RefreshState( void );
88 void SLOT_CleanupOld( void ); 115 void SLOT_CleanupOld( void );
89 void SLOT_UpdateStrength( void ); 116 void SLOT_UpdateStrength( void );
90 void SLOT_PeerState( OTPeer * ); 117 void SLOT_PeerState( OTPeer * );
91 void SLOT_Selected( QListViewItem * ); 118 void SLOT_Selected( QListViewItem * );
92 119
93signals : 120signals :
94 121
95 void selected( void ); 122 void selected( void );
96 123
97protected : 124protected :
98 125
99private : 126private :
100 127
101 void refreshState( PeerLVI *, bool ); 128 void refreshState( PeerLVI *, bool );
102 void scanMode( bool ); 129 void scanMode( bool );
103 130
104 // load scanned devices 131 // load scanned devices
105 132
106 bool MyIcons; 133 bool MyIcons;
107 OTIcons * Icons; 134 OTIcons * Icons;
108 OTGateway * OT; 135 OTGateway * OT;
109 OTInquiry * Scanning; 136 OTInquiry * Scanning;
110 UUIDVector Filter; 137 UUIDVector Filter;
111 138
112 Opie::Ui::OLedBox * Paired_Led; 139 Opie::Ui::OLedBox * Paired_Led;
113 QTimer * StrengthTimer; 140 QTimer * StrengthTimer;
114 PeerLVI * Current; 141 PeerLVI * Current;
115 142
116 OTPeer * SelectedPeer; 143 OTPeer * SelectedPeer;
117 int SelectedChannel; 144 int SelectedChannel;
118}; 145};
119}; 146};
120 147
121#include <OTManageGUI.h> 148#include <OTManageGUI.h>
122namespace Opietooth2 { 149namespace Opietooth2 {
123 150
124class OTManage : public OTManageGUI { 151class OTManage : public OTManageGUI {
125 152
126 Q_OBJECT 153 Q_OBJECT
127 154
128public : 155public :
129 156
130 OTManage( QWidget * parent, 157 OTManage( QWidget * parent,
131 OTIcons * _IC = 0 ); 158 OTIcons * _IC = 0 );
132 ~OTManage(); 159 ~OTManage();
133 160
134public slots : 161public slots :
135 162
136private slots : 163private slots :
137 164
138 void SLOT_ShowDriver( QListViewItem * ); 165 void SLOT_ShowDriver( QListViewItem * );
139 void SLOT_UpDriver( bool ); 166 void SLOT_UpDriver( bool );
140 void SLOT_StateChange( OTDriver * , bool ); 167 void SLOT_StateChange( OTDriver * , bool );
141 void SLOT_DriverListChanged(); 168 void SLOT_DriverListChanged();
142 void SLOT_SetRefreshTimer( int ); 169 void SLOT_SetRefreshTimer( int );
143 170
144signals : 171signals :
145 172
146protected : 173protected :
147 174
148private : 175private :
149 176
150 // load scanned devices 177 // load scanned devices
151 178
152 bool MyIcons; 179 bool MyIcons;
153 OTIcons * Icons; 180 OTIcons * Icons;
154 OTGateway * OT; 181 OTGateway * OT;
155 OTInquiry * Scanning; 182 OTInquiry * Scanning;
156}; 183};
157}; 184};
158 185
159#include <OTMainGUI.h> 186#include <OTMainGUI.h>
160 187
161namespace Opietooth2 { 188namespace Opietooth2 {
162class OTMain : public OTMainGUI { 189class OTMain : public OTMainGUI {
163 190
164 Q_OBJECT 191 Q_OBJECT
165 192
166public : 193public :
167 194
168 OTMain( QWidget * parent ); 195 OTMain( QWidget * parent );
169 ~OTMain(); 196 ~OTMain();
170 197
171public slots : 198public slots :
172 199
173private slots : 200private slots :
174 201
175 void SLOT_Pairing( void ); 202 void SLOT_Pairing( void );
176 void SLOT_Manage( void ); 203 void SLOT_Manage( void );
204 void SLOT_Sniffing( void );
177 void SLOT_Scan( void ); 205 void SLOT_Scan( void );
178 void SLOT_EnableBluetooth( bool ); 206 void SLOT_EnableBluetooth( bool );
179 void SLOT_DriverListChanged(); 207 void SLOT_DriverListChanged();
180 void SLOT_DeviceIsEnabled( bool ); 208 void SLOT_DeviceIsEnabled( bool );
181 void SLOT_StateChange( OTDriver * , bool ); 209 void SLOT_StateChange( OTDriver * , bool );
182 210
183signals : 211signals :
184 212
185protected : 213protected :
186 214
187private : 215private :
188 216
189 // load scanned devices 217 // load scanned devices
190 OTIcons * Icons; 218 OTIcons * Icons;
191 OTGateway * OT; 219 OTGateway * OT;
220 OTSniffing * SnifWindow;
192}; 221};
193}; 222};
194#endif 223#endif
diff --git a/noncore/settings/networksettings2/opietooth2/opietooth2.pro b/noncore/settings/networksettings2/opietooth2/opietooth2.pro
index 590b656..cfb527d 100644
--- a/noncore/settings/networksettings2/opietooth2/opietooth2.pro
+++ b/noncore/settings/networksettings2/opietooth2/opietooth2.pro
@@ -1,37 +1,37 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug 3 #CONFIG += qt warn_on debug
4 DESTDIR = $(OPIEDIR)/lib$(PROJMAK) 4 DESTDIR = $(OPIEDIR)/lib$(PROJMAK)
5 HEADERS = OTDevice.h \ 5 HEADERS = OTDevice.h \
6 OTDriver.h \ 6 OTDriver.h \
7 OTGateway.h \ 7 OTGateway.h \
8 OTHCISocket.h \ 8 OTHCISocket.h \
9 OTInquiry.h \ 9 OTInquiry.h \
10 OTDeviceAddress.h \ 10 OTDeviceAddress.h \
11 OTIcons.h \ 11 OTIcons.h \
12 OTUUID.h \ 12 OTUUID.h \
13 OTSDPAttribute.h \ 13 OTSDPAttribute.h \
14 OTSDPService.h \ 14 OTSDPService.h \
15 OTPeer.h \ 15 OTPeer.h \
16 Opietooth.h 16 Opietooth.h
17 SOURCES = OTDevice.cpp \ 17 SOURCES = OTDevice.cpp \
18 OTDriver.cpp \ 18 OTDriver.cpp \
19 OTDriverList.cpp \ 19 OTDriverList.cpp \
20 OTHCISocket.cpp \ 20 OTHCISocket.cpp \
21 OTInquiry.cpp \ 21 OTInquiry.cpp \
22 OTDeviceAddress.cpp \ 22 OTDeviceAddress.cpp \
23 OTUUID.cpp \ 23 OTUUID.cpp \
24 OTSDPAttribute.cpp \ 24 OTSDPAttribute.cpp \
25 OTSDPService.cpp \ 25 OTSDPService.cpp \
26 OTIcons.cpp \ 26 OTIcons.cpp \
27 OTPeer.cpp \ 27 OTPeer.cpp \
28 OTGateway.cpp \ 28 OTGateway.cpp \
29 Opietooth.cpp 29 Opietooth.cpp
30 INCLUDEPATH+= $(OPIEDIR)/include 30 INCLUDEPATH+= $(OPIEDIR)/include
31 DEPENDPATH+= $(OPIEDIR)/include 31 DEPENDPATH+= $(OPIEDIR)/include
32LIBS += -lqpe -lopiecore2 -lbluetooth 32LIBS += -lqpe -lopiecore2 -lbluetooth
33 INTERFACES= OTMainGUI.ui OTScanGUI.ui OTManageGUI.ui OTPairingGUI.ui 33 INTERFACES= OTMainGUI.ui OTSniffGUI.ui OTScanGUI.ui OTManageGUI.ui OTPairingGUI.ui
34 TARGET = opietooth2 34 TARGET = opietooth2
35 VERSION = 1.0.0 35 VERSION = 1.0.0
36 36
37include ( $(OPIEDIR)/include.pro ) 37include ( $(OPIEDIR)/include.pro )
diff --git a/noncore/settings/packagemanager/opackagemanager.cpp b/noncore/settings/packagemanager/opackagemanager.cpp
index c9fdec1..ac16954 100644
--- a/noncore/settings/packagemanager/opackagemanager.cpp
+++ b/noncore/settings/packagemanager/opackagemanager.cpp
@@ -1,394 +1,397 @@
1/* 1/*
2 This file is part of the Opie Project 2 This file is part of the Opie Project
3 3
4 Copyright (c) 2003 Dan Williams <drw@handhelds.org> 4 Copyright (c) 2003 Dan Williams <drw@handhelds.org>
5 =. 5 =.
6 .=l. 6 .=l.
7 .>+-= 7 .>+-=
8_;:, .> :=|. This program is free software; you can 8_;:, .> :=|. This program is free software; you can
9.> <`_, > . <= redistribute it and/or modify it under 9.> <`_, > . <= redistribute it and/or modify it under
10:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 10:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
11.="- .-=="i, .._ License as published by the Free Software 11.="- .-=="i, .._ License as published by the Free Software
12- . .-<_> .<> Foundation; either version 2 of the License, 12- . .-<_> .<> Foundation; either version 2 of the License,
13 ._= =} : or (at your option) any later version. 13 ._= =} : or (at your option) any later version.
14 .%`+i> _;_. 14 .%`+i> _;_.
15 .i_,=:_. -<s. This program is distributed in the hope that 15 .i_,=:_. -<s. This program is distributed in the hope that
16 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 16 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
17 : .. .:, . . . without even the implied warranty of 17 : .. .:, . . . without even the implied warranty of
18 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 18 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
19 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 19 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
20..}^=.= = ; Library General Public License for more 20..}^=.= = ; Library General Public License for more
21++= -. .` .: details. 21++= -. .` .: details.
22: = ...= . :.=- 22: = ...= . :.=-
23-. .:....=;==+<; You should have received a copy of the GNU 23-. .:....=;==+<; You should have received a copy of the GNU
24 -_. . . )=. = Library General Public License along with 24 -_. . . )=. = Library General Public License along with
25 -- :-=` this library; see the file COPYING.LIB. 25 -- :-=` this library; see the file COPYING.LIB.
26 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
27 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
28 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
29 29
30*/ 30*/
31 31
32#include "opackagemanager.h" 32#include "opackagemanager.h"
33#include "oipkgconfigdlg.h" 33#include "oipkgconfigdlg.h"
34 34
35#include <qpe/qpeapplication.h> 35#include <qpe/qpeapplication.h>
36 36
37#include <ctype.h> 37#include <ctype.h>
38 38
39OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name ) 39OPackageManager::OPackageManager( Config *config, QObject *parent, const char *name )
40 : QObject( parent, name ) 40 : QObject( parent, name )
41 , m_config( config ) 41 , m_config( config )
42 , m_ipkg( m_config, this ) 42 , m_ipkg( m_config, this )
43 , m_packages( 9973 ) 43 , m_packages( 9973 )
44 , m_categories() 44 , m_categories()
45{ 45{
46 m_packages.setAutoDelete( true ); 46 m_packages.setAutoDelete( true );
47} 47}
48 48
49void OPackageManager::loadAvailablePackages() 49void OPackageManager::loadAvailablePackages()
50{ 50{
51 m_packages.clear(); 51 m_packages.clear();
52 52
53 OConfItemList *serverList = m_ipkg.servers(); 53 OConfItemList *serverList = m_ipkg.servers();
54 54
55 if ( serverList ) 55 if ( serverList )
56 { 56 {
57 // Initialize status messaging 57 // Initialize status messaging
58 emit initStatus( serverList->count() ); 58 emit initStatus( serverList->count() );
59 int serverCount = 0; 59 int serverCount = 0;
60 60
61 bool categoryAdded = false; 61 bool categoryAdded = false;
62 62
63 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) 63 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
64 { 64 {
65 OConfItem *server = serverIt.current(); 65 OConfItem *server = serverIt.current();
66 66
67 // Process server only if it is active 67 // Process server only if it is active
68 if ( server->active() ) 68 if ( server->active() )
69 { 69 {
70 // Update status 70 // Update status
71 QString status = tr( "Reading available packages:\n\t" ); 71 QString status = tr( "Reading available packages:\n\t" );
72 status.append( server->name() ); 72 status.append( server->name() );
73 emit statusText( status ); 73 emit statusText( status );
74 ++serverCount; 74 ++serverCount;
75 emit statusBar( serverCount ); 75 emit statusBar( serverCount );
76 qApp->processEvents(); 76 qApp->processEvents();
77 77
78 OPackageList *packageList = m_ipkg.availablePackages( server->name() ); 78 OPackageList *packageList = m_ipkg.availablePackages( server->name() );
79 if ( packageList ) 79 if ( packageList )
80 { 80 {
81 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) 81 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
82 { 82 {
83 OPackage *package = packageIt.current(); 83 OPackage *package = packageIt.current();
84 84
85 // Load package info 85 // Load package info
86 if ( !m_packages.find( package->name() ) ) 86 if ( !m_packages.find( package->name() ) ) {
87 printf( "ADD AVAILABLE '%s'\n", package->name().latin1());
87 m_packages.insert( package->name(), package ); 88 m_packages.insert( package->name(), package );
88 else 89 } else
89 { 90 {
90 // If new package is newer version, replace existing package 91 // If new package is newer version, replace existing package
91 OPackage *currPackage = m_packages[package->name()]; 92 OPackage *currPackage = m_packages[package->name()];
92 if ( compareVersions( package->version(), currPackage->version() ) == 1 ) 93 if ( compareVersions( package->version(), currPackage->version() ) == 1 )
93 m_packages.replace( package->name(), package ); 94 m_packages.replace( package->name(), package );
94 } 95 }
95 96
96 // Add category to list if it doesn't already exist 97 // Add category to list if it doesn't already exist
97 if ( m_categories.grep( package->category() ).isEmpty() ) 98 if ( m_categories.grep( package->category() ).isEmpty() )
98 { 99 {
99 m_categories << package->category(); 100 m_categories << package->category();
100 categoryAdded = true; 101 categoryAdded = true;
101 } 102 }
102 } 103 }
103 } 104 }
104 } 105 }
105 } 106 }
106 delete serverList; 107 delete serverList;
107 108
108 // Sort category list if categories were added 109 // Sort category list if categories were added
109 if ( categoryAdded ) 110 if ( categoryAdded )
110 m_categories.sort(); 111 m_categories.sort();
111 } 112 }
112} 113}
113 114
114void OPackageManager::loadInstalledPackages() 115void OPackageManager::loadInstalledPackages()
115{ 116{
116 OConfItemList *destList = m_ipkg.destinations(); 117 OConfItemList *destList = m_ipkg.destinations();
117 118
118 if ( destList ) 119 if ( destList )
119 { 120 {
120 // Initialize status messaging 121 // Initialize status messaging
121 emit initStatus( destList->count() ); 122 emit initStatus( destList->count() );
122 int destCount = 0; 123 int destCount = 0;
123 124
124 bool categoryAdded = false; 125 bool categoryAdded = false;
125 126
126 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) 127 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
127 { 128 {
128 OConfItem *destination = destIt.current(); 129 OConfItem *destination = destIt.current();
129 130
130 // Process destination only if it is active 131 // Process destination only if it is active
131 if ( destination->active() ) 132 if ( destination->active() )
132 { 133 {
133 // Update status 134 // Update status
134 QString status = tr( "Reading installed packages:\n\t" ); 135 QString status = tr( "Reading installed packages:\n\t" );
135 status.append( destination->name() ); 136 status.append( destination->name() );
136 emit statusText( status ); 137 emit statusText( status );
137 ++destCount; 138 ++destCount;
138 emit statusBar( destCount ); 139 emit statusBar( destCount );
139 qApp->processEvents(); 140 qApp->processEvents();
140 141
142 printf( "DESGTINATION %s\n", destination->name().latin1());
141 OPackageList *packageList = m_ipkg.installedPackages( destination->name(), 143 OPackageList *packageList = m_ipkg.installedPackages( destination->name(),
142 destination->value() ); 144 destination->value() );
143 if ( packageList ) 145 if ( packageList )
144 { 146 {
145 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt ) 147 for ( OPackageListIterator packageIt( *packageList ); packageIt.current(); ++packageIt )
146 { 148 {
147 OPackage *package = packageIt.current(); 149 OPackage *package = packageIt.current();
148 OPackage *currPackage = m_packages[package->name()]; 150 OPackage *currPackage = m_packages[package->name()];
149 if ( currPackage ) 151 if ( currPackage )
150 { 152 {
151 // Package is in a current feed, update installed version, destination 153 // Package is in a current feed, update installed version, destination
152 currPackage->setVersionInstalled( package->versionInstalled() ); 154 currPackage->setVersionInstalled( package->versionInstalled() );
153 currPackage->setDestination( package->destination() ); 155 currPackage->setDestination( package->destination() );
154 156
155 delete package; 157 delete package;
156 } 158 }
157 else 159 else
158 { 160 {
159 // Package isn't in a current feed, add to list 161 // Package isn't in a current feed, add to list
162 printf( "ADD INSTALLED '%s'\n", package->name().latin1());
160 m_packages.insert( package->name(), package ); 163 m_packages.insert( package->name(), package );
161 164
162 // Add category to list if it doesn't already exist 165 // Add category to list if it doesn't already exist
163 if ( m_categories.grep( package->category() ).isEmpty() ) 166 if ( m_categories.grep( package->category() ).isEmpty() )
164 { 167 {
165 m_categories << package->category(); 168 m_categories << package->category();
166 categoryAdded = true; 169 categoryAdded = true;
167 } 170 }
168 } 171 }
169 } 172 }
170 } 173 }
171 } 174 }
172 } 175 }
173 delete destList; 176 delete destList;
174 177
175 // Sort category list if categories were added 178 // Sort category list if categories were added
176 if ( categoryAdded ) 179 if ( categoryAdded )
177 m_categories.sort(); 180 m_categories.sort();
178 } 181 }
179} 182}
180 183
181OPackageList *OPackageManager::packages() 184OPackageList *OPackageManager::packages()
182{ 185{
183 // TODO - look to see if list is loaded, if not, load available & installed 186 // TODO - look to see if list is loaded, if not, load available & installed
184 187
185 OPackageList *pl = new OPackageList; 188 OPackageList *pl = new OPackageList;
186 189
187 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt ) 190 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
188 pl->append( packageIt.current() ); 191 pl->append( packageIt.current() );
189 192
190 return pl; 193 return pl;
191} 194}
192 195
193OPackageList *OPackageManager::filterPackages( const QString &name,const QString &server, 196OPackageList *OPackageManager::filterPackages( const QString &name,const QString &server,
194 const QString &destination, Status status, const QString &category ) 197 const QString &destination, Status status, const QString &category )
195{ 198{
196 // TODO - look to see if list is loaded, if not, load available & installed 199 // TODO - look to see if list is loaded, if not, load available & installed
197 200
198 OPackageList *pl = new OPackageList; 201 OPackageList *pl = new OPackageList;
199 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt ) 202 for ( QDictIterator<OPackage> packageIt( m_packages ); packageIt.current(); ++packageIt )
200 { 203 {
201 OPackage *package = packageIt.current(); 204 OPackage *package = packageIt.current();
202 205
203 bool nameMatch = ( name.isNull() || package->name().contains( name ) ); 206 bool nameMatch = ( name.isNull() || package->name().contains( name ) );
204 bool serverMatch = ( server.isNull() || package->source() == server ); 207 bool serverMatch = ( server.isNull() || package->source() == server );
205 bool destinationMatch = ( destination.isNull() || package->destination() == destination ); 208 bool destinationMatch = ( destination.isNull() || package->destination() == destination );
206 bool statusMatch; 209 bool statusMatch;
207 switch ( status ) 210 switch ( status )
208 { 211 {
209 case All : statusMatch = true; 212 case All : statusMatch = true;
210 break; 213 break;
211 case NotInstalled : statusMatch = package->versionInstalled().isNull(); 214 case NotInstalled : statusMatch = package->versionInstalled().isNull();
212 break; 215 break;
213 case Installed : statusMatch = !package->versionInstalled().isNull(); 216 case Installed : statusMatch = !package->versionInstalled().isNull();
214 break; 217 break;
215 case Updated : statusMatch = ( !package->versionInstalled().isNull() && 218 case Updated : statusMatch = ( !package->versionInstalled().isNull() &&
216 compareVersions( package->version(), package->versionInstalled() ) == 1 ); 219 compareVersions( package->version(), package->versionInstalled() ) == 1 );
217 break; 220 break;
218 default : statusMatch = true; 221 default : statusMatch = true;
219 break; 222 break;
220 }; 223 };
221 bool categoryMatch = ( category.isNull() || package->category() == category ); 224 bool categoryMatch = ( category.isNull() || package->category() == category );
222 225
223 if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch ) 226 if ( nameMatch && serverMatch && destinationMatch && statusMatch && categoryMatch )
224 pl->append( packageIt.current() ); 227 pl->append( packageIt.current() );
225 } 228 }
226 229
227 return pl; 230 return pl;
228} 231}
229 232
230QStringList OPackageManager::servers() 233QStringList OPackageManager::servers()
231{ 234{
232 QStringList sl; 235 QStringList sl;
233 236
234 OConfItemList *serverList = m_ipkg.servers(); 237 OConfItemList *serverList = m_ipkg.servers();
235 if ( serverList ) 238 if ( serverList )
236 { 239 {
237 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt ) 240 for ( OConfItemListIterator serverIt( *serverList ); serverIt.current(); ++serverIt )
238 { 241 {
239 OConfItem *server = serverIt.current(); 242 OConfItem *server = serverIt.current();
240 243
241 // Add only active servers 244 // Add only active servers
242 if ( server->active() ) 245 if ( server->active() )
243 sl << server->name(); 246 sl << server->name();
244 } 247 }
245 } 248 }
246 249
247 return sl; 250 return sl;
248} 251}
249 252
250QStringList OPackageManager::destinations() 253QStringList OPackageManager::destinations()
251{ 254{
252 QStringList dl; 255 QStringList dl;
253 256
254 OConfItemList *destList = m_ipkg.destinations(); 257 OConfItemList *destList = m_ipkg.destinations();
255 if ( destList ) 258 if ( destList )
256 { 259 {
257 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt ) 260 for ( OConfItemListIterator destIt( *destList ); destIt.current(); ++destIt )
258 { 261 {
259 OConfItem *destination = destIt.current(); 262 OConfItem *destination = destIt.current();
260 263
261 // Add only active destinations 264 // Add only active destinations
262 if ( destination->active() ) 265 if ( destination->active() )
263 dl << destination->name(); 266 dl << destination->name();
264 } 267 }
265 } 268 }
266 269
267 return dl; 270 return dl;
268} 271}
269 272
270OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name ) 273OConfItem *OPackageManager::findConfItem( OConfItem::Type type, const QString &name )
271{ 274{
272 return m_ipkg.findConfItem( type, name ); 275 return m_ipkg.findConfItem( type, name );
273} 276}
274 277
275OPackage *OPackageManager::findPackage( const QString &name ) 278OPackage *OPackageManager::findPackage( const QString &name )
276{ 279{
277 return m_packages[ name ]; 280 return m_packages[ name ];
278} 281}
279 282
280int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 ) 283int OPackageManager::compareVersions( const QString &ver1, const QString &ver2 )
281{ 284{
282 // TODO - should this be in OIpkg??? 285 // TODO - should this be in OIpkg???
283 286
284 int epoch1, epoch2; 287 int epoch1, epoch2;
285 QString version1, revision1; 288 QString version1, revision1;
286 QString version2, revision2; 289 QString version2, revision2;
287 290
288 parseVersion( ver1, &epoch1, &version1, &revision1 ); 291 parseVersion( ver1, &epoch1, &version1, &revision1 );
289 parseVersion( ver2, &epoch2, &version2, &revision2 ); 292 parseVersion( ver2, &epoch2, &version2, &revision2 );
290 293
291 if ( epoch1 > epoch2 ) 294 if ( epoch1 > epoch2 )
292 return 1; 295 return 1;
293 else if ( epoch1 < epoch2 ) 296 else if ( epoch1 < epoch2 )
294 return -1; 297 return -1;
295 298
296 int r = verrevcmp( version1.latin1(), version2.latin1() ); 299 int r = verrevcmp( version1.latin1(), version2.latin1() );
297 if (r) 300 if (r)
298 return r; 301 return r;
299 302
300 r = verrevcmp( revision1.latin1(), revision2.latin1() ); 303 r = verrevcmp( revision1.latin1(), revision2.latin1() );
301 return r; 304 return r;
302} 305}
303 306
304bool OPackageManager::configureDlg( bool installOptions ) 307bool OPackageManager::configureDlg( bool installOptions )
305{ 308{
306 OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) ); 309 OIpkgConfigDlg dlg( &m_ipkg, installOptions, static_cast<QWidget *>(parent()) );
307 return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted ); 310 return ( QPEApplication::execDialog( &dlg ) == QDialog::Accepted );
308} 311}
309 312
310void OPackageManager::saveSettings() 313void OPackageManager::saveSettings()
311{ 314{
312 m_ipkg.saveSettings(); 315 m_ipkg.saveSettings();
313} 316}
314 317
315bool OPackageManager::executeCommand( OPackage::Command command, const QStringList &packages, 318bool OPackageManager::executeCommand( OPackage::Command command, const QStringList &packages,
316 const QString &destination, const QObject *receiver, 319 const QString &destination, const QObject *receiver,
317 const char *slotOutput, bool rawOutput ) 320 const char *slotOutput, bool rawOutput )
318{ 321{
319 return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput ); 322 return m_ipkg.executeCommand( command, packages, destination, receiver, slotOutput, rawOutput );
320} 323}
321 324
322void OPackageManager::parseVersion( const QString &verstr, int *epoch, QString *version, 325void OPackageManager::parseVersion( const QString &verstr, int *epoch, QString *version,
323 QString *revision ) 326 QString *revision )
324{ 327{
325 *epoch = 0; 328 *epoch = 0;
326 *revision = QString::null; 329 *revision = QString::null;
327 330
328 // Version string is in the format "ee:vv-rv", where ee=epoch, vv=version, rv=revision 331 // Version string is in the format "ee:vv-rv", where ee=epoch, vv=version, rv=revision
329 332
330 // Get epoch 333 // Get epoch
331 int colonpos = verstr.find( ':' ); 334 int colonpos = verstr.find( ':' );
332 if ( colonpos > -1 ) 335 if ( colonpos > -1 )
333 { 336 {
334 *epoch = verstr.left( colonpos ).toInt(); 337 *epoch = verstr.left( colonpos ).toInt();
335 } 338 }
336 339
337 // Get version and revision 340 // Get version and revision
338 int hyphenpos = verstr.find( '-', colonpos + 1 ); 341 int hyphenpos = verstr.find( '-', colonpos + 1 );
339 int verlen = verstr.length(); 342 int verlen = verstr.length();
340 if ( hyphenpos > -1 ) 343 if ( hyphenpos > -1 )
341 { 344 {
342 *version = verstr.mid( colonpos + 1, hyphenpos - colonpos - 1 ); 345 *version = verstr.mid( colonpos + 1, hyphenpos - colonpos - 1 );
343 *revision = verstr.right( verlen - hyphenpos - 1 ); 346 *revision = verstr.right( verlen - hyphenpos - 1 );
344 } 347 }
345 else 348 else
346 { 349 {
347 *version = verstr.right( verlen - colonpos ); 350 *version = verstr.right( verlen - colonpos );
348 } 351 }
349} 352}
350 353
351/* 354/*
352 * libdpkg - Debian packaging suite library routines 355 * libdpkg - Debian packaging suite library routines
353 * vercmp.c - comparison of version numbers 356 * vercmp.c - comparison of version numbers
354 * 357 *
355 * Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk> 358 * Copyright (C) 1995 Ian Jackson <iwj10@cus.cam.ac.uk>
356 */ 359 */
357int OPackageManager::verrevcmp( const char *val, const char *ref ) 360int OPackageManager::verrevcmp( const char *val, const char *ref )
358{ 361{
359 int vc, rc; 362 int vc, rc;
360 long vl, rl; 363 long vl, rl;
361 const char *vp, *rp; 364 const char *vp, *rp;
362 const char *vsep, *rsep; 365 const char *vsep, *rsep;
363 366
364 if (!val) val= ""; 367 if (!val) val= "";
365 if (!ref) ref= ""; 368 if (!ref) ref= "";
366 for (;;) { 369 for (;;) {
367 vp= val; while (*vp && !isdigit(*vp)) vp++; 370 vp= val; while (*vp && !isdigit(*vp)) vp++;
368 rp= ref; while (*rp && !isdigit(*rp)) rp++; 371 rp= ref; while (*rp && !isdigit(*rp)) rp++;
369 for (;;) { 372 for (;;) {
370 vc= (val == vp) ? 0 : *val++; 373 vc= (val == vp) ? 0 : *val++;
371 rc= (ref == rp) ? 0 : *ref++; 374 rc= (ref == rp) ? 0 : *ref++;
372 if (!rc && !vc) break; 375 if (!rc && !vc) break;
373 if (vc && !isalpha(vc)) vc += 256; /* assumes ASCII character set */ 376 if (vc && !isalpha(vc)) vc += 256; /* assumes ASCII character set */
374 if (rc && !isalpha(rc)) rc += 256; 377 if (rc && !isalpha(rc)) rc += 256;
375 if (vc != rc) return vc - rc; 378 if (vc != rc) return vc - rc;
376 } 379 }
377 val= vp; 380 val= vp;
378 ref= rp; 381 ref= rp;
379 vl=0; if (isdigit(*vp)) vl= strtol(val,(char**)&val,10); 382 vl=0; if (isdigit(*vp)) vl= strtol(val,(char**)&val,10);
380 rl=0; if (isdigit(*rp)) rl= strtol(ref,(char**)&ref,10); 383 rl=0; if (isdigit(*rp)) rl= strtol(ref,(char**)&ref,10);
381 if (vl != rl) return vl - rl; 384 if (vl != rl) return vl - rl;
382 385
383 vc = *val; 386 vc = *val;
384 rc = *ref; 387 rc = *ref;
385 vsep = strchr(".-", vc); 388 vsep = strchr(".-", vc);
386 rsep = strchr(".-", rc); 389 rsep = strchr(".-", rc);
387 if (vsep && !rsep) return -1; 390 if (vsep && !rsep) return -1;
388 if (!vsep && rsep) return +1; 391 if (!vsep && rsep) return +1;
389 392
390 if (!*val && !*ref) return 0; 393 if (!*val && !*ref) return 0;
391 if (!*val) return -1; 394 if (!*val) return -1;
392 if (!*ref) return +1; 395 if (!*ref) return +1;
393 } 396 }
394} 397}