diff --git a/web-greeter/bridge/__init__.py b/web-greeter/bridge/__init__.py index d81d20f..3d7f8f9 100644 --- a/web-greeter/bridge/__init__.py +++ b/web-greeter/bridge/__init__.py @@ -91,10 +91,14 @@ class Battery: return self._state def language_to_dict(lang): + if (not lang): + return dict() return dict(code=lang.get_code(), name=lang.get_name(), territory=lang.get_territory()) def layout_to_dict(layout): + if (not layout): + return dict() return dict( description=layout.get_description(), name=layout.get_name(), @@ -103,6 +107,8 @@ def layout_to_dict(layout): def session_to_dict(session): + if (not session): + return dict() return dict( comment=session.get_comment(), key=session.get_key(), @@ -112,6 +118,8 @@ def session_to_dict(session): def user_to_dict(user): + if (not user): + return dict() return dict( display_name=user.get_display_name(), home_directory=user.get_home_directory(), @@ -124,6 +132,8 @@ def user_to_dict(user): ) def battery_to_dict(battery): + if (not battery): + return dict() return dict( name = battery.get_name(), level = battery.get_level(), diff --git a/web-greeter/utils/keyboard.py b/web-greeter/utils/keyboard.py index f3d799b..193a6cb 100644 --- a/web-greeter/utils/keyboard.py +++ b/web-greeter/utils/keyboard.py @@ -30,6 +30,8 @@ from whither.toolkits.bootstrap import WebPage, MainWindow from PyQt5.QtCore import QUrl, pyqtSignal, Qt from PyQt5.QtGui import QKeyEvent +import globals + def keyPressEvent(self, keyEvent: QKeyEvent): super(MainWindow, self).keyPressEvent(keyEvent) if (keyEvent.key() == Qt.Key.Key_MonBrightnessUp): diff --git a/web-greeter/whither.yml b/web-greeter/whither.yml index af35005..7051d77 100644 --- a/web-greeter/whither.yml +++ b/web-greeter/whither.yml @@ -38,8 +38,7 @@ WebGreeter: secure_mode: True theme: default icon_theme: Adwaita - time_format: LT - time_language: auto + time_language: "" features: battery: False backlight: