diff --git a/LICENSE b/LICENSE index f06e0f8..bdf27d9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2021 achimmihca +Copyright (c) 2021 Andreas Achim Stange Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/gui/LicenseTab.py b/src/gui/LicenseTab.py new file mode 100644 index 0000000..7680f1b --- /dev/null +++ b/src/gui/LicenseTab.py @@ -0,0 +1,42 @@ +from PySide6.QtWidgets import QWidget, QVBoxLayout, QPlainTextEdit +from common.Config import Config +from common.LogHolder import LogHolder + +class LicenseTab(QWidget, LogHolder): + def __init__(self, config: Config) -> None: + QWidget.__init__(self) + LogHolder.__init__(self) + self.config = config + + text_edit = QPlainTextEdit() + text_edit.setReadOnly(True) + + text_edit.setPlainText(self.get_license_text()) + + self.setLayout(QVBoxLayout()) + self.layout().addWidget(text_edit) + + def get_license_text(self) -> str: + return """\ +MIT License + +Copyright (c) 2021 Andreas Achim Stange + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.\ +""" \ No newline at end of file diff --git a/src/gui/MainWidget.py b/src/gui/MainWidget.py index 978469e..3a57a0f 100644 --- a/src/gui/MainWidget.py +++ b/src/gui/MainWidget.py @@ -9,6 +9,7 @@ from .GeometryConfigTab import GeometryConfigTab from .ShortcutsConfigTab import ShortcutsConfigTab from .LogTab import LogTab +from .LicenseTab import LicenseTab class MainWidget(QWidget, LogHolder): def __init__(self, config: Config, close_callback: Callable) -> None: @@ -41,3 +42,4 @@ def __init__(self, config: Config, close_callback: Callable) -> None: self.tab_widget.addTab(GeometryConfigTab(config), "Geometry") self.tab_widget.addTab(ShortcutsConfigTab(config), "Shortcuts") self.tab_widget.addTab(LogTab(config), "Log") + self.tab_widget.addTab(LicenseTab(config), "License")