[PATCH 2/5] Only save changes if needed when adding mountpoint

Vratislav Podzimek vpodzime at redhat.com
Fri Apr 11 09:28:08 UTC 2014


If there are no changes to be saved, it's not necessary to call the code saving
them. Also we should only reset the back_already_clicked flag if some mountpoint
was actually added.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/custom.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index d8223b1..04339e1 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1501,8 +1501,9 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         NormalSpoke.on_back_clicked(self, button)
 
     def on_add_clicked(self, button):
-        self._save_right_side(self._current_selector)
-        self._back_already_clicked = False
+        if self._addButton.get_sensitive():
+            self._save_right_side(self._current_selector)
+            self._back_already_clicked = False
 
         dialog = AddDialog(self.data,
                            mountpoints=self._storage_playground.mountpoints.keys())
@@ -1515,6 +1516,8 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
                 dialog.window.destroy()
                 return
 
+        self._back_already_clicked = False
+
         # create a device of the default type, using any disks, with an
         # appropriate fstype and mountpoint
         mountpoint = dialog.mountpoint
-- 
1.9.0



More information about the anaconda-patches mailing list