[rhel7-branch 10/29] Mountpoint encrypted checkbox reflects container state (#1076171)

bcl installerbot-noreply at redhat.com
Wed Jun 3 00:36:42 UTC 2015


From: "Brian C. Lane" <bcl at redhat.com>

When the container is encrypted the mountpoint's encryption checkbox is
insensitive, but doesn't reflect the encrypted state. This changes the
checkbox so that when it the container is encrypted it will be
insensitive and checked as well as setting a tooltip saying "The
Container is encrypted."

Resolves: rhbz#1076171
(cherry picked from commit 067d5d9a16fa6ba71914838cdb77377b7652648f)

Related: rhbz#1196721
---
 pyanaconda/ui/gui/spokes/custom.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 5319c7c..bc3518f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -928,7 +928,7 @@ def _save_right_side(self, selector):
 
         # ENCRYPTION
         old_encrypted = isinstance(device, LUKSDevice)
-        encrypted = self._encryptCheckbox.get_active()
+        encrypted = self._encryptCheckbox.get_active() and self._encryptCheckbox.is_sensitive()
         changed_encryption = (old_encrypted != encrypted)
         old_device_info["encrypted"] = old_encrypted
         new_device_info["encrypted"] = encrypted
@@ -1406,6 +1406,10 @@ def _populate_right_side(self, selector):
             # The encryption checkbutton should not be sensitive if there is
             # existing encryption below the leaf layer.
             self._encryptCheckbox.set_sensitive(False)
+            self._encryptCheckbox.set_active(True)
+            self._encryptCheckbox.set_tooltip_text(_("The container is encrypted."))
+        else:
+            self._encryptCheckbox.set_tooltip_text("")
 
         # Set up the filesystem type combo.
         self._setup_fstype_combo(device)
@@ -2008,6 +2012,7 @@ def on_modify_container_clicked(self, button):
 
         log.debug("%s -> %s", container_name, self._device_container_name)
         if container_name == self._device_container_name:
+            self.on_apply_clicked(None)
             return
 
         log.debug("renaming container %s to %s", container_name, self._device_container_name)
@@ -2045,6 +2050,7 @@ def on_modify_container_clicked(self, button):
         self._containerStore.remove(self._containerStore.get_iter_from_string("%s" % (idx + 1)))
 
         self._update_selectors()
+        self.on_apply_clicked(None)
 
     def on_container_changed(self, combo):
         ndx = combo.get_active()


-- 
To view this commit on github, visit https://github.com/rhinstaller/anaconda/commit/e4d815241c3247edfe0b17800deb9332ce1b34b6


More information about the anaconda-patches mailing list