Re: [sugar] Recent Updates to Sugar Almanac

2008-06-13 Thread Martin Sevior
Hi Faisal,
   You might want to gather together the documentation we wrote
for abiwidget which explains how to embed the collaborative Rich Text
widget (as used by write) in python programs.

The links are on our wiki here:


http://www.abisource.com/wiki/AbiWidget

http://www.abisource.com/wiki/PyAbiWord

Cheers

Martin


On Fri, 2008-06-13 at 17:34 -0400, Faisal Anwar wrote:
> Hello All,
> 
> As many of you know, I'm writing up a sugar almanac to help new
> sugar/python developers get up and running with creating useful
> activities. I will try to send frequent updates in terms of what has
> been added. In addition to using the documentation, I'd appreciate it
> if people familiar with the different modules I am writing can send
> any better or alternative code examples to the ones that I have
> written. Review and feedback is ALWAYS appreciated.
> 
> This week, I have updated the section on how to do many of the basic
> activity creation tasks (see
> http://wiki.laptop.org/go/Sugar.activity.activity). In addition, I've
> provided some basic examples of how to read and write your activity to
> the datastore so that it can be resumed later from the journal. Below
> is a list of the different how to's contained in this section of the
> almanac. Hope some of these ring a bell in terms of what you all are
> trying to get done!
>   * 1 Helper Functions in sugar.activity.activity 
>   * 1.1 How do I get the file path for my activity bundle?
>   * 1.2 How do I get the file path where I can write files
> programmatically?
>   * 1.3 How do I get the name of my activity?
>   * 2 Class: Activity 
>   * 2.1 How do I set the canvas (main work area) of my
> activity to a specific UI widget?
>   * 2.2 What are activity id's? How do I obtain the
> activity id for an instance of my activity?
>   * 2.3 How do I create a new activity that is derived
> from the base Activity class?
>   * 2.4 How do I implement a write_file method for my
> activity in order to persist my activity in the
> journal?
>   * 2.5 How do I implement a read_file method for my
> activity so that I can resume activities from the
> sugar journal?
>   * 3 Class: ActivityToolbox (Toolbox) 
>   * 3.1 What is the standard toolbox needed in most
> activities and how do I create it?
>   * 3.2 How do I get a handle on the standard activity
> toolbar given an ActivityToolbox object?
>   * 4 Class: ActivityToolbar (gtk.Toolbar)
>   * 5 Class: EditToolbar (gtk.Toolbar) 
>   * 5.1 How do I add a standard edit toolbar to my
> activity?
>   * 5.2 How do I hide a button in the edit toolbar that is
> not needed in my activity?
>   * 5.3 How do I disable and enable a button on the edit
> toolbar?
> 
> You can also find the homepage for the documentation at
> http://wiki.laptop.org/go/Sugar-api-doc. 
> 
> 
> Best,
> 
> 
> Faisal
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Change tabbing to show a preview by opening the frame

2008-06-13 Thread Marco Pesenti Gritti
I had a quick look to the patches and the approach looks good to me. I
asked Eben to comment on the UI side of this before we make a more
careful review. Would be nice to get this in by the feature freeze.

Marco
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] Recent Updates to Sugar Almanac

2008-06-13 Thread Faisal Anwar
Hello All,

As many of you know, I'm writing up a sugar almanac to help new sugar/python
developers get up and running with creating useful activities. I will try to
send frequent updates in terms of what has been added. In addition to using
the documentation, I'd appreciate it if people familiar with the different
modules I am writing can send any better or alternative code examples to the
ones that I have written. Review and feedback is ALWAYS appreciated.

This week, I have updated the section on how to do many of the basic
activity creation tasks (see
http://wiki.laptop.org/go/Sugar.activity.activity). In addition, I've
provided some basic examples of how to read and write your activity to the
datastore so that it can be resumed later from the journal. Below is a list
of the different how to's contained in this section of the almanac. Hope
some of these ring a bell in terms of what you all are trying to get done!

   - 1 Helper Functions in
sugar.activity.activity
  - 1.1 How do I get the file path for my activity
bundle?
  - 1.2 How do I get the file path where I can write files
  
programmatically?
  - 1.3 How do I get the name of my
activity?
   - 2 Class: 
Activity
  - 2.1 How do I set the canvas (main work area) of my activity to a
  specific UI
widget?
  - 2.2 What are activity id's? How do I obtain the activity id for an
  instance of my
activity?
  - 2.3 How do I create a new activity that is derived from the base
  Activity 
class?
  - 2.4 How do I implement a write_file method for my activity in order
  to persist my activity in the
journal?
  - 2.5 How do I implement a read_file method for my activity so that I
  can resume activities from the sugar
journal?
   - 3 Class: ActivityToolbox
(Toolbox)
  - 3.1 What is the standard toolbox needed in most activities and how
  do I create
it?
  - 3.2 How do I get a handle on the standard activity toolbar given an
  ActivityToolbox
object?
   - 4 Class: ActivityToolbar
(gtk.Toolbar)
   - 5 Class: EditToolbar
(gtk.Toolbar)
  - 5.1 How do I add a standard edit toolbar to my
activity?
  - 5.2 How do I hide a button in the edit toolbar that is not needed in
  my 
activity?
  - 5.3 How do I disable and enable a button on the edit
toolbar?


You can also find the homepage for the documentation at
http://wiki.laptop.org/go/Sugar-api-doc.


Best,


Faisal
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [Announce] Web-90

2008-06-13 Thread Simon Schampijer
A new browse has been released!

NEWS:
* Add address entry focus with ctrl+l (erikos)
* Add find in context functionality (erikos)
* History and bookmarks autocompletion (marco)
* To resolve trac 6250, we disable browser detection of offline mode
   using xpcom. (erikg)
* Fix copy Image to clipboard under rainbow (tomeu/erikos)

get it at: http://dev.laptop.org/~erikos/bundles/Web-90.xo

New navigation instructions can be found here: 
http://wiki.laptop.org/go/Browse#Navigation

Have fun,
Simon
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] Sugar mtg minutes, 12th June 2008

2008-06-13 Thread Simon Schampijer
=Update on the status of the ongoing features=
Looks very good: http://wiki.sugarlabs.org/go/ReleaseTeam/Roadmap#New_features

=How to announce a new release of an activity best?=
unmadindu looked into remora http://wiki.mozilla.org/Update:Remora. he noted 
that 
it's not well documented, and the look and feel needs to be changed 
significantly 
(it's primarily written for addons.mozilla.org), and we would need some PHP dev 
to 
modify it for our work

Conclusion:
Someone needs to step in and do it if he/she has time!

=Providing test plans along releases=
m_stone and QA are requesting that each release we get in the stable build is 
associated with a set of tests that they need to perform to verify that stuff 
works 
as expected.

Basically we make mandatory to have a trac item associated with each news in 
the 
changelog and each trac item needs to have a testcase in it. We could use some 
keyword in the comment to mark it so that it can be extracted automatically. We 
need a ticket for each feature or fix - each item in the news basically.

=Documentation efforts for Sugar API and creating sugar activities=
fanwar's overall approach: One set of docs for high level functional design of 
sugar (Human Interface Guidelines), one set for how to's (almanac - which is 
what 
I'm working on), one set of apis from the actual code (which will be extracted 
through pydocs) and also some basic startup docs like those by Christoph in 
olpc 
austria.

For the moment the place where the documentation can be found is: 
http://wiki.laptop.org/go/Sugar-api-doc

fanwar requests: In the meantime, everyone continues to document code using 
pydocs 
and also please contribute to the almanac wiki yourselves.



---
PS: I will not be around the next two weeks so tomeu will be your host.

Best,
Simon
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Release Status Report - 8.2.0

2008-06-13 Thread Chris Ball
Hi,

   > is there background missing from trac?  i don't read anything in #6010
   > other than "we wake up only to go right back to sleep too often",
   > which seems even more benign (leaving power usage aside) than
   > you're describing.

Yes, there's some background missing -- both the lid switch detection
and power button detection have proven occasionally unreliable from
inside the kernel, and having them unreliable leads to a confusing state
of seeing the laptop turn on and off again quickly.  The lid bug is:

   http://dev.laptop.org/ticket/5703

That's not the main reason for doing it, though; we've always planned
on having the wakeup decision made by the EC, but didn't have the
ability to set the wakeup mask until recently.

- Chris.
-- 
Chris Ball   <[EMAIL PROTECTED]>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Info about data, instance and tmp directories in activity root

2008-06-13 Thread Faisal Anwar
thanks!

On Fri, Jun 13, 2008 at 10:31 AM, Tomeu Vizoso <[EMAIL PROTECTED]>
wrote:

> On Fri, Jun 13, 2008 at 4:20 PM, Faisal Anwar <[EMAIL PROTECTED]>
> wrote:
> > Hi,
> >
> > Does anyone know about (or can point me to docs for) the recommended uses
> of
> > the data, instance and tmp directories that exist for every activity
> > (usually found in the  ~myhome/.sugar/default/org.laptop.MyActivity/
> > directory)? In particular, I had the following questions:
> >
> > - what types of data should be written in each of these three
> subdirectories
> > and what is the difference between each?
> > - Are there specific permissions or ownership issues involved with these
> > directories.
>
> http://wiki.laptop.org/go/Low-level_Activity_API#Writable_Directories
>
> > - When should developers be writing files or data to the datastore and
> when
> > should they instead by saving files directly to one of these directories?
>
> An activity has to save to the DS all that is required to resume the
> activity at a later point. You can see this as storing an activity
> into the freezer, so it can be unfrozen later and resumed.
>
> Regards,
>
> Tomeu
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Refactor invites for 1-1 Chat (#6298)

2008-06-13 Thread Tomeu Vizoso
r+ ;)

On Fri, Jun 13, 2008 at 3:41 PM, Morgan Collett
<[EMAIL PROTECTED]> wrote:
> On Fri, Jun 13, 2008 at 14:56, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
>>
>> #6298: Launch Chat for 1-1 XMPP chat
>>
>> +activityfactory.create_with_uri('org.laptop.Chat', tp_channel)
>>
>> Marco, I thought we wanted to deprecate create_with_uri()? Do you have
>> a better idea here?
>
> What I need is to pass a string to the activity, in the metadata. It's
> not a URI (actually it's the json-encoded strings for a telepathy
> channel) but create_with_uri was the closest to what I need.
>
> I'm happy to change to something similar which isn't create_with_uri,
> but I don't know what you would prefer.
>
> Regards
> Morgan
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Info about data, instance and tmp directories in activity root

2008-06-13 Thread Tomeu Vizoso
On Fri, Jun 13, 2008 at 4:20 PM, Faisal Anwar <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Does anyone know about (or can point me to docs for) the recommended uses of
> the data, instance and tmp directories that exist for every activity
> (usually found in the  ~myhome/.sugar/default/org.laptop.MyActivity/
> directory)? In particular, I had the following questions:
>
> - what types of data should be written in each of these three subdirectories
> and what is the difference between each?
> - Are there specific permissions or ownership issues involved with these
> directories.

http://wiki.laptop.org/go/Low-level_Activity_API#Writable_Directories

> - When should developers be writing files or data to the datastore and when
> should they instead by saving files directly to one of these directories?

An activity has to save to the DS all that is required to resume the
activity at a later point. You can see this as storing an activity
into the freezer, so it can be unfrozen later and resumed.

Regards,

Tomeu
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] Info about data, instance and tmp directories in activity root

2008-06-13 Thread Faisal Anwar
Hi,

Does anyone know about (or can point me to docs for) the recommended uses of
the data, instance and tmp directories that exist for every activity
(usually found in the  ~myhome/.sugar/default/org.laptop.MyActivity/
directory)? In particular, I had the following questions:

- what types of data should be written in each of these three subdirectories
and what is the difference between each?
- Are there specific permissions or ownership issues involved with these
directories.
- When should developers be writing files or data to the datastore and when
should they instead by saving files directly to one of these directories?

Thanks


Faisal
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Release Status Report - 8.2.0

2008-06-13 Thread pgf
c. scott ananian wrote:
 > On Thu, Jun 12, 2008 at 7:40 PM, Chris Ball <[EMAIL PROTECTED]> wrote:
 > > Before we can ship power management, though, we should also fix:
 > >  * the SD corruption bug (#6532) -- if we can't fix it in time, we can
 > >inhibit suspend when an SD card is plugged in.
 > >  * pushing wakeup decisions to the EC (#6010) -- this will make the
 > >wakeup logic more reliable.
 > 
 > I'd claim that #6532 is not a *blocker*, it is just a desired feature.
 >  I think that we should ship low-power mode in 8.2 even if that means
 > we grey out the option to turn it on when an sd card is mounted.

if we can guarantee that we won't corrupt user data, then i agree
that it's not a blocker.  but if not, i'd say it is.

 > #6010 I'm a little more ambivalent on; I'd need more opinions on
 > whether wakeup is unreliable "enough" to make an explicit low-power
 > mode unworkable.  If it means that sometimes it takes two power button
 > presses to wake up, that's probably not a blocker.  If it is so hard
 > to wake up that people regularly think the machine is hung and
 > hard-power-off instead, that's probably a blocker.

is there background missing from trac?  i don't read anything in #6010
other than "we wake up only to go right back to sleep too often",
which seems even more benign (leaving power usage aside) than
you're describing.

paul
=-
 paul fox, [EMAIL PROTECTED]
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Browse - Find in Page

2008-06-13 Thread Simon Schampijer
Pushed.

Tomeu Vizoso wrote:
> r+ if Eben is ok with
> 
>> +width = int(gtk.gdk.screen_width() / 3)
>> +self.search_entry.set_size_request(width, -1)
> 
> I'm wondering if this will be ok in other screen resolutions.

Yeah we should see if other approaches makes more sense here in general since 
we 
have this code in some places. An alternative is for example: size based on the 
number of chars.

Thanks,
Simon

> Cheers,
> 
> Tomeu
> 
> On Thu, Jun 12, 2008 at 11:35 PM, Simon Schampijer <[EMAIL PROTECTED]> wrote:
>> Simon Schampijer wrote:
>>> Hi,
>>>
>>> this patch adds an entry field and a previous and next button to the edit
>>> toolbar to search in the context. You can use (ctrl+f) to focus the search
>>> entry in the edit toolbar. The find is typeahead. Hitting 'Enter' will find
>>> the next occurrence.
>>>
>>> I used the xpcom interface nsITypeAheadFind since it allows find() and
>>> findAgain() compared to nsIWebBrowserFind.
>>>
>>> Open questions:
>>>  - what feedback do we give when no occurrence was found (firefox paints
>>> the entry red)
>> I use now a light gray to change the color of the text (works as well in
>> grayscale mode). The buttons for next, prev are inactive as well in that
>> case.
>>
>> Simon
>>
>> diff --git a/edittoolbar.py b/edittoolbar.py
>> index 91e8d6a..b9b270a 100644
>> --- a/edittoolbar.py
>> +++ b/edittoolbar.py
>> @@ -14,9 +14,16 @@
>>  # along with this program; if not, write to the Free Software
>>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
>>  USA
>>
>> +import gtk
>> +from gettext import gettext as _
>> +
>> +from xpcom import components
>>  from xpcom.components import interfaces
>>
>>  from sugar.activity import activity
>> +from sugar.graphics import iconentry
>> +from sugar.graphics.toolbutton import ToolButton
>> +from sugar.graphics import style
>>
>>  class EditToolbar(activity.EditToolbar):
>>
>> @@ -25,14 +32,12 @@ class EditToolbar(activity.EditToolbar):
>> def __init__(self, browser):
>> activity.EditToolbar.__init__(self)
>>
>> -self._browser = browser
>> -
>> self.undo.connect('clicked', self.__undo_cb)
>> self.redo.connect('clicked', self.__redo_cb)
>> self.copy.connect('clicked', self.__copy_cb)
>> self.paste.connect('clicked', self.__paste_cb)
>>
>> -"""
>> +"""
>> Notifications are not working right now:
>> https://bugzilla.mozilla.org/show_bug.cgi?id=207339
>>
>> @@ -54,7 +59,48 @@ class EditToolbar(activity.EditToolbar):
>>
>> def observe(self, subject, topic, data):
>> logging.debug('observe: %r %r %r' % (subject, topic, data))
>> -"""
>> +"""
>> +
>> +separator = gtk.SeparatorToolItem()
>> +separator.set_draw(False)
>> +separator.set_expand(True)
>> +self.insert(separator, -1)
>> +separator.show()
>> +
>> +cls = components.classes["@mozilla.org/typeaheadfind;1"]
>> +self._typeahead = cls.createInstance(interfaces.nsITypeAheadFind)
>> +self._typeahead.init(browser.doc_shell)
>> +
>> +search_item = gtk.ToolItem()
>> +self.search_entry = iconentry.IconEntry()
>> +self.search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
>> + 'system-search')
>> +self.search_entry.add_clear_button()
>> +self.search_entry.connect('activate',
>> self.__search_entry_activate_cb)
>> +self.search_entry.connect('changed',
>> self.__search_entry_changed_cb)
>> +
>> +width = int(gtk.gdk.screen_width() / 3)
>> +self.search_entry.set_size_request(width, -1)
>> +
>> +search_item.add(self.search_entry)
>> +self.search_entry.show()
>> +
>> +self.insert(search_item, -1)
>> +search_item.show()
>> +
>> +self._prev = ToolButton('go-previous-paired')
>> +self._prev.set_tooltip(_('Previous'))
>> +self._prev.props.sensitive = False
>> +self._prev.connect('clicked', self.__find_previous_cb)
>> +self.insert(self._prev, -1)
>> +self._prev.show()
>> +
>> +self._next = ToolButton('go-next-paired')
>> +self._next.set_tooltip(_('Next'))
>> +self._next.props.sensitive = False
>> +self._next.connect('clicked', self.__find_next_cb)
>> +self.insert(self._next, -1)
>> +self._next.show()
>>
>> def __undo_cb(self, button):
>> command_manager = self._get_command_manager()
>> @@ -77,3 +123,24 @@ class EditToolbar(activity.EditToolbar):
>> requestor =
>> web_browser.queryInterface(interfaces.nsIInterfaceRequestor)
>> return requestor.getInterface(interfaces.nsICommandManager)
>>
>> +def __search_entry_activate_cb(self, entry):
>> +self._typeahead.findAgain(False, False)
>> +
>> +def __search_entry_changed_cb(self, entry):
>> +found = self._typeahead.find(entry.props.text, False)
>> +if fo

Re: [sugar] [PATCH] Browse - Add-address-entry-focus

2008-06-13 Thread Simon Schampijer
Pushed.

Thanks,
Simon

Tomeu Vizoso wrote:
> r+
> 
> On Fri, Jun 13, 2008 at 1:18 PM, Simon Schampijer <[EMAIL PROTECTED]> wrote:
>> Hi,
>>
>> this patch adds the shortcut ctr+l (a la firefox) to focus the adress/uri
>> entry. Furthermore it changes the shortcut for adding a bookmark to be
>> ctrl+d (standard a la firefox) - was ctrl+l before.
>>
>> Thanks,
>>   Simon
>>
>> diff --git a/webactivity.py b/webactivity.py
>> index f0d5021..7a0d5df 100755
>> --- a/webactivity.py
>> +++ b/webactivity.py
>> @@ -108,17 +108,17 @@ class WebActivity(activity.Activity):
>> toolbox.add_toolbar(_('Edit'), self._edit_toolbar)
>> self._edit_toolbar.show()
>>
>> -self.toolbar = WebToolbar(self._browser)
>> -toolbox.add_toolbar(_('Browse'), self.toolbar)
>> -self.toolbar.show()
>> +self._web_toolbar = WebToolbar(self._browser)
>> +toolbox.add_toolbar(_('Browse'), self._web_toolbar)
>> +self._web_toolbar.show()
>>
>> self._tray = HTray()
>> self.set_tray(self._tray, gtk.POS_BOTTOM)
>> self._tray.show()
>>
>> -self.viewtoolbar = ViewToolbar(self)
>> -toolbox.add_toolbar(_('View'), self.viewtoolbar)
>> -self.viewtoolbar.show()
>> +self._view_toolbar = ViewToolbar(self)
>> +toolbox.add_toolbar(_('View'), self._view_toolbar)
>> +self._view_toolbar.show()
>>
>> self.set_toolbox(toolbox)
>> toolbox.show()
>> @@ -129,7 +129,7 @@ class WebActivity(activity.Activity):
>> self.session_history = sessionhistory.get_instance()
>> self.session_history.connect('session-link-changed',
>>  self._session_history_changed_cb)
>> -self.toolbar.connect('add-link', self._link_add_button_cb)
>> +self._web_toolbar.connect('add-link', self._link_add_button_cb)
>>
>> self._browser.connect("notify::title", self._title_changed_cb)
>>
>> @@ -344,7 +344,7 @@ class WebActivity(activity.Activity):
>>
>> def _key_press_cb(self, widget, event):
>> if event.state & gtk.gdk.CONTROL_MASK:
>> -if gtk.gdk.keyval_name(event.keyval) == "l":
>> +if gtk.gdk.keyval_name(event.keyval) == "d":
>> _logger.debug('keyboard: Add link: %s.' % self.current)
>> self._add_link()
>> return True
>> @@ -353,6 +353,11 @@ class WebActivity(activity.Activity):
>> self.toolbox.set_current_toolbar(_TOOLBAR_EDIT)
>> self._edit_toolbar.search_entry.grab_focus()
>> return True
>> +elif gtk.gdk.keyval_name(event.keyval) == "l":
>> +_logger.debug('keyboard: Focus url entry')
>> +self.toolbox.set_current_toolbar(_TOOLBAR_BROWSE)
>> +self._web_toolbar.entry.grab_focus()
>> +return True
>> elif gtk.gdk.keyval_name(event.keyval) == "u":
>> _logger.debug('keyboard: Show source of the current page')
>> self._show_source()
>> @@ -407,14 +412,14 @@ class WebActivity(activity.Activity):
>> item.show()
>> if self._tray.props.visible is False:
>> self._tray.show()
>> -self.viewtoolbar.traybutton.props.sensitive = True
>> +self._view_toolbar.traybutton.props.sensitive = True
>>
>> def _link_removed_cb(self, button, hash):
>> ''' remove a link from tray and delete it in the model '''
>> self.model.remove_link(hash)
>> self._tray.remove_item(button)
>> if len(self._tray.get_children()) == 0:
>> -self.viewtoolbar.traybutton.props.sensitive = False
>> +self._view_toolbar.traybutton.props.sensitive = False
>>
>> def _link_clicked_cb(self, button, url):
>> ''' an item of the link tray has been clicked '''
>> diff --git a/webtoolbar.py b/webtoolbar.py
>> index 8987a37..3d1877c 100755
>> --- a/webtoolbar.py
>> +++ b/webtoolbar.py
>> @@ -67,13 +67,13 @@ class WebToolbar(gtk.Toolbar):
>> self.insert(self._stop_and_reload, -1)
>> self._stop_and_reload.show()
>>
>> -self._entry = AddressEntry()
>> -self._entry.connect('activate', self._entry_activate_cb)
>> +self.entry = AddressEntry()
>> +self.entry.connect('activate', self._entry_activate_cb)
>>
>> entry_item = gtk.ToolItem()
>> entry_item.set_expand(True)
>> -entry_item.add(self._entry)
>> -self._entry.show()
>> +entry_item.add(self.entry)
>> +self.entry.show()
>>
>> self.insert(entry_item, -1)
>> entry_item.show()
>> @@ -124,13 +124,13 @@ class WebToolbar(gtk.Toolbar):
>> self._set_progress(progress)
>>
>> def _set_progress(self, progress):
>> -self._entry.props.progress = progress
>> +self.entry.props.progress = progress
>>
>> def _set_address(self, address):
>> -self._entry.props.address = address
>> +self.entry

Re: [sugar] Release Status Report - 8.2.0

2008-06-13 Thread C. Scott Ananian
On Thu, Jun 12, 2008 at 7:40 PM, Chris Ball <[EMAIL PROTECTED]> wrote:
> Before we can ship power management, though, we should also fix:
>  * the SD corruption bug (#6532) -- if we can't fix it in time, we can
>inhibit suspend when an SD card is plugged in.
>  * pushing wakeup decisions to the EC (#6010) -- this will make the
>wakeup logic more reliable.

I'd claim that #6532 is not a *blocker*, it is just a desired feature.
 I think that we should ship low-power mode in 8.2 even if that means
we grey out the option to turn it on when an sd card is mounted.

#6010 I'm a little more ambivalent on; I'd need more opinions on
whether wakeup is unreliable "enough" to make an explicit low-power
mode unworkable.  If it means that sometimes it takes two power button
presses to wake up, that's probably not a blocker.  If it is so hard
to wake up that people regularly think the machine is hung and
hard-power-off instead, that's probably a blocker.

I'm not saying these bugs aren't important, I'm just trying to clarify
our "WE DON'T SHIP 8.2 UNTIL..." list.I'd like to say that
low-power mode is a must-have for 8.2.  I think "we don't ship 8.2
until low-power mode doesn't eat SD cards" is on the "don't ship"
list, but the way we get there might be by disabling low-power mode in
some situations -- it depends on how hard the SD corruption bug is to
fix.
 --scott

-- 
 ( http://cscott.net/ )
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Refactor invites for 1-1 Chat (#6298)

2008-06-13 Thread Morgan Collett
On Fri, Jun 13, 2008 at 14:56, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
>
> #6298: Launch Chat for 1-1 XMPP chat
>
> +activityfactory.create_with_uri('org.laptop.Chat', tp_channel)
>
> Marco, I thought we wanted to deprecate create_with_uri()? Do you have
> a better idea here?

What I need is to pass a string to the activity, in the metadata. It's
not a URI (actually it's the json-encoded strings for a telepathy
channel) but create_with_uri was the closest to what I need.

I'm happy to change to something similar which isn't create_with_uri,
but I don't know what you would prefer.

Regards
Morgan
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Refactor invites for 1-1 Chat (#6298)

2008-06-13 Thread Morgan Collett
On Fri, Jun 13, 2008 at 14:56, Tomeu Vizoso <[EMAIL PROTECTED]> wrote:
> On Tue, Jun 10, 2008 at 5:21 PM, Morgan Collett
> <[EMAIL PROTECTED]> wrote:
>> http://dev.laptop.org/git?p=users/morgan/sugar-toolkit;a=shortlog;h=6298
>> - Guillaume's change, r+ from me
>> - Can I push this to sugar-toolkit?
>
> Think so.

Thanks.

I've pushed the changes for the issues below to a new patch:
http://dev.laptop.org/git?p=users/morgan/sugar;a=commitdiff;h=0b821f770d51647f3d41131027db6c4345501a45

> #6298: Launch Chat for 1-1 XMPP chat
>
> +import json
> +from sugar import activity
> +from sugar.activity import activityfactory
>
> Why not having the imports at the top?

Fixed in a subsequent patch:
http://dev.laptop.org/git?p=users/morgan/sugar;a=commitdiff;h=1eff46e05bf56ae49304c3233fe3f8988c8e284e#patch2

>
> +tp_channel = json.write([str(bus_name), str(connection),
> + str(channel)])
>
> If you use simpljson instead, you won't need to cast to str.

Already switched to simplejson:
http://dev.laptop.org/git?p=users/morgan/sugar;a=commitdiff;h=1eff46e05bf56ae49304c3233fe3f8988c8e284e#patch2

I have now removed the cast to str.

>
> +activityfactory.create_with_uri('org.laptop.Chat', tp_channel)
>
> Marco, I thought we wanted to deprecate create_with_uri()? Do you have
> a better idea here?

Will discuss in a separate mail.

> 6298: Refactor invites to handle 1-1 XMPP connections
>
> +Note: self_activity_id is set to None to differentiate between
> +PrivateInvites and ActivityInvites
>
> What about having _activity_id only in ActivityInvite and use
> isinstance of hasattr to differentiate if needed?

Good idea, I'll change to that.

>
> +tp_channel = simplejson.dumps([str(bus_name), str(connection),
> +   str(channel)])
>
> No need to cast when using simplejson

Right - same as above. Fixed.

>
> +self._activity_model = activity_model = None
>
> This is only needed in the else block below.

Fixed in 
http://dev.laptop.org/git?p=users/morgan/sugar;a=commitdiff;h=0383581b2789fa7a8d0f8eb99da6068eb67b5500

>
> +if activity_model:
>
> Better to check if it isn't None?

Fixed.

>
> +if activity_model:
> +# shared activity
> ...
> else:
> +# private invite: displays with owner's colors
>
> I suggest to use a boolean variable with a sensible name instead of
> inline comments.

Removed when I refactored InviteButton to BaseInviteButton,
ActivityInviteButton and PrivateInviteButton (and same for
InvitePalette) in
http://dev.laptop.org/git?p=users/morgan/sugar;a=commitdiff;h=0383581b2789fa7a8d0f8eb99da6068eb67b5500

> 6298: Subclass InviteButton
>
> -menu_item.connect('activate', self.__join_activate_cb)
> +menu_item.connect('activate', self._join_activate_cb)
>
> Better use __ for signal handlers, so we avoid name clashes in
> subclasses. People can lose lots of time because of this.
>
> +def _join_activate_cb(self, menu_item):
> +raise NotImplementedError
>
> Oh, I see now. Overriding signal handlers is not something that you'll
> see in the code very often. What about:
>
> +def __join_activate_cb(self, menu_item):
> +self.join()
> +
> +def join(self):
> +raise NotImplementedError

Ah, great idea. Done.

Regards
Morgan
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Browse "autocompletion"

2008-06-13 Thread Michael Stone
On Fri, Jun 13, 2008 at 01:37:33PM +0200, Tomeu Vizoso wrote:
> +cur = self._con.cursor()
> ...
> +cur.close()
> 
> Should we use try...finally blocks so we don't leak open cursors?
> Also, we could use the with statement from future.

The "with" statement (and the contextlib's @contextmanager decorator)
have worked out really well for me so far. I'd be happy to see it used
more widely throughout Sugar.

Michael
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Refactor invites for 1-1 Chat (#6298)

2008-06-13 Thread Tomeu Vizoso
On Tue, Jun 10, 2008 at 5:21 PM, Morgan Collett
<[EMAIL PROTECTED]> wrote:
> http://dev.laptop.org/git?p=users/morgan/sugar-toolkit;a=shortlog;h=6298
> - Guillaume's change, r+ from me
> - Can I push this to sugar-toolkit?

Think so.

#6298: Launch Chat for 1-1 XMPP chat

+import json
+from sugar import activity
+from sugar.activity import activityfactory

Why not having the imports at the top?

+tp_channel = json.write([str(bus_name), str(connection),
+ str(channel)])

If you use simpljson instead, you won't need to cast to str.

+activityfactory.create_with_uri('org.laptop.Chat', tp_channel)

Marco, I thought we wanted to deprecate create_with_uri()? Do you have
a better idea here?

6298: Refactor invites to handle 1-1 XMPP connections

+Note: self_activity_id is set to None to differentiate between
+PrivateInvites and ActivityInvites

What about having _activity_id only in ActivityInvite and use
isinstance of hasattr to differentiate if needed?

+tp_channel = simplejson.dumps([str(bus_name), str(connection),
+   str(channel)])

No need to cast when using simplejson

+self._activity_model = activity_model = None

This is only needed in the else block below.

+if activity_model:

Better to check if it isn't None?

+if activity_model:
+# shared activity
...
 else:
+# private invite: displays with owner's colors

I suggest to use a boolean variable with a sensible name instead of
inline comments.

6298: Subclass InviteButton

-menu_item.connect('activate', self.__join_activate_cb)
+menu_item.connect('activate', self._join_activate_cb)

Better use __ for signal handlers, so we avoid name clashes in
subclasses. People can lose lots of time because of this.

+def _join_activate_cb(self, menu_item):
+raise NotImplementedError

Oh, I see now. Overriding signal handlers is not something that you'll
see in the code very often. What about:

+def __join_activate_cb(self, menu_item):
+self.join()
+
+def join(self):
+raise NotImplementedError

Sorry about the delay,

Tomeu
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Build streams

2008-06-13 Thread Martin Dengler
On Thu, Jun 12, 2008 at 11:36:51PM -0400, Mikus Grinbergs wrote:
> Finally, finally, Joyride 2024 managed to 'make available to users' 
> some of the newer Sugar changes (packaged in a build, as opposed to 
> only available in source).

So you want to see new sugar (sucrose?) code on your XO but only if
it's been pushed to an OLPC build?  I'd say you need to complain to
SugarLabs/sugar@ to make it easier to get new code to deployed systems
without requiring the downstream packagers (e.g., OLPC, ubuntu, etc.)
to do a whole new distribution.

> I'm interested in how the new Sugar behaves on my XO . . .

If you relax your restriction to using OLPC builds it's pretty easy /
durable (in the short term, in the usual case, YMMV but I've been
doing it) to just symlink a few dirs to a git clone (e.g., mv
/usr/share/sugar/shell /usr/share/sugar/shell.orig && ln -s
/home/olpc/sugar-clone/src /usr/share/sugar/shell && cp
/usr/share/sugar/shell{.orig,}/config.py) to really try to catch the
bleeding edge.  But it really is the bleeding edge, and if you are
worried about that not getting into builds enough you should complain
to sugar@, as I mentioned above, I think.

> mikus

Martin


pgpnUpbYdX8v2.pgp
Description: PGP signature
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Browse - Add-address-entry-focus

2008-06-13 Thread Tomeu Vizoso
r+

On Fri, Jun 13, 2008 at 1:18 PM, Simon Schampijer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> this patch adds the shortcut ctr+l (a la firefox) to focus the adress/uri
> entry. Furthermore it changes the shortcut for adding a bookmark to be
> ctrl+d (standard a la firefox) - was ctrl+l before.
>
> Thanks,
>   Simon
>
> diff --git a/webactivity.py b/webactivity.py
> index f0d5021..7a0d5df 100755
> --- a/webactivity.py
> +++ b/webactivity.py
> @@ -108,17 +108,17 @@ class WebActivity(activity.Activity):
> toolbox.add_toolbar(_('Edit'), self._edit_toolbar)
> self._edit_toolbar.show()
>
> -self.toolbar = WebToolbar(self._browser)
> -toolbox.add_toolbar(_('Browse'), self.toolbar)
> -self.toolbar.show()
> +self._web_toolbar = WebToolbar(self._browser)
> +toolbox.add_toolbar(_('Browse'), self._web_toolbar)
> +self._web_toolbar.show()
>
> self._tray = HTray()
> self.set_tray(self._tray, gtk.POS_BOTTOM)
> self._tray.show()
>
> -self.viewtoolbar = ViewToolbar(self)
> -toolbox.add_toolbar(_('View'), self.viewtoolbar)
> -self.viewtoolbar.show()
> +self._view_toolbar = ViewToolbar(self)
> +toolbox.add_toolbar(_('View'), self._view_toolbar)
> +self._view_toolbar.show()
>
> self.set_toolbox(toolbox)
> toolbox.show()
> @@ -129,7 +129,7 @@ class WebActivity(activity.Activity):
> self.session_history = sessionhistory.get_instance()
> self.session_history.connect('session-link-changed',
>  self._session_history_changed_cb)
> -self.toolbar.connect('add-link', self._link_add_button_cb)
> +self._web_toolbar.connect('add-link', self._link_add_button_cb)
>
> self._browser.connect("notify::title", self._title_changed_cb)
>
> @@ -344,7 +344,7 @@ class WebActivity(activity.Activity):
>
> def _key_press_cb(self, widget, event):
> if event.state & gtk.gdk.CONTROL_MASK:
> -if gtk.gdk.keyval_name(event.keyval) == "l":
> +if gtk.gdk.keyval_name(event.keyval) == "d":
> _logger.debug('keyboard: Add link: %s.' % self.current)
> self._add_link()
> return True
> @@ -353,6 +353,11 @@ class WebActivity(activity.Activity):
> self.toolbox.set_current_toolbar(_TOOLBAR_EDIT)
> self._edit_toolbar.search_entry.grab_focus()
> return True
> +elif gtk.gdk.keyval_name(event.keyval) == "l":
> +_logger.debug('keyboard: Focus url entry')
> +self.toolbox.set_current_toolbar(_TOOLBAR_BROWSE)
> +self._web_toolbar.entry.grab_focus()
> +return True
> elif gtk.gdk.keyval_name(event.keyval) == "u":
> _logger.debug('keyboard: Show source of the current page')
> self._show_source()
> @@ -407,14 +412,14 @@ class WebActivity(activity.Activity):
> item.show()
> if self._tray.props.visible is False:
> self._tray.show()
> -self.viewtoolbar.traybutton.props.sensitive = True
> +self._view_toolbar.traybutton.props.sensitive = True
>
> def _link_removed_cb(self, button, hash):
> ''' remove a link from tray and delete it in the model '''
> self.model.remove_link(hash)
> self._tray.remove_item(button)
> if len(self._tray.get_children()) == 0:
> -self.viewtoolbar.traybutton.props.sensitive = False
> +self._view_toolbar.traybutton.props.sensitive = False
>
> def _link_clicked_cb(self, button, url):
> ''' an item of the link tray has been clicked '''
> diff --git a/webtoolbar.py b/webtoolbar.py
> index 8987a37..3d1877c 100755
> --- a/webtoolbar.py
> +++ b/webtoolbar.py
> @@ -67,13 +67,13 @@ class WebToolbar(gtk.Toolbar):
> self.insert(self._stop_and_reload, -1)
> self._stop_and_reload.show()
>
> -self._entry = AddressEntry()
> -self._entry.connect('activate', self._entry_activate_cb)
> +self.entry = AddressEntry()
> +self.entry.connect('activate', self._entry_activate_cb)
>
> entry_item = gtk.ToolItem()
> entry_item.set_expand(True)
> -entry_item.add(self._entry)
> -self._entry.show()
> +entry_item.add(self.entry)
> +self.entry.show()
>
> self.insert(entry_item, -1)
> entry_item.show()
> @@ -124,13 +124,13 @@ class WebToolbar(gtk.Toolbar):
> self._set_progress(progress)
>
> def _set_progress(self, progress):
> -self._entry.props.progress = progress
> +self.entry.props.progress = progress
>
> def _set_address(self, address):
> -self._entry.props.address = address
> +self.entry.props.address = address
>
> def _set_title(self, title):
> -self._entry.props.title = title
> +self.entry.props.title = title
>
> def _show_stop_

Re: [sugar] [PATCH] Browse "autocompletion"

2008-06-13 Thread Tomeu Vizoso
Hi,

+self._con = sqlite3.connect(db_path)
+cur = self._con.cursor()

I'd avoid abbreviations if possible: self._connection and cursor.

+cur.execute('insert into places values (?, ?, ?, ?, ?, ?)', \
+(place.uri, place.title, place.bookmark,
+ place.gecko_flags, place.visits, place.last_visit))

This will break or have unintended effects if the schema changes.
Specifying the names of the fields will make it more robust:

'insert into places (uri, title, bookmark, gecko_flags, visits,
last_visit) values (?, ?, ?, ?, ?, ?)'

+cur = self._con.cursor()
...
+cur.close()

Should we use try...finally blocks so we don't leak open cursors?
Also, we could use the with statement from future.

+place.uri, place.title, place.bookmark, place.gecko_flags, \
+place.visits, place.last_visit = row

If we are going to use row as a tuple, we should specify the columns
we are querying in every select statement, so code is more resilient
to schema changes. If row could be used as a dict, then it wouldn't
matter.

+COL_ADDRESS = 0
+COL_TITLE = 1

Should be private?

+self.handler_block(self._change_hid)
+self.props.text = uri
+self.handler_unblock(self._change_hid)

try...finally?

+self.handler_block(self._change_hid)
+self._address = address
+self.handler_unblock(self._change_hid)

Do we really need to block the signal handler here? Same with self._title.

+list_store = gtk.ListStore(str, str)
+
+for place in places.get_store().search(self.props.text):
+list_store.append([place.uri, place.title])

Might be interesting to implement a descendant of ListStore that
accesses directly the places db, so that the user can scroll down past
the maximum number of search results.

+def __focus_in_event_cb(self, entry, event):
+self.handler_block(self._change_hid)
+self.props.text = self._address
+self.handler_unblock(self._change_hid)

Could we avoid this code duplication?

+path, col_dummy, x_dummy, y_dummy = \

I've been using col_ for dummies and pylint seems to like it.

Regards,

Tomeu

On Thu, Jun 12, 2008 at 11:22 PM, Marco Pesenti Gritti
<[EMAIL PROTECTED]> wrote:
> Added the bookmark field so that we don't have to change tables later.
>
> Marco
>
> On Thu, Jun 12, 2008 at 11:09 PM, Marco Pesenti Gritti
> <[EMAIL PROTECTED]> wrote:
>> Hello,
>>
>> the attached patch implements history and autocompletion. Terminology:
>> I'm calling a history/bookmark item place, similarly to firefox. I'm
>> also generally using search instead of autocompletion, because that's
>> what it actually does.
>>
>> Bookmarks are not hooked up, but it should be trivial to do so. I'd
>> actually appreciate if someone with some more understanding of the
>> bookmarks code in Browse could do that (Simon?). I think the idea is
>> that all the session bookmarks are added to the places store, even
>> those which are just shared by someone else but never visited. I think
>> we should add a bookmark:boolean to Place so that we can give those
>> higher priority in the queries.
>>
>> The entry patch is to sugar-toolkit, I'm moving adress/title handling
>> in web-activity.
>>
>> For splitted up commits see:
>> http://dev.laptop.org/git?p=users/marco/web-activity;a=summary
>>
>> Marco
>>
>
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Bundlebuilder use manifest, fix_manifest function

2008-06-13 Thread Marco Pesenti Gritti
Please open a ticket yeah. This patch did not touch that code.

Marco

On Fri, Jun 13, 2008 at 12:56 PM, Simon Schampijer <[EMAIL PROTECTED]> wrote:
> As a little note so I don't forget: In the latest version Sucrose 0.82.2
> when you did a ./setup release the bundle number did not get updated. Not
> sure how much was refactored now. I can file a ticket as well.
>
> Simon
>
> Marco Pesenti Gritti wrote:
>>
>> Also we need to provide commands to generate the MANIFEST.
>>
>> Marco
>>
>> On Fri, Jun 13, 2008 at 12:42 PM, Marco Pesenti Gritti
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> Landed with some cleanup and little fixes. Please test it and see if I
>>> broke anything in the process.
>>>
>>> I removed is_dir (and the po check which use it) because the return
>>> True was too much of an hack. Happy to consider a better fix for that
>>> as a separate patch.
>>>
>>> Thanks!
>>> Marco
>>>
>> ___
>> Sugar mailing list
>> Sugar@lists.laptop.org
>> http://lists.laptop.org/listinfo/sugar
>>
>
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] Home Design: Free Layout View

2008-06-13 Thread Martin Dengler
On Fri, Jun 13, 2008 at 12:52:15AM -0400, Mikus Grinbergs wrote:
[...]
> What could be done on the Home-view page (once the existing "ring" 
> gets too crowded) is to *not* show some icons until an "enabling 
> object" is clicked.  By "expanding" only one "enabling object" at a 
> time, the available space on the Home-view page gets multi-used -- 
> providing lots of scalability.  Since a "ring display of objects" 
> looks good, clicking on an "enabling object" put into an inner ring 
> could bring up an adjacent "outer ring segment" showing more icons.

This made me think of a hyperbolic tree[1,2] layout with the root node
obviously being the XO, the central ring being the activities and each
activity allowing navigation to its instances in the journal.

> mikus

Martin

1. http://en.wikipedia.org/wiki/HyperbolicTree
2. http://www.visual-literacy.org/periodic_table/periodic_table.html


pgpNH74MnL4mB.pgp
Description: PGP signature
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


[sugar] [PATCH] Browse - Add-address-entry-focus

2008-06-13 Thread Simon Schampijer

Hi,

this patch adds the shortcut ctr+l (a la firefox) to focus the adress/uri entry. 
Furthermore it changes the shortcut for adding a bookmark to be ctrl+d (standard a 
la firefox) - was ctrl+l before.


Thanks,
   Simon
diff --git a/webactivity.py b/webactivity.py
index f0d5021..7a0d5df 100755
--- a/webactivity.py
+++ b/webactivity.py
@@ -108,17 +108,17 @@ class WebActivity(activity.Activity):
 toolbox.add_toolbar(_('Edit'), self._edit_toolbar)
 self._edit_toolbar.show()
 
-self.toolbar = WebToolbar(self._browser)
-toolbox.add_toolbar(_('Browse'), self.toolbar)
-self.toolbar.show()
+self._web_toolbar = WebToolbar(self._browser)
+toolbox.add_toolbar(_('Browse'), self._web_toolbar)
+self._web_toolbar.show()

 self._tray = HTray()
 self.set_tray(self._tray, gtk.POS_BOTTOM)
 self._tray.show()
 
-self.viewtoolbar = ViewToolbar(self)
-toolbox.add_toolbar(_('View'), self.viewtoolbar)
-self.viewtoolbar.show()
+self._view_toolbar = ViewToolbar(self)
+toolbox.add_toolbar(_('View'), self._view_toolbar)
+self._view_toolbar.show()
 
 self.set_toolbox(toolbox)
 toolbox.show()
@@ -129,7 +129,7 @@ class WebActivity(activity.Activity):
 self.session_history = sessionhistory.get_instance()
 self.session_history.connect('session-link-changed', 
  self._session_history_changed_cb)
-self.toolbar.connect('add-link', self._link_add_button_cb)
+self._web_toolbar.connect('add-link', self._link_add_button_cb)
 
 self._browser.connect("notify::title", self._title_changed_cb)
 
@@ -344,7 +344,7 @@ class WebActivity(activity.Activity):
 
 def _key_press_cb(self, widget, event):
 if event.state & gtk.gdk.CONTROL_MASK:
-if gtk.gdk.keyval_name(event.keyval) == "l":
+if gtk.gdk.keyval_name(event.keyval) == "d":
 _logger.debug('keyboard: Add link: %s.' % self.current) 
 self._add_link()
 return True
@@ -353,6 +353,11 @@ class WebActivity(activity.Activity):
 self.toolbox.set_current_toolbar(_TOOLBAR_EDIT)
 self._edit_toolbar.search_entry.grab_focus()
 return True
+elif gtk.gdk.keyval_name(event.keyval) == "l":
+_logger.debug('keyboard: Focus url entry')
+self.toolbox.set_current_toolbar(_TOOLBAR_BROWSE)
+self._web_toolbar.entry.grab_focus()
+return True
 elif gtk.gdk.keyval_name(event.keyval) == "u":
 _logger.debug('keyboard: Show source of the current page')
 self._show_source()
@@ -407,14 +412,14 @@ class WebActivity(activity.Activity):
 item.show()
 if self._tray.props.visible is False:
 self._tray.show()
-self.viewtoolbar.traybutton.props.sensitive = True
+self._view_toolbar.traybutton.props.sensitive = True
 
 def _link_removed_cb(self, button, hash):
 ''' remove a link from tray and delete it in the model '''
 self.model.remove_link(hash)
 self._tray.remove_item(button)
 if len(self._tray.get_children()) == 0:
-self.viewtoolbar.traybutton.props.sensitive = False
+self._view_toolbar.traybutton.props.sensitive = False
 
 def _link_clicked_cb(self, button, url):
 ''' an item of the link tray has been clicked '''
diff --git a/webtoolbar.py b/webtoolbar.py
index 8987a37..3d1877c 100755
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -67,13 +67,13 @@ class WebToolbar(gtk.Toolbar):
 self.insert(self._stop_and_reload, -1)
 self._stop_and_reload.show()
 
-self._entry = AddressEntry()
-self._entry.connect('activate', self._entry_activate_cb)
+self.entry = AddressEntry()
+self.entry.connect('activate', self._entry_activate_cb)
 
 entry_item = gtk.ToolItem()
 entry_item.set_expand(True)
-entry_item.add(self._entry)
-self._entry.show()
+entry_item.add(self.entry)
+self.entry.show()
 
 self.insert(entry_item, -1)
 entry_item.show()
@@ -124,13 +124,13 @@ class WebToolbar(gtk.Toolbar):
 self._set_progress(progress)
 
 def _set_progress(self, progress):
-self._entry.props.progress = progress
+self.entry.props.progress = progress
 
 def _set_address(self, address):
-self._entry.props.address = address
+self.entry.props.address = address
 
 def _set_title(self, title):
-self._entry.props.title = title
+self.entry.props.title = title
 
 def _show_stop_icon(self):
 self._stop_and_reload.set_icon('media-playback-stop')
___
Sugar mailing list
Sugar@lists.laptop.org
http:

Re: [sugar] [PATCH] Bundlebuilder use manifest, fix_manifest function

2008-06-13 Thread Simon Schampijer
As a little note so I don't forget: In the latest version Sucrose 0.82.2 when 
you 
did a ./setup release the bundle number did not get updated. Not sure how much 
was 
refactored now. I can file a ticket as well.

Simon

Marco Pesenti Gritti wrote:
> Also we need to provide commands to generate the MANIFEST.
> 
> Marco
> 
> On Fri, Jun 13, 2008 at 12:42 PM, Marco Pesenti Gritti
> <[EMAIL PROTECTED]> wrote:
>> Landed with some cleanup and little fixes. Please test it and see if I
>> broke anything in the process.
>>
>> I removed is_dir (and the po check which use it) because the return
>> True was too much of an hack. Happy to consider a better fix for that
>> as a separate patch.
>>
>> Thanks!
>> Marco
>>
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
> 

___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Bundlebuilder use manifest, fix_manifest function

2008-06-13 Thread Marco Pesenti Gritti
Also we need to provide commands to generate the MANIFEST.

Marco

On Fri, Jun 13, 2008 at 12:42 PM, Marco Pesenti Gritti
<[EMAIL PROTECTED]> wrote:
> Landed with some cleanup and little fixes. Please test it and see if I
> broke anything in the process.
>
> I removed is_dir (and the po check which use it) because the return
> True was too much of an hack. Happy to consider a better fix for that
> as a separate patch.
>
> Thanks!
> Marco
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Bundlebuilder use manifest, fix_manifest function

2008-06-13 Thread Marco Pesenti Gritti
Landed with some cleanup and little fixes. Please test it and see if I
broke anything in the process.

I removed is_dir (and the po check which use it) because the return
True was too much of an hack. Happy to consider a better fix for that
as a separate patch.

Thanks!
Marco
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar


Re: [sugar] [PATCH] Browse - Find in Page

2008-06-13 Thread Tomeu Vizoso
r+ if Eben is ok with

> +width = int(gtk.gdk.screen_width() / 3)
> +self.search_entry.set_size_request(width, -1)

I'm wondering if this will be ok in other screen resolutions.

Cheers,

Tomeu

On Thu, Jun 12, 2008 at 11:35 PM, Simon Schampijer <[EMAIL PROTECTED]> wrote:
> Simon Schampijer wrote:
>>
>> Hi,
>>
>> this patch adds an entry field and a previous and next button to the edit
>> toolbar to search in the context. You can use (ctrl+f) to focus the search
>> entry in the edit toolbar. The find is typeahead. Hitting 'Enter' will find
>> the next occurrence.
>>
>> I used the xpcom interface nsITypeAheadFind since it allows find() and
>> findAgain() compared to nsIWebBrowserFind.
>>
>> Open questions:
>>  - what feedback do we give when no occurrence was found (firefox paints
>> the entry red)
>
> I use now a light gray to change the color of the text (works as well in
> grayscale mode). The buttons for next, prev are inactive as well in that
> case.
>
> Simon
>
> diff --git a/edittoolbar.py b/edittoolbar.py
> index 91e8d6a..b9b270a 100644
> --- a/edittoolbar.py
> +++ b/edittoolbar.py
> @@ -14,9 +14,16 @@
>  # along with this program; if not, write to the Free Software
>  # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
>  USA
>
> +import gtk
> +from gettext import gettext as _
> +
> +from xpcom import components
>  from xpcom.components import interfaces
>
>  from sugar.activity import activity
> +from sugar.graphics import iconentry
> +from sugar.graphics.toolbutton import ToolButton
> +from sugar.graphics import style
>
>  class EditToolbar(activity.EditToolbar):
>
> @@ -25,14 +32,12 @@ class EditToolbar(activity.EditToolbar):
> def __init__(self, browser):
> activity.EditToolbar.__init__(self)
>
> -self._browser = browser
> -
> self.undo.connect('clicked', self.__undo_cb)
> self.redo.connect('clicked', self.__redo_cb)
> self.copy.connect('clicked', self.__copy_cb)
> self.paste.connect('clicked', self.__paste_cb)
>
> -"""
> +"""
> Notifications are not working right now:
> https://bugzilla.mozilla.org/show_bug.cgi?id=207339
>
> @@ -54,7 +59,48 @@ class EditToolbar(activity.EditToolbar):
>
> def observe(self, subject, topic, data):
> logging.debug('observe: %r %r %r' % (subject, topic, data))
> -"""
> +"""
> +
> +separator = gtk.SeparatorToolItem()
> +separator.set_draw(False)
> +separator.set_expand(True)
> +self.insert(separator, -1)
> +separator.show()
> +
> +cls = components.classes["@mozilla.org/typeaheadfind;1"]
> +self._typeahead = cls.createInstance(interfaces.nsITypeAheadFind)
> +self._typeahead.init(browser.doc_shell)
> +
> +search_item = gtk.ToolItem()
> +self.search_entry = iconentry.IconEntry()
> +self.search_entry.set_icon_from_name(iconentry.ICON_ENTRY_PRIMARY,
> + 'system-search')
> +self.search_entry.add_clear_button()
> +self.search_entry.connect('activate',
> self.__search_entry_activate_cb)
> +self.search_entry.connect('changed',
> self.__search_entry_changed_cb)
> +
> +width = int(gtk.gdk.screen_width() / 3)
> +self.search_entry.set_size_request(width, -1)
> +
> +search_item.add(self.search_entry)
> +self.search_entry.show()
> +
> +self.insert(search_item, -1)
> +search_item.show()
> +
> +self._prev = ToolButton('go-previous-paired')
> +self._prev.set_tooltip(_('Previous'))
> +self._prev.props.sensitive = False
> +self._prev.connect('clicked', self.__find_previous_cb)
> +self.insert(self._prev, -1)
> +self._prev.show()
> +
> +self._next = ToolButton('go-next-paired')
> +self._next.set_tooltip(_('Next'))
> +self._next.props.sensitive = False
> +self._next.connect('clicked', self.__find_next_cb)
> +self.insert(self._next, -1)
> +self._next.show()
>
> def __undo_cb(self, button):
> command_manager = self._get_command_manager()
> @@ -77,3 +123,24 @@ class EditToolbar(activity.EditToolbar):
> requestor =
> web_browser.queryInterface(interfaces.nsIInterfaceRequestor)
> return requestor.getInterface(interfaces.nsICommandManager)
>
> +def __search_entry_activate_cb(self, entry):
> +self._typeahead.findAgain(False, False)
> +
> +def __search_entry_changed_cb(self, entry):
> +found = self._typeahead.find(entry.props.text, False)
> +if found == interfaces.nsITypeAheadFind.FIND_NOTFOUND:
> +self._prev.props.sensitive = False
> +self._next.props.sensitive = False
> +entry.modify_text(gtk.STATE_NORMAL,
> +  style.COLOR_BUTTON_GREY.get_gdk_color())
> +else:
> +self._prev.props.sensitive = True
> +self._next

Re: [sugar] [PATCH] Journal able to use "open with" for activity bundles

2008-06-13 Thread Tomeu Vizoso
r+ with the following comments:

+84

Please take this out.

+for handler in activities:

This rename confused me for a bit, but I think I see what you meant.

Thanks,

Tomeu

On Fri, Jun 13, 2008 at 8:21 AM, Jameson Chema Quinn
<[EMAIL PROTECTED]> wrote:
> Here's the revised patch. May I respectfully suggest that further discussion
> of ancillary issues move to other threads? (I actually started another
> thread, and got no responses, while this one continued one more round.)
>
> Jameson
>
> ___
> Sugar mailing list
> Sugar@lists.laptop.org
> http://lists.laptop.org/listinfo/sugar
>
>
___
Sugar mailing list
Sugar@lists.laptop.org
http://lists.laptop.org/listinfo/sugar