From 23406eb604055a68d0ee3c0ff9133bfa8c914184 Mon Sep 17 00:00:00 2001
From: Simon Schampijer <simon@schampijer.de>
Date: Mon, 1 Mar 2010 17:34:47 +0100
Subject: [PATCH 3/3] 3G - cleanup layout in control panel section #1768
Organization: Sugar Labs Foundation

---
 extensions/cpsection/modemconfiguration/view.py |   33 ++++++++++++++++++-----
 1 files changed, 26 insertions(+), 7 deletions(-)

diff --git a/extensions/cpsection/modemconfiguration/view.py b/extensions/cpsection/modemconfiguration/view.py
index 2445005..b236f3f 100644
--- a/extensions/cpsection/modemconfiguration/view.py
+++ b/extensions/cpsection/modemconfiguration/view.py
@@ -37,11 +37,12 @@ class EntryWithLabel(gtk.HBox):
         self._changed_handler = None
         self._is_valid = True
 
-        label = gtk.Label(label_text)
-        label.modify_fg(gtk.STATE_NORMAL,
+        self.label = gtk.Label(label_text)
+        self.label.modify_fg(gtk.STATE_NORMAL,
                         style.COLOR_SELECTION_GREY.get_gdk_color())
-        self.pack_start(label, True, True)
-        label.show()
+        self.label.set_alignment(1, 0.5)
+        self.pack_start(self.label, expand=False)
+        self.label.show()
 
         self._entry = gtk.Entry(25)
         self._entry.connect('changed', self.__entry_changed_cb)
@@ -120,7 +121,7 @@ class NumberEntry(EntryWithLabel):
 
 class ApnEntry(EntryWithLabel):
     def __init__(self, model):
-        EntryWithLabel.__init__(self, _('APN:'))
+        EntryWithLabel.__init__(self, _('Access Point Name (APN):'))
         self._model = model
 
     def get_value(self):
@@ -131,7 +132,7 @@ class ApnEntry(EntryWithLabel):
 
 class PinEntry(EntryWithLabel):
     def __init__(self, model):
-        EntryWithLabel.__init__(self, _('PIN:'))
+        EntryWithLabel.__init__(self, _('Personal Identity Number (PIN):'))
         self._model = model
 
     def get_value(self):
@@ -142,7 +143,7 @@ class PinEntry(EntryWithLabel):
 
 class PukEntry(EntryWithLabel):
     def __init__(self, model):
-        EntryWithLabel.__init__(self, _('PUK:'))
+        EntryWithLabel.__init__(self, _('Personal Unblocking Key (PUK):'))
         self._model = model
 
     def get_value(self):
@@ -161,40 +162,58 @@ class ModemConfiguration(SectionView):
 
         self.set_border_width(style.DEFAULT_SPACING)
         self.set_spacing(style.DEFAULT_SPACING)
+        self._group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
+
+        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(explanation)
+        self._text.set_width_chars(100)
+        self._text.set_line_wrap(True)
+        self._text.set_alignment(0, 0)
+        self.pack_start(self._text, False)
+        self._text.show()
 
         self._username_entry = UsernameEntry(model)
         self._username_entry.connect('notify::is-valid',
                                      self.__notify_is_valid_cb)
+        self._group.add_widget(self._username_entry.label)
         self.pack_start(self._username_entry, expand=False)
         self._username_entry.show()
 
         self._password_entry = PasswordEntry(model)
         self._password_entry.connect('notify::is-valid',
                                      self.__notify_is_valid_cb)
+        self._group.add_widget(self._password_entry.label)
         self.pack_start(self._password_entry, expand=False)
         self._password_entry.show()
 
         self._number_entry = NumberEntry(model)
         self._number_entry.connect('notify::is-valid',
                                    self.__notify_is_valid_cb)
+        self._group.add_widget(self._number_entry.label)
         self.pack_start(self._number_entry, expand=False)
         self._number_entry.show()
 
         self._apn_entry = ApnEntry(model)
         self._apn_entry.connect('notify::is-valid',
                                 self.__notify_is_valid_cb)
+        self._group.add_widget(self._apn_entry.label)
         self.pack_start(self._apn_entry, expand=False)
         self._apn_entry.show()
 
         self._pin_entry = PinEntry(model)
         self._pin_entry.connect('notify::is-valid',
                                 self.__notify_is_valid_cb)
+        self._group.add_widget(self._pin_entry.label)
         self.pack_start(self._pin_entry, expand=False)
         self._pin_entry.show()
         
         self._puk_entry = PukEntry(model)
         self._puk_entry.connect('notify::is-valid',
                                 self.__notify_is_valid_cb)
+        self._group.add_widget(self._puk_entry.label)
         self.pack_start(self._puk_entry, expand=False)        
         self._puk_entry.show()
 
-- 
1.6.6.1

