[master 2/2] Prevent Storage spoke Done button method from multiple launch

jkonecny12 installerbot-noreply at redhat.com
Wed Mar 25 11:07:15 UTC 2015


From: Jiri Konecny <jkonecny at redhat.com>

This happens when user clicking on Done button very fast.

Add flag which is reset when user enter the storage spoke.
---
 pyanaconda/ui/gui/spokes/storage.py | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 1154297..5dc1c70 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -250,6 +250,7 @@ def __init__(self, *args, **kwargs):
         self.encrypted = False
         self.passphrase = ""
         self.selected_disks = self.data.ignoredisk.onlyuse[:]
+        self.backclicked = False
 
         # This list contains all possible disks that can be included in the install.
         # All types of advanced disks should be set up for us ahead of time, so
@@ -461,6 +462,8 @@ def _on_disk_focus_in(self, overview, event):
     def refresh(self):
         self.disks = getDisks(self.storage.devicetree)
 
+        self.backclicked = False
+
         # synchronize our local data store with the global ksdata
         disk_names = [d.name for d in self.disks]
         # don't put disks with hidden formats in selected_disks
@@ -734,6 +737,13 @@ def on_back_clicked(self, button):
         # user might want to change settings presented in the dialogs shown from
         # within this method.
 
+        # Do not enter this method multiple times if user clicking multiple times
+        # on back button
+        if self.backclicked:
+            return
+        else:
+            self.backclicked = True
+
         # Remove all non-existing devices if autopart was active when we last
         # refreshed.
         if self._previous_autopart:


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


More information about the anaconda-patches mailing list