def show_sources()

in client/securedrop_client/gui/widgets.py [0:0]


    def show_sources(self, sources: list[Source]) -> None:
        """
        Update the sources list in the GUI with the supplied list of sources.
        """
        # If the source list in the GUI is empty, then we will run the optimized initial update.
        # Otherwise, do a regular source list update.
        if not self.source_list.source_items:
            self.source_list.initial_update(sources)
        else:
            deleted_sources = self.source_list.update_sources(sources)
            for source_uuid in deleted_sources:
                # Then call the function to remove the wrapper and its children.
                self.delete_conversation(source_uuid)

        # Show the correct conversation pane gui element depending on
        # the number of sources a) available and b) selected.
        # An improved approach will be to create an `on_source_context_update`
        # pyQtSlot that subscribes/listens for storage updates and calls
        # `show_sources` and `show_conversation_context`.
        self._on_update_conversation_context()