show a quick bit of copyright/license info

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
Brian S. Stephan 2024-03-12 13:33:37 -05:00
parent af46a0200b
commit 610e1a2801
Signed by: bss
GPG Key ID: 3DE06D3180895FCB
2 changed files with 16 additions and 5 deletions

View File

@ -41,8 +41,8 @@ EditScreen Label {
#message-dialog {
padding: 0 1;
grid-rows: 3fr 1fr;
width: 50%;
height: 50%;
max-width: 75%;
max-height: 75%;
border: tall gray 100%;
}

View File

@ -5,6 +5,7 @@ SPDX-License-Identifier: GPL-3.0-or-later
"""
import argparse
import logging
from textwrap import dedent
from google.protobuf import descriptor
from google.protobuf.message import Message
@ -16,7 +17,7 @@ from textual.containers import Container, Grid, Horizontal
from textual.logging import TextualHandler
from textual.screen import ModalScreen
from textual.validation import Number
from textual.widgets import Button, Footer, Header, Input, Label, Pretty, Select, Tree
from textual.widgets import Button, Footer, Header, Input, Label, Pretty, Select, TextArea, Tree
from textual.widgets.tree import TreeNode
from gp2040ce_bintools import _version, core_parser, handler
@ -114,8 +115,8 @@ class MessageScreen(ModalScreen):
def compose(self) -> ComposeResult:
"""Build the pop-up window with the desired message displayed."""
yield Grid(
Container(Label(self.text, id="message-text"), id="text-container"),
Container(Button("OK", id='ok-button'), id="button-container"),
Container(TextArea(self.text, id='message-text', read_only=True), id='text-container'),
Container(Button("OK", id='ok-button'), id='button-container'),
id='message-dialog',
)
@ -131,6 +132,7 @@ class ConfigEditor(App):
('a', 'add_node', "Add Node"),
('s', 'save', "Save Config"),
('q', 'quit', "Quit"),
('?', 'about', "About"),
]
CSS_PATH = "config_tree.css"
TITLE = F"GP2040-CE Configuration Editor - {_version.version}"
@ -188,6 +190,15 @@ class ConfigEditor(App):
"""Take the appropriate action for this type of node."""
self._modify_node(node_event.node)
def action_about(self) -> None:
"""Display a help/about popup."""
self.push_screen(MessageScreen(dedent("""
gp2040ce-binary-tools - Tools for working with GP2040-CE firmware and storage binaries
Copyright © 2023 Brian S. Stephan <bss@incorporeal.org>
Made available WITHOUT ANY WARRANTY under the GNU General Public License, version 3 or later.
""")))
def action_add_node(self) -> None:
"""Add a node to the tree item, if allowed by the tree and config section."""
tree = self.query_one(Tree)