Re: [Sugar-devel] [DESIGN] Write to Journal Anytime

2012-01-25 Thread Simon Schampijer

On 01/23/2012 11:12 PM, Simon Schampijer wrote:
[...]

While thinking further about how to best solve this issue I came across
the search key (magnifier icon on the olpc keyboard or F5 on non-olpc
hardware) which we have to get to the Journal quickly. I wondered if it
would be a good idea to let that key reveal the detail view of the
Journal entry when pressed while the activity is open. This might be a
nice and quick way to write notes. You could toggle the views quickly
with the 'search' and 'activity' keys. The downside here is that you do
not see what you write about while writing and it might not be as
discoverable and with non-keyboard Sugar you don't have that option. But
it might be a nice thing to have on top of Walter's approach. (I have
hacked up a quick patch and technically it is doable).


Attached is the patch to bring up the Journal detail view when you press 
the search key/F5 while having an activity focused (start Sugar, open 
Browse, hit search key/F5).


For a quick toggle of the views you would expect the activity key/F4 
bring you back to the activity now. This is currently not possible 
because the Journal itself is considered an activity and is part of the 
list of activities, hence after pressing search key/F5 the Journal is 
the current active activity.


In general I think the Journal should not be considered an activity and 
should be a view (hence neighborhood/goups/home/activity/journal) 
instead. That would not only make this use case easier it would as well 
tabbing through activities feel more right (at the moment the 
'tabbing-list' includes the Journal which I always found to be confusing).


What do others think about this general change in behavior? Something 
that is a good path forward? Or do you feel the search key is too 
overloaded that way?


Walter was mentioning that he would like to see the detail view being 
part of the main view [1]. If that change is computationally possible, 
we can apply the same logic, when you hit search key/F5 while over an 
activity you will be brought to the Journal and the entry is expanded, 
if you hit search key/F5 in any other view (or an activity has no 
Journal object associated) you will get to the Journal view with no 
entry expanded.


Regards,
   Simon

[1] http://wiki.sugarlabs.org/go/Design_Team/Designs/Journal#02
diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index bb1c7f6..0ec33bb 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -358,6 +358,16 @@ class JournalActivity(JournalWindow):
 def focus_search(self):
 Become visible and give focus to the search entry
 
+from jarabe.model import shell
+shell_model = shell.get_model()
+if shell_model.zoom_level == shell_model.ZOOM_ACTIVITY:
+active_activity = shell_model.get_active_activity()
+if not active_activity.is_journal():
+object_id = model.get_object_id(active_activity.get_activity_id())
+if object_id:
+self.reveal()
+self.show_object(object_id)
+return
 self.reveal()
 self.show_main_view()
 self.search_grab_focus()
diff --git a/src/jarabe/journal/model.py b/src/jarabe/journal/model.py
index 5285a7c..8a83477 100644
--- a/src/jarabe/journal/model.py
+++ b/src/jarabe/journal/model.py
@@ -489,6 +489,17 @@ def _get_file_metadata_from_json(dir_path, filename, fetch_preview):
 return metadata
 
 
+def get_object_id(activity_id):
+query = {}
+properties = []
+query['activity_id'] = activity_id
+entries, total_count = _get_datastore().find(query, properties,
+ byte_arrays=True)
+if entries:
+return entries[0]['uid']
+return None
+
+
 def _get_datastore():
 global _datastore
 if _datastore is None:
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Sugar Digest 2012-01-25

2012-01-25 Thread Walter Bender
== Sugar Digest ==

1. I was in Colombia last week and had a chance to meet up with some
Sugar hackers in Bogota. It was nice to catch up with Rafael Ortiz and
Pilar Saenz and to meet Fabian Prieto. The interest in Sugar in
Colombia is on the rise, so it is great that there is a local
community that can offer support.

In Cali, I met with Eduteka [1], a comprehensive education portal used
throughout the region. I gave them a mini-Turtle Art workshop with the
goal that they would be able to write a plugin for a simple USB IO
device that they have built.

2. Speaking of USB IO devices, Tony Forster is having fun [2] with the
Freetronics Leostick [3], an Arduino on a stick, which were given
out to every attendee of LCA 2012. It looks really cute. I haven't
been able to find a price for it anywhere on the Freetronics website,
but it looks quite promising. Tony also pulled together a WeDo plugin
[4, 5] for Turtle Art into shape (based on the work of Ian Daniher
[6]).

3. Speaking of Turtle Art plugins, I have begun working on a new
plugin to explore nutrition. The idea is to have a variety of food
blocks, each representing a polynomial description of their
nutritional value. Numerical value blocks will accumulate factors such
as calories, protein, fat, carbohydrates, calcium, iron, fiber, salt,
vitamin A, vitamin C, saturated fats, cholesterol, et al. The blocks
can then be used to calculate the various nutritional value of a
recipe or diet. Eventually, I'd like to add various operations such as
the impact of cooking. Stay tuned.

4. Along with Pacita Pena and Martin Oesterreich, the first release
version of the I Can Read activity [7] is just about ready. Keep an
eye out on activities.sugarlabs.org.
--
5. Quote of the week: Science is the belief in the ignorance of
experts. --Richard Feynman

=== In the community ===

6. There will be an eduJAM! in the  week of May 7-12 in Montevideo.
Details to follow.

=== Tech Talk ===

7. The Devel Team has been making great progress on the new features
for Sugar 0.96 [8].

8. AlanJAS (Alan Jhonn Aguiar Schwyn) has embarked upon an ASLO
cleanup. See [9] for the details on all of his analysis work. There
are many small tasks that need attention. Please jump in to help if
you have time.

9. Sugar is a learning community: I love reading Sascha Silbe's patch
reviews. I learn something every time.

=== Sugar Labs ===

Gary Martin has generated SOMs from the past few weeks of discussion
on the IAEP mailing list:

2012 Jan 7th-13th (45 emails) [10]

Visit our planet [11] for more updates about Sugar and Sugar deployments.

-walter



[1] http://eduteka.org
[2] http://tonyforster.blogspot.com/2012/01/arduino-and-xo-laptop.html
[3] http://www.freetronics.com/pages/leostick-quickstart-guide
[4] http://tonyforster.blogspot.com/2012/01/wedo-plugin-for-turtle-art.html
[5] http://wiki.sugarlabs.org/go/File:Wedo_plugin.tar.gz
[6] https://github.com/itdaniher/WeDoMore/tree/master/TurtleArt
[7] http://git.sugarlabs.org/icanread
[8] http://wiki.sugarlabs.org/go/0.96/Feature_List
[9] 
https://docs.google.com/spreadsheet/ccc?key=0AntaXnq4oy2_dHpvZHhLeGRQYzc1cDlRZU9Mc1NldGc
[10] http://wiki.sugarlabs.org/go/File:2012-January-7-13-som.jpg
[11] http://plant.sugarlabs.org


-- 
Walter Bender
Sugar Labs
http://www.sugarlabs.org
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] Localisation of Socialcalc activity in different languages

2012-01-25 Thread Anurag Chowdhury
Hi all,

I am working on the localisation of the socialcalc activity on sugar in
different languages for which I am in need of some pointers as follows:

1) After making the translations of the string in msgid to the required
language (starting with bengali) as portrayed below

#:
/home/olpc/Activities/SocialCalcActivity.activity/localized_strings_file.py:

msgid Recalculation   #--- in english

msgstr  Nuevo cálculo#---in desired language(spanish
here)

 above is a snippet from the es.po file used in spanish localisation
of socialcalc activity.

 What should be the next step following the creation of bn.po file (for
bengali) also I would need a detailed pointer on creation of .po files.

Regards
Anurag Chowdhury
Research Engineer
SEETA

.
___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release StarChart-13

2012-01-25 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4300

Sugar Platform:
0.82 - 0.94

Download Now:
http://activities.sugarlabs.org/downloads/file/27836/starchart-13.xo

Release notes:
v13
* Support for new Sugar toolbars
* Fixed initialize bug with lmag



Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel


[Sugar-devel] [ASLO] Release I Can Read-1

2012-01-25 Thread Sugar Labs Activities
Activity Homepage:
http://activities.sugarlabs.org/addon/4529

Sugar Platform:
0.82 - 0.94

Download Now:
http://activities.sugarlabs.org/downloads/file/27837/i_can_read-1.xo

Release notes:
New activity (Spanish only)


Sugar Labs Activities
http://activities.sugarlabs.org

___
Sugar-devel mailing list
Sugar-devel@lists.sugarlabs.org
http://lists.sugarlabs.org/listinfo/sugar-devel