Ticket #1768: 1768_3G_cp_section_cleanup.patch

File 1768_3G_cp_section_cleanup.patch, 4.3 KB (added by erikos, 14 years ago)
  • extensions/cpsection/modemconfiguration/view.py

    diff --git a/extensions/cpsection/modemconfiguration/view.py b/extensions/cpsection/modemconfiguration/view.py
    index 2445005..b236f3f 100644
    a b class EntryWithLabel(gtk.HBox): 
    3737        self._changed_handler = None
    3838        self._is_valid = True
    3939
    40         label = gtk.Label(label_text)
    41         label.modify_fg(gtk.STATE_NORMAL,
     40        self.label = gtk.Label(label_text)
     41        self.label.modify_fg(gtk.STATE_NORMAL,
    4242                        style.COLOR_SELECTION_GREY.get_gdk_color())
    43         self.pack_start(label, True, True)
    44         label.show()
     43        self.label.set_alignment(1, 0.5)
     44        self.pack_start(self.label, expand=False)
     45        self.label.show()
    4546
    4647        self._entry = gtk.Entry(25)
    4748        self._entry.connect('changed', self.__entry_changed_cb)
    class NumberEntry(EntryWithLabel): 
    120121
    121122class ApnEntry(EntryWithLabel):
    122123    def __init__(self, model):
    123         EntryWithLabel.__init__(self, _('APN:'))
     124        EntryWithLabel.__init__(self, _('Access Point Name (APN):'))
    124125        self._model = model
    125126
    126127    def get_value(self):
    class ApnEntry(EntryWithLabel): 
    131132
    132133class PinEntry(EntryWithLabel):
    133134    def __init__(self, model):
    134         EntryWithLabel.__init__(self, _('PIN:'))
     135        EntryWithLabel.__init__(self, _('Personal Identity Number (PIN):'))
    135136        self._model = model
    136137
    137138    def get_value(self):
    class PinEntry(EntryWithLabel): 
    142143
    143144class PukEntry(EntryWithLabel):
    144145    def __init__(self, model):
    145         EntryWithLabel.__init__(self, _('PUK:'))
     146        EntryWithLabel.__init__(self, _('Personal Unblocking Key (PUK):'))
    146147        self._model = model
    147148
    148149    def get_value(self):
    class ModemConfiguration(SectionView): 
    161162
    162163        self.set_border_width(style.DEFAULT_SPACING)
    163164        self.set_spacing(style.DEFAULT_SPACING)
     165        self._group = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
     166
     167        explanation = _("You will need to provide the following " \
     168                            "information to set up a mobile " \
     169                            "broadband connection to a cellular "\
     170                            "(3G) network.")
     171        self._text = gtk.Label(explanation)
     172        self._text.set_width_chars(100)
     173        self._text.set_line_wrap(True)
     174        self._text.set_alignment(0, 0)
     175        self.pack_start(self._text, False)
     176        self._text.show()
    164177
    165178        self._username_entry = UsernameEntry(model)
    166179        self._username_entry.connect('notify::is-valid',
    167180                                     self.__notify_is_valid_cb)
     181        self._group.add_widget(self._username_entry.label)
    168182        self.pack_start(self._username_entry, expand=False)
    169183        self._username_entry.show()
    170184
    171185        self._password_entry = PasswordEntry(model)
    172186        self._password_entry.connect('notify::is-valid',
    173187                                     self.__notify_is_valid_cb)
     188        self._group.add_widget(self._password_entry.label)
    174189        self.pack_start(self._password_entry, expand=False)
    175190        self._password_entry.show()
    176191
    177192        self._number_entry = NumberEntry(model)
    178193        self._number_entry.connect('notify::is-valid',
    179194                                   self.__notify_is_valid_cb)
     195        self._group.add_widget(self._number_entry.label)
    180196        self.pack_start(self._number_entry, expand=False)
    181197        self._number_entry.show()
    182198
    183199        self._apn_entry = ApnEntry(model)
    184200        self._apn_entry.connect('notify::is-valid',
    185201                                self.__notify_is_valid_cb)
     202        self._group.add_widget(self._apn_entry.label)
    186203        self.pack_start(self._apn_entry, expand=False)
    187204        self._apn_entry.show()
    188205
    189206        self._pin_entry = PinEntry(model)
    190207        self._pin_entry.connect('notify::is-valid',
    191208                                self.__notify_is_valid_cb)
     209        self._group.add_widget(self._pin_entry.label)
    192210        self.pack_start(self._pin_entry, expand=False)
    193211        self._pin_entry.show()
    194212       
    195213        self._puk_entry = PukEntry(model)
    196214        self._puk_entry.connect('notify::is-valid',
    197215                                self.__notify_is_valid_cb)
     216        self._group.add_widget(self._puk_entry.label)
    198217        self.pack_start(self._puk_entry, expand=False)       
    199218        self._puk_entry.show()
    200219