mirror of
https://github.com/onionshare/onionshare.git
synced 2024-10-01 01:35:40 -04:00
Reset the ToggleHistory indicator count/label when a share starts. Add a test for this
This commit is contained in:
parent
f118ebcb09
commit
09f2f57298
@ -212,6 +212,8 @@ class ReceiveMode(Mode):
|
||||
Set the info counters back to zero.
|
||||
"""
|
||||
self.history.reset()
|
||||
self.toggle_history.indicator_count = 0
|
||||
self.toggle_history.update_indicator()
|
||||
|
||||
def update_primary_action(self):
|
||||
self.common.log('ReceiveMode', 'update_primary_action')
|
||||
|
@ -334,6 +334,8 @@ class ShareMode(Mode):
|
||||
Set the info counters back to zero.
|
||||
"""
|
||||
self.history.reset()
|
||||
self.toggle_history.indicator_count = 0
|
||||
self.toggle_history.update_indicator()
|
||||
|
||||
@staticmethod
|
||||
def _compute_total_size(filenames):
|
||||
|
@ -258,6 +258,8 @@ class WebsiteMode(Mode):
|
||||
Set the info counters back to zero.
|
||||
"""
|
||||
self.history.reset()
|
||||
self.toggle_history.indicator_count = 0
|
||||
self.toggle_history.update_indicator()
|
||||
|
||||
@staticmethod
|
||||
def _compute_total_size(filenames):
|
||||
|
@ -170,6 +170,9 @@ class GuiBaseTest(object):
|
||||
QtTest.QTest.mouseClick(mode.server_status.server_button, QtCore.Qt.LeftButton)
|
||||
self.assertEqual(mode.server_status.status, 1)
|
||||
|
||||
def toggle_indicator_is_reset(self, mode):
|
||||
self.assertEqual(mode.toggle_history.indicator_count, 0)
|
||||
self.assertFalse(mode.toggle_history.indicator_label.isVisible())
|
||||
|
||||
def server_status_indicator_says_starting(self, mode):
|
||||
'''Test that the Server Status indicator shows we are Starting'''
|
||||
|
@ -173,6 +173,7 @@ class GuiShareTest(GuiBaseTest):
|
||||
self.server_status_indicator_says_closed(self.gui.share_mode, stay_open)
|
||||
self.add_button_visible(self.gui.share_mode)
|
||||
self.server_working_on_start_button_pressed(self.gui.share_mode)
|
||||
self.toggle_indicator_is_reset(self.gui.share_mode)
|
||||
self.server_is_started(self.gui.share_mode)
|
||||
self.history_indicator(self.gui.share_mode, public_mode)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user