diff -r dd4a8b507144 -r 35ec993034e1 WebBrowser/Download/DownloadItem.py --- a/WebBrowser/Download/DownloadItem.py Sat Apr 07 16:40:21 2018 +0200 +++ b/WebBrowser/Download/DownloadItem.py Sun Apr 08 15:54:34 2018 +0200 @@ -21,7 +21,7 @@ from .Ui_DownloadItem import Ui_DownloadItem -from .DownloadUtilities import timeString, dataString +from .DownloadUtilities import timeString, dataString, speedString from WebBrowser.WebBrowserWindow import WebBrowserWindow import UI.PixmapCache @@ -401,6 +401,15 @@ self.progress.emit(currentValue, totalValue) self.__updateInfoLabel() + def downloadProgress(self): + """ + Public method to get the download progress. + + @return current download progress + @rtype int + """ + return self.progressBar.value() + def bytesTotal(self): """ Public method to get the total number of bytes of the download. @@ -471,12 +480,12 @@ if bytesTotal > 0: remaining = timeString(timeRemaining) - info = self.tr("{0} of {1} ({2}/sec)\n{3}")\ + info = self.tr("{0} of {1} ({2}/sec) {3}")\ .format( dataString(self.__bytesReceived), bytesTotal == -1 and self.tr("?") or dataString(bytesTotal), - dataString(int(speed)), + speedString(speed), remaining) else: if self.__bytesReceived == bytesTotal or bytesTotal == -1: