[Sugar-devel] [DESIGN] Feature "Enhanced support for 3G modems"

Miguel González migonzalvar at activitycentral.com
Wed Jul 3 13:02:52 EDT 2013


I fixed combo and its label expansion so now they are corrected aligned
with entries below. See attached screenshot.

This change is pushed on the same previous pull request [1]. It could be
squashed with previous commit so I could send a new pull request if needed.


About the top label, it already has line-wrap set to True. I tried to force
to wrap at 70 chars. My Gtk skills wasn't good enough so I came around to
texwrap Python module. There is the patch and I attached a screenshot:

diff --git a/extensions/cpsection/modemconfiguration/view.py
b/extensions/cpsection/modemconfiguration/view.py
index 331f717..ccdb96b 100644
--- a/extensions/cpsection/modemconfiguration/view.py
+++ b/extensions/cpsection/modemconfiguration/view.py
@@ -18,6 +18,7 @@
 # along with this program; if not, write to the Free Software
 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  US

+import textwrap
 from gettext import gettext as _

 from gi.repository import Gtk
@@ -93,7 +94,7 @@ class ModemConfiguration(SectionView):
         explanation = _('You will need to provide the following
information'
                         ' to set up a mobile broadband connection to a'
                         ' cellular (3G) network.')
-        self._text = Gtk.Label(label=explanation)
+        self._text = Gtk.Label(label=textwrap.fill(explanation))
         self._text.set_line_wrap(True)
         self._text.set_alignment(0, 0)
         main_box.pack_start(self._text, True, False, 0)

Implementation apart, IMO the result is not much better so I *discarded*
this patch.


[1]: https://github.com/sugarlabs/sugar/pull/46



On Tue, Jul 2, 2013 at 10:49 PM, Miguel González <
migonzalvar at activitycentral.com> wrote:

> Hello,
>
> I've just send a pull request with the implementation of 3G database
> support in control panel modem configuration section.
>
> https://github.com/sugarlabs/sugar/pull/46
>
> In this email, I'm attaching  a screenshot to review UI design.
>
> About the implementation, some highlights:
>
> - There is a new config.py file with constants: file paths and GConf keys.
>
> - It uses GConf keys to persistently store country, provider and plan
> selections
>
> - In model.py a class controller retrieve data form XML and store
> selections on GConf
>
> - In the view.py, adds a new ScrolledWindow with an upper box for 3 combo
> provider selection, a separator and a lower box with the previous entries
> for network settings.
>
> - When a plan is selected, network settings are changed using the same
> methods.
>
>
> I have some concerns:
>
> - Is the GUI correct?
>
> - File paths should be move to a template config.py.in file?
>
> - I have kind of unitary tests for ServiceProviderDatabase class but I
> don't know exactly where to put them. They use mock library to simulate
> GConf calls.
>
> - Is it necessary to write functional test for view? Is there information
> about how to do it?
>
>
> Thank you for your attention.
> --
> Miguel González
> Activity Central: http://www.activitycentral.com
>



-- 
Miguel González
Activity Central: http://www.activitycentral.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130703/8c1e688e/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3g-database-support-screenshot_3.png
Type: image/png
Size: 36141 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130703/8c1e688e/attachment-0002.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 3g-database-support-textwrap.png
Type: image/png
Size: 36694 bytes
Desc: not available
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20130703/8c1e688e/attachment-0003.png>


More information about the Sugar-devel mailing list