Thanks a ton Manuel; I will test the patch on the weekend, and let you know :)<br><br><div class="gmail_quote">On Thu, Mar 14, 2013 at 7:27 AM, Manuel Quiñones <span dir="ltr"><<a href="mailto:manuq@laptop.org" target="_blank">manuq@laptop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi Ajay and other devs,<br>
<br>
Ajay, whlie reviewing your patch for the proxy feature, I decided to<br>
step in and work on the issues I've found by myself. I did this to<br>
speed up the process, instead of going through a long<br>
review/patch/review loop. I hope you understand. A (rather long,<br>
sorry) description of what I did follows. But first of all, I would<br>
be glad if you can test my last patch:<br>
<br>
<a href="https://bugs.sugarlabs.org/attachment/ticket/3070/0001-Add-proxy-configuration-support-to-Network-Control-P.patch" target="_blank">https://bugs.sugarlabs.org/attachment/ticket/3070/0001-Add-proxy-configuration-support-to-Network-Control-P.patch</a><br>
<br>
The first thing I've found is that your patch does both GConf and<br>
GSettings. I decided to go just for GSettings because Browse and all<br>
underlayng GTK use it.</blockquote><div><br>Great !! <br>If we are sure that no application carries the legacy "Gconf" proxy-settings/schema, we are done, (not to forget less lines of code to carry :P)<br><br><br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"> In any case I think you should have added<br>
another mixin class for GSettings instead of adding code to GConfMixin<br>
class. Sasha's original patch had that quite separated to make adding<br>
another backend an easy task.<br>
<br>
So my first attempt was doing only GSettings and fixing the issues<br>
I've found in yours:<br>
<br>
<a href="https://bugs.sugarlabs.org/attachment/ticket/3070/proxy_gsettings.patch" target="_blank">https://bugs.sugarlabs.org/attachment/ticket/3070/proxy_gsettings.patch</a><br>
(note this is not my final patch, let's call this my a) patch)<br>
<br>
An issue with your patch: the UI does not always update when a setting<br>
is changed. TestCase: change a setting, quickly close the network<br>
section and open it again: you will see the original value. This is<br>
because the timeout that calls _commit has not finished yet. Sasha's<br>
patch had gconf client.notify_add() for this. In my a) patch I have<br>
added a callback to the 'changed' event of gsettings that does the<br>
same. <br></blockquote><div><br>I had fixed this, in the patch I had floated :)<br>The "self._section_view.perform_accept_actions()" did the fix in my patch; now substituted by "self._section_view.apply()" in your patch.<br>
<br>I had even mentioned that in point c) in the patch at <a href="http://lists.sugarlabs.org/archive/sugar-devel/2013-February/041779.html">http://lists.sugarlabs.org/archive/sugar-devel/2013-February/041779.html</a> :)<br>
<br>Anyways, the end result is that, we HAVE TAKEN care of the racy-behaviour, as far as the persistence of values is concerned.<br><br><br><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<a href="https://developer.gnome.org/gio/stable/GSettings.html#GSettings-changed" target="_blank">https://developer.gnome.org/gio/stable/GSettings.html#GSettings-changed</a><br>
<br>
There are other differences between Sasha's patch and yours. For<br>
example you seem to forgot the try/finally clause in the _commit<br>
method that blocks the __changed_cb callback. I have added it back in<br>
my a) patch.<br>
<br>
I intentionally skipped $http_proxy environment variable (Sasha's patch 3/3):<br>
<br>
<a href="http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038804.html" target="_blank">http://lists.sugarlabs.org/archive/sugar-devel/2012-August/038804.html</a><br>
<br>
This could be added later if there is a reason. I don't see GNOME<br>
doing it. Which activities or parts of Sugar need it? Indeed this<br>
makes wget work with proxy by default but then why GNOME does not do<br>
it? Am I missing any conversation?<br></blockquote><div><br>Hmm.. One place where I know for confirmed it is used in "webkitgtk3", thus making its use in "Browse".<br>But you said earlier that using ONLY GSettings (without setting the "http_poxy" variable), propogates the proxy-settings in "Browse". If that is the case, I think setting "http_proxy" is not needed.<br>
<br>For more details of the "http_proxy" interactions with GTK+, please see the source-code of webkit, in particular<br><a href="http://svn.webkit.org/repository/webkit/trunk/Tools/GtkLauncher/main.c">http://svn.webkit.org/repository/webkit/trunk/Tools/GtkLauncher/main.c</a> <br>
<br><br> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So, now for my final patch. After having my a) patch working, I took<br>
another path using the convenient way GSettings provides to bind<br>
widgets and settings:<br>
<br>
<a href="https://developer.gnome.org/gio/stable/GSettings.html#g-settings-bind" target="_blank">https://developer.gnome.org/gio/stable/GSettings.html#g-settings-bind</a><br>
<br>
The adventages can be seen in the ~100 lines removed. There is...<br>
<br>
- no need for a mixin class,<br>
<br>
- no need for connecting callbacks to signals between widgets and<br>
settings in both directions<br>
<br>
- no need to implement get_value_for_gsettings /<br>
set_value_from_gsettings for each widget. Sasha's gconf<br>
implementation needed a big hierarchy of classes to archive this.<br>
<br>
- no need to test the key type to map the corresponding getter ('s' to<br>
use get_string(), for example, compare with my a) patch)<br></blockquote><div><br><br>These look good !!!<br><br><br> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
So, I welcome testing in different proxy scenarios for my patch.<br>
Thanks a lot Ajay for your contributed work, which I took as basement.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
.. manuq ..<br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br><font face="arial, sans-serif">Regards,<br><br>Ajay Garg</font><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><font face="arial, sans-serif">Dextrose Developer</font><br style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Activity Central: </span><a href="http://activitycentral.com/" style="font-family:arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)" target="_blank">http://activitycentral.com</a>