[PATCH 2/4] Remember autopart UI choice when going back (#596146)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 iw/autopart_type.py |   17 +++++++++++------
 storage/__init__.py |    1 +
 2 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/iw/autopart_type.py b/iw/autopart_type.py
index 9134e68..7219403 100644
--- a/iw/autopart_type.py
+++ b/iw/autopart_type.py
@@ -148,6 +148,8 @@ class PartitionTypeWindow(InstallWindow):
         if self.storage.checkNoDisks():
             raise gui.StayOnScreen
 
+        self.storage.clearPartChoice = self.buttonGroup.getCurrent()
+
         if self.buttonGroup.getCurrent() == "custom":
             self.dispatch.skipStep("autopartitionexecute", skip = 1)
             self.dispatch.skipStep("partition", skip = 0)
@@ -265,12 +267,15 @@ class PartitionTypeWindow(InstallWindow):
         self.table.attach(widget, 0, 1, 1, 2)
 
         # if not set in ks, use UI default
-        if self.storage.clearPartType is None or self.storage.clearPartType == CLEARPART_TYPE_LINUX:
-            self.buttonGroup.setCurrent("replace")
-        elif self.storage.clearPartType == CLEARPART_TYPE_NONE:
-            self.buttonGroup.setCurrent("freespace")
-        elif self.storage.clearPartType == CLEARPART_TYPE_ALL:
-            self.buttonGroup.setCurrent("all")
+        if self.storage.clearPartChoice:
+            self.buttonGroup.setCurrent(self.storage.clearPartChoice)
+        else:
+            if self.storage.clearPartType is None or self.storage.clearPartType == CLEARPART_TYPE_LINUX:
+                self.buttonGroup.setCurrent("replace")
+            elif self.storage.clearPartType == CLEARPART_TYPE_NONE:
+                self.buttonGroup.setCurrent("freespace")
+            elif self.storage.clearPartType == CLEARPART_TYPE_ALL:
+                self.buttonGroup.setCurrent("all")
 
         if self.buttonGroup.getCurrent() == "custom":
             # make sure reviewButton is active and not sensitive
diff --git a/storage/__init__.py b/storage/__init__.py
index c7863e0..dfe8a78 100644
--- a/storage/__init__.py
+++ b/storage/__init__.py
@@ -251,6 +251,7 @@ class Storage(object):
         self.doAutoPart = False
         self.clearPartType = None
         self.clearPartDisks = []
+        self.clearPartChoice = None
         self.encryptedAutoPart = False
         self.encryptionPassphrase = None
         self.autoPartEscrowCert = None
-- 
1.7.0.1

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux