[Dextrose] [PATCH 51/54] au#687: Add network proxy config extension to CP

Sascha Silbe sascha-ml-reply-to-2011-4 at silbe.org
Sat Nov 19 16:25:02 EST 2011


Excerpts from Anish Mangal's message of 2011-11-08 19:18:02 +0100:
> This work has been done and maintained by:
> 
> Aleksey Lim <alsroot at activitycentral.org>
> 
> here:
> 
> http://git.sugarlabs.org/alsroot/proxy_cp

This is rather complicated, both code- and UI-wise. Let's check where we
can simplify:

1. Direct connection is equivalent to configuring no proxy at all.
2. Does anybody seriously use different proxies for HTTP, HTTPS and/or
   FTP?
3. Does OLPC AU need SOCKS proxies? On a non-standard port?
4. The example given for automatic configuration
   ("http://wpad.ntschools.net/wpad.dat") suggests WPAD is supported. We
   should use that (by not setting autoconfig_url [1]) instead of
   letting the user enter proxy configuration settings manually. Should
   be the default, i.e. the behaviour in absence of manual configuration.
5. Is authentication support required?


Ideally the proxy settings would be bound to a NetworkManager connection
(and even be managed by NM), but as that won't happen in the short term
users will want a way to temporarily disable the proxy settings (e.g. if
they're at home), in contrast to #1/#4.

Similarly, I don't think what most users want is a list of host names to
bypass the proxy for (what you call "Ignore Host List"), but rather have
it connect to hosts on the same LAN directly. Unfortunately Gnome (and
thus the gconf settings we're using) doesn't seem to support that.


[configure.ac, data/icons/Makefile.am, extensions/cpsection/Makefile.am]

Please keep the lists sorted.


[data/icons/module-proxy.svg]

Interesting icon for proxy settings. But I don't have any idea myself
and the gnome-control-center choice of icon for the proxy settings isn't
really any better.

What's the license for this file and where did it come from? There are
Creative Commons tags in that file, but none that give a source, author
or license.


[extensions/cpsection/proxy/__init__.py]
[...]
> +CLASS = 'Proxy'
> +ICON = 'module-proxy'
> +TITLE = _('Proxy')

I wonder whether this would be better suited as an additional "page" in
the existing "Network" control panel section. We should ask Gary for
advice.

> diff --git a/extensions/cpsection/proxy/model.py b/extensions/cpsection/proxy/model.py
> new file mode 100644
> index 0000000..c88b116
> --- /dev/null
> +++ b/extensions/cpsection/proxy/model.py
> @@ -0,0 +1,14 @@
> +# Copyright (C) 2011, Aleksey Lim
> +#
> +# This program is free software: you can redistribute it and/or modify
> +# it under the terms of the GNU General Public License as published by
> +# the Free Software Foundation, either version 3 of the License, or
> +# (at your option) any later version.
> +#
> +# This program is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> +# GNU General Public License for more details.
> +#
> +# You should have received a copy of the GNU General Public License
> +# along with this program.  If not, see <http://www.gnu.org/licenses/>.
[no further content in this file]

If you add a real model file, you can get rid of some of your code, e.g.
the undo stuff. jarabe.controlpanel.gui.ModelWrapper has generic undo
support that gets used if you follow the Control Panel programming
conventions. I don't really like the way it does things and there's a
lot we could do better, but we should at least make use of what we have.


[extensions/cpsection/proxy/view.py]
[...]
> +def _register_bool_key(key, widget, reverse=False):
[...]
> +def _register_string_key(key, widget):
[...]
> +def _register_int_key(key, widget):
[...]

This looks like it could be simplified by using a mapping (dictionary)
from type to constants etc..


Bug: On first usage, switching to "Manual proxy configuration" did not
enable the settings grouped below it. The following Tracebacks appeared
in shell.log:

=== Begin ===
Traceback (most recent call last):
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/extensions/cpsection/proxy/view.py", line 363, in signal_cb
    value = get_cb()
NameError: free variable 'get_cb' referenced before assignment in enclosing scope
Traceback (most recent call last):
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/extensions/cpsection/proxy/view.py", line 363, in signal_cb
    value = get_cb()
NameError: free variable 'get_cb' referenced before assignment in enclosing scope
Traceback (most recent call last):
  File "/home/sascha.silbe/sugar-jhbuild/install/share/sugar/extensions/cpsection/proxy/view.py", line 363, in signal_cb
    value = get_cb()
NameError: free variable 'get_cb' referenced before assignment in enclosing scope
=== End ===

Sascha

[1] http://git.gnome.org/browse/gnome-control-center/tree/panels/network/cc-network-panel.c#n269
-- 
http://sascha.silbe.org/
http://www.infra-silbe.de/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/dextrose/attachments/20111119/8f930c4e/attachment.pgp>


More information about the Dextrose mailing list