def __init__(self, weboob, backend, torrent, parent=None): super(MiniTorrent, self).__init__(parent) self.parent = parent self.ui = Ui_MiniTorrent() self.ui.setupUi(self) self.weboob = weboob self.backend = backend self.torrent = torrent self.ui.nameLabel.setText(torrent.name) if not empty(torrent.seeders) and not empty(torrent.leechers): self.ui.seedLeechLabel.setText('%s/%s' % (torrent.seeders, torrent.leechers)) if not empty(torrent.size): self.ui.sizeLabel.setText(u'%s' % sizeof_fmt(torrent.size)) self.ui.backendButton.setText(backend.name) minfo = self.weboob.repositories.get_module_info(backend.NAME) icon_path = self.weboob.repositories.get_module_icon_path(minfo) if icon_path: pixmap = QPixmapCache.find(icon_path) if not pixmap: pixmap = QPixmap(QImage(icon_path)) self.ui.backendButton.setIcon(QIcon(pixmap)) self.ui.newTabButton.clicked.connect(self.newTabPressed) self.ui.viewButton.clicked.connect(self.viewPressed)
def __init__(self, weboob, backend, torrent, parent=None): QFrame.__init__(self, parent) self.parent = parent self.ui = Ui_MiniTorrent() self.ui.setupUi(self) self.weboob = weboob self.backend = backend self.torrent = torrent self.ui.nameLabel.setText(torrent.name) if not empty(torrent.seeders) and not empty(torrent.leechers): self.ui.seedLeechLabel.setText('%s/%s' % (torrent.seeders, torrent.leechers)) if not empty(torrent.size): self.ui.sizeLabel.setText(u'%s' % sizeof_fmt(torrent.size)) self.ui.backendLabel.setText(backend.name)
def __init__(self, weboob, backend, torrent, parent=None): super(MiniTorrent, self).__init__(parent) self.parent = parent self.ui = Ui_MiniTorrent() self.ui.setupUi(self) self.weboob = weboob self.backend = backend self.torrent = torrent self.ui.nameLabel.setText(torrent.name) if not empty(torrent.seeders) and not empty(torrent.leechers): self.ui.seedLeechLabel.setText('%s/%s' % (torrent.seeders, torrent.leechers)) if not empty(torrent.size): self.ui.sizeLabel.setText(u'%s' % sizeof_fmt(torrent.size)) self.ui.backendLabel.setText(backend.name) self.ui.newTabButton.clicked.connect(self.newTabPressed) self.ui.viewButton.clicked.connect(self.viewPressed)