diff options
-rwxr-xr-x | gui.py | 6 | ||||
-rw-r--r-- | iw/partition_gui.py | 8 | ||||
-rw-r--r-- | partitioning.py | 14 | ||||
-rw-r--r-- | text.py | 8 | ||||
-rw-r--r-- | textw/partition_text.py | 6 |
5 files changed, 32 insertions, 10 deletions
@@ -241,7 +241,7 @@ class MessageWindow: def getrc (self): return self.rc - def __init__ (self, title, text, type="ok"): + def __init__ (self, title, text, type="ok", default=None): if flags.autostep: print title, text, type self.rc = 1 @@ -299,8 +299,8 @@ class InstallInterface: self.ppw.setSizes (total, totalSize) return self.ppw - def messageWindow(self, title, text, type="ok"): - rc = MessageWindow (title, text, type).getrc() + def messageWindow(self, title, text, type="ok", default = None): + rc = MessageWindow (title, text, type, default).getrc() return rc def exceptionWindow(self, title, text): diff --git a/iw/partition_gui.py b/iw/partition_gui.py index e0c85e713..1d615f8e2 100644 --- a/iw/partition_gui.py +++ b/iw/partition_gui.py @@ -858,8 +858,6 @@ class PartitionWindow(InstallWindow): formatrb.set_active(0) if origrequest.format: formatrb.set_active(1) - elif origrequest.format == None and not origrequest.migrate: - formatrb.set_active(isFormatOnByDefault(origrequest)) maintable.attach(formatrb, 0, 1, row, row + 1) (fstype, fstypeMenu) = createFSTypeMenu(ofstype,fstypechangeCB, @@ -1056,9 +1054,13 @@ class PartitionWindow(InstallWindow): "%s" % (err)) continue - if origrequest.format == None and request.format: + if not origrequest.format and request.format: if not queryFormatPreExisting(self.intf): continue + + if not request.format and request.mountpoint and isFormatOnByDefault(origrequest): + if not queryNoFormatPreExisting(self.intf): + continue # backup current (known working) configuration backpart = self.partitions.copy() diff --git a/partitioning.py b/partitioning.py index a0e4331d8..a70773698 100644 --- a/partitioning.py +++ b/partitioning.py @@ -1343,7 +1343,19 @@ def queryFormatPreExisting(intf): "partition. This will destroy all data " "that was previously on it.\n\n" "Are you sure you want to do this?"), - type = "yesno") + type = "yesno", default = "no") + return rc + +def queryNoFormatPreExisting(intf): + rc = intf.messageWindow(_("Format?"), + _("You have chosen not to format a pre-existing " + "partition which is being mounted as a " + "system directory. It is highly " + "recommended you format this partition to " + "guarantee the data formerly on the partition " + "does not corrupt your new installation.\n\n" + "Are you sure you want to do this?"), + type = "yesno", default = "no") return rc @@ -221,13 +221,17 @@ class InstallInterface: def progressWindow(self, title, text, total): return ProgressWindow(self.screen, _(title), _(text), total) - def messageWindow(self, title, text, type="ok"): + def messageWindow(self, title, text, type="ok", default = None): if type == "ok": ButtonChoiceWindow(self.screen, _(title), _(text), buttons=[TEXT_OK_BUTTON]) elif type == "yesno": + if default and default == "no": + btnlist = [TEXT_NO_BUTTON, TEXT_YES_BUTTON] + else: + btnlist = [TEXT_YES_BUTTON, TEXT_NO_BUTTON] rc = ButtonChoiceWindow(self.screen, _(title), _(text), - buttons=[TEXT_YES_BUTTON, TEXT_NO_BUTTON]) + buttons=btnlist) if rc == "yes": return 1 else: diff --git a/textw/partition_text.py b/textw/partition_text.py index efe93de09..6582b8798 100644 --- a/textw/partition_text.py +++ b/textw/partition_text.py @@ -706,10 +706,14 @@ class PartitionWindow: "%s" % (err)) continue - if origrequest.format == None and request.format: + if not origrequest.format and request.format: if not queryFormatPreExisting(self.intf): continue + if not request.format and request.mountpoint and isFormatOnByDefault(origrequest): + if not queryNoFormatPreExisting(self.intf): + continue + # backup current (known working) configuration backpart = self.partitions.copy() if origrequest.device or origrequest.type != REQUEST_NEW: |