From 26c9256679c817ce608174ef980815e63dc4f995 Mon Sep 17 00:00:00 2001 From: Micah Lee Date: Sun, 8 Sep 2019 17:39:31 -0700 Subject: Make web requests indicator icon increment on web requests --- onionshare_gui/mode/__init__.py | 4 ++++ onionshare_gui/mode/history.py | 6 +++--- onionshare_gui/mode/website_mode/__init__.py | 2 ++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/onionshare_gui/mode/__init__.py b/onionshare_gui/mode/__init__.py index 69ad00e6..3ef285c4 100644 --- a/onionshare_gui/mode/__init__.py +++ b/onionshare_gui/mode/__init__.py @@ -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) diff --git a/onionshare_gui/mode/history.py b/onionshare_gui/mode/history.py index 568bda7b..5dad9614 100644 --- a/onionshare_gui/mode/history.py +++ b/onionshare_gui/mode/history.py @@ -663,8 +663,8 @@ class History(QtWidgets.QWidget): else: image = self.common.get_resource_path('images/history_requests.png') - self.requests_label.setText(' {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(' {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 diff --git a/onionshare_gui/mode/website_mode/__init__.py b/onionshare_gui/mode/website_mode/__init__.py index 3d4497f0..b277b6c3 100644 --- a/onionshare_gui/mode/website_mode/__init__.py +++ b/onionshare_gui/mode/website_mode/__init__.py @@ -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 -- cgit v1.2.3-54-g00ecf