def __init__(self, filename: str, filesize: str, runtime: str, icon: str, parent=None):
super(JobCompleteNotification, self).__init__(icon, parent)
pencolor = '#C681D5' if self.theme == 'dark' else '#642C68'
self.filename = filename
self.filesize = filesize
self.runtime = runtime
self.parent = parent
self.title = 'Your media file is ready!'
self.message = '''
<style>
h1 {{
color: {labelscolor};
font-family: "Futura-Light", sans-serif;
font-weight: 400;
text-align: center;
}}
table.info {{
margin: 6px;
padding: 4px 2px;
font-family: "Noto Sans UI", sans-serif;
}}
td.label {{
font-weight: bold;
color: {labelscolor};
text-transform: lowercase;
text-align: right;
padding-right: 5px;
font-size: 14px;
}}
td.value {{
color: {valuescolor};
font-size: 14px;
}}
</style>
<h1>{heading}</h1>
<table border="0" class="info" cellpadding="2" cellspacing="0" align="left">
<tr>
<td width="20%%" class="label"><b>File:</b></td>
<td width="80%%" class="value" nowrap>{filename}</td>
</tr>
<tr>
<td width="20%%" class="label"><b>Size:</b></td>
<td width="80%%" class="value">{filesize}</td>
</tr>
<tr>
<td width="20%%" class="label"><b>Runtime:</b></td>
<td width="80%%" class="value">{runtime}</td>
</tr>
</table>'''.format(labelscolor=pencolor,
valuescolor=('#EFF0F1' if self.theme == 'dark' else '#222'),
heading=self._title,
filename=os.path.basename(self.filename),
filesize=self.filesize,
runtime=self.runtime)
playButton = QPushButton(QIcon(':/images/complete-play.png'), 'Play', self)
playButton.setFixedWidth(82)
playButton.clicked.connect(self.playMedia)
playButton.setCursor(Qt.PointingHandCursor)
self.buttons.append(playButton)
评论列表
文章目录