[PATCH] Do not accept changes if the user presses Esc on summary screen.

David Shea dshea at redhat.com
Tue Oct 1 19:45:06 UTC 2013


On 10/01/2013 11:54 AM, mulhern wrote:
> Resolves: rhel7#998384
>
> Changed summary.glade file so it returns numeric value for GTK_RESPONSE_CANCEL
> for Cancel button and numeric value for GTK_RESPONSE_ACCEPT for Accept button.
>
> Changed custom.py so returns to custom screen unless return code from summary
> screen is GTK_RESPONSE_ACCEPT.
>
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>   pyanaconda/ui/gui/spokes/custom.py         | 2 +-
>   pyanaconda/ui/gui/spokes/lib/summary.glade | 4 ++--
>   2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
> index 8a2b9cd..64abc1d 100644
> --- a/pyanaconda/ui/gui/spokes/custom.py
> +++ b/pyanaconda/ui/gui/spokes/custom.py
> @@ -1882,7 +1882,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
>               dialog.refresh(self.__storage.devicetree.findActions())
>               rc = dialog.run()
>   
> -        if rc == 0:
> +        if rc != int(Gtk.ResponseType.ACCEPT):
There's an extra space at the end of this line. You don't really need 
the cast, either: the introspected enumerator values behave like longs 
as far as __cmp__ is concerned.

Other than that the patch looks fine.
>               # Cancel.  Stay on the custom screen.
>               return
>   
> diff --git a/pyanaconda/ui/gui/spokes/lib/summary.glade b/pyanaconda/ui/gui/spokes/lib/summary.glade
> index 3d020e8..aba4914 100644
> --- a/pyanaconda/ui/gui/spokes/lib/summary.glade
> +++ b/pyanaconda/ui/gui/spokes/lib/summary.glade
> @@ -197,8 +197,8 @@
>         </object>
>       </child>
>       <action-widgets>
> -      <action-widget response="0">summaryCancelButton</action-widget>
> -      <action-widget response="1">summaryAcceptButton</action-widget>
> +      <action-widget response="-6">summaryCancelButton</action-widget>
> +      <action-widget response="-3">summaryAcceptButton</action-widget>
>       </action-widgets>
>     </object>
>   </interface>



More information about the anaconda-patches mailing list