mirror of
https://github.com/onionshare/onionshare.git
synced 2024-12-28 16:59:35 -05:00
Make web requests indicator icon increment on web requests
This commit is contained in:
parent
2219e107c4
commit
26c9256679
@ -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)
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user