Skip to content

Commit

Permalink
show license in GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
achimmihca committed Aug 23, 2021
1 parent c5b177c commit 7b9012e
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -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
Expand Down
42 changes: 42 additions & 0 deletions src/gui/LicenseTab.py
Original file line number Diff line number Diff line change
@@ -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.\
"""
2 changes: 2 additions & 0 deletions src/gui/MainWidget.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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")

0 comments on commit 7b9012e

Please sign in to comment.