From 470be04f460e0b607b5dd7ca1114dbf672e6d124 Mon Sep 17 00:00:00 2001 From: Michael Hudson-Doyle Date: Fri, 20 Mar 2020 10:12:48 +1300 Subject: [PATCH] don't offer tiny disks for the guided options --- subiquity/ui/views/filesystem/guided.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/subiquity/ui/views/filesystem/guided.py b/subiquity/ui/views/filesystem/guided.py index dceb71fb..54950f9a 100644 --- a/subiquity/ui/views/filesystem/guided.py +++ b/subiquity/ui/views/filesystem/guided.py @@ -86,16 +86,22 @@ class GuidedChoiceForm(SubForm): super().__init__(parent) options = [] tables = [] + initial = -1 for disk in parent.model.all_disks(): for obj, cells in summarize_device(disk): table = TablePile([TableRow(cells)]) tables.append(table) - options.append(Option((table, obj is disk, obj))) + enabled = False + if obj is disk and disk.size > 6*(2**30): + enabled = True + if initial < 0: + initial = len(options) + options.append(Option((table, enabled, obj))) t0 = tables[0] for t in tables[1:]: t0.bind(t) self.disk.widget.options = options - self.disk.widget.index = 0 + self.disk.widget.index = initial connect_signal(self.use_lvm.widget, 'change', self._toggle) self.lvm_options.enabled = self.use_lvm.value