コード例 #1
0
ファイル: search.py プロジェクト: thejacer87/cozy
    def __on_author_search_finished(self, authors):
        """
        This gets called after the author search is finished.
        It adds all the results to the gui.
        :param authors: Result peewee query containing the authors
        """
        if len(authors) > 0:
            self.stack.set_visible_child_name("main")
            self.author_label.set_visible(True)
            self.author_separator.set_visible(True)

            for author in authors:
                if self.search_thread_stop.is_set():
                    return
                self.author_box.add(ArtistSearchResult(self.ui.jump_to_author, author, True))
コード例 #2
0
ファイル: ui.py プロジェクト: HansCz/cozy
    def __on_reader_search_finished(self, readers):
        """
        This gets called after the reader search is finished.
        It adds all the results to the gui.
        It also resets the gui to a state before the search.
        :param readers: Result peewee query containing the readers
        """
        if len(readers) > 0:
            self.search_stack.set_visible_child_name("main")
            self.search_reader_label.set_visible(True)
            self.search_reader_separator.set_visible(True)

            for reader in readers:
                if self.search_thread_stop.is_set():
                    return
                self.search_reader_box.add(
                    ArtistSearchResult(self.__jump_to_reader, reader, False))

        # the reader search is the last that finishes
        # so we stop the throbber and reset the prefered height & width
        self.throbber.stop()
        self.search_popover.set_size_request(-1, -1)