Skip to content

Commit

Permalink
Prevent Storage spoke Done button method from multiple launch
Browse files Browse the repository at this point in the history
This happens when user clicking on Done button very fast.

Add flag which is reset when user enter the storage spoke.
  • Loading branch information
jkonecny12 committed Mar 25, 2015
1 parent 9c40bff commit f4cb311
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pyanaconda/ui/gui/spokes/storage.py
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

1 comment on commit f4cb311

@vpodzime
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think self.back_clicked would be a better name.

Please sign in to comment.