[PATCH 2/2] More changes to leave the spoke via a glib idle call, not calling directly.

Vratislav Podzimek vpodzime at redhat.com
Fri Nov 16 13:22:49 UTC 2012


On Thu, 2012-11-15 at 17:16 -0500, Chris Lumens wrote:
> These may not fix anything we've got right now, but it's the more correct
> way to do it.
> ---
>  pyanaconda/ui/gui/spokes/storage.py | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
> index c5b7fcf..f78100b 100644
> --- a/pyanaconda/ui/gui/spokes/storage.py
> +++ b/pyanaconda/ui/gui/spokes/storage.py
> @@ -706,14 +706,14 @@ class StorageSpoke(NormalSpoke, StorageChecker):
>  
>                  self.passphrase = dialog.passphrase
>  
> -            self.on_back_clicked(self.window)
> +            GLib.idle_add(self._leave_spoke)
>          elif rc == dialog.RESPONSE_CANCEL:
>              # stay on this spoke
>              print "user chose to continue disk selection"
>          elif rc == dialog.RESPONSE_MODIFY_SW:
>              # go to software spoke
>              self.skipTo = "SoftwareSelectionSpoke"
> -            self.on_back_clicked(self.window)
> +            GLib.idle_add(self._leave_spoke)
>          elif rc == dialog.RESPONSE_RECLAIM:
>              self.autopart = not dialog.custom
>              self.autoPartType = dialog.autoPartType
> @@ -725,7 +725,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
>  
>              if dialog.custom:
>                  self.skipTo = "CustomPartitioningSpoke"
> -                self.on_back_clicked(self.window)
> +                GLib.idle_add(self._leave_spoke)
>              else:
>                  if self.encrypted:
>                      dialog = PassphraseDialog(self.data)
> @@ -747,6 +747,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
>          # resizeDialog handles okay/cancel on its own, so we can throw out the
>          # return value.
>          self.run_lightbox_dialog(resizeDialog)
> +        GLib.idle_add(self._leave_spoke)
> +        return False
> +
> +    def _leave_spoke(self):
>          self.window.emit("button-clicked")
>          return False
Could you please replace GLib.idle_add with gtk_call_once? I know it
does the same with the function always returning False, but we never
know what happens to _leave_spoke or GLib.idle_add in the future.
Otherwise it looks good to me.

-- 
Vratislav Podzimek

Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic



More information about the anaconda-patches mailing list