本文整理汇总了Python中pyanaconda.ui.gui.spokes.NormalSpoke.on_back_clicked方法的典型用法代码示例。如果您正苦于以下问题:Python NormalSpoke.on_back_clicked方法的具体用法?Python NormalSpoke.on_back_clicked怎么用?Python NormalSpoke.on_back_clicked使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pyanaconda.ui.gui.spokes.NormalSpoke
的用法示例。
在下文中一共展示了NormalSpoke.on_back_clicked方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# Clear any existing errors
self.clear_errors()
# If back has been clicked on once already and no other changes made on the screen,
# run the storage check now. This handles displaying any errors in the info bar.
if not self._back_already_clicked:
self._back_already_clicked = True
# If we hit any errors while saving things above, stop and let the
# user think about what they have done
if self._error is not None:
return
if not self._do_check():
return
if len(self._storage_playground.devicetree.actions.find()) > 0:
dialog = ActionSummaryDialog(self.data)
dialog.refresh(self._storage_playground.devicetree.actions.find())
with self.main_window.enlightbox(dialog.window):
rc = dialog.run()
if rc != 1:
# Cancel. Stay on the blivet-gui screen.
return
else:
# remove redundant actions and sort them now
self._storage_playground.devicetree.actions.prune()
self._storage_playground.devicetree.actions.sort()
NormalSpoke.on_back_clicked(self, button)
示例2: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
if self._validatePassword():
self.clear_info()
NormalSpoke.on_back_clicked(self, button)
else:
self.clear_info()
self.set_warning(self._error)
self.pw.grab_focus()
self.window.show_all()
示例3: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
"""If the user entered duplicate repo names, keep them on the screen.
Otherwise, do the usual thing."""
ui_repo_names = [r[REPO_OBJ].name for r in self._repoStore]
if len(ui_repo_names) != len(frozenset(ui_repo_names)):
return
else:
NormalSpoke.on_back_clicked(self, button)
示例4: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# Add a click and re-check the password strength
self._waivePasswordClicks += 1
self._pwStrengthCheck.update_check_status()
# If there is no user set, skip the checks
if not self.username.get_text():
for check in self.checks:
check.disable()
NormalSpoke.on_back_clicked(self, button)
示例5: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# Add a click and re-check the password strength
self._waivePasswordClicks += 1
self._pwStrengthCheck.update_check_status()
# If neither the password nor the confirm field are set, skip the checks
if (not self.pw.get_text()) and (not self.confirm.get_text()):
for check in self.checks:
check.disable()
NormalSpoke.on_back_clicked(self, button)
示例6: on_specialized_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_specialized_clicked(self, button):
# Don't want to run apply or execute in this case, since we have to
# collect some more disks first. The user will be back to this spoke.
self.applyOnSkip = False
# However, we do want to apply current selections so the disk cart off
# the filter spoke will display the correct information.
self._applyDiskSelection(self.selected_disks)
self.skipTo = "FilterSpoke"
NormalSpoke.on_back_clicked(self, button)
示例7: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, *args):
pw = self._pwEntry.get_text()
confirm = self._confirmEntry.get_text()
if pw != confirm:
self.set_error(_("Passwords do not match"))
self.window.show_all()
self._confirmEntry.grab_focus()
return
NormalSpoke.on_back_clicked(self, *args)
示例8: on_specialized_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_specialized_clicked(self, button):
# there will be changes in disk selection, revert storage to an early snapshot (if it exists)
if on_disk_storage.created:
on_disk_storage.reset_to_snapshot(self.storage)
# Don't want to run apply or execute in this case, since we have to
# collect some more disks first. The user will be back to this spoke.
self.applyOnSkip = False
# However, we do want to apply current selections so the disk cart off
# the filter spoke will display the correct information.
applyDiskSelection(self.storage, self.data, self.selected_disks)
self.skipTo = "FilterSpoke"
NormalSpoke.on_back_clicked(self, button)
示例9: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# If the failed check is for non-ASCII characters,
# add a click to the counter and check again
failed_check = next(self.failed_checks_with_message, None)
if not self.policy.strict and failed_check == self._pwStrengthCheck:
self._waiveStrengthClicks += 1
self._pwStrengthCheck.update_check_status()
elif failed_check == self._pwASCIICheck:
self._waiveASCIIClicks += 1
self._pwASCIICheck.update_check_status()
# If there is no user set, skip the checks
if not self.username.get_text():
for check in self.checks:
check.enabled = False
if GUISpokeInputCheckHandler.on_back_clicked(self, button):
NormalSpoke.on_back_clicked(self, button)
示例10: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# If the failed check is for password strength or non-ASCII
# characters, add a click to the counter and check again
failed_check = next(self.failed_checks_with_message, None)
if not self.policy.strict and failed_check == self._pwStrengthCheck:
self._waiveStrengthClicks += 1
self._pwStrengthCheck.update_check_status()
elif failed_check == self._pwASCIICheck:
self._waiveASCIIClicks += 1
self._pwASCIICheck.update_check_status()
# If neither the password nor the confirm field are set, skip the checks
if (not self.pw.get_text()) and (not self.confirm.get_text()):
for check in self.checks:
check.enabled = False
if GUISpokeInputCheckHandler.on_back_clicked(self, button):
NormalSpoke.on_back_clicked(self, button)
示例11: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# If the failed check is for password strength or non-ASCII
# characters, add a click to the counter and check again
failed_check = next(self.failed_checks_with_message, None)
if not self.policy.strict:
if failed_check == self._pwStrengthCheck:
self.waive_clicks += 1
self._pwStrengthCheck.update_check_status()
elif failed_check == self._pwEmptyCheck:
self.waive_clicks += 1
self._pwEmptyCheck.update_check_status()
elif failed_check == self._pwASCIICheck:
self.waive_ASCII_clicks += 1
self._pwASCIICheck.update_check_status()
elif failed_check: # no failed checks -> failed_check == None
failed_check.update_check_status()
if GUISpokeInputCheckHandler.on_back_clicked(self, button):
NormalSpoke.on_back_clicked(self, button)
示例12: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# Return if:
# - no user is requested (empty username)
# - no password is required
# - password is set by kickstart and password text entry is empty
# - password is set by dialog and _validatePassword returns True
if not self.username.get_text() or \
not self.usepassword.get_active() or \
(self.pw.get_text() == "" and \
self.pw.get_text() == self.confirm.get_text() and \
self._user.password_kickstarted) or \
self._validatePassword():
self._error = False
self.clear_info()
NormalSpoke.on_back_clicked(self, button)
# Show the confirmation message if the password is not acceptable
else:
self.clear_info()
self.set_warning(self._error)
self.pw.grab_focus()
self.window.show_all()
示例13: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# the GUI spoke input check handler handles the spoke exit logic for us
if self.try_to_go_back():
NormalSpoke.on_back_clicked(self, button)
else:
log.info("Return to hub prevented by password checking rules.")
示例14: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
self.skipTo = "StorageSpoke"
NormalSpoke.on_back_clicked(self, button)
示例15: on_back_clicked
# 需要导入模块: from pyanaconda.ui.gui.spokes import NormalSpoke [as 别名]
# 或者: from pyanaconda.ui.gui.spokes.NormalSpoke import on_back_clicked [as 别名]
def on_back_clicked(self, button):
# We can't exit early if it looks like nothing has changed because the
# 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._back_clicked:
return
else:
self._back_clicked = True
# make sure the snapshot of unmodified on-disk-storage model is created
if not on_disk_storage.created:
on_disk_storage.create_snapshot(self.storage)
if self.autopart_missing_passphrase:
self._setup_passphrase()
NormalSpoke.on_back_clicked(self, button)
return
# No disks selected? The user wants to back out of the storage spoke.
if not self.selected_disks:
NormalSpoke.on_back_clicked(self, button)
return
disk_selection_changed = False
if self._last_selected_disks:
disk_selection_changed = (self._last_selected_disks != set(self.selected_disks))
# remember the disk selection for future decisions
self._last_selected_disks = set(self.selected_disks)
if disk_selection_changed:
# Changing disk selection is really, really complicated and has
# always been causing numerous hard bugs. Let's not play the hero
# game and just revert everything and start over again.
on_disk_storage.reset_to_snapshot(self.storage)
self.disks = getDisks(self.storage.devicetree)
else:
# Remove all non-existing devices if autopart was active when we last
# refreshed.
if self._previous_autopart:
self._previous_autopart = False
self._remove_nonexistant_partitions()
# hide disks as requested
self._hide_disks()
# make sure no containers were split up by the user's disk selection
self.clear_info()
# if there are some disk selection errors we don't let user to leave the
# spoke, so these errors don't have to go to self.errors
self.disks_errors = checkDiskSelection(self.storage, self.selected_disks)
if self.disks_errors:
# The disk selection has to make sense before we can proceed.
self.set_error(_("There was a problem with your disk selection. "
"Click here for details."))
self._back_clicked = False
return
if arch.isS390():
# check for unformatted DASDs and launch dasdfmt if any discovered
rc = self._check_dasd_formats()
if rc == DASD_FORMAT_NO_CHANGE:
pass
elif rc == DASD_FORMAT_REFRESH:
# User hit OK on the dialog
self.refresh()
elif rc == DASD_FORMAT_RETURN_TO_HUB:
# User clicked uri to return to hub.
NormalSpoke.on_back_clicked(self, button)
return
else:
# User either hit cancel on the dialog or closed it via escape,
# there was no formatting done.
self._back_clicked = False
return
# even if they're not doing autopart, setting autopart.encrypted
# establishes a default of encrypting new devices
self.encrypted = self._encrypted.get_active()
# We might first need to ask about an encryption passphrase.
if self.encrypted and not self._setup_passphrase():
self._back_clicked = False
return
# At this point there are three possible states:
# 1) user chose custom part => just send them to the CustomPart spoke
# 2) user wants to reclaim some more space => run the ResizeDialog
# 3) we are just asked to do autopart => check free space and see if we need
# user to do anything more
self.autopart = not self._customPart.get_active()
disks = [d for d in self.disks if d.name in self.selected_disks]
dialog = None
if not self.autopart:
self.skipTo = "CustomPartitioningSpoke"
elif self._reclaim.get_active():
#.........这里部分代码省略.........