readability: add type annotations, fix logger method
- Added : Variant annotations to exit_button, container, focus_group - Fixed logger.warning -> logger.warn for consistency
This commit is contained in:
parent
b8d229c9a6
commit
e611e16651
1 changed files with 4 additions and 4 deletions
|
|
@ -51,11 +51,11 @@ func _try_add_button() -> bool:
|
||||||
if not power_menu:
|
if not power_menu:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
var exit_button = power_menu.get("exit_button")
|
var exit_button: Variant = power_menu.get("exit_button")
|
||||||
if not exit_button:
|
if not exit_button:
|
||||||
return false
|
return false
|
||||||
|
|
||||||
var container = exit_button.get_parent()
|
var container: Variant = exit_button.get_parent()
|
||||||
if not container:
|
if not container:
|
||||||
return false
|
return false
|
||||||
if container.has_node(BUTTON_NAME):
|
if container.has_node(BUTTON_NAME):
|
||||||
|
|
@ -74,7 +74,7 @@ func _try_add_button() -> bool:
|
||||||
container.add_child(button)
|
container.add_child(button)
|
||||||
container.move_child(button, exit_button.get_index())
|
container.move_child(button, exit_button.get_index())
|
||||||
|
|
||||||
var focus_group = power_menu.get("focus_group")
|
var focus_group: Variant = power_menu.get("focus_group")
|
||||||
if focus_group and focus_group.has_method("recalculate_focus"):
|
if focus_group and focus_group.has_method("recalculate_focus"):
|
||||||
focus_group.recalculate_focus()
|
focus_group.recalculate_focus()
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ func _restart_inputplumber() -> void:
|
||||||
var out: Array = []
|
var out: Array = []
|
||||||
var code := OS.execute("sudo", ["-n", "systemctl", "restart", "inputplumber"], out)
|
var code := OS.execute("sudo", ["-n", "systemctl", "restart", "inputplumber"], out)
|
||||||
if code != OK:
|
if code != OK:
|
||||||
logger.warning("Unable to restart InputPlumber: " + _result_text(out))
|
logger.warn("Unable to restart InputPlumber: " + _result_text(out))
|
||||||
|
|
||||||
|
|
||||||
## Returns the session recorded by os-session-select before OpenGamepadUI was
|
## Returns the session recorded by os-session-select before OpenGamepadUI was
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue