mirror of
https://github.com/KeksPirates/SoftwareManager.git
synced 2026-08-04 17:59:43 +02:00
fix broken merge
This commit is contained in:
+11
-4
@@ -294,11 +294,18 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
download = state.downloads[index.row()]
|
download = state.downloads[index.row()]
|
||||||
button = editor.findChild(QtWidgets.QPushButton)
|
button = editor.findChild(QtWidgets.QPushButton)
|
||||||
|
|
||||||
|
paused = index.data(Qt.UserRole)
|
||||||
|
|
||||||
|
magnet_link = list(state.active_downloads.keys())[index.row()]
|
||||||
|
magnetdl = state.active_downloads[magnet_link]
|
||||||
|
status = magnetdl.status()
|
||||||
|
|
||||||
if button:
|
if button:
|
||||||
if download.progress == 100:
|
if status.state == lt.torrent_status.seeding:
|
||||||
button.setText("📁")
|
button.setText("📁")
|
||||||
else:
|
else:
|
||||||
button.setText("▶︎" if download.is_paused else "⏸︎")
|
button.setText("▶︎" if status.paused else "⏸︎")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def createEditor(self, parent, option, index):
|
def createEditor(self, parent, option, index):
|
||||||
@@ -308,10 +315,10 @@ class MainWindow(QtWidgets.QMainWindow, QWidget):
|
|||||||
widget.setStyleSheet("border: none;")
|
widget.setStyleSheet("border: none;")
|
||||||
layout = QHBoxLayout(widget)
|
layout = QHBoxLayout(widget)
|
||||||
layout.setContentsMargins(0, 0, 0, 0)
|
layout.setContentsMargins(0, 0, 0, 0)
|
||||||
if download.progress == 100:
|
if status.state == lt.torrent_status.seeding:
|
||||||
btnPause = QtWidgets.QPushButton("📁")
|
btnPause = QtWidgets.QPushButton("📁")
|
||||||
else:
|
else:
|
||||||
btnPause = QtWidgets.QPushButton("▶︎" if download.is_paused else "⏸︎")
|
btnPause = QtWidgets.QPushButton("▶︎" if status.paused else "⏸︎")
|
||||||
btnPause.setFixedSize(40, 30)
|
btnPause.setFixedSize(40, 30)
|
||||||
btnPause.clicked.connect(lambda: self.clicked.emit(index.row()))
|
btnPause.clicked.connect(lambda: self.clicked.emit(index.row()))
|
||||||
layout.addStretch()
|
layout.addStretch()
|
||||||
|
|||||||
Reference in New Issue
Block a user