[Sugar-devel] [PATCH 2/3] sdxo#2572: Add 'Load_URI' signal-handler in 'Browse' activity. When this signal is received (with the 'uri' as the argument), this 'uri' is reloaded in the 'Browse' instance.
Manuel Quiñones
manuq at laptop.org
Fri Jan 4 17:01:26 EST 2013
Please explain the reasoning behind this patch. What does it do?
2013/1/3 Ariel Calzada <ariel.calzada at gmail.com>:
> ---
> webactivity.py | 7 +++++++
> webactivity.py.orig | 5 +++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/webactivity.py b/webactivity.py
> index c5f13c1..fc60069 100644
> --- a/webactivity.py
> +++ b/webactivity.py
> @@ -20,6 +20,7 @@ import logging
> from gettext import gettext as _
> from gettext import ngettext
> import os
> +import dbus
>
> from gi.repository import GObject
> GObject.threads_init()
> @@ -252,6 +253,12 @@ class WebActivity(activity.Activity):
> # http://bugs.sugarlabs.org/ticket/3973
> self._cleanup_temp_files()
>
> + dbus.SessionBus().add_signal_receiver(self._load_uri, 'Load_URI',
> + IFACE)
> +
> + def _load_uri(self, uri):
> + self._link_clicked_cb(None, uri)
> +
> def _cleanup_temp_files(self):
> """Removes temporary files generated by Download Manager that
> were cancelled by the user or failed for any reason.
> diff --git a/webactivity.py.orig b/webactivity.py.orig
> index 3c0d337..c5f13c1 100644
> --- a/webactivity.py.orig
> +++ b/webactivity.py.orig
> @@ -159,6 +159,11 @@ class WebActivity(activity.Activity):
> session.set_property('ssl-use-system-ca-file', True)
> session.set_property('ssl-strict', False)
>
> + # Honor the http_proxy variable
> + if os.environ.get('http_proxy') is not None:
> + proxy_uri = Soup.URI.new(os.environ['http_proxy'])
> + session.set_property("proxy-uri",proxy_uri)
> +
> # By default, cookies are not stored persistently, we have to
> # add a cookie jar so that they get saved to disk. We use one
> # with a SQlite database:
> --
> 1.7.10.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
--
.. manuq ..
More information about the Sugar-devel
mailing list