The volume label can be set in the modify volume dialog.
---
pyanaconda/ui/gui/spokes/custom.py | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 0f270b3..ac006f9 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1634,12 +1634,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._mountPointEntry.set_text(getattr(device.format, "mountpoint",
"") or "")
fancy_set_sensitive(self._mountPointEntry, device.format.mountable)
- # FIXME: Make sure you cannot set a label for specific btrfs subvols
self._labelEntry.set_text(getattr(device.format, "label", "")
or "")
# We could label existing formats that have a labelFsProg if we added an
# ActionLabelFormat class.
can_label = (hasattr(device.format, "label") and
- not device.format.exists)
+ not device.format.exists and
+ device.format.type != "btrfs")
fancy_set_sensitive(self._labelEntry, can_label)
if hasattr(device.format, "label"):
@@ -2495,7 +2495,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
label_active = active
if active:
fmt = getFormat(self._fsCombo.get_active_text())
- label_active = active and hasattr(fmt, "label")
+ label_active = (active and hasattr(fmt, "label") and
+ fmt.type != "btrfs")
fancy_set_sensitive(self._labelEntry, label_active)
@@ -2509,8 +2510,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
log.debug("fs type changed: %s" % new_type)
fmt = getFormat(new_type)
# FIXME: can't set a label on an existing format as of now
- fancy_set_sensitive(self._labelEntry, self._reformatCheckbox.get_active() and
- hasattr(fmt, "label"))
+ label_active = (self._reformatCheckbox.get_active() and
+ hasattr(fmt, "label") and
+ fmt.type != "btrfs")
+ fancy_set_sensitive(self._labelEntry, label_active)
fancy_set_sensitive(self._mountPointEntry, fmt.mountable)
def _populate_container(self, device=None):
--
1.8.1.4
Show replies by date
---
pyanaconda/ui/gui/spokes/custom.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index ac006f9..75b7556 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2265,6 +2265,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# until there's a setter for btrfs volume name
container._name = self._device_container_name
+ if container.format.type == "btrfs":
+ container.format.label = self._device_container_name
container_exists = getattr(container, "exists", False)
container_combo = self.builder.get_object("containerCombo")
--
1.8.1.4
This is mostly for switching a device from btrfs to lvm.
---
pyanaconda/ui/gui/spokes/custom.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 75b7556..1dbfee6 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1241,6 +1241,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
changed_container_encrypted = (container_encrypted != old_container_encrypted)
container_raid_level = self._device_container_raid_level
+ if container_raid_level == "single" and device_type !=
DEVICE_TYPE_BTRFS:
+ container_raid_level = None
+
log.debug("old container raid level: %s" % old_container_raid_level)
log.debug("new container raid level: %s" % container_raid_level)
changed_container_raid_level = (old_container_raid_level !=
container_raid_level)
--
1.8.1.4
The volume size can be managed via the "Modify container" dialog.
---
pyanaconda/ui/gui/spokes/custom.py | 20 ++++++++++++++------
1 file changed, 14 insertions(+), 6 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 1dbfee6..71d4931 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1651,12 +1651,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._labelEntry.set_tooltip_text(_("This file system does not support
labels."))
self._sizeEntry.set_text(Size(spec="%d MB" %
device.size).humanReadable(max_places=None))
- fancy_set_sensitive(self._sizeEntry, device.resizable or not device.exists)
-
- if self._sizeEntry.get_sensitive():
- self._sizeEntry.props.has_tooltip = False
- else:
- self._sizeEntry.set_tooltip_text(_("This file system may not be
resized."))
self._reformatCheckbox.set_active(not device.format.exists)
fancy_set_sensitive(self._reformatCheckbox, not device.protected and
@@ -1807,6 +1801,19 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# you can't encrypt a btrfs subvolume -- only the volume/container
fancy_set_sensitive(self._encryptCheckbox, device_type != DEVICE_TYPE_BTRFS)
+ # The size entry is only sensitive for resizable existing devices and
+ # new devices that are not btrfs subvolumes.
+ # Do this after the device type combo is set since
+ # on_device_type_changed doesn't account for device existence.
+ fancy_set_sensitive(self._sizeEntry, device.resizable or (not device.exists and
device.format.type != "btrfs"))
+
+ if self._sizeEntry.get_sensitive():
+ self._sizeEntry.props.has_tooltip = False
+ elif device.format.type == "btrfs":
+ self._sizeEntry.set_tooltip_text(_("The space available to this
mountpoint can be changed by modifying the volume below."))
+ else:
+ self._sizeEntry.set_tooltip_text(_("This file system may not be
resized."))
+
self._populate_raid(raid_level)
self._populate_container(device=use_dev)
# do this last in case this was set sensitive in on_device_type_changed
@@ -2640,6 +2647,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
fancy_set_sensitive(self._nameEntry, new_type in (DEVICE_TYPE_BTRFS,
DEVICE_TYPE_LVM, DEVICE_TYPE_MD))
self._nameEntry.set_text(self._device_name_dict[new_type])
+ fancy_set_sensitive(self._sizeEntry, new_type != DEVICE_TYPE_BTRFS)
# begin btrfs magic
model = self._fsCombo.get_model()
--
1.8.1.4
---
pyanaconda/ui/gui/spokes/custom.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 71d4931..5325c9b 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2184,6 +2184,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self.window.show_all()
return
+ if set(disks) != self._device_disks:
+ self._applyButton.set_sensitive(True)
+
self._device_disks = disks
self._populate_raid(self._get_raid_level())
@@ -2240,7 +2243,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
if (set(disks) != set(self._device_disks) or
name != container_name or
dialog.raid_level != self._device_container_raid_level or
- dialog.encrypted != self._device_container_encrypted):
+ dialog.encrypted != self._device_container_encrypted or
+ dialog.size_policy != self._device_container_size):
self._applyButton.set_sensitive(True)
log.debug("new container raid level: %s" % dialog.raid_level)
--
1.8.1.4
Some of the options are only presented in the dialogs that get shown
when leaving the storage spoke. We can't skip those without locking
users into the choices they made the first time through.
---
pyanaconda/ui/gui/spokes/storage.py | 24 +++---------------------
1 file changed, 3 insertions(+), 21 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 3082130..501d9b1 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -334,8 +334,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self.clearPartType = CLEARPART_TYPE_NONE
self._previous_autopart = False
- self._initial_selected_disks = []
- self._initial_bootloader_disk = None
self._last_clicked_overview = None
self._cur_clicked_overview = None
@@ -412,15 +410,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
hubQ.send_ready(self.__class__.__name__, True)
@property
- def changed(self):
- disksChanged = set(self._initial_selected_disks) != set(self.selected_disks)
- bootloaderChanged = not bool(self.data.bootloader.bootDrive) or \
- self._initial_bootloader_disk !=
self.data.bootloader.bootDrive
- autopartChanged = self.autopart != self.data.autopart.autopart
-
- return disksChanged or bootloaderChanged or autopartChanged
-
- @property
def completed(self):
retval = (threadMgr.get(constants.THREAD_EXECUTE_STORAGE) is None and
threadMgr.get(constants.THREAD_CHECK_STORAGE) is None and
@@ -573,12 +562,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
self._update_summary()
- # This list is used to determine if anything has changed in storage
- # configuration since the user entered the spoke. If not, we shouldn't
- # do anything when Done is clicked.
- self._initial_selected_disks = self.selected_disks[:]
- self._initial_bootloader_disk = self.data.bootloader.bootDrive
-
if self.errors:
self.set_warning(_("Error checking storage configuration. Click for
details."))
elif self.warnings:
@@ -766,10 +749,9 @@ class StorageSpoke(NormalSpoke, StorageChecker):
return True
def on_back_clicked(self, button):
- # Did the user change anything? If not, this method is a no-op.
- if not self.changed and self.autopart:
- NormalSpoke.on_back_clicked(self, button)
- return
+ # We can't exit early if it looks like nothing has changed because the
+ # user might want to change settings presented in the dialogs shown from
+ # within this method.
# Remove all non-existing devices if autopart was active when we last
# refreshed.
--
1.8.1.4
This was causing unnecessary churn in addition to hiding error messages.
---
pyanaconda/ui/gui/spokes/custom.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 5325c9b..6ee8ff5 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -959,7 +959,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
self._initialized = True
firstPage = self._accordion.allPages[0]
self._accordion.expandPage(firstPage.pageTitle)
- self.on_page_clicked(firstPage, mountpointToShow=mountpointToShow)
+ self._show_mountpoint(page=firstPage, mountpoint=mountpointToShow)
self._applyButton.set_sensitive(False)
@@ -2349,7 +2349,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
return
# Take care of the previously chosen selector.
- if self._current_selector and self._initialized:
+ if self._current_selector and self._initialized and \
+ self._current_selector != selector:
self._save_current_selector()
log.debug("new selector: %s" % selector._device)
--
1.8.1.4
Ack to all of these.
--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)