Merge lp:~vaudano/babiloo/efl into lp:babiloo

Proposed by zeusOne
Status: Needs review
Proposed branch: lp:~vaudano/babiloo/efl
Merge into: lp:babiloo
Diff against target: 2582 lines (+2149/-10)
48 files modified
.bzrignore (+34/-0)
core/dictionary/pystardict.py (+31/-2)
core/modules/configuration.py (+2/-0)
core/modules/constants.py (+22/-0)
core/modules/status.py (+70/-0)
debian/babiloo.install (+7/-0)
debian/babiloo.links (+1/-0)
debian/babiloo.manpages (+1/-0)
debian/babiloo.menu (+5/-0)
debian/changelog (+52/-0)
debian/compat (+1/-0)
debian/control (+20/-0)
debian/copyright (+84/-0)
debian/rules (+27/-0)
debian/watch (+3/-0)
doc/efl/babiloo.tex (+28/-0)
doc/efl/configuration.tex (+12/-0)
doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo (+8/-0)
doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo (+7/-0)
doc/efl/frontPage.tex (+3/-0)
doc/efl/genDoc.sh (+2/-0)
doc/efl/installation.tex (+34/-0)
doc/efl/intro.tex (+4/-0)
doc/efl/planning.tex (+125/-0)
doc/efl/source.tex (+7/-0)
doc/efl/version0.1.tex (+38/-0)
doc/efl/version0.2.tex (+39/-0)
doc/efl/version0.3.tex (+23/-0)
doc/efl/version0.4.tex (+15/-0)
efl/__init__.py (+21/-0)
efl/about_ui.py (+124/-0)
efl/babiloo-efl.bb (+41/-0)
efl/babiloo.desktop (+11/-0)
efl/config.py (+56/-0)
efl/constants.py (+67/-0)
efl/definition_ui.py (+173/-0)
efl/dictionaries_ui.py (+196/-0)
efl/main.py (+48/-0)
efl/main_model.py (+352/-0)
efl/main_ui.py (+117/-0)
efl/settings_ui.py (+140/-0)
efl/utils_ui.py (+77/-0)
qt/about_ui.py (+2/-2)
qt/chooseLanguage_ui.py (+2/-2)
qt/images_rc.py (+1/-1)
qt/main_ui.py (+1/-1)
qt/settings_ui.py (+2/-2)
run.py (+13/-0)
To merge this branch: bzr merge lp:~vaudano/babiloo/efl
Reviewer Review Type Date Requested Status
The Developers of the Babiloo Project Pending
Review via email: mp+11119@code.launchpad.net
To post a comment you must log in.
Revision history for this message
zeusOne (vaudano) wrote :

Hi,
I noticed two things from the review.diff:

1 .bzignore is wrong (keep the trunk version)
2 the debian directory should be in another repository, I think

Cheers
Luca

On Thu, Sep 3, 2009 at 1:35 PM, zeusOne<email address hidden> wrote:
> zeusOne has proposed merging lp:~vaudano/babiloo/efl into lp:babiloo.
>
> Requested reviews:
>    The Developers of the Babiloo Project (babiloo-developers)
> --
> https://code.launchpad.net/~vaudano/babiloo/efl/+merge/11119
> You are the owner of lp:~vaudano/babiloo/efl.
>

lp:~vaudano/babiloo/efl updated
266. By Luca Vaudano <vaudano@debian-navi>

Database not found error

267. By Luca Vaudano <vaudano@debian-navi>

ecore.idler_add doesn't work well on desktop

268. By Luca Vaudano <vaudano@debian-navi>

Comment

269. By Luca Vaudano <vaudano@debian-navi>

Nicer file structure (gui, controller, model)

270. By Luca Vaudano <vaudano@debian-navi>

Fix loading database frame

271. By Luca Vaudano <vaudano@debian-navi>

Fix loading frame problem

272. By Luca Vaudano <vaudano@debian-navi>

Empty windows for Settings and Dictionaries, configuration file not present error

273. By Luca Vaudano <vaudano@debian-navi>

Start the program without database, it shows warning not error

274. By zeusOne <zeusone@maggie>

Fix UI for Netbook

275. By zeusOne <zeusone@maggie>

Working on the dictionaries tab

276. By Luca Vaudano <vaudano@debian-navi>

Dictionaries tab - New dictionary via file selector

277. By Luca Vaudano <vaudano@debian-navi>

New configuration management - not working :)

278. By Luca Vaudano <vaudano@debian-navi>

New configuration mechanism merged

279. By Luca Vaudano <vaudano@debian-navi>

Adapt for using Progress Bar, touched the pyStarDict file

280. By root <root@maggie>

Sound dictionary configuration

281. By Luca Vaudano <vaudano@debian-navi>

Added documentation and released files

282. By zeusOne <zeusone@maggie>

No progress bar

283. By Luca Vaudano <vaudano@debian-navi>

Dictionaries for performance testing

284. By Luca Vaudano <vaudano@debian-navi>

Move files to the doc directory

285. By zeusOne <zeusone@maggie>

Validation dictionary entry, sound dictionary entry, using dialog for loading frame

286. By zeusOne <zeusone@maggie>

Pager instead of multiple windows

287. By Luca Vaudano <vaudano@debian-navi>

Settings - Player and about page

288. By Luca Vaudano <vaudano@debian-navi>

One page different boxes - No pager

289. By Luca Vaudano <vaudano@debian-navi>

Released file and images for v0.2

290. By Luca Vaudano <vaudano@debian-navi>

Fix - Sound setting problem

291. By Luca Vaudano <vaudano@debian-navi>

Alignment with new elm-entry behaviout without br

292. By Luca Vaudano <vaudano@debian-navi>

Fix bug - Dialog always on top

293. By Luca Vaudano <vaudano@debian-navi>

New released file 2.0.9-2b

294. By Luca Vaudano <vaudano@debian-navi>

2.0.9-3 version

295. By Luca Vaudano <vaudano@debian-navi>

Changed source tarball position

296. By Luca Vaudano <vaudano@debian-navi>

Version 2.0.9-4 python-elementary alignment

297. By Luca Vaudano <vaudano@debian-navi>

Updated documentation

298. By Elive User <luca@Elive>

New release

299. By Elive User <luca@Elive>

New release

300. By Luca Vaudano <vaudano@debian-navi>

Final release

Unmerged revisions

300. By Luca Vaudano <vaudano@debian-navi>

Final release

299. By Elive User <luca@Elive>

New release

298. By Elive User <luca@Elive>

New release

297. By Luca Vaudano <vaudano@debian-navi>

Updated documentation

296. By Luca Vaudano <vaudano@debian-navi>

Version 2.0.9-4 python-elementary alignment

295. By Luca Vaudano <vaudano@debian-navi>

Changed source tarball position

294. By Luca Vaudano <vaudano@debian-navi>

2.0.9-3 version

293. By Luca Vaudano <vaudano@debian-navi>

New released file 2.0.9-2b

292. By Luca Vaudano <vaudano@debian-navi>

Fix bug - Dialog always on top

291. By Luca Vaudano <vaudano@debian-navi>

Alignment with new elm-entry behaviout without br

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file '.bzrignore'
2--- .bzrignore 2009-03-09 00:05:55 +0000
3+++ .bzrignore 2010-02-08 17:08:17 +0000
4@@ -5,3 +5,37 @@
5 dicts/en_vi
6 dicts/vi_en
7 dicts/vi_vi
8+*.debhelper
9+*.log
10+debian/babiloo
11+debian/files
12+debian/babiloo.substvars
13+qt
14+qt/about.py
15+qt/about.ui
16+qt/about_ui.py
17+qt/chooseLanguage.py
18+qt/chooseLanguage.ui
19+qt/chooseLanguage_ui.py
20+qt/contentSearchModel.py
21+qt/definitionView.py
22+qt/dictfilemanager.py
23+qt/dictionariesview.py
24+qt/gui_widgets.py
25+qt/historylistmodel.py
26+qt/images_rc.py
27+qt/__init__.py
28+qt/main.py
29+qt/main.ui
30+qt/main_ui.py
31+qt/Makefile
32+qt/onlineDictionariesView.py
33+qt/plugins
34+qt/Qt2Po.py
35+qt/settings.py
36+qt/settings.ui
37+qt/settings_ui.py
38+qt/SplashScreen.py
39+qt/wordlistmodel.py
40+*.aux
41+*.log
42
43=== modified file 'core/dictionary/pystardict.py'
44--- core/dictionary/pystardict.py 2009-05-25 12:31:48 +0000
45+++ core/dictionary/pystardict.py 2010-02-08 17:08:17 +0000
46@@ -26,6 +26,9 @@
47 from dictionary import DictionaryType, DictFormatError, Definition
48 import core.modules.utils as utils
49
50+from core.modules.constants import *
51+from core.modules.status import Status
52+
53 try:
54 from hashlib import md5
55 new_hash = md5
56@@ -34,6 +37,10 @@
57 import md5
58 new_hash = md5.new
59
60+if PROGRESS_BAR == "on":
61+ status = Status()
62+ status.setSteps(2)
63+
64 class _StarDictIfo():
65 """
66 The .ifo file has the following format:
67@@ -174,12 +181,23 @@
68 raise Exception('words count is incorrect')
69
70 # unpack parsed records
71+ if PROGRESS_BAR == "on":
72+ tot = len(matched_records)
73+ i = 0
74+ perc = 0
75 for matched_record in matched_records:
76+ if PROGRESS_BAR == "on":
77+ currentPerc = (i * MAX_SINGLE_STEP) / tot
78+ if currentPerc != perc:
79+ perc = currentPerc
80+ status.setStatus(0, perc)
81+ i = i + 1
82 c = matched_record.find('\x00') + 1
83 record_tuple = unpack('!%sc%sL' % (c, idx_offset_format),
84 matched_record)
85 word, cords = record_tuple[:c-1], record_tuple[c:]
86- self._idx[word] = cords
87+ self._idx[word] = cords
88+
89
90 def __getitem__(self, word):
91 """
92@@ -461,15 +479,26 @@
93
94 #Sorting keys
95 self._DictionaryType__keys = self.keys()
96- self._DictionaryType__keys.sort(utils.normalized_comparison)
97+ if STARDICT_SORT_KEY == "on":
98+ self._DictionaryType__keys.sort(utils.normalized_comparison)
99 # print self.idx._idx.keys()
100
101 def keys(self):
102 """
103 raises NotImplemented exception
104 """
105+ if PROGRESS_BAR == "on":
106+ tot = len(self.dict.keys())
107+ i = 0
108+ perc = 0
109 keys = []
110 for tupled_word in self.dict.keys():
111+ if PROGRESS_BAR == "on":
112+ currentPerc = (i * MAX_SINGLE_STEP) / tot
113+ if currentPerc != perc:
114+ perc = currentPerc
115+ status.setStatus(1, perc)
116+ i = i + 1
117 try:
118 keys.append("".join(tupled_word).decode(self.encoding))
119 except:
120
121=== modified file 'core/modules/configuration.py'
122--- core/modules/configuration.py 2009-03-28 01:13:40 +0000
123+++ core/modules/configuration.py 2010-02-08 17:08:17 +0000
124@@ -37,6 +37,8 @@
125 # internal application options
126 make_option("-g", "--gui", dest="mode", action="store_const", const="gui", #default="cli",
127 help="Run applicatin in GUI mode. This is the default"),
128+ make_option("-e", "--efl", dest="mode", action="store_const", const="efl", default="gui",
129+ help="Run applicatin in EFL mode"),
130 make_option("-c", "--cli", dest="mode", action="store_const", const="cli", default="gui",
131 help="Run applicatin in CLI mode"),
132 make_option("-d", "--debug", dest="logging", default=logging.INFO,
133
134=== added file 'core/modules/constants.py'
135--- core/modules/constants.py 1970-01-01 00:00:00 +0000
136+++ core/modules/constants.py 2010-02-08 17:08:17 +0000
137@@ -0,0 +1,22 @@
138+#!/usr/bin/env python
139+# -*- coding: utf-8 -*-
140+
141+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
142+# This program is free software; you can redistribute it and/or modify
143+# it under the terms of the GNU General Public License as published by
144+# the Free Software Foundation; either version 3 of the License, or
145+# (at your option) any later version.
146+#
147+# This program is distributed in the hope that it will be useful,
148+# but WITHOUT ANY WARRANTY; without even the implied warranty of
149+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
150+# GNU General Public License for more details.
151+#
152+# You should have received a copy of the GNU General Public License along
153+# with this program; if not, write to the Free Software Foundation, Inc.,
154+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
155+STARDICT_SORT_KEY = 'off'
156+
157+# Progress bar
158+PROGRESS_BAR = 'off' # values: 'on' or 'off'
159+MAX_SINGLE_STEP = 25 # for sure less than 100!
160\ No newline at end of file
161
162=== added file 'core/modules/status.py'
163--- core/modules/status.py 1970-01-01 00:00:00 +0000
164+++ core/modules/status.py 2010-02-08 17:08:17 +0000
165@@ -0,0 +1,70 @@
166+#!/usr/bin/env python
167+# -*- coding: utf-8 -*-
168+
169+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
170+# This program is free software; you can redistribute it and/or modify
171+# it under the terms of the GNU General Public License as published by
172+# the Free Software Foundation; either version 3 of the License, or
173+# (at your option) any later version.
174+#
175+# This program is distributed in the hope that it will be useful,
176+# but WITHOUT ANY WARRANTY; without even the implied warranty of
177+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
178+# GNU General Public License for more details.
179+#
180+# You should have received a copy of the GNU General Public License along
181+# with this program; if not, write to the Free Software Foundation, Inc.,
182+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
183+from core.modules.constants import *
184+
185+# Singleton
186+class Status:
187+
188+ class __impl:
189+
190+ # Initialization
191+ def __init__(self):
192+ status = 0
193+ steps = 1
194+
195+ # Get status
196+ def getStatus(self):
197+ return status
198+
199+ # Set UI
200+ def setUI(self, ui):
201+ self.ui = ui
202+
203+ # Set steps to do
204+ def setSteps(self, steps):
205+ self.steps = steps
206+
207+ # Set status
208+ def setStatus(self, step, value):
209+ singleStepMax = 100 / self.steps
210+ multiple = singleStepMax / MAX_SINGLE_STEP
211+ status = (singleStepMax * step) + (value * multiple)
212+ if self.ui is not None:
213+ self.ui.setStatus(status)
214+
215+ # storage for the instance reference
216+ __instance = None
217+
218+ def __init__(self):
219+
220+ # Check whether we already have an instance
221+ if Status.__instance is None:
222+
223+ # Create instance
224+ Status.__instance = Status.__impl()
225+
226+ # Store instance reference as the only member in the handle
227+ self.__dict__['_Singleton__instance'] = Status.__instance
228+
229+ def __getattr__(self, attr):
230+ """ Delegate access to implementation """
231+ return getattr(self.__instance, attr)
232+
233+ def __setattr__(self, attr, value):
234+ """ Delegate access to implementation """
235+ return setattr(self.__instance, attr, value)
236
237=== added directory 'debian'
238=== added file 'debian/babiloo.install'
239--- debian/babiloo.install 1970-01-01 00:00:00 +0000
240+++ debian/babiloo.install 2010-02-08 17:08:17 +0000
241@@ -0,0 +1,7 @@
242+efl /usr/share/babiloo
243+core /usr/share/babiloo
244+images /usr/share/babiloo
245+dicts /usr/share/babiloo
246+run.py /usr/share/babiloo
247+efl/babiloo.desktop /usr/share/applications
248+images/babiloo.png /usr/share/pixmaps/
249
250=== added file 'debian/babiloo.links'
251--- debian/babiloo.links 1970-01-01 00:00:00 +0000
252+++ debian/babiloo.links 2010-02-08 17:08:17 +0000
253@@ -0,0 +1,1 @@
254+usr/share/babiloo/run.py /usr/bin/babiloo
255
256=== added file 'debian/babiloo.manpages'
257--- debian/babiloo.manpages 1970-01-01 00:00:00 +0000
258+++ debian/babiloo.manpages 2010-02-08 17:08:17 +0000
259@@ -0,0 +1,1 @@
260+babiloo.1
261
262=== added file 'debian/babiloo.menu'
263--- debian/babiloo.menu 1970-01-01 00:00:00 +0000
264+++ debian/babiloo.menu 2010-02-08 17:08:17 +0000
265@@ -0,0 +1,5 @@
266+?package(babiloo):needs="X11" \
267+ section="Applications/Office" \
268+ title="Babiloo 2" \
269+ command="/usr/bin/babiloo" \
270+ icon="/usr/share/pixmaps/babiloo.xpm"
271
272=== added file 'debian/changelog'
273--- debian/changelog 1970-01-01 00:00:00 +0000
274+++ debian/changelog 2010-02-08 17:08:17 +0000
275@@ -0,0 +1,52 @@
276+babiloo (2.0.9-4) karmic; urgency=low
277+
278+ [ Luca Vaudano ]
279+ * Python-elementary alignment
280+
281+ -- Luca Vaudano <vaudano@debian-navi> Tue, 01 Dec 2009 10:55:55 +0100
282+
283+babiloo (2.0.9-3) karmic; urgency=low
284+
285+ [ Luca Vaudano ]
286+ * EFL bug fixing
287+
288+ -- Luca Vaudano <vaudano@debian-navi> Fri, 27 Nov 2009 12:05:17 +0100
289+
290+babiloo (2.0.9-1) unstable; urgency=low
291+
292+ [ Ryan Kavanagh ]
293+ * New upstream release
294+ * Bumped standards version to 3.8.2
295+
296+ -- Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org> Fri, 26 Jun 2009 21:44:44 -0400
297+
298+babiloo (2.0.8-1) unstable; urgency=low
299+
300+ * New upstream version.
301+ * debian/control:
302+ + Improve long description (Closes: #528202).
303+ + Change XS-Python-Version to >= 2.5 and bump python dependency
304+ to 2.5.2 as upstream needs python 2.5 to work correctly.
305+
306+ -- Marco Rodrigues <gothicx@sapo.pt> Thu, 28 May 2009 19:51:31 +0100
307+
308+babiloo (2.0.7-1) unstable; urgency=low
309+
310+ * New upstream version.
311+ * XPM icon provided by upstream. Removed.
312+ * debian/babiloo.install:
313+ + Use upstream xpm icon.
314+ * debian/control:
315+ + Bump Standards-Version to 3.8.1 (no changes).
316+ * debian/rules:
317+ + Rebuild QT ui files.
318+ * debian/copyright:
319+ + Add myself to upstream authors :)
320+
321+ -- Marco Rodrigues <gothicx@sapo.pt> Tue, 28 Apr 2009 12:30:40 +0000
322+
323+babiloo (2.0.3.1-1) unstable; urgency=low
324+
325+ * Initial Release (Closes: #510132).
326+
327+ -- Marco Rodrigues <gothicx@sapo.pt> Tue, 10 Mar 2009 20:58:02 +0000
328
329=== added file 'debian/compat'
330--- debian/compat 1970-01-01 00:00:00 +0000
331+++ debian/compat 2010-02-08 17:08:17 +0000
332@@ -0,0 +1,1 @@
333+7
334
335=== added file 'debian/control'
336--- debian/control 1970-01-01 00:00:00 +0000
337+++ debian/control 2010-02-08 17:08:17 +0000
338@@ -0,0 +1,20 @@
339+Source: babiloo
340+Section: utils
341+Priority: optional
342+Maintainer: Python Applications Packaging Team <python-apps-team@lists.alioth.debian.org>
343+Uploaders: Luca Vaudano <vaudano@gmail.com>
344+Build-Depends: debhelper (>= 7), python (>= 2.5.2-3)
345+Build-Depends-Indep: python-support (>= 0.5.6)
346+Standards-Version: 3.8.2
347+Homepage: http://www.babiloo-project.org/
348+
349+Package: babiloo
350+Architecture: all
351+Depends: python-compression, python-misc, python-netclient
352+Description: dictionary viewer.
353+ It supports dictionaries in SDictionary and StarDict format.
354+ Features:
355+ * Don't convert dictionaries, use originals.
356+ * Phonetic sounds.
357+ .
358+ This package contains the GUI frontend and common files.
359
360=== added file 'debian/copyright'
361--- debian/copyright 1970-01-01 00:00:00 +0000
362+++ debian/copyright 2010-02-08 17:08:17 +0000
363@@ -0,0 +1,84 @@
364+This package was debianized by Marco Rodrigues <gothicx@sapo.pt> on
365+Mon, 05 Jan 2009 10:05:30 +0000.
366+
367+It was downloaded from http://www.babiloo-project.org/
368+
369+Upstream Author: Ivan Garcia <ivangarcia@gmail.com>
370+ Marco Ferreira <mferreira@devion.org>
371+ Marco Rodrigues <gothicx@sapo.pt>
372+
373+Copyright:
374+
375+ Copyright (C) 2008-2009 by Ivan Garcia <ivangarcia@gmail.com>
376+ Copyright (C) 2008-2009 by Marco Ferreira <mferreira@devion.org>
377+ Copyright (C) 2008-2009 by Marco Rodrigues <gothicx@sapo.pt>
378+
379+License:
380+
381+ This package is free software; you can redistribute it and/or modify
382+ it under the terms of the GNU General Public License as published by
383+ the Free Software Foundation; either version 2 of the License, or
384+ (at your option) any later version.
385+
386+ This package is distributed in the hope that it will be useful,
387+ but WITHOUT ANY WARRANTY; without even the implied warranty of
388+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
389+ GNU General Public License for more details.
390+
391+ You should have received a copy of the GNU General Public License
392+ along with this package; if not, write to the Free Software
393+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
394+
395+On Debian systems, the complete text of the GNU General
396+Public License can be found in `/usr/share/common-licenses/GPL-3'.
397+
398+* core/dictionary/psdict.py:
399+ Copyright (C) 2006 Dmitri Brechalov
400+ Copyright (C) Igor Tkach, 2006
401+
402+ This program is free software; you can redistribute it and/or modify
403+ it under the terms of the GNU General Public License as published by
404+ the Free Software Foundation; either version 2 of the License, or
405+ (at your option) any later version.
406+ The full license is in the file COPYING, distributed as part of
407+ this software.
408+
409+* core/dictionary/pystardict.py:
410+ Copyright 2008 Serge Matveenko
411+
412+ PyStarDict is free software: you can redistribute it and/or modify
413+ it under the terms of the GNU General Public License as published by
414+ the Free Software Foundation, either version 3 of the License, or
415+ (at your option) any later version.
416+
417+* languages/autodetect_lang.py:
418+ Copyright (c) 2006 Thomas Mangin
419+
420+ This program is distributed under Gnu General Public License
421+ (cf. the file COPYING in distribution). Alternatively, you can use
422+ the program under the conditions of the Artistic License (as Perl).
423+
424+* modules/progressbar.py:
425+ Copyright (C) 2005 Nilton Volpato
426+
427+ This library is free software; you can redistribute it and/or
428+ modify it under the terms of the GNU Lesser General Public
429+ License as published by the Free Software Foundation; either
430+ version 2.1 of the License, or (at your option) any later version.
431+
432+ On Debian systems, the complete text of the GNU Lesser General
433+ Public License can be found in `/usr/share/common-licenses/LGPL-2.1'.
434+
435+* locale/*:
436+ Copyright (c) 2008-2009 Rosetta Contributors and Canonical Ltd 2008
437+
438+* efl/*:
439+ Copyright (c) 2009 Luca Vaudano
440+
441+ This program is free software; you can redistribute it and/or modify
442+ it under the terms of the GNU General Public License as published by
443+ the Free Software Foundation; either version 2 of the License, or
444+ (at your option) any later version.
445+
446+The Debian packaging is © 2009, Marco Rodrigues <gothicx@sapo.pt> and
447+is licensed under the GPL, see above.
448
449=== added file 'debian/rules'
450--- debian/rules 1970-01-01 00:00:00 +0000
451+++ debian/rules 2010-02-08 17:08:17 +0000
452@@ -0,0 +1,27 @@
453+#!/usr/bin/make -f
454+
455+LANGUAGES=$(shell find locale/ -maxdepth 1 -mindepth 1 -type d -not -name \.svn -printf "%f ")
456+
457+build:
458+ dh build
459+
460+clean:
461+ make -C qt/ clean
462+ dh clean
463+ find . -name "*\.py[co]" -delete
464+
465+install: build
466+ make -C qt/ all
467+ dh --with python_support install
468+
469+ # Make it executable to run.py
470+ chmod +x debian/babiloo/usr/bin/babiloo
471+
472+binary-indep: build install
473+ dh --with python_support binary-indep
474+
475+binary-arch: build install
476+
477+binary: binary-indep binary-arch
478+
479+.PHONY: build clean binary-indep binary-arch binary
480
481=== added file 'debian/watch'
482--- debian/watch 1970-01-01 00:00:00 +0000
483+++ debian/watch 2010-02-08 17:08:17 +0000
484@@ -0,0 +1,3 @@
485+version=3
486+https://launchpad.net/babiloo/+download \
487+http://launchpad.net/babiloo/(?:.*)/(?:.*)/\+download/babiloo-(.*)\.tar\.gz
488
489=== added directory 'doc'
490=== added directory 'doc/efl'
491=== added file 'doc/efl/babiloo.pdf'
492Binary files doc/efl/babiloo.pdf 1970-01-01 00:00:00 +0000 and doc/efl/babiloo.pdf 2010-02-08 17:08:17 +0000 differ
493=== added file 'doc/efl/babiloo.tex'
494--- doc/efl/babiloo.tex 1970-01-01 00:00:00 +0000
495+++ doc/efl/babiloo.tex 2010-02-08 17:08:17 +0000
496@@ -0,0 +1,28 @@
497+\documentclass[english,a4paper,10pt]{article}
498+\usepackage{enumerate} % need for alphabetic list enumeration
499+\usepackage{amsmath,amssymb,amsfonts} % Typical maths resource packages
500+\usepackage{graphicx} % Packages to allow inclusion of graphics
501+\usepackage{color} % For creating coloured text and background
502+\usepackage{times} % True Type Font
503+\usepackage{babel} % English language
504+\usepackage{subfigure} % Sub-figure for screenshots
505+
506+\begin{document}
507+
508+\include{frontPage}
509+
510+\include{intro}
511+\include{installation}
512+\include{configuration}
513+\include{source}
514+
515+\section{Changelog}
516+\include{version0.1}
517+\include{version0.2}
518+\include{version0.3}
519+\include{version0.4}
520+\include{version1.0}
521+
522+\include{planning}
523+
524+\end{document}
525\ No newline at end of file
526
527=== added file 'doc/efl/configuration.tex'
528--- doc/efl/configuration.tex 1970-01-01 00:00:00 +0000
529+++ doc/efl/configuration.tex 2010-02-08 17:08:17 +0000
530@@ -0,0 +1,12 @@
531+\section{Configuration}
532+
533+\subsection{Dictionaries}
534+
535+\begin{itemize}
536+ \item Download from the Web a dictionary\\
537+ (e.g. http://sourceforge.net/projects/stardict/files/stardict-dictionaries-dictd/)
538+ \item Unzip the dictionary (e.g. bunzip2 stardict-longman-2.4.2.tar.bz2 then tar xvf stardict-longman-2.4.2.tar)
539+ \item Optionally, download and unzip a sound dictionary \\
540+ (e.g. from http://sourceforge.net/projects/stardict/files/ the WyabdcRealPeopleTTS section)
541+ \item Configure the 'Dictonaries tab', see \ref{dictionaryTab}, in the Babiloo GUI
542+\end{itemize}
543\ No newline at end of file
544
545=== added directory 'doc/efl/dictTest'
546=== added file 'doc/efl/dictTest/CollinsCOBUILD.dct'
547Binary files doc/efl/dictTest/CollinsCOBUILD.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/CollinsCOBUILD.dct 2010-02-08 17:08:18 +0000 differ
548=== added file 'doc/efl/dictTest/English_Italian.dct'
549Binary files doc/efl/dictTest/English_Italian.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/English_Italian.dct 2010-02-08 17:08:18 +0000 differ
550=== added file 'doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct'
551Binary files doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/simplewiki-2007-01-03_wiki.dct 2010-02-08 17:08:18 +0000 differ
552=== added directory 'doc/efl/dictTest/stardict-longman-2.4.2'
553=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz'
554Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.dict.dz 2010-02-08 17:08:18 +0000 differ
555=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.idx'
556Binary files doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-longman-2.4.2/longman.idx 2010-02-08 17:08:18 +0000 differ
557=== added file 'doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo'
558--- doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo 1970-01-01 00:00:00 +0000
559+++ doc/efl/dictTest/stardict-longman-2.4.2/longman.ifo 2010-02-08 17:08:18 +0000
560@@ -0,0 +1,8 @@
561+StarDict's dict ifo file
562+version=2.4.2
563+wordcount=43052
564+idxfilesize=771616
565+bookname=Longman Dictionary of Contemporary English
566+description=Made by Hu Zheng
567+date=2005.10.23
568+sametypesequence=m
569
570=== added directory 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2'
571=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz'
572Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.dict.dz 2010-02-08 17:08:18 +0000 differ
573=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx'
574Binary files doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 1970-01-01 00:00:00 +0000 and doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.idx 2010-02-08 17:08:18 +0000 differ
575=== added file 'doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo'
576--- doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo 1970-01-01 00:00:00 +0000
577+++ doc/efl/dictTest/stardict-oxford_collocations-2.4.2/oxford_collocations.ifo 2010-02-08 17:08:18 +0000
578@@ -0,0 +1,7 @@
579+StarDict's dict ifo file
580+version=2.4.2
581+wordcount=8338
582+idxfilesize=180266
583+bookname=Oxford English Collocation Dictionary
584+description=Made by Hu Zheng, privoided by Dr.Treo and lewpda.
585+sametypesequence=m
586
587=== added file 'doc/efl/frontPage.tex'
588--- doc/efl/frontPage.tex 1970-01-01 00:00:00 +0000
589+++ doc/efl/frontPage.tex 2010-02-08 17:08:17 +0000
590@@ -0,0 +1,3 @@
591+\title{Babiloo-efl}
592+\author{Luca Vaudano}
593+\maketitle
594\ No newline at end of file
595
596=== added file 'doc/efl/genDoc.sh'
597--- doc/efl/genDoc.sh 1970-01-01 00:00:00 +0000
598+++ doc/efl/genDoc.sh 2010-02-08 17:08:17 +0000
599@@ -0,0 +1,2 @@
600+#!/bin/bash
601+pdflatex babiloo.tex
602
603=== added directory 'doc/efl/images'
604=== added directory 'doc/efl/images/v0.1'
605=== added file 'doc/efl/images/v0.1/1.png'
606Binary files doc/efl/images/v0.1/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/1.png 2010-02-08 17:08:18 +0000 differ
607=== added file 'doc/efl/images/v0.1/2.png'
608Binary files doc/efl/images/v0.1/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/2.png 2010-02-08 17:08:18 +0000 differ
609=== added file 'doc/efl/images/v0.1/3.png'
610Binary files doc/efl/images/v0.1/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/3.png 2010-02-08 17:08:18 +0000 differ
611=== added file 'doc/efl/images/v0.1/4.png'
612Binary files doc/efl/images/v0.1/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/4.png 2010-02-08 17:08:18 +0000 differ
613=== added file 'doc/efl/images/v0.1/5.png'
614Binary files doc/efl/images/v0.1/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/5.png 2010-02-08 17:08:18 +0000 differ
615=== added file 'doc/efl/images/v0.1/6.png'
616Binary files doc/efl/images/v0.1/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/6.png 2010-02-08 17:08:18 +0000 differ
617=== added file 'doc/efl/images/v0.1/7.png'
618Binary files doc/efl/images/v0.1/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.1/7.png 2010-02-08 17:08:18 +0000 differ
619=== added directory 'doc/efl/images/v0.2'
620=== added file 'doc/efl/images/v0.2/1.png'
621Binary files doc/efl/images/v0.2/1.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/1.png 2010-02-08 17:08:18 +0000 differ
622=== added file 'doc/efl/images/v0.2/2.png'
623Binary files doc/efl/images/v0.2/2.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/2.png 2010-02-08 17:08:18 +0000 differ
624=== added file 'doc/efl/images/v0.2/3.png'
625Binary files doc/efl/images/v0.2/3.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/3.png 2010-02-08 17:08:18 +0000 differ
626=== added file 'doc/efl/images/v0.2/4.png'
627Binary files doc/efl/images/v0.2/4.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/4.png 2010-02-08 17:08:18 +0000 differ
628=== added file 'doc/efl/images/v0.2/5.png'
629Binary files doc/efl/images/v0.2/5.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/5.png 2010-02-08 17:08:18 +0000 differ
630=== added file 'doc/efl/images/v0.2/6.png'
631Binary files doc/efl/images/v0.2/6.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/6.png 2010-02-08 17:08:18 +0000 differ
632=== added file 'doc/efl/images/v0.2/7.png'
633Binary files doc/efl/images/v0.2/7.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/7.png 2010-02-08 17:08:18 +0000 differ
634=== added file 'doc/efl/images/v0.2/8.png'
635Binary files doc/efl/images/v0.2/8.png 1970-01-01 00:00:00 +0000 and doc/efl/images/v0.2/8.png 2010-02-08 17:08:18 +0000 differ
636=== added file 'doc/efl/installation.tex'
637--- doc/efl/installation.tex 1970-01-01 00:00:00 +0000
638+++ doc/efl/installation.tex 2010-02-08 17:08:17 +0000
639@@ -0,0 +1,34 @@
640+\section{Installation}
641+
642+\subsection{Neo frerunner SHR}
643+
644+\begin{itemize}
645+ \item opkg install babiloo-efl
646+\end{itemize}
647+
648+\subsection{Desktop}
649+
650+\subsubsection{Ubuntu 9.04}
651+
652+\begin{itemize}
653+ \item Configure the enlightenment repository:\\
654+ http://packages.enlightenment.org/
655+ \item Install babiloo (it requires python-efl-elementary)
656+ \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
657+\end{itemize}
658+
659+\subsubsection{Elive}
660+
661+\begin{itemize}
662+ \item Install babiloo in Elive (http://www.elivecd.org/)
663+ \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
664+\end{itemize}
665+
666+\subsubsection{OzOs}
667+
668+\begin{itemize}
669+ \item Install python-elementary from SVN\\
670+ svn co http://svn.enlightenment.org/svn/e/trunk/BINDINGS/python
671+ \item Install babiloo
672+ \item Launch babiloo -e (e switch launches the EFL interface, QT is the standard interface for desktop)
673+\end{itemize}
674\ No newline at end of file
675
676=== added file 'doc/efl/intro.tex'
677--- doc/efl/intro.tex 1970-01-01 00:00:00 +0000
678+++ doc/efl/intro.tex 2010-02-08 17:08:17 +0000
679@@ -0,0 +1,4 @@
680+\section{Intro}
681+The objective of this module is creating a graphics user interface that emphasizes simplicity and lightness. As development focuses on keeping weight down to a minimum, only the most essential features are implemented. It should be simple to use, requires few libraries and starts up quickly.\\
682+The main target is the openmoko Freerunner cellphone (http://www.openmoko.org) and secondly the netbook.\\
683+If you need a full-features program, you have to use the QT interface.
684\ No newline at end of file
685
686=== added file 'doc/efl/planning.tex'
687--- doc/efl/planning.tex 1970-01-01 00:00:00 +0000
688+++ doc/efl/planning.tex 2010-02-08 17:08:17 +0000
689@@ -0,0 +1,125 @@
690+\section{Planning}
691+
692+\subsection{Library}
693+The first thing to choose is the python GUI library.
694+Finally my decision is to use the Enlightenment Foundation Library (EFL) due his performance and because it fits very well with the embedded devices.\\
695+But also in the EFL world there are many choice:
696+
697+\begin{enumerate}
698+ \item Evas / edje\\
699+ (http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-edje)
700+ \item python-elementary\\
701+ (http://trac.enlightenment.org/e/browser/trunk/BINDINGS/python/python-elementary)
702+ \item python-terra\\
703+ (http://code.openbossa.org/projects/python-terra)
704+ \item guarana\\
705+ (http://profusion.mobi/node/10)
706+\end{enumerate}
707+
708+Among these solutions I discarded guarana because it doesn't have python bindings and evas / edje because python-elementary is born on top of it just for rendering the things simpler and it's more embedded devices oriented, especially touch screen.\\
709+Therefore after the reply in the e-devel mailing list\\
710+(http://www.mail-archive.com/enlightenment-devel@lists.sourceforge.net/msg21290.html)\\
711+I decided to use:
712+\begin{itemize}
713+ \item elementary as a widget set
714+ \item python-terra if I need some MVC logic (for e.g. for the file selector not implemented yet in the elementary library)
715+\end{itemize}
716+
717+\subsection{Milestones}
718+
719+\subsubsection{0.1}
720+\begin{itemize}
721+ \item Improve the GUI
722+ \item text size
723+ \item adjust the interface for working well on Neo and on desktop
724+ \begin{itemize}
725+ \item enable / disable Illume keyboard on Neo, do nothing on desktop
726+ \item scaling correctly the icon on Neo and on desktop
727+ \item wrap line different constant value for Neo and desktop
728+ \end{itemize}
729+ \item Empty windows for Settings and Dictionaries
730+ \item Link babiloo core:
731+ \begin{itemize}
732+ \item EFL switch in the command line
733+ \item Install all the babiloo core dependencies in Neo
734+ \begin{itemize}
735+ \item python-compression: gzip, zipfile, tarfile
736+ \item python-misc: platform, user
737+ \item python-netclient: mimetypes
738+ \end{itemize}
739+ \end{itemize}
740+ \item Message popup for babiloo-core error (like error during perform the search)
741+ \item Nicer file structure (gui, controller, model)
742+ \item Load database
743+ \begin{itemize}
744+ \item constant in a configuration file
745+ \item Configuration file not present error
746+ \item Dictionary file not present error
747+ \end{itemize}
748+ \item Link the GUI to the word search logic
749+ \item Voice capability
750+ \item Openmoko package
751+ \begin{itemize}
752+ \item Same process than deb package (we can skip qt and s60 directories and use the correct command line switch for launching it)
753+ \end{itemize}
754+\end{itemize}
755+
756+\subsubsection{0.2}
757+\begin{itemize}
758+ \item Improve the GUI
759+ \begin{itemize}
760+ \item Entry lost input data when switch between application
761+ \end{itemize}
762+ \item Start the program without database, it should show warning not error
763+ \item Change configuration format: use cPickle
764+ \item Set SINGLE database:
765+ \begin{itemize}
766+ \item he user clicks on the dictionaries icon
767+ \item the user changes the dictionary value via file selector widget and confirms
768+ \item the program in the 'Dictionaries tab' shows the selected dictionary
769+ \item after the user confirm the choice:
770+ \begin{itemize}
771+ \item the program sets the dictionary in the config file
772+ \item the program closes the 'Dictionaries tab' and shows the 'loading dictionary...' frame
773+ \item the program calls babiloo core passing the file
774+ \end{itemize}
775+ \item test on Neo
776+ \end{itemize}
777+ \item Set sound dictionary:
778+ \begin{itemize}
779+ \item like single database
780+ \end{itemize}
781+ \item Settings, player
782+ \begin{itemize}
783+ \item like single database
784+ \end{itemize}
785+ \item About page
786+ \item Performance problem for StarDict dictionary (due to the auto sorting feature)
787+ \begin{verbatim}
788+ Loading /home/root/babiloo/stardict-longman-2.4.2/longman.dict.dz ...
789+ (Stardict) type detected
790+ Dictionary loaded in 452.63 sec
791+ \end{verbatim}
792+ \item Desktop package (merge trunk repositories with efl branch then add efl directory in the control file)
793+\end{itemize}
794+
795+\subsubsection{Out of target}
796+\begin{itemize}
797+ \item Load MULTI databases:
798+ \begin{itemize}
799+ \item the user clicks on the dictionaries icon
800+ \item the program shows a table with all the available dictionaries and the default one
801+ \item the user can change the default one -> program saves it on the config file
802+ \item the user clicks on add icon
803+ \item the program opens a file selector widget
804+ \item after the user selected a dictionary the program calls babiloo core passing the file
805+ \item if everything go smoothly, returns to the dictionary table with a new row and selected as default
806+ \item the program adds the dictionary to the config file
807+ \end{itemize}
808+ \item Try to take off python-misc dependency ?
809+ \item HTML rendering ?
810+ \item GUI localization
811+ \item Progress bar (need Enlightenment rev43106)
812+ \item Multi dictionaries capability
813+ \item Word search filter (using elementary hover)
814+\end{itemize}
815\ No newline at end of file
816
817=== added directory 'doc/efl/releasedFiles'
818=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk'
819Binary files doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-1_neo.ipk 2010-02-08 17:08:18 +0000 differ
820=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk'
821Binary files doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2_all.ipk 2010-02-08 17:08:18 +0000 differ
822=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk'
823Binary files doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2a_all.ipk 2010-02-08 17:08:18 +0000 differ
824=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk'
825Binary files doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-2b_all.ipk 2010-02-08 17:08:18 +0000 differ
826=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz'
827Binary files doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3.tar.gz 2010-02-08 17:08:18 +0000 differ
828=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk'
829Binary files doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-3_all.ipk 2010-02-08 17:08:19 +0000 differ
830=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz'
831Binary files doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4.tar.gz 2010-02-08 17:08:19 +0000 differ
832=== added file 'doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk'
833Binary files doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 1970-01-01 00:00:00 +0000 and doc/efl/releasedFiles/babiloo_2.0.9-4_all.ipk 2010-02-08 17:08:19 +0000 differ
834=== added file 'doc/efl/source.tex'
835--- doc/efl/source.tex 1970-01-01 00:00:00 +0000
836+++ doc/efl/source.tex 2010-02-08 17:08:17 +0000
837@@ -0,0 +1,7 @@
838+\section{Source code}
839+bzr branch lp:~vaudano/babiloo/efl
840+
841+\subsection{Package}
842+Make a package, create the debian directory with the correct files, then:\\
843+\texttt{dpkg-buildpackage}\\
844+the command generates files in the parent directory, keep the deb one and rename it with ipk extension.
845\ No newline at end of file
846
847=== added file 'doc/efl/version0.1.tex'
848--- doc/efl/version0.1.tex 1970-01-01 00:00:00 +0000
849+++ doc/efl/version0.1.tex 2010-02-08 17:08:17 +0000
850@@ -0,0 +1,38 @@
851+\subsection{0.1}
852+
853+Babiloo version 2.0.9\\
854+Bazaar revision: 272\\
855+Release date: 16 September 2009\\
856+
857+\begin{itemize}
858+ \item GUI fits for Neo freerunner and EFL desktop (especially Netbook)
859+ \item Dictionaries configuration in a file (efl/config.cfg)
860+ \item Voice capability
861+\end{itemize}
862+
863+\subsubsection{Screenshots}
864+Figure~\ref{screenshotVer0.1} SHR with SHR-simple theme and SHR-Simple elementary theme.\\
865+
866+\begin{figure}[htp]
867+ \begin{center}
868+ \subfigure[Babiloo icon]{\includegraphics[scale=0.2]{images/v0.1/1.png}}
869+ \subfigure[Loading dictionary]{\includegraphics[scale=0.2]{images/v0.1/2.png}}
870+ \subfigure[Babiloo main screen]{\includegraphics[scale=0.2]{images/v0.1/3.png}}\\
871+ \subfigure[Dictionary tab]{\includegraphics[scale=0.2]{images/v0.1/4.png}}
872+ \subfigure[Settings tab]{\includegraphics[scale=0.2]{images/v0.1/5.png}}
873+ \subfigure[Search a word]{\includegraphics[scale=0.2]{images/v0.1/6.png}}\\
874+ \subfigure[Show the definition]{\includegraphics[scale=0.2]{images/v0.1/7.png}}
875+ \end{center}
876+ \caption{Babiloo EFL 0.1}
877+ \label{screenshotVer0.1}
878+\end{figure}
879+
880+\subsubsection{Performance}
881+\begin{tabular}{lllllll}
882+Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
883+272 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & 4.22 sec & 452.63 sec\\
884+272 & Oxford English Collocation & stardict & 2.0 Mb & 8K & 0.75 sec & 76.07 sec\\
885+272 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & 0.65 sec & 93.91 sec\\
886+272 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & 0.54 sec & 74.57 sec\\
887+272 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & 0.49 sec & 70.74 sec\\
888+\end{tabular}
889\ No newline at end of file
890
891=== added file 'doc/efl/version0.2.tex'
892--- doc/efl/version0.2.tex 1970-01-01 00:00:00 +0000
893+++ doc/efl/version0.2.tex 2010-02-08 17:08:17 +0000
894@@ -0,0 +1,39 @@
895+\subsection{0.2}
896+
897+Babiloo version 2.0.9-2 \\
898+Bazaar revision: 288 \\
899+Release date: 3 November 2009
900+
901+\begin{itemize}
902+ \item Bug fixing
903+ \item Configuration via GUI
904+ \item Performance improvements
905+\end{itemize}
906+
907+\subsubsection{Screenshots}
908+Figure~\ref{screenshotVer0.2} SHR with gry theme and gry elementary theme.\\
909+
910+\begin{figure}[htp]
911+ \begin{center}
912+ \subfigure[Babiloo icon]{\includegraphics[scale=0.2]{images/v0.2/1.png}}
913+ \subfigure[Loading dictionary]{\includegraphics[scale=0.2]{images/v0.2/2.png}}
914+ \subfigure[Babiloo main screen]{\includegraphics[scale=0.2]{images/v0.2/3.png}}\\
915+ \subfigure[Dictionary tab]{\label{dictionaryTab} \includegraphics[scale=0.2]{images/v0.2/4.png}}
916+ \subfigure[Settings tab]{\includegraphics[scale=0.2]{images/v0.2/5.png}}
917+ \subfigure[File selector]{\includegraphics[scale=0.2]{images/v0.2/6.png}}\\
918+ \subfigure[Search a word]{\includegraphics[scale=0.2]{images/v0.2/7.png}}
919+ \subfigure[Show the definition]{\includegraphics[scale=0.2]{images/v0.2/8.png}}
920+ \end{center}
921+ \caption{Babiloo EFL 0.2}
922+ \label{screenshotVer0.2}
923+\end{figure}
924+
925+\subsubsection{Performance}
926+\begin{tabular}{lllllll}
927+Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
928+288 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & less than 1 sec & 36 sec\\
929+288 & Oxford English Collocation & stardict & 2.0 Mb & 8K & less than 1 sec & 7 sec\\
930+288 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & less than 1 sec & 101 sec\\
931+288 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & less than 1 sec & 84 sec\\
932+288 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & less than 1 sec & 79 sec\\
933+\end{tabular}
934
935=== added file 'doc/efl/version0.3.tex'
936--- doc/efl/version0.3.tex 1970-01-01 00:00:00 +0000
937+++ doc/efl/version0.3.tex 2010-02-08 17:08:17 +0000
938@@ -0,0 +1,23 @@
939+\subsection{0.3}
940+
941+Babiloo version 2.0.9-3 \\
942+Bazaar revision: 295 \\
943+Release date: 27 November 2009 \\
944+
945+\begin{itemize}
946+ \item Bug fixing
947+ \item Included in the SHR feed ( opkg install babiloo-efl )
948+\end{itemize}
949+
950+\subsubsection{Screenshots}
951+As before
952+
953+\subsubsection{Performance}
954+\begin{tabular}{lllllll}
955+Rev & Dictionary name & Dict type & Size & Words & PC & Neo\\
956+295 & stardict-longman-2.4.2 & stardict & 6.8 Mb & 43K & less than 1 sec & 32 sec\\
957+295 & Oxford English Collocation & stardict & 2.0 Mb & 8K & less than 1 sec & 7 sec\\
958+295 & Collins Cobuild advanced...,4th & sDictionary & 9 Mb & 40K & less than 1 sec & 80 sec\\
959+295 & Wikipedia en 2007-01-03 (simple) & sDictionary & 9 Mb & 18K & less than 1 sec & 69 sec\\
960+295 & Englis-italian dictionary & sDictionary & 2 Mb & 33K & less than 1 sec & 66 sec\\
961+\end{tabular}
962\ No newline at end of file
963
964=== added file 'doc/efl/version0.4.tex'
965--- doc/efl/version0.4.tex 1970-01-01 00:00:00 +0000
966+++ doc/efl/version0.4.tex 2010-02-08 17:08:17 +0000
967@@ -0,0 +1,15 @@
968+\subsection{0.4}
969+
970+Babiloo version 2.0.9-4 \\
971+Bazaar revision: 296 \\
972+Release date: 1 December 2009 \\
973+
974+\begin{itemize}
975+ \item python-elementary code alignment
976+\end{itemize}
977+
978+\subsubsection{Screenshots}
979+As before
980+
981+\subsubsection{Performance}
982+As before
983\ No newline at end of file
984
985=== added directory 'efl'
986=== added file 'efl/__init__.py'
987--- efl/__init__.py 1970-01-01 00:00:00 +0000
988+++ efl/__init__.py 2010-02-08 17:08:19 +0000
989@@ -0,0 +1,21 @@
990+#!/usr/bin/env python
991+# -*- coding: utf-8 -*-
992+
993+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
994+# This program is free software; you can redistribute it and/or modify
995+# it under the terms of the GNU General Public License as published by
996+# the Free Software Foundation; either version 3 of the License, or
997+# (at your option) any later version.
998+#
999+# This program is distributed in the hope that it will be useful,
1000+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1001+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1002+# GNU General Public License for more details.
1003+#
1004+# You should have received a copy of the GNU General Public License along
1005+# with this program; if not, write to the Free Software Foundation, Inc.,
1006+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1007+
1008+__author__ = "Luca Vaudano <vaudano@gmail.com>"
1009+__version__ = "0.2"
1010+__module_name = "efl"
1011
1012=== added file 'efl/about_ui.py'
1013--- efl/about_ui.py 1970-01-01 00:00:00 +0000
1014+++ efl/about_ui.py 2010-02-08 17:08:19 +0000
1015@@ -0,0 +1,124 @@
1016+#!/usr/bin/env python
1017+# -*- coding: utf-8 -*-
1018+
1019+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1020+# This program is free software; you can redistribute it and/or modify
1021+# it under the terms of the GNU General Public License as published by
1022+# the Free Software Foundation; either version 3 of the License, or
1023+# (at your option) any later version.
1024+#
1025+# This program is distributed in the hope that it will be useful,
1026+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1027+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1028+# GNU General Public License for more details.
1029+#
1030+# You should have received a copy of the GNU General Public License along
1031+# with this program; if not, write to the Free Software Foundation, Inc.,
1032+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1033+import elementary
1034+
1035+import logging
1036+log = logging.getLogger("babiloo.efl.aboutPage")
1037+
1038+from efl.constants import *
1039+
1040+class AboutPage(object):
1041+ def __init__(self, main):
1042+ self.main = main
1043+ self.box = None
1044+
1045+ def setupUi(self):
1046+
1047+ # Box Window with scroller and quit button
1048+ self.box = elementary.Box(self.main.win)
1049+ self.box.horizontal_set(False)
1050+ self.main.win.resize_object_add(self.box)
1051+ self.box.size_hint_weight_set(1.0, 1.0)
1052+ self.box.size_hint_align_set(-1, -1)
1053+ self.box.show()
1054+
1055+ # Scroller
1056+ scroller = elementary.Scroller(self.main.win)
1057+ scroller.bounce_set(0, 0)
1058+ scroller.size_hint_weight_set(1.0, 1.0)
1059+ scroller.size_hint_align_set(-1.0, -1.0)
1060+ self.box.pack_end(scroller)
1061+ scroller.show()
1062+
1063+ # Quit button
1064+ self.quitAboutWin = elementary.Button(self.main.win)
1065+ self.quitAboutWin.label_set("Quit")
1066+ self.quitAboutWin.size_hint_align_set(-1.0, 0.0)
1067+ ic = elementary.Icon(self.quitAboutWin)
1068+ ic.file_set( QUIT_ICON)
1069+ ic.smooth_set(1)
1070+ ic.scale_set(1, 1)
1071+ self.quitAboutWin.icon_set(ic)
1072+ self.quitAboutWin.show()
1073+ self.box.pack_end(self.quitAboutWin)
1074+
1075+ # Box inside scroller
1076+ boxScroller = elementary.Box(self.main.win)
1077+ boxScroller.horizontal_set(False)
1078+ boxScroller.size_hint_weight_set(1.0, -1.0)
1079+ scroller.content_set(boxScroller)
1080+ boxScroller.show()
1081+
1082+ # Frame for dictionary section
1083+ self.createAboutFrame()
1084+ boxScroller.pack_end(self.frameAbout)
1085+
1086+ def createAboutFrame(self):
1087+ self.frameAbout = elementary.Frame(self.main.win)
1088+ self.frameAbout.label_set('%s %s' % (APP_NAME, APP_VERSION))
1089+ self.frameAbout.size_hint_align_set(-1.0, 0.0)
1090+ self.frameAbout.show()
1091+
1092+ about = """\
1093+Babiloo is a offline dictionaries reader.\
1094+<br><br>\
1095+<b>Copyright</> 2008-2009, Babiloo Developers<br>\
1096+<b>Licensed</> under the GNU GPL v3<br>\
1097+<b>Homepage</> http://babiloo-project.org</license>\
1098+<br><br>\
1099+The team would like to thank these 3 GPL projects where Babiloo has used part of their codes:\
1100+<br><br>\
1101+QStardict, OpenDict, Sdiqt
1102+<br><br>\
1103+========\
1104+<br><br>\
1105+<b>Elementary UI</>\
1106+<br><br>\
1107+The objective of this module is creating a graphics user interface that emphasizes simplicity and lightness.\
1108+<br><br>\
1109+As development focuses on keeping weight down to a minimum, only the most essential features are implemented.
1110+It should be simple to use, requires few libraries and starts up quickly.\
1111+<br><br>\
1112+The main target is the openmoko Freerunner cellphone and secondly the netbook.\
1113+<br><br>\
1114+If you need a full-features program, you have to use the QT interface.\
1115+<br><br>\
1116+========\
1117+<br><br>\
1118+<b>Elementary UI features</>\
1119+<br><br>\
1120+* Supports dictionaries in SDictionary and StarDict formats.\
1121+<br><br>\
1122+* Voice capability\
1123+"""
1124+ entry = elementary.Entry(self.main.win)
1125+ entry.editable_set(False)
1126+ entry.line_wrap_set(True)
1127+ entry.size_hint_align_set(-1, -1)
1128+ entry.entry_set(about)
1129+ entry.show()
1130+
1131+ self.frameAbout.content_set(entry)
1132+
1133+
1134+
1135+
1136+
1137+
1138+
1139+
1140
1141=== added file 'efl/babiloo-efl.bb'
1142--- efl/babiloo-efl.bb 1970-01-01 00:00:00 +0000
1143+++ efl/babiloo-efl.bb 2010-02-08 17:08:19 +0000
1144@@ -0,0 +1,41 @@
1145+DESCRIPTION = "EFL Dictionary Viewer. It supports dictionaries in SDictionary and StarDict format."
1146+SECTION = "devel/python"
1147+PRIORITY = "optional"
1148+LICENSE = "GPL"
1149+AUTHOR = "Luca Vaudano <vaudano@gmail.com>"
1150+HOMEPAGE = "http://babiloo-project.org"
1151+RDEPENDS = "python-elementary python-compression python-misc python-netclient"
1152+
1153+PACKAGE_ARCH = "all"
1154+
1155+DEFAULT_PREFERENCE = "-1"
1156+PV = "2.0.9-bzrr${SRCREV}"
1157+
1158+SRC_URI = "bzr://bazaar.launchpad.net/~vaudano/babiloo/efl"
1159+
1160+S = "${WORKDIR}/efl"
1161+
1162+do_install() {
1163+ install -d "${D}${datadir}/babiloo"
1164+ cp -a "${S}/core" "${D}${datadir}/babiloo/"
1165+ cp -a "${S}/efl" "${D}${datadir}/babiloo/"
1166+ cp -a "${S}/images" "${D}${datadir}/babiloo/"
1167+ cp -a "${S}/dicts" "${D}${datadir}/babiloo/"
1168+ install -m 0755 "${S}/run.py" "${D}${datadir}/babiloo/"
1169+ install -d "${D}${bindir}"
1170+ ln -s "${datadir}/babiloo/run.py" "${D}${bindir}/babiloo"
1171+ install -d "${D}${datadir}/pixmaps"
1172+ install -m 0644 "${S}/images/babiloo.png" "${D}${datadir}/pixmaps"
1173+ install -d "${D}${datadir}/applications"
1174+ install -m 0644 "${S}/babiloo.desktop" "${D}${datadir}/applications"
1175+
1176+ install -d "${D}${datadir}"
1177+ cp -a "${S}/locale" "${D}${datadir}/"
1178+ find ${D}${datadir}/locale -name *.po -exec rm {} \;
1179+ rm -f ${D}${datadir}/locale/babiloo.pot
1180+
1181+ install -d "${D}${datadir}/doc"
1182+ install -m 0644 "${S}/doc/efl/babiloo.pdf" "${D}${datadir}/doc/"
1183+}
1184+
1185+FILES_${PN} += "${datadir}/babiloo"
1186
1187=== added file 'efl/babiloo.desktop'
1188--- efl/babiloo.desktop 1970-01-01 00:00:00 +0000
1189+++ efl/babiloo.desktop 2010-02-08 17:08:19 +0000
1190@@ -0,0 +1,11 @@
1191+[Desktop Entry]
1192+Name=Babiloo
1193+Comment=Application to view dictionaries
1194+Exec=/usr/bin/babiloo
1195+Icon=/usr/share/pixmaps/babiloo.png
1196+Terminal=false
1197+Type=Application
1198+Categories=Utility;
1199+SingleInstance=true
1200+StartupNotify=true
1201+
1202
1203=== added file 'efl/config.py'
1204--- efl/config.py 1970-01-01 00:00:00 +0000
1205+++ efl/config.py 2010-02-08 17:08:19 +0000
1206@@ -0,0 +1,56 @@
1207+#!/usr/bin/env python
1208+# -*- coding: utf-8 -*-
1209+
1210+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1211+# This program is free software; you can redistribute it and/or modify
1212+# it under the terms of the GNU General Public License as published by
1213+# the Free Software Foundation; either version 3 of the License, or
1214+# (at your option) any later version.
1215+#
1216+# This program is distributed in the hope that it will be useful,
1217+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1218+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1219+# GNU General Public License for more details.
1220+#
1221+# You should have received a copy of the GNU General Public License along
1222+# with this program; if not, write to the Free Software Foundation, Inc.,
1223+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1224+import cPickle, os.path
1225+
1226+from efl.constants import *
1227+
1228+class Config():
1229+
1230+ # Initialization
1231+ def __init__(self):
1232+
1233+ # if the directory doesn't exist, create it
1234+ if not os.path.exists(CONFIG_DIR):
1235+ os.makedirs(CONFIG_DIR, 0755)
1236+
1237+ # if the file doesn't exist use default setting, otherwise use it
1238+ if not os.path.exists(CONFIG_FILE):
1239+ self.data = DEFAULT_CONFIGURATION
1240+ else:
1241+ self.data = cPickle.load(open(CONFIG_FILE, 'r'))
1242+
1243+ # Flag if the data are to save
1244+ self.toSave = False
1245+
1246+ # Save all the configuration settings into the file
1247+ def save(self):
1248+ if self.toSave:
1249+ cPickle.dump(self.data, open(CONFIG_FILE, 'w+'))
1250+ self.toSave = False
1251+
1252+ # Get the value from the configuration or default value
1253+ def get(self, name):
1254+ if name not in self.data.keys():
1255+ self.data[name] = DEFAULT_SETTINGS[name]
1256+ return self.data[name]
1257+
1258+ # Set a new value
1259+ def set(self, name, value):
1260+ if self.data[name] != value:
1261+ self.data[name] = value
1262+ self.toSave = True
1263\ No newline at end of file
1264
1265=== added file 'efl/constants.py'
1266--- efl/constants.py 1970-01-01 00:00:00 +0000
1267+++ efl/constants.py 2010-02-08 17:08:19 +0000
1268@@ -0,0 +1,67 @@
1269+#!/usr/bin/env python
1270+# -*- coding: utf-8 -*-
1271+
1272+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1273+# This program is free software; you can redistribute it and/or modify
1274+# it under the terms of the GNU General Public License as published by
1275+# the Free Software Foundation; either version 3 of the License, or
1276+# (at your option) any later version.
1277+#
1278+# This program is distributed in the hope that it will be useful,
1279+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1280+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1281+# GNU General Public License for more details.
1282+#
1283+# You should have received a copy of the GNU General Public License along
1284+# with this program; if not, write to the Free Software Foundation, Inc.,
1285+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1286+import os.path
1287+
1288+APP_NAME = 'Babiloo'
1289+APP_VERSION = '2.0.9'
1290+
1291+# Model
1292+ENV_PC = 'pc'
1293+ENV_NEO = 'neo'
1294+ROOT_DIR = '/usr/share/babiloo/'
1295+HOME_DIR = os.path.expanduser("~")
1296+CONFIG_DIR = os.path.join(HOME_DIR, ".config/%s" % APP_NAME.lower())
1297+CONFIG_FILE = os.path.join(CONFIG_DIR, "config.cfg")
1298+
1299+# UI
1300+WIDTH_PC = 60
1301+WIDTH_NEO = 33
1302+SCREEN_WIDTH = 480
1303+SCREEN_HEIGHT = 480
1304+ROOT_DIR = '/usr/share/babiloo/'
1305+DICTIONARIES_ICON = ROOT_DIR + 'images/system-installer.png'
1306+SETTINGS_ICON = ROOT_DIR + 'images/preferences-system.png'
1307+SPEAK_ICON = ROOT_DIR + 'images/speaker.png'
1308+CLEAR_ICON = ROOT_DIR + 'images/clear-right.png'
1309+SEARCH_ICON = ROOT_DIR + 'images/system-search.png'
1310+QUIT_ICON = ROOT_DIR + 'images/process-stop.png'
1311+ABOUT_ICON = ROOT_DIR + 'images/dialog-information.png'
1312+NEW_DICTIONARY_ICON = ROOT_DIR + 'images/dictionary-new.png'
1313+NEW_SOUND_DICTIONARY_ICON = ROOT_DIR + 'images/dictionary-new.png'
1314+NEW_PLAYER_ICON = ROOT_DIR + 'images/dictionary-new.png'
1315+
1316+# Set to PC value
1317+WIDTH = WIDTH_PC
1318+ENV = ENV_PC
1319+
1320+# Retrieve if the hardware is GTA01 or GTA02
1321+# if is, set to NEO value
1322+for line in open('/proc/cpuinfo'):
1323+ if line.startswith('Hardware'):
1324+ type = line.split()
1325+ type =type[len(type)-1]
1326+ if type.startswith('GTA0'):
1327+ ENV = ENV_NEO
1328+ WIDTH = WIDTH_NEO
1329+
1330+# Default configuration settings
1331+DEFAULT_CONFIGURATION = {
1332+ 'dictionary_path': '',
1333+ 'sound_dictionary_path': '',
1334+ 'player': '/usr/bin/aplay',
1335+}
1336\ No newline at end of file
1337
1338=== added file 'efl/definition_ui.py'
1339--- efl/definition_ui.py 1970-01-01 00:00:00 +0000
1340+++ efl/definition_ui.py 2010-02-08 17:08:19 +0000
1341@@ -0,0 +1,173 @@
1342+#!/usr/bin/env python
1343+# -*- coding: utf-8 -*-
1344+
1345+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1346+# This program is free software; you can redistribute it and/or modify
1347+# it under the terms of the GNU General Public License as published by
1348+# the Free Software Foundation; either version 3 of the License, or
1349+# (at your option) any later version.
1350+#
1351+# This program is distributed in the hope that it will be useful,
1352+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1353+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1354+# GNU General Public License for more details.
1355+#
1356+# You should have received a copy of the GNU General Public License along
1357+# with this program; if not, write to the Free Software Foundation, Inc.,
1358+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1359+import elementary
1360+import textwrap
1361+import re
1362+import os
1363+
1364+import logging
1365+log = logging.getLogger("babiloo.efl.definition_ui")
1366+
1367+from efl.constants import *
1368+
1369+class DefinitionPage():
1370+
1371+ # Initialization
1372+ def __init__(self, main):
1373+ self.main = main
1374+ self.box = None
1375+
1376+ def setupUi(self):
1377+
1378+ # Box object
1379+ self.box = elementary.Box(self.main.win)
1380+ self.box.horizontal_set(False)
1381+ self.main.win.resize_object_add(self.box)
1382+ self.box.size_hint_weight_set(1.0, 1.0)
1383+ self.box.show()
1384+
1385+ # Horizontal box with clear, word field and search button
1386+ toolbarBox = elementary.Box(self.main.win)
1387+ toolbarBox.horizontal_set(True)
1388+ toolbarBox.homogenous_set(True)
1389+ toolbarBox.size_hint_weight_set(1.0, 0.0)
1390+ toolbarBox.size_hint_align_set(-1.0, 0.0)
1391+
1392+ # Dictionaries icon
1393+ self.dictionariesButton = elementary.Button(self.main.win)
1394+ dictionariesIcon = elementary.Icon(self.dictionariesButton)
1395+ dictionariesIcon.file_set(DICTIONARIES_ICON)
1396+ self.dictionariesButton.icon_set(dictionariesIcon)
1397+ self.dictionariesButton.size_hint_weight_set(1.0, 1.0)
1398+ self.dictionariesButton.size_hint_align_set(-1.0, -1.0)
1399+ toolbarBox.pack_end(self.dictionariesButton)
1400+ self.dictionariesButton.show()
1401+
1402+ # Settings toolbar icon
1403+ self.settingsButton = elementary.Button(self.main.win)
1404+ settingsIcon = elementary.Icon(self.settingsButton)
1405+ settingsIcon.file_set(SETTINGS_ICON)
1406+ self.settingsButton.icon_set(settingsIcon)
1407+ self.settingsButton.size_hint_weight_set(1.0, 1.0)
1408+ self.settingsButton.size_hint_align_set(-1.0, -1.0)
1409+ toolbarBox.pack_end(self.settingsButton)
1410+ self.settingsButton.show()
1411+
1412+ # Speak toolbar icon
1413+ self.speakButton = elementary.Button(self.main.win)
1414+ speakIcon = elementary.Icon(self.speakButton)
1415+ speakIcon.file_set(SPEAK_ICON)
1416+ self.speakButton.icon_set(speakIcon)
1417+ self.speakButton.size_hint_weight_set(1.0, 1.0)
1418+ self.speakButton.size_hint_align_set(-1.0, -1.0)
1419+ toolbarBox.pack_end(self.speakButton)
1420+ self.speakButton.show()
1421+
1422+ self.box.pack_end(toolbarBox)
1423+ toolbarBox.show()
1424+
1425+ # Horizontal box with clear, word field and search button
1426+ bx2 = elementary.Box(self.main.win)
1427+ bx2.horizontal_set(True)
1428+ #bx2.homogenous_set(True)
1429+ bx2.size_hint_weight_set(1.0, 0.0)
1430+ bx2.size_hint_align_set(-1.0, 0.0)
1431+
1432+ # Clear button
1433+ self.clearButton = elementary.Button(self.main.win)
1434+ ic = elementary.Icon(self.clearButton)
1435+ ic.file_set(CLEAR_ICON)
1436+ self.clearButton.icon_set(ic)
1437+ # workround for nice position
1438+ self.clearButton.label_set(" ")
1439+ self.clearButton.size_hint_weight_set(0.0, 1.0)
1440+ self.clearButton.size_hint_align_set(-1.0, -1.0)
1441+ bx2.pack_end(self.clearButton)
1442+ self.clearButton.show()
1443+
1444+ # Word field
1445+ self.word = elementary.Entry(self.main.win)
1446+ self.word.line_wrap_set(False)
1447+ self.word.entry_set("")
1448+ self.word.single_line_set(True)
1449+ self.word.scale_set(1.5)
1450+ self.word.size_hint_weight_set(1.0, 1.0)
1451+ self.word.size_hint_align_set(-1.0, -1.0)
1452+ bx2.pack_end(self.word)
1453+ self.word.show()
1454+
1455+ # Search button
1456+ self.searchButton = elementary.Button(self.main.win)
1457+ ic = elementary.Icon(self.main.win)
1458+ ic.file_set(SEARCH_ICON)
1459+ self.searchButton.icon_set(ic)
1460+ # workround for nice position
1461+ self.searchButton.label_set(" ")
1462+ self.searchButton.size_hint_weight_set(0.0, 1.0)
1463+ self.searchButton.size_hint_align_set(-1.0, -1.0)
1464+ bx2.pack_end(self.searchButton)
1465+ self.searchButton.show()
1466+
1467+ self.box.pack_end(bx2)
1468+ bx2.show()
1469+
1470+ # Frame
1471+ self.fr = elementary.Frame(self.main.win)
1472+ self.fr.label_set(' ')
1473+ self.fr.size_hint_weight_set(1.0, 1.0)
1474+ self.fr.size_hint_align_set(-1.0, -1.0)
1475+
1476+ # Entry scroller
1477+ sc = elementary.Scroller(self.main.win)
1478+ sc.size_hint_weight_set(1.0, 1.0)
1479+ sc.size_hint_align_set(-1.0, -1.0)
1480+ ## hide scrollbars
1481+ #sc.policy_set(2, 2)
1482+ ## make it non-bouncing
1483+ #sc.drag_bouncy_set(0)
1484+
1485+ # Definition text area
1486+ self.definition = elementary.Entry(self.main.win)
1487+ #self.definition.line_wrap_set(True)
1488+ self.definition.line_wrap_set(False)
1489+ self.definition.scale_set(1.25)
1490+ self.definition.entry_set("")
1491+ self.definition.single_line_set(False)
1492+ self.definition.editable_set(False)
1493+ self.definition.size_hint_weight_set(1.0, 1.0)
1494+ self.definition.size_hint_align_set(-1.0, -1.0)
1495+
1496+ sc.content_set(self.definition)
1497+ self.fr.content_set(sc)
1498+
1499+ self.definition.show()
1500+ self.fr.show()
1501+ sc.show()
1502+
1503+ self.box.pack_end(self.fr)
1504+
1505+ def frame_title_set(self, text):
1506+ if self.box:
1507+ if (len(text) > WIDTH):
1508+ text = text[:WIDTH-3] + '...'
1509+ self.fr.label_set(text)
1510+
1511+ def content_set(self, text):
1512+ definitionString = textwrap.fill(text, WIDTH)
1513+ definitionString = re.sub("\n", "<br>", definitionString)
1514+ self.definition.entry_set(definitionString)
1515
1516=== added file 'efl/dictionaries_ui.py'
1517--- efl/dictionaries_ui.py 1970-01-01 00:00:00 +0000
1518+++ efl/dictionaries_ui.py 2010-02-08 17:08:19 +0000
1519@@ -0,0 +1,196 @@
1520+#!/usr/bin/env python
1521+# -*- coding: utf-8 -*-
1522+
1523+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1524+# This program is free software; you can redistribute it and/or modify
1525+# it under the terms of the GNU General Public License as published by
1526+# the Free Software Foundation; either version 3 of the License, or
1527+# (at your option) any later version.
1528+#
1529+# This program is distributed in the hope that it will be useful,
1530+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1531+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1532+# GNU General Public License for more details.
1533+#
1534+# You should have received a copy of the GNU General Public License along
1535+# with this program; if not, write to the Free Software Foundation, Inc.,
1536+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1537+import elementary
1538+
1539+import logging
1540+log = logging.getLogger("babiloo.efl.dictionariesPage")
1541+
1542+from efl.constants import *
1543+
1544+class DictionariesPage():
1545+
1546+ # Initialization
1547+ def __init__(self, main):
1548+ self.main = main
1549+ self.box = None
1550+
1551+ #
1552+ # self.box
1553+ # scroller
1554+ # boxScroller
1555+ # for each Section
1556+ # frameSection
1557+ # boxSection
1558+ # quitDictionariesWin
1559+ def setupUi(self):
1560+
1561+ # Box Window with scroller and quit button
1562+ self.box = elementary.Box(self.main.win)
1563+ self.box.horizontal_set(False)
1564+ self.main.win.resize_object_add(self.box)
1565+ self.box.size_hint_weight_set(1.0, 1.0)
1566+ self.box.size_hint_align_set(-1, -1)
1567+ self.box.show()
1568+
1569+ # Scroller
1570+ scroller = elementary.Scroller(self.main.win)
1571+ scroller.bounce_set(0, 0)
1572+ scroller.size_hint_weight_set(1.0, 1.0)
1573+ scroller.size_hint_align_set(-1.0, -1.0)
1574+ self.box.pack_end(scroller)
1575+ scroller.show()
1576+
1577+ # Quit button
1578+ self.quitDictionariesWin = elementary.Button(self.main.win)
1579+ self.quitDictionariesWin.label_set("Quit")
1580+ self.quitDictionariesWin.size_hint_align_set(-1.0, 0.0)
1581+ ic = elementary.Icon(self.quitDictionariesWin)
1582+ ic.file_set( QUIT_ICON)
1583+ ic.smooth_set(1)
1584+ ic.scale_set(1, 1)
1585+ self.quitDictionariesWin.icon_set(ic)
1586+ self.quitDictionariesWin.show()
1587+ self.box.pack_end(self.quitDictionariesWin)
1588+
1589+ # Box inside scroller
1590+ boxScroller = elementary.Box(self.main.win)
1591+ boxScroller.horizontal_set(False)
1592+ boxScroller.size_hint_weight_set(1.0, -1.0)
1593+ scroller.content_set(boxScroller)
1594+ boxScroller.show()
1595+
1596+ # Frame for dictionary section
1597+ self.createDictionaryFrame()
1598+ boxScroller.pack_end(self.frameDictionary)
1599+
1600+ # Frame for sound dictionary section
1601+ self.createSoundDictionaryFrame()
1602+ boxScroller.pack_end(self.frameSoundDictionary)
1603+
1604+ def createDictionaryFrame(self):
1605+ self.frameDictionary = elementary.Frame(self.main.win)
1606+ self.frameDictionary.label_set("Dictionary FILE NAME")
1607+ self.frameDictionary.size_hint_align_set(-1.0, 0.0)
1608+ self.frameDictionary.show()
1609+
1610+ # Box for dictionary section
1611+ boxDictionary = elementary.Box(self.main.win)
1612+ boxDictionary.horizontal_set(False)
1613+ boxDictionary.size_hint_align_set(-1.0, 0.0)
1614+ boxDictionary.show()
1615+
1616+ # Box object with 'New dictionary' and 'DictionaryPathEntry'
1617+ boxDictionaryPathEntry= elementary.Box(self.main.win)
1618+ boxDictionaryPathEntry.horizontal_set(True)
1619+ boxDictionaryPathEntry.size_hint_weight_set(1.0, 1.0)
1620+ boxDictionaryPathEntry.show()
1621+
1622+ # New dictionary button
1623+ self.newDictionaryButton = elementary.Button(self.main.win)
1624+ ic = elementary.Icon(self.newDictionaryButton)
1625+ ic.file_set(NEW_DICTIONARY_ICON)
1626+ self.newDictionaryButton.icon_set(ic)
1627+ # workround for nice position
1628+ self.newDictionaryButton.label_set(" ")
1629+ self.newDictionaryButton.size_hint_weight_set(0.0, 1.0)
1630+ self.newDictionaryButton.size_hint_align_set(-1.0, -1.0)
1631+ self.newDictionaryButton.show()
1632+
1633+ # Dictionary path entry
1634+ self.dictionaryEntry = elementary.Entry(self.main.win)
1635+ self.dictionaryEntry.line_wrap_set(False)
1636+ self.dictionaryEntry.entry_set('')
1637+ self.dictionaryEntry.single_line_set(True)
1638+ self.dictionaryEntry.editable_set(False)
1639+ self.newDictionaryButton.size_hint_weight_set(0.0, 1.0)
1640+ self.dictionaryEntry.size_hint_align_set(-1.0, -1.0)
1641+ self.dictionaryEntry.scale_set(1.25)
1642+
1643+ self.dictionaryEntry.show()
1644+
1645+ boxDictionaryPathEntry.pack_end(self.newDictionaryButton)
1646+ boxDictionaryPathEntry.pack_end(self.dictionaryEntry)
1647+
1648+ # File selector
1649+ self.saveDictionary = elementary.Button(self.main.win)
1650+ self.saveDictionary.label_set("Save ( it takes time! )")
1651+ self.saveDictionary.size_hint_align_set(-1.0, 0.0)
1652+ self.saveDictionary.show()
1653+
1654+ boxDictionary.pack_end(boxDictionaryPathEntry)
1655+ boxDictionary.pack_end(self.saveDictionary)
1656+
1657+ self.frameDictionary.content_set(boxDictionary)
1658+
1659+
1660+ def createSoundDictionaryFrame(self):
1661+ self.frameSoundDictionary = elementary.Frame(self.main.win)
1662+ self.frameSoundDictionary.label_set("Sound dictionary PATH")
1663+ self.frameSoundDictionary.size_hint_align_set(-1.0, 0.0)
1664+ self.frameSoundDictionary.show()
1665+
1666+ # Box for sound dictionary section
1667+ boxSoundDictionary = elementary.Box(self.main.win)
1668+ boxSoundDictionary.horizontal_set(False)
1669+ boxSoundDictionary.size_hint_align_set(-1.0, 0.0)
1670+ boxSoundDictionary.show()
1671+
1672+ # Box object with 'New sound dictionary' and 'SoundDictionaryPathEntry'
1673+ boxSoundDictionaryPathEntry= elementary.Box(self.main.win)
1674+ boxSoundDictionaryPathEntry.horizontal_set(True)
1675+ boxSoundDictionaryPathEntry.size_hint_weight_set(1.0, 1.0)
1676+ boxSoundDictionaryPathEntry.show()
1677+
1678+ # New dictionary button
1679+ self.newSoundDictionaryButton = elementary.Button(self.main.win)
1680+ ic = elementary.Icon(self.newSoundDictionaryButton)
1681+ ic.file_set(NEW_SOUND_DICTIONARY_ICON)
1682+ self.newSoundDictionaryButton.icon_set(ic)
1683+ # workround for nice position
1684+ self.newSoundDictionaryButton.label_set(" ")
1685+ self.newSoundDictionaryButton.size_hint_weight_set(0.0, 1.0)
1686+ self.newSoundDictionaryButton.size_hint_align_set(-1.0, -1.0)
1687+ self.newSoundDictionaryButton.show()
1688+
1689+ # Dictionary path entry
1690+ self.soundDictionaryEntry = elementary.Entry(self.main.win)
1691+ self.soundDictionaryEntry.line_wrap_set(False)
1692+ self.soundDictionaryEntry.entry_set('')
1693+ self.soundDictionaryEntry.single_line_set(True)
1694+ self.soundDictionaryEntry.editable_set(False)
1695+ self.newSoundDictionaryButton.size_hint_weight_set(0.0, 1.0)
1696+ self.soundDictionaryEntry.size_hint_align_set(-1.0, -1.0)
1697+ self.soundDictionaryEntry.scale_set(1.25)
1698+
1699+ self.soundDictionaryEntry.show()
1700+
1701+ boxSoundDictionaryPathEntry.pack_end(self.newSoundDictionaryButton)
1702+ boxSoundDictionaryPathEntry.pack_end(self.soundDictionaryEntry)
1703+
1704+ # File selector
1705+ self.saveSoundDictionary = elementary.Button(self.main.win)
1706+ self.saveSoundDictionary.label_set("Save")
1707+ self.saveSoundDictionary.size_hint_align_set(-1.0, 0.0)
1708+ self.saveSoundDictionary.show()
1709+
1710+ boxSoundDictionary.pack_end(boxSoundDictionaryPathEntry)
1711+ boxSoundDictionary.pack_end(self.saveSoundDictionary)
1712+
1713+ self.frameSoundDictionary.content_set(boxSoundDictionary)
1714+
1715+
1716\ No newline at end of file
1717
1718=== added file 'efl/main.py'
1719--- efl/main.py 1970-01-01 00:00:00 +0000
1720+++ efl/main.py 2010-02-08 17:08:19 +0000
1721@@ -0,0 +1,48 @@
1722+#!/usr/bin/env python
1723+# -*- coding: utf-8 -*-
1724+
1725+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1726+# This program is free software; you can redistribute it and/or modify
1727+# it under the terms of the GNU General Public License as published by
1728+# the Free Software Foundation; either version 3 of the License, or
1729+# (at your option) any later version.
1730+#
1731+# This program is distributed in the hope that it will be useful,
1732+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1733+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1734+# GNU General Public License for more details.
1735+#
1736+# You should have received a copy of the GNU General Public License along
1737+# with this program; if not, write to the Free Software Foundation, Inc.,
1738+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1739+from main_ui import Ui_Main
1740+from main_model import Model
1741+import elementary
1742+
1743+import logging
1744+log = logging.getLogger("babiloo.efl.main")
1745+
1746+from efl.constants import *
1747+
1748+class Main(Ui_Main, Model):
1749+
1750+ def __init__(self, options):
1751+
1752+ # Create UI
1753+ elementary.init()
1754+ self.setupUi()
1755+
1756+ # Load database, if already set
1757+ self.loadDatabase()
1758+
1759+ # Destroy method binding
1760+ self.win.callback_destroy_add(self.destroy, (APP_NAME))
1761+
1762+ # Start elementary UI
1763+ elementary.run()
1764+ elementary.shutdown()
1765+
1766+def main(options):
1767+ log.debug("Building main dialog")
1768+ Main(options)
1769+
1770\ No newline at end of file
1771
1772=== added file 'efl/main_model.py'
1773--- efl/main_model.py 1970-01-01 00:00:00 +0000
1774+++ efl/main_model.py 2010-02-08 17:08:19 +0000
1775@@ -0,0 +1,352 @@
1776+#!/usr/bin/env python
1777+# -*- coding: utf-8 -*-
1778+
1779+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
1780+# This program is free software; you can redistribute it and/or modify
1781+# it under the terms of the GNU General Public License as published by
1782+# the Free Software Foundation; either version 3 of the License, or
1783+# (at your option) any later version.
1784+#
1785+# This program is distributed in the hope that it will be useful,
1786+# but WITHOUT ANY WARRANTY; without even the implied warranty of
1787+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1788+# GNU General Public License for more details.
1789+#
1790+# You should have received a copy of the GNU General Public License along
1791+# with this program; if not, write to the Free Software Foundation, Inc.,
1792+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
1793+from time import time
1794+import os
1795+
1796+import ecore
1797+import elementary
1798+
1799+from core.modules import *
1800+import core.dictionary.engine as engine
1801+
1802+import logging
1803+log = logging.getLogger("babiloo.efl.main_model")
1804+
1805+from efl.constants import *
1806+from efl.config import Config
1807+from core.modules.status import Status
1808+from utils_ui import UtilsUi
1809+
1810+config = Config()
1811+utils = UtilsUi()
1812+
1813+class Model():
1814+
1815+ # Destroy called on destroy window
1816+ def destroy(self, obj, data):
1817+
1818+ # Save settings
1819+ config.save()
1820+
1821+ # Exit
1822+ elementary.exit()
1823+
1824+ # Load database for Neo or Netbook
1825+ def loadDatabase(self):
1826+
1827+ # Load database
1828+ if config.get('dictionary_path') != '':
1829+
1830+ # Show ''Loading database ...''
1831+ self.create_loadingFrame("Please wait...<br>Loading dictionary...")
1832+
1833+ # it doesn't work well on OpenGeu / Ubuntu + OzOs
1834+ # it works well on Neo and Elive
1835+ ecore.idler_add(self.loadDatabaseCore)
1836+
1837+ else:
1838+ self.create_dialog("No dictionary to load")
1839+
1840+ # TODO Set percentage status
1841+ def setStatus(self, status):
1842+ print "%d" % status
1843+ #self.loadinglabel.label_set("Loading dictionary...<br> %d%%" %status)
1844+
1845+ # Call the babiloo core module for loading the database
1846+ def loadDatabaseCore(self):
1847+ nowtime = time()
1848+ self.dictionary_name = ' '
1849+ try:
1850+ self.engine = engine.DictionaryEngine()
1851+
1852+ self.testdict = self.engine.loadDictionary(config.get('dictionary_path'))
1853+ self.dictionary_name = self.engine.getDictionary( self.testdict['dict'].getUniqueId() ).getName()
1854+ except:
1855+ log.error("Dictionary can't be loaded!")
1856+ self.create_dialog("Dictionary can't be loaded!")
1857+
1858+ # Hide the loading frame
1859+ self.loading.hide()
1860+
1861+ # Put the database name on the frame title
1862+ self.definitionPage.frame_title_set(self.dictionary_name)
1863+ log.info("Dictionary loaded in %.2f sec" % (time() - nowtime) )
1864+
1865+ # Close the thread
1866+ return None
1867+
1868+ def speak(self, obj, data):
1869+
1870+ # check if the player exists
1871+ if not os.path.exists(config.get('player')):
1872+ self.create_dialog("Please install %s" %config.get('player'));
1873+ return
1874+
1875+ # check if the sound dictionary path is set
1876+ if config.get('sound_dictionary_path') == '':
1877+ self.create_dialog("Sound dictionary path not set");
1878+ return
1879+
1880+ # check if the sound dictionary path exists
1881+ if not os.path.exists(config.get('sound_dictionary_path')):
1882+ self.create_dialog("Sound dictionary path not valid %s" %config.get('sound_dictionary_path'));
1883+ return
1884+
1885+ # searched word
1886+ speakWord = data.entry_get()
1887+ speakWord = speakWord.strip()
1888+
1889+ # if the user inserted the word in the entry filed
1890+ if len(speakWord) != 0:
1891+ speakWord = config.get('sound_dictionary_path') + '/' + speakWord[0] + '/' + speakWord + '.wav'
1892+ log.debug("Speak %s" % speakWord)
1893+ if not os.path.exists(speakWord):
1894+ self.create_dialog("Word not found");
1895+ return
1896+ speakCmd = config.get('player') + " %s" % speakWord
1897+ log.debug(speakCmd)
1898+ os.system(speakCmd + ' &')
1899+
1900+ def clear_text_field(self, obj, data):
1901+ data.entry_set("")
1902+
1903+ def search_word(self, obj, input):
1904+
1905+ # if the database is loaded
1906+ if config.get('dictionary_path') != '':
1907+
1908+ # searched word
1909+ self.word = input.entry_get()
1910+ self.word = self.word.strip()
1911+
1912+ # if the user inserted the word in the entry filed
1913+ if len(self.word) != 0:
1914+ log.debug("Searched word: %s" % self.word)
1915+
1916+ try:
1917+ result = self.engine.search(self.word, self.testdict['dict'].getUniqueId())
1918+
1919+ # Format the dictionary result
1920+ self.definitionPage.content_set( result.content() )
1921+
1922+ except KeyError:
1923+ self.create_dialog("Word %s not found" %self.word)
1924+ except:
1925+ self.create_dialog("Error during the search of %s" %self.word)
1926+
1927+ else:
1928+ self.create_dialog("You have to load the dictionary")
1929+
1930+ # Browse for selecting the dictionary file
1931+ def newDictionaryClicked(self, obj):
1932+ utils.fileSelectorUI()
1933+
1934+ def fs_cb_done(obj, event_info, data):
1935+ if event_info is not None:
1936+
1937+ # Cut br. Depends of the Elementary version!
1938+ event_info = event_info.replace('<br>', '')
1939+
1940+ # If is not a directory
1941+ if event_info[-1] != '/':
1942+ # Used in the save action
1943+ self.newDictionary = event_info
1944+ utils.filename_set(self.dictionariesPage.dictionaryEntry, self.newDictionary)
1945+ utils.fileSelectorWindow.hide()
1946+ else:
1947+ self.create_dialog("You have to select the dictionary file.")
1948+ else:
1949+ data.delete()
1950+ utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
1951+
1952+ # Browse for selecting the sound dictionary path
1953+ def newSoundDictionaryClicked(self, obj):
1954+ utils.fileSelectorUI()
1955+
1956+ def fs_cb_done(obj, event_info, data):
1957+ if event_info is not None:
1958+
1959+ # Cut br. Depends of the Elementary version!
1960+ event_info = event_info.replace('<br>', '')
1961+
1962+ # If is a directory
1963+ if event_info[-1] == '/':
1964+ # Used in the save action
1965+ self.newSoundDictionary = event_info
1966+ utils.filename_set(self.dictionariesPage.soundDictionaryEntry, self.newSoundDictionary)
1967+ utils.fileSelectorWindow.hide()
1968+ else:
1969+ self.create_dialog("You have to select a dictionary.<br>\
1970+The directory should contain folders<br>\
1971+a, b, c and so on")
1972+ else:
1973+ data.delete()
1974+ utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
1975+
1976+ # Browse for selecting the player
1977+ def newPlayerClicked(self, obj):
1978+ utils.fileSelectorUI()
1979+
1980+ def fs_cb_done(obj, event_info, data):
1981+ if event_info is not None:
1982+
1983+ # Cut br. Depends of the Elementary version!
1984+ event_info = event_info.replace('<br>', '')
1985+
1986+ # If is not a directory
1987+ if event_info[-1] != '/':
1988+ # Used in the save action
1989+ self.newPlayer = event_info
1990+ utils.filename_set(self.settingsPage.playerEntry, self.newPlayer)
1991+ utils.fileSelectorWindow.hide()
1992+ else:
1993+ self.create_dialog("You have to select player executable file.")
1994+ else:
1995+ data.delete()
1996+ utils.fileSelector.callback_done_add(fs_cb_done, utils.fileSelectorWindow)
1997+
1998+ # Load the new dictionary
1999+ def saveDictionaryClicked(self, obj):
2000+ self.promoteDefinitionPage()
2001+ if self.newDictionary is not None:
2002+ log.info("Save dictionary in the configuration %s" % self.newDictionary)
2003+ config.set('dictionary_path', self.newDictionary)
2004+ self.loadDatabase()
2005+
2006+ # Load the new sound dictionary
2007+ def saveSoundDictionaryClicked(self, obj):
2008+ self.promoteDefinitionPage()
2009+ if self.newSoundDictionary is not None:
2010+ log.info("Save sound dictionary in the configuration %s" % self.newSoundDictionary)
2011+ config.set('sound_dictionary_path', self.newSoundDictionary)
2012+
2013+ # Load player
2014+ def savePlayerClicked(self, obj):
2015+ self.promoteDefinitionPage()
2016+ if self.newPlayer is not None:
2017+ log.info("Save player in the configuration %s" % self.newPlayer)
2018+ config.set('player', self.newPlayer)
2019+
2020+ def promote(self, boxToPromote):
2021+ if self.definitionPage.box:
2022+ self.definitionPage.box.hide()
2023+ if self.dictionariesPage.box:
2024+ self.dictionariesPage.box.hide()
2025+ if self.settingsPage.box:
2026+ self.settingsPage.box.hide()
2027+ if self.aboutPage.box:
2028+ self.aboutPage.box.hide()
2029+ self.win.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
2030+ boxToPromote.show()
2031+
2032+ def promoteDefinitionPage(self, obj=None, event=None, data=None):
2033+
2034+ if not self.definitionPage.box:
2035+
2036+ # Setup UI
2037+ self.definitionPage.setupUi()
2038+
2039+ # Bind methods
2040+ self.definitionPage.dictionariesButton.callback_clicked_add(self.promoteDictionariesPage)
2041+ self.definitionPage.settingsButton.callback_clicked_add(self.promoteSettingsPage)
2042+ self.definitionPage.speakButton.callback_clicked_add(self.speak, self.definitionPage.word)
2043+ self.definitionPage.clearButton.callback_clicked_add(self.clear_text_field, self.definitionPage.word)
2044+ self.definitionPage.searchButton.callback_clicked_add(self.search_word, self.definitionPage.word)
2045+ self.definitionPage.definition.callback_activated_add(self.search_word, self.definitionPage.word)
2046+
2047+ # Put the definition page on the top of the pager
2048+ self.promote(self.definitionPage.box)
2049+
2050+ def promoteDictionariesPage(self, obj=None, event=None, data=None):
2051+
2052+ if not self.dictionariesPage.box:
2053+
2054+ # Setup UI
2055+ self.dictionariesPage.setupUi()
2056+
2057+ # Set quit function
2058+ self.dictionariesPage.quitDictionariesWin.callback_clicked_add(self.promoteDefinitionPage)
2059+
2060+ # Show the loaded dictionary
2061+ self.newDictionary = config.get('dictionary_path')
2062+
2063+ # Set dictionary filename from configuration
2064+ utils.filename_set(self.dictionariesPage.dictionaryEntry, self.newDictionary)
2065+
2066+ # Set new dictionary function
2067+ self.dictionariesPage.newDictionaryButton.callback_clicked_add(self.newDictionaryClicked)
2068+
2069+ # Set save function
2070+ self.dictionariesPage.saveDictionary.callback_clicked_add(self.saveDictionaryClicked)
2071+
2072+ # Set the loaded sound dictionary path
2073+ self.newSoundDictionary = config.get('sound_dictionary_path')
2074+
2075+ # Set dictionary filename from configuration
2076+ utils.filename_set(self.dictionariesPage.soundDictionaryEntry, self.newSoundDictionary)
2077+
2078+ # Set new dictionary function
2079+ self.dictionariesPage.newSoundDictionaryButton.callback_clicked_add(self.newSoundDictionaryClicked)
2080+
2081+ # Set save function
2082+ self.dictionariesPage.saveSoundDictionary.callback_clicked_add(self.saveSoundDictionaryClicked)
2083+
2084+ # Put the dictionaries page on the top of the pager
2085+ self.promote(self.dictionariesPage.box)
2086+
2087+ def promoteSettingsPage(self, obj=None, event=None, data=None):
2088+
2089+ if not self.settingsPage.box:
2090+
2091+ # Setup UI
2092+ self.settingsPage.setupUi()
2093+
2094+ # Quit button
2095+ self.settingsPage.quitSettingsWin.callback_clicked_add(self.promoteDefinitionPage)
2096+
2097+ # Show the loaded player
2098+ self.newPlayer = config.get('player')
2099+
2100+ # Set dictionary filename from configuration
2101+ utils.filename_set(self.settingsPage.playerEntry, self.newPlayer)
2102+
2103+ # Set new dictionary function
2104+ self.settingsPage.newPlayerButton.callback_clicked_add(self.newPlayerClicked)
2105+
2106+ # Set save function
2107+ self.settingsPage.savePlayer.callback_clicked_add(self.savePlayerClicked)
2108+
2109+ # About button
2110+ self.settingsPage.aboutPageWin.callback_clicked_add(self.promoteAboutPage)
2111+
2112+ # Put the setting page on the top of the pager
2113+ self.promote(self.settingsPage.box)
2114+
2115+ def promoteAboutPage(self, obj=None, event=None, data=None):
2116+
2117+ if not self.aboutPage.box:
2118+
2119+ # Setup UI
2120+ self.aboutPage.setupUi()
2121+
2122+ # Quit button
2123+ self.aboutPage.quitAboutWin.callback_clicked_add(self.promoteDefinitionPage)
2124+
2125+ # Put the setting page on the top of the pager
2126+ self.promote(self.aboutPage.box)
2127+
2128\ No newline at end of file
2129
2130=== added file 'efl/main_ui.py'
2131--- efl/main_ui.py 1970-01-01 00:00:00 +0000
2132+++ efl/main_ui.py 2010-02-08 17:08:19 +0000
2133@@ -0,0 +1,117 @@
2134+#!/usr/bin/env python
2135+# -*- coding: utf-8 -*-
2136+
2137+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
2138+# This program is free software; you can redistribute it and/or modify
2139+# it under the terms of the GNU General Public License as published by
2140+# the Free Software Foundation; either version 3 of the License, or
2141+# (at your option) any later version.
2142+#
2143+# This program is distributed in the hope that it will be useful,
2144+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2145+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2146+# GNU General Public License for more details.
2147+#
2148+# You should have received a copy of the GNU General Public License along
2149+# with this program; if not, write to the Free Software Foundation, Inc.,
2150+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
2151+import elementary
2152+
2153+import logging
2154+log = logging.getLogger("babiloo.efl.definition_ui")
2155+
2156+from definition_ui import DefinitionPage
2157+from dictionaries_ui import DictionariesPage
2158+from settings_ui import SettingsPage
2159+from about_ui import AboutPage
2160+
2161+from efl.constants import *
2162+
2163+class Ui_Main(object):
2164+
2165+ def setupUi(self):
2166+
2167+ # Basic window - name, title
2168+ self.win = elementary.Window(APP_NAME, elementary.ELM_WIN_BASIC)
2169+ self.win.title_set(APP_NAME)
2170+
2171+ # Standard background
2172+ bg = elementary.Background(self.win)
2173+ self.win.resize_object_add(bg)
2174+ bg.size_hint_weight_set(1.0, 1.0)
2175+ bg.show()
2176+
2177+ # Different contents on the same page
2178+ self.definitionPage = DefinitionPage(self)
2179+ self.dictionariesPage = DictionariesPage(self)
2180+ self.settingsPage = SettingsPage(self)
2181+ self.aboutPage = AboutPage(self)
2182+
2183+ # Show definition page
2184+ self.promoteDefinitionPage()
2185+
2186+ # Window size (size for pc application, for neo means full screen)
2187+ self.win.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
2188+ self.win.show()
2189+
2190+ def create_dialog(self, text):
2191+ self.dialog = elementary.Box(self.win)
2192+
2193+ loadingframe = elementary.Frame(self.win)
2194+ loadingframe.style_set("outdent_bottom")
2195+ loadingframe2 = elementary.Frame(self.win)
2196+ loadingframe2.style_set("outdent_top")
2197+ loadingframe2.size_hint_weight_set(0.0, 0.0)
2198+ loadingframe2.size_hint_align_set(0.5, 0.5)
2199+
2200+ # Internal box object
2201+ self.internalBox = elementary.Box(self.win)
2202+ self.messageEntry = elementary.Entry(self.win)
2203+ self.messageEntry.line_wrap_set(False)
2204+ self.messageEntry.entry_set(text)
2205+ self.messageEntry.editable_set(False)
2206+ self.internalBox.pack_end(self.messageEntry)
2207+ self.messageEntry.show()
2208+ self.okButton = elementary.Button(self.win)
2209+ self.okButton.label_set('OK')
2210+ self.okButton.size_hint_weight_set(0.0, 0.0)
2211+ self.okButton.size_hint_align_set(0.5, 0.5)
2212+ self.internalBox.pack_end(self.okButton)
2213+ self.okButton.show()
2214+
2215+ loadingframe.content_set(loadingframe2)
2216+ loadingframe2.content_set(self.internalBox)
2217+ self.win.resize_object_add(self.dialog)
2218+ self.dialog.pack_start(loadingframe)
2219+ self.internalBox.show()
2220+ loadingframe.show()
2221+ loadingframe2.show()
2222+ self.dialog.show()
2223+
2224+ self.okButton.callback_clicked_add(self.dialogClicked, self.dialog)
2225+
2226+ def dialogClicked(self, obj, data):
2227+ data.hide()
2228+
2229+ def create_loadingFrame(self, text):
2230+
2231+ self.loading = elementary.Box(self.win)
2232+
2233+ loadingframe = elementary.Frame(self.win)
2234+ loadingframe.style_set("outdent_bottom")
2235+ loadingframe2 = elementary.Frame(self.win)
2236+ loadingframe2.style_set("outdent_top")
2237+ loadingframe2.size_hint_weight_set(0.0, 0.0)
2238+ loadingframe2.size_hint_align_set(0.5, 0.5)
2239+
2240+ loadinglabel = elementary.Label(self.win)
2241+ loadinglabel.label_set(text)
2242+
2243+ loadingframe.content_set(loadingframe2)
2244+ loadingframe2.content_set(loadinglabel)
2245+ self.win.resize_object_add(self.loading)
2246+ self.loading.pack_start(loadingframe)
2247+ loadinglabel.show()
2248+ loadingframe.show()
2249+ loadingframe2.show()
2250+ self.loading.show()
2251
2252=== added file 'efl/settings_ui.py'
2253--- efl/settings_ui.py 1970-01-01 00:00:00 +0000
2254+++ efl/settings_ui.py 2010-02-08 17:08:19 +0000
2255@@ -0,0 +1,140 @@
2256+#!/usr/bin/env python
2257+# -*- coding: utf-8 -*-
2258+
2259+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
2260+# This program is free software; you can redistribute it and/or modify
2261+# it under the terms of the GNU General Public License as published by
2262+# the Free Software Foundation; either version 3 of the License, or
2263+# (at your option) any later version.
2264+#
2265+# This program is distributed in the hope that it will be useful,
2266+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2267+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2268+# GNU General Public License for more details.
2269+#
2270+# You should have received a copy of the GNU General Public License along
2271+# with this program; if not, write to the Free Software Foundation, Inc.,
2272+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
2273+import elementary
2274+
2275+import logging
2276+log = logging.getLogger("babiloo.efl.settingsPage")
2277+
2278+from efl.constants import *
2279+
2280+class SettingsPage():
2281+
2282+ # Initialization
2283+ def __init__(self, main):
2284+ self.main = main
2285+ self.box = None
2286+
2287+ # Setup user interface
2288+ def setupUi(self):
2289+
2290+ # Box Window with scroller and quit button
2291+ self.box = elementary.Box(self.main.win)
2292+ self.box.horizontal_set(False)
2293+ self.main.win.resize_object_add(self.box)
2294+ self.box.size_hint_weight_set(1.0, 1.0)
2295+ self.box.size_hint_align_set(-1, -1)
2296+ self.box.show()
2297+
2298+ # Scroller
2299+ scroller = elementary.Scroller(self.main.win)
2300+ scroller.bounce_set(0, 0)
2301+ scroller.size_hint_weight_set(1.0, 1.0)
2302+ scroller.size_hint_align_set(-1.0, -1.0)
2303+ self.box.pack_end(scroller)
2304+ scroller.show()
2305+
2306+ # About button
2307+ self.aboutPageWin = elementary.Button(self.main.win)
2308+ self.aboutPageWin.label_set("About")
2309+ self.aboutPageWin.size_hint_align_set(-1.0, 0.0)
2310+ ic = elementary.Icon(self.aboutPageWin)
2311+ ic.file_set( ABOUT_ICON)
2312+ ic.smooth_set(1)
2313+ ic.scale_set(1, 1)
2314+ self.aboutPageWin.icon_set(ic)
2315+ self.aboutPageWin.show()
2316+ self.box.pack_end(self.aboutPageWin)
2317+
2318+ # Quit button
2319+ self.quitSettingsWin = elementary.Button(self.main.win)
2320+ self.quitSettingsWin.label_set("Quit")
2321+ self.quitSettingsWin.size_hint_align_set(-1.0, 0.0)
2322+ ic = elementary.Icon(self.quitSettingsWin)
2323+ ic.file_set( QUIT_ICON)
2324+ ic.smooth_set(1)
2325+ ic.scale_set(1, 1)
2326+ self.quitSettingsWin.icon_set(ic)
2327+ self.quitSettingsWin.show()
2328+ self.box.pack_end(self.quitSettingsWin)
2329+
2330+ # Box inside scroller
2331+ boxScroller = elementary.Box(self.main.win)
2332+ boxScroller.horizontal_set(False)
2333+ boxScroller.size_hint_weight_set(1.0, -1.0)
2334+ scroller.content_set(boxScroller)
2335+ boxScroller.show()
2336+
2337+ # Frame for dictionary section
2338+ self.createPlayerFrame()
2339+ boxScroller.pack_end(self.framePlayer)
2340+
2341+ def createPlayerFrame(self):
2342+ self.framePlayer = elementary.Frame(self.main.win)
2343+ self.framePlayer.label_set("Player FILE NAME")
2344+ self.framePlayer.size_hint_align_set(-1.0, 0.0)
2345+ self.framePlayer.show()
2346+
2347+ # Box for dictionary section
2348+ boxPlayer = elementary.Box(self.main.win)
2349+ boxPlayer.horizontal_set(False)
2350+ boxPlayer.size_hint_align_set(-1.0, 0.0)
2351+ boxPlayer.show()
2352+
2353+ # Box object with 'New player' and 'PlayerPathEntry'
2354+ boxPlayerPathEntry= elementary.Box(self.main.win)
2355+ boxPlayerPathEntry.horizontal_set(True)
2356+ boxPlayerPathEntry.size_hint_weight_set(1.0, 1.0)
2357+ boxPlayerPathEntry.show()
2358+
2359+ # New player button
2360+ self.newPlayerButton = elementary.Button(self.main.win)
2361+ ic = elementary.Icon(self.newPlayerButton)
2362+ ic.file_set(NEW_PLAYER_ICON)
2363+ self.newPlayerButton.icon_set(ic)
2364+ # workround for nice position
2365+ self.newPlayerButton.label_set(" ")
2366+ self.newPlayerButton.size_hint_weight_set(0.0, 1.0)
2367+ self.newPlayerButton.size_hint_align_set(-1.0, -1.0)
2368+ self.newPlayerButton.show()
2369+
2370+ # Player path entry
2371+ self.playerEntry = elementary.Entry(self.main.win)
2372+ self.playerEntry.line_wrap_set(False)
2373+ self.playerEntry.entry_set('')
2374+ self.playerEntry.single_line_set(True)
2375+ self.playerEntry.editable_set(False)
2376+ self.newPlayerButton.size_hint_weight_set(0.0, 1.0)
2377+ self.playerEntry.size_hint_align_set(-1.0, -1.0)
2378+ self.playerEntry.scale_set(1.25)
2379+
2380+ self.playerEntry.show()
2381+
2382+ boxPlayerPathEntry.pack_end(self.newPlayerButton)
2383+ boxPlayerPathEntry.pack_end(self.playerEntry)
2384+
2385+ # File selector
2386+ self.savePlayer = elementary.Button(self.main.win)
2387+ self.savePlayer.label_set("Save")
2388+ self.savePlayer.size_hint_align_set(-1.0, 0.0)
2389+ self.savePlayer.show()
2390+
2391+ boxPlayer.pack_end(boxPlayerPathEntry)
2392+ boxPlayer.pack_end(self.savePlayer)
2393+
2394+ self.framePlayer.content_set(boxPlayer)
2395+
2396
2397=== added file 'efl/utils_ui.py'
2398--- efl/utils_ui.py 1970-01-01 00:00:00 +0000
2399+++ efl/utils_ui.py 2010-02-08 17:08:19 +0000
2400@@ -0,0 +1,77 @@
2401+#!/usr/bin/env python
2402+# -*- coding: utf-8 -*-
2403+
2404+# Copyright (C) 2009 Luca Vaudano vaudano@gmail.com
2405+# This program is free software; you can redistribute it and/or modify
2406+# it under the terms of the GNU General Public License as published by
2407+# the Free Software Foundation; either version 3 of the License, or
2408+# (at your option) any later version.
2409+#
2410+# This program is distributed in the hope that it will be useful,
2411+# but WITHOUT ANY WARRANTY; without even the implied warranty of
2412+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2413+# GNU General Public License for more details.
2414+#
2415+# You should have received a copy of the GNU General Public License along
2416+# with this program; if not, write to the Free Software Foundation, Inc.,
2417+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.Warning
2418+import elementary
2419+
2420+import logging
2421+log = logging.getLogger("babiloo.efl.utils")
2422+
2423+from efl.constants import *
2424+
2425+class UtilsUi():
2426+
2427+ # UI for the file selector window
2428+ def fileSelectorUI(self):
2429+ self.fileSelectorWindow = elementary.Window("fileselector", elementary.ELM_WIN_BASIC)
2430+ self.fileSelectorWindow.title_set("File selector")
2431+ self.fileSelectorWindow.autodel_set(True)
2432+
2433+ bg = elementary.Background(self.fileSelectorWindow)
2434+ self.fileSelectorWindow.resize_object_add(bg)
2435+ bg.size_hint_weight_set(1.0, 1.0)
2436+ bg.show()
2437+
2438+ vbox = elementary.Box(self.fileSelectorWindow)
2439+ self.fileSelectorWindow.resize_object_add(vbox)
2440+ vbox.size_hint_weight_set(1.0, 1.0)
2441+ vbox.show()
2442+
2443+ self.fileSelector = elementary.Fileselector(self.fileSelectorWindow)
2444+ # is_save_set what means?
2445+ self.fileSelector.is_save_set(True)
2446+ self.fileSelector.expandable_set(False)
2447+ self.fileSelector.path_set(os.getenv("HOME"))
2448+ self.fileSelector.size_hint_weight_set(1.0, 1.0)
2449+ self.fileSelector.size_hint_align_set(-1.0, -1.0)
2450+ vbox.pack_end(self.fileSelector)
2451+ self.fileSelector.show()
2452+
2453+ hbox = elementary.Box(self.fileSelectorWindow)
2454+ hbox.horizontal_set(True)
2455+ vbox.pack_end(hbox)
2456+ hbox.show()
2457+
2458+ self.fileSelectorWindow.resize(SCREEN_WIDTH, SCREEN_HEIGHT)
2459+ self.fileSelectorWindow.show()
2460+
2461+ # Show only the filename or part of it if longer than width
2462+ def filename_set(self, entry, filename):
2463+ if filename != "":
2464+
2465+ # If is a directory
2466+ if filename[-1] == '/':
2467+ # Cut last slash
2468+ filename = filename[0:-1]
2469+
2470+ # Cut the path
2471+ lastSlash = filename.rfind('/')
2472+ filename = filename[lastSlash+1:].strip()
2473+
2474+ if (len(filename) > WIDTH):
2475+ filename = filename[:WIDTH-3] + '...'
2476+ entry.entry_set(filename)
2477+ log.debug("Selected %s" % filename)
2478
2479=== added file 'images/babiloo.png'
2480Binary files images/babiloo.png 1970-01-01 00:00:00 +0000 and images/babiloo.png 2010-02-08 17:08:19 +0000 differ
2481=== modified file 'qt/about_ui.py'
2482--- qt/about_ui.py 2009-04-28 12:15:50 +0000
2483+++ qt/about_ui.py 2010-02-08 17:08:19 +0000
2484@@ -2,8 +2,8 @@
2485
2486 # Form implementation generated from reading ui file 'about.ui'
2487 #
2488-# Created: Tue Apr 28 13:12:48 2009
2489-# by: PyQt4 UI code generator 4.4.3
2490+# Created: Tue Sep 1 20:42:24 2009
2491+# by: PyQt4 UI code generator 4.4.4
2492 #
2493 # WARNING! All changes made in this file will be lost!
2494
2495
2496=== modified file 'qt/chooseLanguage_ui.py'
2497--- qt/chooseLanguage_ui.py 2009-04-28 12:15:50 +0000
2498+++ qt/chooseLanguage_ui.py 2010-02-08 17:08:19 +0000
2499@@ -2,8 +2,8 @@
2500
2501 # Form implementation generated from reading ui file 'chooseLanguage.ui'
2502 #
2503-# Created: Tue Apr 28 13:12:48 2009
2504-# by: PyQt4 UI code generator 4.4.3
2505+# Created: Tue Sep 1 20:42:24 2009
2506+# by: PyQt4 UI code generator 4.4.4
2507 #
2508 # WARNING! All changes made in this file will be lost!
2509
2510
2511=== modified file 'qt/images_rc.py'
2512--- qt/images_rc.py 2009-05-31 22:13:44 +0000
2513+++ qt/images_rc.py 2010-02-08 17:08:19 +0000
2514@@ -2,7 +2,7 @@
2515
2516 # Resource object code
2517 #
2518-# Created: Mon Jun 1 04:37:24 2009
2519+# Created: Tue Sep 1 20:42:23 2009
2520 # by: The Resource Compiler for PyQt (Qt v4.5.0)
2521 #
2522 # WARNING! All changes made in this file will be lost!
2523
2524=== modified file 'qt/main_ui.py'
2525--- qt/main_ui.py 2009-05-31 22:13:44 +0000
2526+++ qt/main_ui.py 2010-02-08 17:08:19 +0000
2527@@ -2,7 +2,7 @@
2528
2529 # Form implementation generated from reading ui file 'main.ui'
2530 #
2531-# Created: Mon Jun 1 04:37:24 2009
2532+# Created: Tue Sep 1 20:42:23 2009
2533 # by: PyQt4 UI code generator 4.4.4
2534 #
2535 # WARNING! All changes made in this file will be lost!
2536
2537=== modified file 'qt/settings_ui.py'
2538--- qt/settings_ui.py 2009-04-28 14:06:16 +0000
2539+++ qt/settings_ui.py 2010-02-08 17:08:19 +0000
2540@@ -2,8 +2,8 @@
2541
2542 # Form implementation generated from reading ui file 'settings.ui'
2543 #
2544-# Created: Tue Apr 28 16:03:26 2009
2545-# by: PyQt4 UI code generator 4.4.3
2546+# Created: Tue Sep 1 20:42:23 2009
2547+# by: PyQt4 UI code generator 4.4.4
2548 #
2549 # WARNING! All changes made in this file will be lost!
2550
2551
2552=== modified file 'run.py'
2553--- run.py 2009-03-28 01:13:40 +0000
2554+++ run.py 2010-02-08 17:08:17 +0000
2555@@ -39,8 +39,19 @@
2556 parser = OptionParser(description=conf.General.description, version=conf.General.version, option_list=conf.Terminal.option_list)
2557 (options, args) = parser.parse_args()
2558
2559+# Retrieve if the hardware is GTA01 or GTA02
2560+# if is, set to gui mode to efl
2561+for line in open('/proc/cpuinfo'):
2562+ if line.startswith('Hardware'):
2563+ type = line.split()
2564+ type =type[len(type)-1]
2565+ if type.startswith('GTA0'):
2566+ options.mode = 'efl'
2567+
2568 if options.mode == 'gui':
2569 import qt.main
2570+elif options.mode == 'efl':
2571+ import efl.main
2572 #elif options.mode == 'cli':
2573 # import cli.main
2574
2575@@ -75,5 +86,7 @@
2576
2577 if options.mode == 'gui':
2578 qt.main.main(options)
2579+ if options.mode == 'efl':
2580+ efl.main.main(options)
2581
2582 log.info('Babiloo closed for mantainance.')

Subscribers

People subscribed via source and target branches