From e91eebefbea450a447b44a81dcabcc6ac8000a48 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 24 Aug 2013 22:50:00 +0200 Subject: - download size is now displayed - multiple esps/mods can now be enabled/disabled at once using space - bugfix: fomod installer didn't compile because of changes to condition checking - bugfix: broken inverse virtual name resolution in case of non-default mod directory --- src/downloadlistwidgetcompact.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/downloadlistwidgetcompact.cpp') diff --git a/src/downloadlistwidgetcompact.cpp b/src/downloadlistwidgetcompact.cpp index 39e8010b..f3e395da 100644 --- a/src/downloadlistwidgetcompact.cpp +++ b/src/downloadlistwidgetcompact.cpp @@ -44,6 +44,7 @@ DownloadListWidgetCompactDelegate::DownloadListWidgetCompactDelegate(DownloadMan : QItemDelegate(parent), m_Manager(manager), m_ItemWidget(new DownloadListWidgetCompact), m_View(view) { m_NameLabel = m_ItemWidget->findChild("nameLabel"); + m_SizeLabel = m_ItemWidget->findChild("sizeLabel"); m_Progress = m_ItemWidget->findChild("downloadProgress"); m_DoneLabel = m_ItemWidget->findChild("doneLabel"); @@ -106,7 +107,13 @@ void DownloadListWidgetCompactDelegate::paint(QPainter *painter, const QStyleOpt name.append("..."); } m_NameLabel->setText(name); + DownloadManager::DownloadState state = m_Manager->getState(downloadIndex); + + if (state >= DownloadManager::STATE_READY) { + m_SizeLabel->setText(QString::number(m_Manager->getFileSize(downloadIndex) / 1048576)); + } + if ((state == DownloadManager::STATE_PAUSED) || (state == DownloadManager::STATE_ERROR)) { m_DoneLabel->setVisible(true); m_Progress->setVisible(false); -- cgit v1.3.1