MCPcopy Create free account
hub / github.com/Syncplay/syncplay / __init__

Method __init__

syncplay/ui/gui.py:138–185  ·  view source on GitHub ↗
(self, parent=None)

Source from the content-addressed store, hash-verified

136
137class AboutDialog(QtWidgets.QDialog):
138 def __init__(self, parent=None):
139 super(AboutDialog, self).__init__(parent)
140 if isMacOS():
141 self.setWindowTitle("")
142 self.setWindowFlags(Qt.Dialog | Qt.WindowTitleHint | Qt.WindowCloseButtonHint | Qt.CustomizeWindowHint)
143 else:
144 self.setWindowTitle(getMessage("about-dialog-title"))
145 if isWindows():
146 self.setWindowFlags(self.windowFlags() & ~Qt.WindowContextHelpButtonHint)
147 self.setWindowIcon(QtGui.QPixmap(resourcespath + 'syncplay.png'))
148 nameLabel = QtWidgets.QLabel("<center><strong>Syncplay</strong></center>")
149 nameLabel.setFont(QtGui.QFont("Helvetica", 18))
150 linkLabel = QtWidgets.QLabel()
151 if isDarkMode:
152 linkLabel.setText(("<center><a href=\"https://syncplay.pl\" style=\"{}\">syncplay.pl</a></center>").format(constants.STYLE_DARK_ABOUT_LINK_COLOR))
153 else:
154 linkLabel.setText("<center><a href=\"https://syncplay.pl\">syncplay.pl</a></center>")
155 linkLabel.setOpenExternalLinks(True)
156 versionExtString = version + revision
157 versionLabel = QtWidgets.QLabel(
158 "<p><center>" + getMessage("about-dialog-release").format(versionExtString, release_number) +
159 "<br />Python " + python_version() + " - " + __binding__ + " " + __binding_version__ +
160 " - Qt " + __qt_version__ + "</center></p>")
161 licenseLabel = QtWidgets.QLabel(
162 "<center><p>Copyright &copy; 2012&ndash;2025 Syncplay</p><p>" +
163 getMessage("about-dialog-license-text") + "</p></center>")
164 aboutIcon = QtGui.QIcon()
165 aboutIcon.addFile(resourcespath + "syncplayAbout.png")
166 aboutIconLabel = QtWidgets.QLabel()
167 aboutIconLabel.setPixmap(aboutIcon.pixmap(64, 64))
168 aboutLayout = QtWidgets.QGridLayout()
169 aboutLayout.addWidget(aboutIconLabel, 0, 0, 3, 4, Qt.AlignHCenter)
170 aboutLayout.addWidget(nameLabel, 3, 0, 1, 4)
171 aboutLayout.addWidget(linkLabel, 4, 0, 1, 4)
172 aboutLayout.addWidget(versionLabel, 5, 0, 1, 4)
173 aboutLayout.addWidget(licenseLabel, 6, 0, 1, 4)
174 licenseButton = QtWidgets.QPushButton(getMessage("about-dialog-license-button"))
175 licenseButton.setAutoDefault(False)
176 licenseButton.clicked.connect(self.openLicense)
177 aboutLayout.addWidget(licenseButton, 7, 0, 1, 2)
178 dependenciesButton = QtWidgets.QPushButton(getMessage("about-dialog-dependencies"))
179 dependenciesButton.setAutoDefault(False)
180 dependenciesButton.clicked.connect(self.openDependencies)
181 aboutLayout.addWidget(dependenciesButton, 7, 2, 1, 2)
182 aboutLayout.setVerticalSpacing(10)
183 aboutLayout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
184 self.setSizeGripEnabled(False)
185 self.setLayout(aboutLayout)
186
187 def openLicense(self):
188 if isWindows():

Callers

nothing calls this directly

Calls 5

isMacOSFunction · 0.90
getMessageFunction · 0.90
isWindowsFunction · 0.90
__init__Method · 0.45
connectMethod · 0.45

Tested by

no test coverage detected