DownloadsTab: Add static labels to current download stats
This commit is contained in:
parent
3aed7bd79c
commit
4071536f84
|
@ -4,7 +4,7 @@ from qtawesome import icon
|
|||
|
||||
from rare import shared
|
||||
from rare.components.tabs.account import MiniWidget
|
||||
from rare.components.tabs.downloads import DownloadTab
|
||||
from rare.components.tabs.downloads import DownloadsTab
|
||||
from rare.components.tabs.games import GamesTab
|
||||
from rare.components.tabs.settings import SettingsTab
|
||||
from rare.components.tabs.settings.debug import DebugSettings
|
||||
|
@ -28,7 +28,7 @@ class TabWidget(QTabWidget):
|
|||
|
||||
if not shared.args.offline:
|
||||
# updates = self.games_tab.default_widget.game_list.updates
|
||||
self.downloadTab = DownloadTab(self.games_tab.updates)
|
||||
self.downloadTab = DownloadsTab(self.games_tab.updates)
|
||||
self.addTab(self.downloadTab, "Downloads" + (
|
||||
" (" + str(len(self.games_tab.updates)) + ")" if len(self.games_tab.updates) != 0 else ""))
|
||||
self.store = Shop(self.core)
|
||||
|
|
|
@ -12,23 +12,22 @@ from rare import shared
|
|||
from rare.components.dialogs.install_dialog import InstallDialog
|
||||
from rare.components.tabs.downloads.dl_queue_widget import DlQueueWidget, DlWidget
|
||||
from rare.components.tabs.downloads.download_thread import DownloadThread
|
||||
from rare.ui.components.tabs.downloads.downloads_tab import Ui_DownloadWidget
|
||||
from rare.ui.components.tabs.downloads.downloads_tab import Ui_DownloadsTab
|
||||
from rare.utils.models import InstallOptionsModel, InstallQueueItemModel
|
||||
from rare.utils.utils import get_size
|
||||
|
||||
logger = getLogger("Download")
|
||||
|
||||
|
||||
class DownloadTab(QWidget, Ui_DownloadWidget):
|
||||
class DownloadsTab(QWidget, Ui_DownloadsTab):
|
||||
thread: QThread
|
||||
dl_queue = list()
|
||||
dl_status = pyqtSignal(int)
|
||||
|
||||
def __init__(self, updates: list):
|
||||
super(DownloadTab, self).__init__()
|
||||
super(DownloadsTab, self).__init__()
|
||||
self.setupUi(self)
|
||||
self.core = shared.core
|
||||
self.layout = QVBoxLayout()
|
||||
self.active_game: Game = None
|
||||
self.analysis = None
|
||||
self.signals = shared.signals
|
||||
|
@ -36,15 +35,13 @@ class DownloadTab(QWidget, Ui_DownloadWidget):
|
|||
self.kill_button.clicked.connect(self.stop_download)
|
||||
|
||||
self.queue_widget = DlQueueWidget()
|
||||
self.scroll_widget.layout().addWidget(self.queue_widget)
|
||||
self.queue_widget.update_list.connect(self.update_dl_queue)
|
||||
self.queue_scroll_contents_layout.addWidget(self.queue_widget)
|
||||
|
||||
self.updates = QGroupBox(self.tr("Updates"))
|
||||
self.scroll_widget.layout().addWidget(self.updates)
|
||||
self.update_layout = QVBoxLayout()
|
||||
self.updates.setLayout(self.update_layout)
|
||||
|
||||
self.updates.setObjectName("group")
|
||||
self.updates.setObjectName("updates_group")
|
||||
self.update_layout = QVBoxLayout(self.updates)
|
||||
self.queue_scroll_contents_layout.addWidget(self.updates)
|
||||
|
||||
self.update_widgets = {}
|
||||
|
||||
|
@ -57,14 +54,14 @@ class DownloadTab(QWidget, Ui_DownloadWidget):
|
|||
|
||||
self.queue_widget.item_removed.connect(self.queue_item_removed)
|
||||
|
||||
self.setLayout(self.layout)
|
||||
|
||||
self.signals.install_game.connect(self.get_install_options)
|
||||
self.signals.game_uninstalled.connect(self.queue_item_removed)
|
||||
self.signals.game_uninstalled.connect(self.remove_update)
|
||||
|
||||
self.signals.add_download.connect(lambda app_name: self.add_update(self.core.get_installed_game(app_name)))
|
||||
|
||||
self.reset_infos()
|
||||
|
||||
def queue_item_removed(self, app_name):
|
||||
if w := self.update_widgets.get(app_name):
|
||||
w.update_button.setDisabled(False)
|
||||
|
@ -113,13 +110,13 @@ class DownloadTab(QWidget, Ui_DownloadWidget):
|
|||
self.thread.start()
|
||||
self.kill_button.setDisabled(False)
|
||||
self.analysis = queue_item.download.analysis
|
||||
self.installing_game.setText(self.tr("Installing Game: ") + self.active_game.app_title)
|
||||
self.dl_name.setText(self.active_game.app_title)
|
||||
|
||||
self.signals.installation_started.emit(self.active_game.app_name)
|
||||
|
||||
def status(self, text):
|
||||
if text == "finish":
|
||||
self.installing_game.setText(self.tr("Download finished. Reload library"))
|
||||
self.dl_name.setText(self.tr("Download finished. Reload library"))
|
||||
logger.info("Download finished: " + self.active_game.app_title)
|
||||
|
||||
game = self.active_game
|
||||
|
@ -164,22 +161,20 @@ class DownloadTab(QWidget, Ui_DownloadWidget):
|
|||
|
||||
def reset_infos(self):
|
||||
self.kill_button.setDisabled(True)
|
||||
self.installing_game.setText(self.tr("No active download"))
|
||||
self.prog_bar.setValue(0)
|
||||
self.dl_speed.setText("")
|
||||
self.time_left.setText("")
|
||||
self.cache_used.setText("")
|
||||
self.downloaded.setText("")
|
||||
self.dl_name.setText(self.tr("No active download"))
|
||||
self.progress_bar.setValue(0)
|
||||
self.dl_speed.setText("n/a")
|
||||
self.time_left.setText("n/a")
|
||||
self.cache_used.setText("n/a")
|
||||
self.downloaded.setText("n/a")
|
||||
self.analysis = None
|
||||
|
||||
def statistics(self, ui_update: UIUpdate):
|
||||
self.prog_bar.setValue(100 * ui_update.total_downloaded // self.analysis.dl_size)
|
||||
self.dl_speed.setText(self.tr("Download speed") + f": {get_size(ui_update.download_speed)}/s")
|
||||
self.cache_used.setText(
|
||||
self.tr("Cache used") + f": {get_size(ui_update.cache_usage) if ui_update.cache_usage > 1023 else '0KB'}")
|
||||
self.downloaded.setText(
|
||||
self.tr("Downloaded") + f": {get_size(ui_update.total_downloaded)} / {get_size(self.analysis.dl_size)}")
|
||||
self.time_left.setText(self.tr("Time left: ") + self.get_time(ui_update.estimated_time_left))
|
||||
self.progress_bar.setValue(100 * ui_update.total_downloaded // self.analysis.dl_size)
|
||||
self.dl_speed.setText(f"{get_size(ui_update.download_speed)}/s")
|
||||
self.cache_used.setText(f"{get_size(ui_update.cache_usage) if ui_update.cache_usage > 1023 else '0KB'}")
|
||||
self.downloaded.setText(f"{get_size(ui_update.total_downloaded)} / {get_size(self.analysis.dl_size)}")
|
||||
self.time_left.setText(self.get_time(ui_update.estimated_time_left))
|
||||
self.signals.dl_progress.emit(100 * ui_update.total_downloaded // self.analysis.dl_size)
|
||||
|
||||
def get_time(self, seconds: int) -> str:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'rare/components/tabs/downloads/downloads_tab.ui'
|
||||
# Form implementation generated from reading ui file 'rare/ui/components/tabs/downloads/downloads_tab.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.6
|
||||
#
|
||||
|
@ -8,126 +8,179 @@
|
|||
# run again. Do not edit this file unless you know what you are doing.
|
||||
|
||||
|
||||
from PyQt5 import QtCore, QtWidgets
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_DownloadWidget(object):
|
||||
def setupUi(self, DownloadWidget):
|
||||
DownloadWidget.setObjectName("DownloadWidget")
|
||||
DownloadWidget.resize(797, 541)
|
||||
class Ui_DownloadsTab(object):
|
||||
def setupUi(self, DownloadsTab):
|
||||
DownloadsTab.setObjectName("DownloadsTab")
|
||||
DownloadsTab.resize(677, 195)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(DownloadWidget.sizePolicy().hasHeightForWidth())
|
||||
DownloadWidget.setSizePolicy(sizePolicy)
|
||||
DownloadWidget.setWindowTitle("Form")
|
||||
self.gridLayout = QtWidgets.QGridLayout(DownloadWidget)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.downloaded = QtWidgets.QLabel(DownloadWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.downloaded.sizePolicy().hasHeightForWidth())
|
||||
self.downloaded.setSizePolicy(sizePolicy)
|
||||
self.downloaded.setText("")
|
||||
self.downloaded.setObjectName("downloaded")
|
||||
self.gridLayout.addWidget(self.downloaded, 1, 1, 1, 1)
|
||||
self.time_left = QtWidgets.QLabel(DownloadWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.time_left.sizePolicy().hasHeightForWidth())
|
||||
self.time_left.setSizePolicy(sizePolicy)
|
||||
self.time_left.setText("")
|
||||
self.time_left.setObjectName("time_left")
|
||||
self.gridLayout.addWidget(self.time_left, 2, 0, 1, 1)
|
||||
self.dl_speed = QtWidgets.QLabel(DownloadWidget)
|
||||
sizePolicy.setHeightForWidth(DownloadsTab.sizePolicy().hasHeightForWidth())
|
||||
DownloadsTab.setSizePolicy(sizePolicy)
|
||||
DownloadsTab.setWindowTitle("Form")
|
||||
self.downloads_tab_layout = QtWidgets.QVBoxLayout(DownloadsTab)
|
||||
self.downloads_tab_layout.setObjectName("downloads_tab_layout")
|
||||
self.download_layout = QtWidgets.QGridLayout()
|
||||
self.download_layout.setObjectName("download_layout")
|
||||
self.dl_speed_label = QtWidgets.QLabel(DownloadsTab)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.dl_speed_label.setFont(font)
|
||||
self.dl_speed_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.dl_speed_label.setObjectName("dl_speed_label")
|
||||
self.download_layout.addWidget(self.dl_speed_label, 1, 2, 1, 1)
|
||||
self.dl_speed = QtWidgets.QLabel(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.dl_speed.sizePolicy().hasHeightForWidth())
|
||||
self.dl_speed.setSizePolicy(sizePolicy)
|
||||
self.dl_speed.setText("")
|
||||
self.dl_speed.setText("dl_speed")
|
||||
self.dl_speed.setObjectName("dl_speed")
|
||||
self.gridLayout.addWidget(self.dl_speed, 0, 1, 1, 1)
|
||||
self.installing_game = QtWidgets.QLabel(DownloadWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.installing_game.sizePolicy().hasHeightForWidth())
|
||||
self.installing_game.setSizePolicy(sizePolicy)
|
||||
self.installing_game.setObjectName("installing_game")
|
||||
self.gridLayout.addWidget(self.installing_game, 0, 0, 1, 1)
|
||||
self.cache_used = QtWidgets.QLabel(DownloadWidget)
|
||||
self.download_layout.addWidget(self.dl_speed, 1, 3, 1, 1)
|
||||
self.cache_used = QtWidgets.QLabel(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.cache_used.sizePolicy().hasHeightForWidth())
|
||||
self.cache_used.setSizePolicy(sizePolicy)
|
||||
self.cache_used.setText("")
|
||||
self.cache_used.setText("cache_used")
|
||||
self.cache_used.setObjectName("cache_used")
|
||||
self.gridLayout.addWidget(self.cache_used, 1, 0, 1, 1)
|
||||
self.dl_queue_scroll = QtWidgets.QScrollArea(DownloadWidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.dl_queue_scroll.sizePolicy().hasHeightForWidth())
|
||||
self.dl_queue_scroll.setSizePolicy(sizePolicy)
|
||||
self.dl_queue_scroll.setFocusPolicy(QtCore.Qt.WheelFocus)
|
||||
self.dl_queue_scroll.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.dl_queue_scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.dl_queue_scroll.setWidgetResizable(True)
|
||||
self.dl_queue_scroll.setAlignment(QtCore.Qt.AlignLeading | QtCore.Qt.AlignLeft | QtCore.Qt.AlignTop)
|
||||
self.dl_queue_scroll.setObjectName("dl_queue_scroll")
|
||||
self.scroll_widget = QtWidgets.QWidget()
|
||||
self.scroll_widget.setGeometry(QtCore.QRect(0, 0, 779, 16))
|
||||
self.download_layout.addWidget(self.cache_used, 2, 1, 1, 1)
|
||||
self.time_left = QtWidgets.QLabel(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.scroll_widget.sizePolicy().hasHeightForWidth())
|
||||
self.scroll_widget.setSizePolicy(sizePolicy)
|
||||
self.scroll_widget.setObjectName("scroll_widget")
|
||||
self.scroll_contents_layout = QtWidgets.QVBoxLayout(self.scroll_widget)
|
||||
self.scroll_contents_layout.setContentsMargins(0, 0, 9, 0)
|
||||
self.scroll_contents_layout.setObjectName("scroll_contents_layout")
|
||||
self.dl_queue_scroll.setWidget(self.scroll_widget)
|
||||
self.gridLayout.addWidget(self.dl_queue_scroll, 4, 0, 1, 2)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.prog_bar = QtWidgets.QProgressBar(DownloadWidget)
|
||||
sizePolicy.setHeightForWidth(self.time_left.sizePolicy().hasHeightForWidth())
|
||||
self.time_left.setSizePolicy(sizePolicy)
|
||||
self.time_left.setText("time_left")
|
||||
self.time_left.setObjectName("time_left")
|
||||
self.download_layout.addWidget(self.time_left, 1, 1, 1, 1)
|
||||
self.dl_name = QtWidgets.QLabel(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.dl_name.sizePolicy().hasHeightForWidth())
|
||||
self.dl_name.setSizePolicy(sizePolicy)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.dl_name.setFont(font)
|
||||
self.dl_name.setText("dl_name")
|
||||
self.dl_name.setObjectName("dl_name")
|
||||
self.download_layout.addWidget(self.dl_name, 0, 1, 1, 3)
|
||||
self.dl_name_label = QtWidgets.QLabel(DownloadsTab)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.dl_name_label.setFont(font)
|
||||
self.dl_name_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.dl_name_label.setObjectName("dl_name_label")
|
||||
self.download_layout.addWidget(self.dl_name_label, 0, 0, 1, 1)
|
||||
self.time_left_label = QtWidgets.QLabel(DownloadsTab)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.time_left_label.setFont(font)
|
||||
self.time_left_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.time_left_label.setObjectName("time_left_label")
|
||||
self.download_layout.addWidget(self.time_left_label, 1, 0, 1, 1)
|
||||
self.downloaded_label = QtWidgets.QLabel(DownloadsTab)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.downloaded_label.setFont(font)
|
||||
self.downloaded_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.downloaded_label.setObjectName("downloaded_label")
|
||||
self.download_layout.addWidget(self.downloaded_label, 2, 2, 1, 1)
|
||||
self.downloaded = QtWidgets.QLabel(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.downloaded.sizePolicy().hasHeightForWidth())
|
||||
self.downloaded.setSizePolicy(sizePolicy)
|
||||
self.downloaded.setText("downloaded")
|
||||
self.downloaded.setObjectName("downloaded")
|
||||
self.download_layout.addWidget(self.downloaded, 2, 3, 1, 1)
|
||||
self.cache_used_label = QtWidgets.QLabel(DownloadsTab)
|
||||
font = QtGui.QFont()
|
||||
font.setBold(True)
|
||||
font.setWeight(75)
|
||||
self.cache_used_label.setFont(font)
|
||||
self.cache_used_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
|
||||
self.cache_used_label.setObjectName("cache_used_label")
|
||||
self.download_layout.addWidget(self.cache_used_label, 2, 0, 1, 1)
|
||||
self.download_layout.setColumnStretch(1, 1)
|
||||
self.download_layout.setColumnStretch(3, 1)
|
||||
self.downloads_tab_layout.addLayout(self.download_layout)
|
||||
self.progress_layout = QtWidgets.QHBoxLayout()
|
||||
self.progress_layout.setObjectName("progress_layout")
|
||||
self.progress_bar = QtWidgets.QProgressBar(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.prog_bar.sizePolicy().hasHeightForWidth())
|
||||
self.prog_bar.setSizePolicy(sizePolicy)
|
||||
self.prog_bar.setProperty("value", 0)
|
||||
self.prog_bar.setObjectName("prog_bar")
|
||||
self.horizontalLayout.addWidget(self.prog_bar)
|
||||
self.kill_button = QtWidgets.QPushButton(DownloadWidget)
|
||||
sizePolicy.setHeightForWidth(self.progress_bar.sizePolicy().hasHeightForWidth())
|
||||
self.progress_bar.setSizePolicy(sizePolicy)
|
||||
self.progress_bar.setProperty("value", 0)
|
||||
self.progress_bar.setObjectName("progress_bar")
|
||||
self.progress_layout.addWidget(self.progress_bar)
|
||||
self.kill_button = QtWidgets.QPushButton(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.kill_button.sizePolicy().hasHeightForWidth())
|
||||
self.kill_button.setSizePolicy(sizePolicy)
|
||||
self.kill_button.setObjectName("kill_button")
|
||||
self.horizontalLayout.addWidget(self.kill_button)
|
||||
self.gridLayout.addLayout(self.horizontalLayout, 3, 0, 1, 2)
|
||||
self.progress_layout.addWidget(self.kill_button)
|
||||
self.downloads_tab_layout.addLayout(self.progress_layout)
|
||||
self.queue_scroll = QtWidgets.QScrollArea(DownloadsTab)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.queue_scroll.sizePolicy().hasHeightForWidth())
|
||||
self.queue_scroll.setSizePolicy(sizePolicy)
|
||||
self.queue_scroll.setFocusPolicy(QtCore.Qt.WheelFocus)
|
||||
self.queue_scroll.setFrameShape(QtWidgets.QFrame.NoFrame)
|
||||
self.queue_scroll.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
|
||||
self.queue_scroll.setWidgetResizable(True)
|
||||
self.queue_scroll.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
|
||||
self.queue_scroll.setObjectName("queue_scroll")
|
||||
self.queue_scroll_contents = QtWidgets.QWidget()
|
||||
self.queue_scroll_contents.setGeometry(QtCore.QRect(0, 0, 665, 16))
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Maximum)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.queue_scroll_contents.sizePolicy().hasHeightForWidth())
|
||||
self.queue_scroll_contents.setSizePolicy(sizePolicy)
|
||||
self.queue_scroll_contents.setObjectName("queue_scroll_contents")
|
||||
self.queue_scroll_contents_layout = QtWidgets.QVBoxLayout(self.queue_scroll_contents)
|
||||
self.queue_scroll_contents_layout.setContentsMargins(0, 0, 9, 0)
|
||||
self.queue_scroll_contents_layout.setObjectName("queue_scroll_contents_layout")
|
||||
self.queue_scroll.setWidget(self.queue_scroll_contents)
|
||||
self.downloads_tab_layout.addWidget(self.queue_scroll)
|
||||
|
||||
self.retranslateUi(DownloadWidget)
|
||||
QtCore.QMetaObject.connectSlotsByName(DownloadWidget)
|
||||
self.retranslateUi(DownloadsTab)
|
||||
QtCore.QMetaObject.connectSlotsByName(DownloadsTab)
|
||||
|
||||
def retranslateUi(self, DownloadWidget):
|
||||
def retranslateUi(self, DownloadsTab):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
self.installing_game.setText(_translate("DownloadWidget", "No active download"))
|
||||
self.kill_button.setText(_translate("DownloadWidget", "Stop Download"))
|
||||
self.dl_speed_label.setText(_translate("DownloadsTab", "Download speed:"))
|
||||
self.dl_name_label.setText(_translate("DownloadsTab", "Current download:"))
|
||||
self.time_left_label.setText(_translate("DownloadsTab", "Time left:"))
|
||||
self.downloaded_label.setText(_translate("DownloadsTab", "Downloaded:"))
|
||||
self.cache_used_label.setText(_translate("DownloadsTab", "Cache size:"))
|
||||
self.kill_button.setText(_translate("DownloadsTab", "Stop Download"))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
app = QtWidgets.QApplication(sys.argv)
|
||||
DownloadWidget = QtWidgets.QWidget()
|
||||
ui = Ui_DownloadWidget()
|
||||
ui.setupUi(DownloadWidget)
|
||||
DownloadWidget.show()
|
||||
DownloadsTab = QtWidgets.QWidget()
|
||||
ui = Ui_DownloadsTab()
|
||||
ui.setupUi(DownloadsTab)
|
||||
DownloadsTab.show()
|
||||
sys.exit(app.exec_())
|
||||
|
|
|
@ -1,177 +1,267 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DownloadWidget</class>
|
||||
<widget class="QWidget" name="DownloadWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>797</width>
|
||||
<height>541</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="downloaded">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="time_left">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLabel" name="dl_speed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="installing_game">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>No active download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="cache_used">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<widget class="QScrollArea" name="dl_queue_scroll">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::WheelFocus</enum>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="scroll_widget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>779</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="scroll_contents_layout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="prog_bar">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="kill_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop Download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
<class>DownloadsTab</class>
|
||||
<widget class="QWidget" name="DownloadsTab">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>677</width>
|
||||
<height>195</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string notr="true">Form</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="downloads_tab_layout">
|
||||
<item>
|
||||
<layout class="QGridLayout" name="download_layout" columnstretch="0,1,0,1">
|
||||
<item row="1" column="2">
|
||||
<widget class="QLabel" name="dl_speed_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Download speed:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="3">
|
||||
<widget class="QLabel" name="dl_speed">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">dl_speed</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLabel" name="cache_used">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">cache_used</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLabel" name="time_left">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">time_left</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="3">
|
||||
<widget class="QLabel" name="dl_name">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>50</weight>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">dl_name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="dl_name_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Current download:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="time_left_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Time left:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="2">
|
||||
<widget class="QLabel" name="downloaded_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Downloaded:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="3">
|
||||
<widget class="QLabel" name="downloaded">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string notr="true">downloaded</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="cache_used_label">
|
||||
<property name="font">
|
||||
<font>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Cache size:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="progress_layout">
|
||||
<item>
|
||||
<widget class="QProgressBar" name="progress_bar">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="kill_button">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Maximum" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Stop Download</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="queue_scroll">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="focusPolicy">
|
||||
<enum>Qt::WheelFocus</enum>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::NoFrame</enum>
|
||||
</property>
|
||||
<property name="horizontalScrollBarPolicy">
|
||||
<enum>Qt::ScrollBarAlwaysOff</enum>
|
||||
</property>
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<widget class="QWidget" name="queue_scroll_contents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>665</width>
|
||||
<height>16</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Maximum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="queue_scroll_contents_layout">
|
||||
<property name="leftMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>9</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
Loading…
Reference in a new issue