Esempio n. 1
0
 def receive_article(self, item):
     """
     A worker thread delivered an article to the view, see if it is current then display it if so
     """
     assert self.content_view is not None
     current_item = self.gatherer.item(self.last_item_feed_name, self.last_item_index)
     if item == current_item:
         TextFormat.prepare_content_display(item, self.content_view)
Esempio n. 2
0
 def show_new_content(self, tree_view):
     model, it = tree_view.get_selection().get_selected()
     if model and it:
         self.get_info_from_headline(model[it])
         self.color_headline(model[it], string_to_RGBA(self.appearance()['Read Color']))
         item = self.gatherer.item(self.last_item_feed_name, self.last_item_index)
         if item.article:
             TextFormat.prepare_content_display(item, self.content_view)
         else:
             self.gatherer.request(item)
Esempio n. 3
0
 def create_content_box() -> (Gtk.ScrolledWindow, Gtk.TextView):
     text_scroll = Gtk.ScrolledWindow()
     text_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS)
     text_view = TextFormat.prepare_content_display(None, None)
     text_scroll.add(text_view)
     return text_scroll, text_view
Esempio n. 4
0
 def show_new_content(self, tree_view: Gtk.TreeView) -> None:
     model, it = tree_view.get_selection().get_selected()
     if model and it:
         item = self.news_store.row_to_item(model[it])
         TextFormat.prepare_content_display(item, self.content_view)
Esempio n. 5
0
 def create_content_box():
     text_scroll = Gtk.ScrolledWindow()
     text_scroll.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.ALWAYS)
     text_view = TextFormat.prepare_content_display(None, None)
     text_scroll.add(text_view)
     return text_scroll, text_view
Esempio n. 6
0
 def refresh(self):
     self.clear_store(self.headline_store, self.toggle_headline_listening)
     TextFormat.empty(self.content_view)
     super().refresh()
     self.gatherer.request_feeds()