[master 1/1] Cancel Container Edit Sensitizes Update (#1168656)

kellinm installerbot-noreply at redhat.com
Tue Jul 28 18:32:25 UTC 2015


From: Robert Marshall <rmarshall at redhat.com>

Settings" button in the custom partition screen would
activate after a user attempted to create a new volume and then
pressed the cancel button. This patch removes the double event
handler which had the unintended side effect of setting the
sensitive property to True no matter what happened in the
container editor dialog box.

Resolves: rhbz#1168656
---
 pyanaconda/ui/gui/spokes/custom.glade |  1 -
 pyanaconda/ui/gui/spokes/custom.py    | 12 +++++++++---
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 2de2172..5cc6a89 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -808,7 +808,6 @@
                                                         <property name="can_focus">False</property>
                                                         <property name="model">containerStore</property>
                                                         <signal name="changed" handler="on_container_changed" swapped="no"/>
-                                                        <signal name="changed" handler="on_value_changed" swapped="no"/>
                                                         <child>
                                                           <object class="GtkCellRendererText" id="descRenderer">
                                                             <property name="ellipsize">middle</property>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index bf5ae00..3560e41 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2176,13 +2176,15 @@ def on_container_changed(self, combo):
         container_type_name = _(get_container_type(device_type).name).lower()
         new_text = _(NEW_CONTAINER_TEXT) % {"container_type": container_type_name}
         create_new_container = container_name == new_text
+        user_changed_container = True
         if create_new_container:
             # run the vg editor dialog with a default name and disk set
             hostname = self.data.network.hostname
             name = self._storage_playground.suggestContainerName(hostname=hostname)
-            new = self.run_container_editor(name=name)
+            # user_changed_container flips to False if "cancel" picked
+            user_changed_container = self.run_container_editor(name=name)
             for idx, data in enumerate(self._containerStore):
-                if new and data[0] == new_text:
+                if user_changed_container and data[0] == new_text:
                     c = self._storage_playground.devicetree.getDeviceByName(self._device_container_name)
                     freeSpace = getattr(c, "freeSpace", None)
                     row = self._container_store_row(self._device_container_name, freeSpace)
@@ -2190,12 +2192,16 @@ def on_container_changed(self, combo):
                     self._containerStore.insert(idx, row)
                     combo.set_active(idx)   # triggers a call to this method
                     return
-                elif not new and data[0] == self._device_container_name:
+                elif not user_changed_container and data[0] == self._device_container_name:
                     combo.set_active(idx)
                     return
+        # else clause runs if an already existing container is picked
         else:
             self._device_container_name = container_name
 
+        if user_changed_container:
+            self._applyButton.set_sensitive(True)
+
         container = self._storage_playground.devicetree.getDeviceByName(self._device_container_name)
         container_exists = getattr(container, "exists", False)    # might not be in the tree
 


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


More information about the anaconda-patches mailing list