Skip to content

Instantly share code, notes, and snippets.

@cfm
Last active December 21, 2022 01:01
Show Gist options
  • Save cfm/04f7eaa743db05b44c7f68c322eeadd6 to your computer and use it in GitHub Desktop.
Save cfm/04f7eaa743db05b44c7f68c322eeadd6 to your computer and use it in GitHub Desktop.
ReplyWidget state-tracing
--- a/securedrop_client/gui/widgets.py
+++ b/securedrop_client/gui/widgets.py
@@ -1852,6 +1852,7 @@ class SpeechBubble(QWidget):
signal matches the uuid of this speech bubble.
"""
if self.uuid == uuid:
+ logger.debug(uuid)
self.message.setText(text)
self.set_normal_styles()
@@ -2102,6 +2103,7 @@ class ReplyWidget(SpeechBubble):
signal matches the uuid of this widget.
"""
if self.uuid == uuid:
+ logger.debug(uuid)
self.status = "SUCCEEDED" # TODO: Add and use success status in db.ReplySendStatusCodes
self.failed_to_decrypt = False
self._update_styles()
@@ -2113,11 +2115,13 @@ class ReplyWidget(SpeechBubble):
signal matches the uuid of this widget.
"""
if self.uuid == uuid:
+ logger.debug(uuid)
self.status = ReplySendStatusCodes.FAILED.value
self.failed_to_decrypt = False
self._update_styles()
def _update_styles(self) -> None:
+ logger.debug(f"{self.uuid} BEGIN: {self.status} error={not self.error.isHidden()} check_mark={not self.check_mark.isHidden()}")
if self.failed_to_decrypt:
self.set_failed_to_decrypt_styles()
elif self.status == ReplySendStatusCodes.PENDING.value:
@@ -2131,6 +2135,7 @@ class ReplyWidget(SpeechBubble):
self.set_normal_styles()
self.error.hide()
self.check_mark.show()
+ logger.debug(f"{self.uuid} END: {self.status} error={not self.error.isHidden()} check_mark={not self.check_mark.isHidden()}")
def set_normal_styles(self) -> None:
self.message.setStyleSheet("")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment