]> git.ipfire.org Git - people/ms/bricklayer.git/commitdiff
Show release information on main screen
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 May 2021 22:13:26 +0000 (22:13 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 5 May 2021 22:13:26 +0000 (22:13 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/python/tui/__init__.py

index ce241f8c934ada182f7d65d584ad54f1e36ab617..092f041946c42b2d6df7b28db1789a2a2afbc634 100644 (file)
@@ -62,6 +62,9 @@ class Tui(object):
                """
                self.screen = snack.SnackScreen()
 
+               # Setup root text
+               self.draw_root_text("%(PRETTY_NAME)s" % self.bricklayer.os)
+
                # Setup helpline
                self.push_helpline(
                        _("<Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen")
@@ -78,6 +81,16 @@ class Tui(object):
                        self.screen.finish()
                        self.screen = None
 
+       def draw_root_text(self, text, top=0, left=0):
+               if not self.screen:
+                       raise RuntimeError()
+
+               # Center the text
+               text = text.center(self.screen.width)
+
+               # Draw the text
+               self.screen.drawRootText(top, left, text)
+
        def push_helpline(self, helpline):
                """
                        Sets the helpline, but centers it first