8000 add description into the about dialog · ag-python-qt/pyqt-openai@c0e0aef · GitHub
[go: up one dir, main page]

Skip to content

Commit c0e0aef

Browse files
committed
add description into the about dialog
1 parent 34283bc commit c0e0aef

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

pyqt_openai/aboutDialog.py

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1+
import datetime
2+
13
from qtpy.QtCore import Qt, QUrl
24
from qtpy.QtGui import QPixmap, QDesktopServices
35
from qtpy.QtWidgets import QDialog, QPushButton, QHBoxLayout, QWidget, QVBoxLayout, QLabel
46

57
from pyqt_openai.res.language_dict import LangClass
68
from pyqt_openai.svgLabel import SvgLabel
9+
from pyqt_openai.util.script import get_version
710

811

912
class ClickableLabel(SvgLabel):
@@ -35,12 +38,29 @@ def __initUi(self):
3538
logoLbl = QLabel()
3639
logoLbl.setPixmap(p)
3740

38-
expWidget = QLabel()
39-
expWidget.setText(f'''
41+
descWidget1 = QLabel()
42+
descWidget1.setText(f'''
4043
<h1>pyqt-openai</h1>
44+
Software Version {get_version()}<br/>
45+
© 2023 yjg30737. Used under the MIT License.<br/></br/>
46+
MIT License:<br/><br/>
47+
Copyright (c) {datetime.datetime.now().year} yjg30737<br/>
48+
''')
49+
50+
descWidget2 = ClickableLabel()
51+
descWidget2.setText('MIT License Full Text (See More...)')
52+
descWidget2.setUrl('https://github.com/yjg30737/pyqt-openai/blob/main/LICENSE')
53+
descWidget2.setStyleSheet('QLabel:hover { color: blue }')
54+
55+
descWidget3 = QLabel()
56+
descWidget3.setText(f'''
57+
Contact: yjg30737@gmail.com<br/>
4158
<p>{LangClass.TRANSLATIONS['Powered by qtpy']}</p>
4259
''')
43-
expWidget.setAlignment(Qt.AlignTop)
60+
61+
descWidget1.setAlignment(Qt.AlignTop)
62+
descWidget2.setAlignment(Qt.AlignTop)
63+
descWidget3.setAlignment(Qt.AlignTop)
4464

4565
self.__githubLbl = ClickableLabel()
4666
self.__githubLbl.setSvgFile('ico/github.svg')
@@ -61,7 +81,9 @@ def __initUi(self):
6181
linkWidget.setLayout(lay)
6282

6383
lay = QVBoxLayout()
64-
lay.addWidget(expWidget)
84+
lay.addWidget(descWidget1)
85+
lay.addWidget(descWidget2)
86+
lay.addWidget(descWidget3)
6587
lay.addWidget(linkWidget)
6688
lay.setAlignment(Qt.AlignTop)
6789
lay.setContentsMargins(0, 0, 0, 0)

pyqt_openai/util/script.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def open_directory(path):
2323
print("Unsupported operating system.")
2424

2525
def get_version():
26-
with open("../../setup.py", "r") as f:
26+
with open("../setup.py", "r") as f:
2727
setup_content = f.read()
2828

2929
version_match = re.search(r"version=['\"]([^'\"]+)['\"]", setup_content)

0 commit comments

Comments
 (0)
0