Make web requests indicator icon increment on web requests

This commit is contained in:
Micah Lee 2019-09-08 17:39:31 -07:00
parent 2219e107c4
commit 26c9256679
No known key found for this signature in database
GPG Key ID: 403C2657CD994F73
3 changed files with 9 additions and 3 deletions

View File

@ -425,6 +425,10 @@ class Mode(QtWidgets.QWidget):
Handle REQUEST_INDVIDIDUAL_FILES_STARTED event.
Used in both Share and Website modes, so implemented here.
"""
self.toggle_history.update_indicator(True)
self.history.requests_count += 1
self.history.update_requests()
item = IndividualFileHistoryItem(self.common, event["data"], event["path"])
self.history.add(event["data"]["id"], item)

View File

@ -663,8 +663,8 @@ class History(QtWidgets.QWidget):
else:
image = self.common.get_resource_path('images/history_requests.png')
self.requests_label.setText('<img src="{0:s}" /> {1:d}'.format(image, self.in_progress_count))
self.requests_label.setToolTip(strings._('history_requests_tooltip').format(self.in_progress_count))
self.requests_label.setText('<img src="{0:s}" /> {1:d}'.format(image, self.requests_count))
self.requests_label.setToolTip(strings._('history_requests_tooltip').format(self.requests_count))
class ToggleHistory(QtWidgets.QPushButton):
@ -697,7 +697,7 @@ class ToggleHistory(QtWidgets.QPushButton):
def update_indicator(self, increment=False):
"""
Update the display of the indicator count. If increment is True, then
only increment the counter if Downloads is hidden.
only increment the counter if History is hidden.
"""
if increment and not self.history_widget.isVisible():
self.indicator_count += 1

View File

@ -80,6 +80,8 @@ class WebsiteMode(Mode):
strings._('gui_all_modes_history'),
'website'
)
self.history.in_progress_label.hide()
self.history.completed_label.hide()
self.history.hide()
# Info label