예제 #1
0
 def _on_item_chosen(dialog: UiObjectPicker):
     if not dialog.accepted:
         return on_item_chosen(None,
                               CommonChooseItemResult.DIALOG_CANCELLED)
     chosen_item = CommonDialogUtils.get_chosen_item(dialog)
     return on_item_chosen(chosen_item,
                           CommonChooseItemResult.ITEM_CHOSEN)
 def _on_chosen(dialog: UiSimPicker):
     if not dialog.accepted:
         self.log.debug('Dialog cancelled.')
         return on_chosen(None, CommonChoiceOutcome.CANCEL)
     choice = CommonDialogUtils.get_chosen_item(dialog)
     self.log.format_with_message('Choice made.', choice=choice)
     result = on_chosen(choice, CommonChoiceOutcome.CHOICE_MADE)
     self.log.format_with_message('Finished handling choice.', result=result)
     return result
예제 #3
0
 def _on_chosen(dialog: UiSimPicker) -> bool:
     try:
         if not dialog.accepted:
             self.log.debug('Dialog cancelled.')
             return on_chosen(None, CommonChoiceOutcome.CANCEL)
         choice = CommonDialogUtils.get_chosen_item(dialog)
         self.log.format_with_message('Choice made.', choice=choice)
         result = on_chosen(choice, CommonChoiceOutcome.CHOICE_MADE)
         self.log.format_with_message('Finished handling choice.',
                                      result=result)
         return result
     except Exception as ex:
         self.log.error('Error occurred on choosing a value.',
                        exception=ex)
     return False
 def _on_chosen(dialog: UiOutfitPicker) -> None:
     try:
         self.log.format_with_message('Choice made.', picked_results=dialog.picked_results)
         if not dialog.accepted:
             self.log.debug('Dialog cancelled.')
             on_chosen(None, CommonChoiceOutcome.CANCEL)
             return
         self.log.format_with_message('Dialog accepted, checking if choices were made.')
         choice = CommonDialogUtils.get_chosen_item(dialog)
         self.log.format_with_message('Outfit choice made.', choice=choice)
         on_chosen(choice, CommonChoiceOutcome.CHOICE_MADE)
         self.log.debug('Finished handling outfit items _on_chosen.')
         return
     except Exception as ex:
         self.log.error('Error occurred on choosing a value.', exception=ex)
 def _on_chosen(dialog: UiObjectPicker):
     if not dialog.accepted:
         log.debug('Dialog cancelled.')
         return on_chosen(None, CommonChoiceOutcome.CANCEL)
     choice = CommonDialogUtils.get_chosen_item(dialog)
     if choice == 'S4CL_NEXT':
         log.debug('Next chosen.')
         self.show(on_chosen=on_chosen,
                   picker_type=picker_type,
                   page=page + 1)
         return True
     elif choice == 'S4CL_PREVIOUS':
         log.debug('Previous chosen.')
         self.show(on_chosen=on_chosen,
                   picker_type=picker_type,
                   page=page - 1)
         return True
     log.format_with_message('Choice made.', choice=choice)
     result = on_chosen(choice, CommonChoiceOutcome.CHOICE_MADE)
     log.format_with_message('Finished handling choice.', result=result)
     return result