Martin Kolman 3be455
From 8b45aa82bcdee9c5ea19d21ae74f988fee7c1d17 Mon Sep 17 00:00:00 2001
Martin Kolman 3be455
From: Martin Kolman <mkolman@redhat.com>
Martin Kolman 3be455
Date: Thu, 15 Mar 2018 14:35:56 +0100
Martin Kolman 3be455
Subject: [PATCH 2/2] Don't autoquit by default if the last hub is empty
Martin Kolman 3be455
 (#1553935)
Martin Kolman 3be455
Martin Kolman 3be455
With the Reduce Initial Setup Redundancy change[0] in F28
Martin Kolman 3be455
we now encounter an edge case during the Fedora Workstation Live
Martin Kolman 3be455
installation which Anaconda does not handle particularly well.
Martin Kolman 3be455
Martin Kolman 3be455
There are no longer any spokes on the progress hub, which triggers
Martin Kolman 3be455
a piece of code originally added for Initial Setup, which autoclicks
Martin Kolman 3be455
the continue button, effectively quiting the installation as there are
Martin Kolman 3be455
no more hubs present.
Martin Kolman 3be455
Martin Kolman 3be455
While this actually does not influence the correctness of the
Martin Kolman 3be455
installation (this only happens after a successfull installation),
Martin Kolman 3be455
it's a pretty bad UX and as reported by Adam Wiliamson complicates
Martin Kolman 3be455
Open QA based installation testing.
Martin Kolman 3be455
Martin Kolman 3be455
So add a new property for hubs that specifies if a hub should
Martin Kolman 3be455
automaqtically continue if no spokes are present. This property
Martin Kolman 3be455
will be False by defaul but Initial Setup is expected to set it
Martin Kolman 3be455
to True for it's own hub.
Martin Kolman 3be455
Martin Kolman 3be455
Resolves: rhbz#1553935
Martin Kolman 3be455
Martin Kolman 3be455
[0] https://fedoraproject.org/wiki/Changes/ReduceInitialSetupRedundancy
Martin Kolman 3be455
---
Martin Kolman 3be455
 pyanaconda/ui/gui/hubs/__init__.py | 7 ++++++-
Martin Kolman 3be455
 1 file changed, 6 insertions(+), 1 deletion(-)
Martin Kolman 3be455
Martin Kolman 3be455
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
Martin Kolman 3be455
index 3c82b471c..cfbdc8820 100644
Martin Kolman 3be455
--- a/pyanaconda/ui/gui/hubs/__init__.py
Martin Kolman 3be455
+++ b/pyanaconda/ui/gui/hubs/__init__.py
Martin Kolman 3be455
@@ -59,6 +59,11 @@ class Hub(GUIObject, common.Hub):
Martin Kolman 3be455
     handles_autostep = True
Martin Kolman 3be455
     _hubs_collection = []
Martin Kolman 3be455
 
Martin Kolman 3be455
+    # Should we automatically go to next hub if processing is done and there are no
Martin Kolman 3be455
+    # spokes on the hub ? The default value is False and Initial Setup will likely
Martin Kolman 3be455
+    # override it to True in it's hub.
Martin Kolman 3be455
+    continue_if_empty = False
Martin Kolman 3be455
+
Martin Kolman 3be455
     def __init__(self, data, storage, payload, instclass):
Martin Kolman 3be455
         """Create a new Hub instance.
Martin Kolman 3be455
 
Martin Kolman 3be455
@@ -286,7 +291,7 @@ class Hub(GUIObject, common.Hub):
Martin Kolman 3be455
 
Martin Kolman 3be455
         q = hubQ.q
Martin Kolman 3be455
 
Martin Kolman 3be455
-        if not self._spokes and self.window.get_may_continue():
Martin Kolman 3be455
+        if not self._spokes and self.window.get_may_continue() and self.continue_if_empty:
Martin Kolman 3be455
             # no spokes, move on
Martin Kolman 3be455
             log.debug("no spokes available on %s, continuing automatically", self)
Martin Kolman 3be455
             gtk_call_once(self.window.emit, "continue-clicked")
Martin Kolman 3be455
-- 
Martin Kolman 3be455
2.14.3
Martin Kolman 3be455