[Sugar-devel] [PATCH shell 3/3] Keydialog: various fixups

Manuel Quiñones manuq at laptop.org
Thu Sep 13 11:44:00 EDT 2012


Perfect, all good and well documented.  This bring back the password
dialog in the neighborhood, great.  Please push.

2012/9/13 Simon Schampijer <simon at schampijer.de>:
> From: Simon Schampijer <simon at laptop.org>
>
> - set_has_separator has been deprecated [1]
> - if we pass a model to the GtkCombobox we need to name the
>   argument [2]
> - pack_start: the convert script got confused here
>
> [1] http://www.pygtk.org/docs/pygtk/class-gtkdialog.html#method-gtkdialog--set-has-separator
> [2] http://developer.gnome.org/gtk3/3.4/GtkComboBox.html#gtk-combo-box-new-with-model
>
> Signed-off-by: Simon Schampijer <simon at laptop.org>
> ---
>  src/jarabe/desktop/keydialog.py | 11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/src/jarabe/desktop/keydialog.py b/src/jarabe/desktop/keydialog.py
> index cb84b4a..5215d05 100644
> --- a/src/jarabe/desktop/keydialog.py
> +++ b/src/jarabe/desktop/keydialog.py
> @@ -85,8 +85,6 @@ class KeyDialog(Gtk.Dialog):
>          self._rsn_flags = rsn_flags
>          self._dev_caps = dev_caps
>
> -        self.set_has_separator(False)
> -
>          display_name = network.ssid_to_display_name(ssid)
>          label = Gtk.Label(label=_("A wireless encryption key is required for\n"
>                              " the wireless network '%s'.") % (display_name, ))
> @@ -95,7 +93,6 @@ class KeyDialog(Gtk.Dialog):
>          self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
>                           Gtk.STOCK_OK, Gtk.ResponseType.OK)
>          self.set_default_response(Gtk.ResponseType.OK)
> -        self.set_has_separator(True)
>
>      def add_key_entry(self):
>          self._entry = Gtk.Entry()
> @@ -129,7 +126,7 @@ class WEPKeyDialog(KeyDialog):
>          self.key_store.append(['Hex (40/128-bit)', WEP_HEX])
>          self.key_store.append(['ASCII (40/128-bit)', WEP_ASCII])
>
> -        self.key_combo = Gtk.ComboBox(self.key_store)
> +        self.key_combo = Gtk.ComboBox(model=self.key_store)
>          cell = Gtk.CellRendererText()
>          self.key_combo.pack_start(cell, True)
>          self.key_combo.add_attribute(cell, 'text', 0)
> @@ -150,7 +147,7 @@ class WEPKeyDialog(KeyDialog):
>          self.auth_store.append(['Open System', IW_AUTH_ALG_OPEN_SYSTEM])
>          self.auth_store.append(['Shared Key', IW_AUTH_ALG_SHARED_KEY])
>
> -        self.auth_combo = Gtk.ComboBox(self.auth_store)
> +        self.auth_combo = Gtk.ComboBox(model=self.auth_store)
>          cell = Gtk.CellRendererText()
>          self.auth_combo.pack_start(cell, True)
>          self.auth_combo.add_attribute(cell, 'text', 0)
> @@ -222,14 +219,14 @@ class WPAKeyDialog(KeyDialog):
>          self.store = Gtk.ListStore(str)
>          self.store.append([_('WPA & WPA2 Personal')])
>
> -        self.combo = Gtk.ComboBox(self.store)
> +        self.combo = Gtk.ComboBox(model=self.store)
>          cell = Gtk.CellRendererText()
>          self.combo.pack_start(cell, True)
>          self.combo.add_attribute(cell, 'text', 0)
>          self.combo.set_active(0)
>
>          self.hbox = Gtk.HBox()
> -        self.hbox.pack_start(Gtk.Label(_('Wireless Security:', True, True, 0)))
> +        self.hbox.pack_start(Gtk.Label(_('Wireless Security:')), True, True, 0)
>          self.hbox.pack_start(self.combo, True, True, 0)
>          self.hbox.show_all()
>
> --
> 1.7.11.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel



-- 
.. manuq ..


More information about the Sugar-devel mailing list