-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolophon_pages.py
194 lines (142 loc) · 6.88 KB
/
colophon_pages.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# This Python file uses the following encoding: utf-8
#
# Copyright 2022 naracanto, <https://naracanto.github.io>.
#
# This file is part of dwStudio, <https://github.com/naracanto/dwstudio>.
#
# dwStudio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# dwStudio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with dwStudio. If not, see <https://www.gnu.org/licenses/>.
#
import sys
import PySide6.QtCore
from PySide6.QtCore import QSysInfo
from PySide6.QtWidgets import QApplication, QFrame, QTextBrowser, QVBoxLayout, QWidget
#
#
# Colophon page: About
#
class ColophonPageAbout(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
text = "<html><body>"
text += self.tr("<p>{0} is an open source front-end tool for the Datawrapper API written in Python using the Python bindings for the Qt framework.</p>").format(QApplication.applicationName())
text += self.tr("<p>Copyright © 2022 <a href=\"{0}\" title=\"Visit organization's homepage\">{1}</a>.</p>").format(QApplication.organizationDomain(), QApplication.organizationName())
text += self.tr("<p>This application is licensed under the terms of the <a href=\"https://www.gnu.org/licenses/gpl-3.0.en.html\" title=\"Visit license's homepage\">GNU General Public License, version 3</a>.</p>")
text += "</body></html>"
textBox = QTextBrowser()
textBox.setHtml(text)
textBox.setOpenExternalLinks(True)
textBox.setFrameStyle(QFrame.NoFrame)
textBox.setStyleSheet("background-color:transparent;")
# Main layout
mainLayout = QVBoxLayout()
mainLayout.addWidget(textBox)
self.setLayout(mainLayout)
def title(self):
return self.tr("About")
#
#
# Colophon page: Authors
#
class ColophonPageAuthors(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
text = "<html><body><dl>"
text += self.tr("<dt><strong>naracanto</strong></dt>")
text += self.tr("<dd>Created and developed by <a href=\"https://naracanto.github.io\" title=\"Visit author's homepage\">naracanto</a>.</dd>")
text += "</dl></body></html>"
textBox = QTextBrowser()
textBox.setHtml(text)
textBox.setOpenExternalLinks(True)
textBox.setFrameStyle(QFrame.NoFrame)
textBox.setStyleSheet("background-color:transparent;")
# Main layout
mainLayout = QVBoxLayout()
mainLayout.addWidget(textBox)
self.setLayout(mainLayout)
def title(self):
return self.tr("Authors")
#
#
# Colophon page: Credits
#
class ColophonPageCredits(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
text = "<html><body><dl>"
text += self.tr("<dt><strong>BreezeIcons project</strong></dt>")
text += self.tr("<dd>Application logo and icons made by <a href=\"https://api.kde.org/frameworks/breeze-icons/html/\" title=\"Visit project's homepage\">BreezeIcons project</a> "
"from <a href=\"https://kde.org\" title=\"Visit organization's homepage\">KDE</a> are licensed under <a href=\"https://www.gnu.org/licenses/lgpl-3.0.en.html\" title=\"Visit license's homepage\">LGPLv3</a>.</dd>")
text += "</dl></body></html>"
textBox = QTextBrowser()
textBox.setHtml(text)
textBox.setOpenExternalLinks(True)
textBox.setFrameStyle(QFrame.NoFrame)
textBox.setStyleSheet("background-color:transparent;")
# Main layout
mainLayout = QVBoxLayout()
mainLayout.addWidget(textBox)
self.setLayout(mainLayout)
def title(self):
return self.tr("Credits")
#
#
# Colophon page: Environment
#
class ColophonPageEnvironment(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
text = "<html><body><dl>"
text += self.tr("<dt><strong>Application version</strong></dt>")
text += self.tr("<dd>{0}</dd>").format(QApplication.applicationVersion())
text += self.tr("<dt><strong>Qt for Python version</strong></dt>")
text += self.tr("<dd>{0} runs on Qt {1} (Built against {2})</dd>").format(PySide6.__version__, PySide6.QtCore.qVersion(), PySide6.QtCore.__version__)
text += self.tr("<dt><strong>Python version</strong></dt>")
text += self.tr("<dd>{0}</dd>").format(sys.version)
text += self.tr("<dt><strong>Operation System</strong></dt>")
text += self.tr("<dd>{0} (Kernel {1} on {2})</dd>").format(QSysInfo.prettyProductName(), QSysInfo.kernelVersion(), QSysInfo.currentCpuArchitecture())
text += "</dl></body></html>"
textBox = QTextBrowser()
textBox.setHtml(text)
textBox.setOpenExternalLinks(True)
textBox.setFrameStyle(QFrame.NoFrame)
textBox.setStyleSheet("background-color:transparent;")
# Main layout
mainLayout = QVBoxLayout()
mainLayout.addWidget(textBox)
self.setLayout(mainLayout)
def title(self):
return self.tr("Environment")
#
#
# Colophon page: License
#
class ColophonPageLicense(QWidget):
def __init__(self, parent=None):
super().__init__(parent=parent)
text = "<html><body>"
text += self.tr("<p>{0} is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.</p>").format(QApplication.applicationName())
text += self.tr("<p>{0} is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.</p>").format(QApplication.applicationName())
text += self.tr("<p>You should have received a copy of the GNU General Public License along with {0}. If not, see <a href=\"https://www.gnu.org/licenses/\" title=\"Visit license's homepage\">https://www.gnu.org/licenses/</a>.</p>").format(QApplication.applicationName())
text += "</body></html>"
textBox = QTextBrowser()
textBox.setHtml(text)
textBox.setOpenExternalLinks(True)
textBox.setFrameStyle(QFrame.NoFrame)
textBox.setStyleSheet("background-color:transparent;")
# Main layout
mainLayout = QVBoxLayout()
mainLayout.addWidget(textBox)
self.setLayout(mainLayout)
def title(self):
return self.tr("License")