[Sugar-devel] ​​[PATCH Browse] Use a standard gtk.Entry instead of the custom AddressEntry from the toolkit

Simon Schampijer simon at schampijer.de
Fri Aug 12 13:55:14 EDT 2011


I had to rebase that patch [1]. The functionality stays the same.

Regards,
    Simon

[1] http://patchwork.sugarlabs.org/patch/903/


On 08/10/2011 02:40 PM, simon at schampijer.de wrote:
>
> The GtkEntry widget in version 2.16 has support for displaying a progress
> bar inside of an entry widget. This allows us to remove our custom widget.
>
> Signed-off-by: Simon Schampijer<simon at laptop.org>
> ---
>   webtoolbar.py |    8 +++++---
>   1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/webtoolbar.py b/webtoolbar.py
> index a5e2c6e..0454449 100644
> --- a/webtoolbar.py
> +++ b/webtoolbar.py
> @@ -26,7 +26,6 @@ from xpcom import components
>
>   from sugar.graphics.toolbutton import ToolButton
>   from sugar.graphics.menuitem import MenuItem
> -from sugar._sugarext import AddressEntry
>   from sugar.graphics.toolbarbox import ToolbarBox
>   from sugar.activity.widgets import ActivityToolbarButton
>   from sugar.activity.widgets import StopButton
> @@ -37,7 +36,7 @@ import places
>
>   _MAX_HISTORY_ENTRIES = 15
>
> -class WebEntry(AddressEntry):
> +class WebEntry(gtk.Entry):
>       _COL_ADDRESS = 0
>       _COL_TITLE = 1
>
> @@ -371,7 +370,10 @@ class PrimaryToolbar(ToolbarBox):
>           self._set_progress(progress_listener.progress)
>
>       def _set_progress(self, progress):
> -        self.entry.props.progress = progress
> +        if progress == 1.0:
> +            self.entry.set_progress_fraction(0.0)
> +        else:
> +            self.entry.set_progress_fraction(progress)
>
>       def _set_address(self, uri):
>           if uri is not None:
> --
> 1.7.4.4
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



More information about the Sugar-devel mailing list