Ejemplo n.º 1
0
	def _CreateArguments (self,
						  setting: UISettingsShared.SettingWrapper,
						  currentValue: typing.Any,
						  showDialogArguments: typing.Dict[str, typing.Any],
						  *args, **kwargs) -> typing.Dict[str, typing.Any]:

		dialogArguments = dict()

		dialogOwner = showDialogArguments.get("owner")

		dialogButtons = kwargs["dialogButtons"]  # type: typing.List[DialogButton]
		dialogResponses = list()  # type: typing.List[ui_dialog.UiDialogResponse]

		for dialogButton in dialogButtons:  # type: DialogButton
			dialogResponses.append(dialogButton.GenerateDialogResponse())

		textString = self._GetDescriptionText(setting)  # type: localization.LocalizedString

		dialogArguments["owner"] = dialogOwner
		dialogArguments["title"] = Language.MakeLocalizationStringCallable(self._GetTitleText(setting))
		dialogArguments["text"] = Language.MakeLocalizationStringCallable(textString)
		dialogArguments["text_ok"] = Language.MakeLocalizationStringCallable(self._GetAcceptButtonText())
		dialogArguments["text_cancel"] = Language.MakeLocalizationStringCallable(self._GetCancelButtonText())
		dialogArguments["ui_responses"] = dialogResponses

		return dialogArguments
Ejemplo n.º 2
0
	def _CreateArguments (self,
						  listPath: str,
						  showDialogArguments: typing.Dict[str, typing.Any],
						  *args, **kwargs) -> typing.Dict[str, typing.Any]:

		dialogArguments = dict()

		dialogOwner = showDialogArguments.get("owner")

		dialogArguments["owner"] = dialogOwner
		dialogArguments["title"] = Language.MakeLocalizationStringCallable(self._GetTitleText(listPath))
		dialogArguments["text"] = Language.MakeLocalizationStringCallable(self._GetDescriptionText(listPath))

		return dialogArguments
Ejemplo n.º 3
0
		def ResetAllButtonCallback (listDialogReference: ui_dialog.UiDialog) -> None:
			def ResetAllConfirmDialogCallback (confirmDialogReference: ui_dialog.UiDialog) -> None:
				if confirmDialogReference.response == ui_dialog.ButtonType.DIALOG_RESPONSE_OK:
					self.SettingsSystem.ResetAll()

				self.ShowDialog(listPath, returnCallback = returnCallback, **showDialogArguments)

			confirmDialogArguments = {
				"title": Language.MakeLocalizationStringCallable(self._GetResetAllConfirmDialogTitleText()),
				"text": Language.MakeLocalizationStringCallable(self._GetResetAllConfirmDialogDescriptionText()),
				"text_ok": Language.MakeLocalizationStringCallable(self._GetResetAllConfirmDialogYesButtonText()),
				"text_cancel": Language.MakeLocalizationStringCallable(self._GetResetAllConfirmDialogNoButtonText())
			}

			Dialogs.ShowOkCancelDialog(callback = ResetAllConfirmDialogCallback, queue = False, **confirmDialogArguments)