MCPcopy Index your code
hub / github.com/pyload/pyload / paint

Method paint

module/gui/Queue.py:359–389  ·  view source on GitHub ↗

paint the progressbar

(self, painter, option, index)

Source from the content-addressed store, hash-verified

357 self.queue = queue
358
359 def paint(self, painter, option, index):
360 """
361 paint the progressbar
362 """
363 if not index.isValid():
364 return
365 if index.column() == 5:
366 item = index.internalPointer()
367 w = self.queue.getWaitingProgress(item)
368 wait = None
369 if w:
370 progress = w[0]
371 wait = w[1]
372 else:
373 progress = self.queue.getProgress(item)
374 opts = QStyleOptionProgressBarV2()
375 opts.maximum = 100
376 opts.minimum = 0
377 opts.progress = progress
378 opts.rect = option.rect
379 opts.rect.setRight(option.rect.right()-1)
380 opts.rect.setHeight(option.rect.height()-1)
381 opts.textVisible = True
382 opts.textAlignment = Qt.AlignCenter
383 if not wait is None:
384 opts.text = QString(_("waiting %d seconds") % (wait,))
385 else:
386 opts.text = QString.number(opts.progress) + "%"
387 QApplication.style().drawControl(QStyle.CE_ProgressBar, opts, painter)
388 return
389 QItemDelegate.paint(self, painter, option, index)
390

Callers

nothing calls this directly

Calls 3

getWaitingProgressMethod · 0.80
_Function · 0.50
getProgressMethod · 0.45

Tested by

no test coverage detected