/[straw]/straw/src/lib/MainWindow.py
ViewVC logotype

Diff of /straw/src/lib/MainWindow.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.70 by jmalonzo, Mon Aug 18 08:32:52 2003 UTC revision 1.71 by jmalonzo, Tue Aug 19 09:47:55 2003 UTC
# Line 15  from gtk import glade Line 15  from gtk import glade
15  import straw  import straw
16  from error import log  from error import log
17  import htmlentitydefs  import htmlentitydefs
18    import time
19    
20  class ExceptionView:  class ExceptionView:
21      def __init__(self, frame, label):      def __init__(self, frame, label):
# Line 151  class ItemView: Line 152  class ItemView:
152          if item.title is not None:          if item.title is not None:
153              ret.append('<div class="stitle">%s</div>' % item.title)              ret.append('<div class="stitle">%s</div>' % item.title)
154          if item.pub_date is not None:          if item.pub_date is not None:
155                format = '%a, %d %b %H:%M:%S'
156              ret.append('<div class="sdate">%s</div>' %              ret.append('<div class="sdate">%s</div>' %
157              str(item.pub_date.localtime().strftime('%a, %d %b %H:%M:%S')))                         unicode(item.pub_date.localtime().strftime(format),'latin-1').encode('utf-8'))
158          ret.append('<div class="content">')          ret.append('<div class="content">')
159          if item.description is not None:          if item.description is not None:
160              ret.append('%s ' % item.description)              ret.append('%s ' % item.description)
# Line 183  class ItemView: Line 185  class ItemView:
185                                          item.publication_starting_page))                                          item.publication_starting_page))
186              ret.append('</p><p>')              ret.append('</p><p>')
187          if item.link is not None:          if item.link is not None:
188              ret.append('<a href="%s">Full Story &gt;&gt;</a><br />' % item.link)              ret.append('<a href="%s">%s &gt;&gt;</a><br />' %
189                           (item.link,_("Full Story")))
190          if item.guid is not None and is_url(item.guid):          if item.guid is not None and is_url(item.guid):
191              ret.append('<a href="%s">%s &gt;&gt;</a>' %              ret.append('<a href="%s">%s &gt;&gt;</a>' %
192                         (item.guid, _("Permanent link")))                         (item.guid, _("Permanent link")))
# Line 473  class OfflineToggle: Line 476  class OfflineToggle:
476      def mode_changed(self, signal):      def mode_changed(self, signal):
477          self.show()          self.show()
478    
479    class StatusTime:
480        def __init__(self, widget):
481            self.time_label = widget
482            straw.config.signal_connect(straw.LastPollChangedSignal, self.next_poll)
483    
484        def next_poll(self, *args):
485            format = '%d %b %H:%M:%S'
486            npoll = straw.config.last_poll + straw.config.poll_frequency
487            npoll_sane = _("Next polling time: <b>%s</b>" %  time.strftime(format,time.localtime(npoll)))
488            self.time_label.set_text(npoll_sane)
489            self.time_label.set_property("use_markup", True)
490            self.time_label.show()
491    
492        def show(self):
493            self.next_poll()
494            return
495    
496  class Toolbar:  class Toolbar:
497      def __init__(self,widget):      def __init__(self,widget):
498          # set toolbar tooltips          # set toolbar tooltips
# Line 661  class MainWindow: Line 681  class MainWindow:
681              xml.get_widget('offline_toggle'))              xml.get_widget('offline_toggle'))
682          self._toolbar = Toolbar(          self._toolbar = Toolbar(
683              xml.get_widget('toolbar_default'))              xml.get_widget('toolbar_default'))
684            self._timestats = StatusTime(
685                xml.get_widget('status_next_poll'))
686          self._offline_toggle.show()          self._offline_toggle.show()
687          self._toolbar.show_tips()          self._toolbar.show_tips()
688            self._timestats.show()
689          self.create_ui(xml)          self.create_ui(xml)
690          # status messages are queued and displayed with a half a second          # status messages are queued and displayed with a half a second
691          # timeout, so the user can see what's happening. the timeout is only          # timeout, so the user can see what's happening. the timeout is only
# Line 728  class MainWindow: Line 751  class MainWindow:
751    
752      def on_menu_about_activate(self, menuitem, *args):      def on_menu_about_activate(self, menuitem, *args):
753          gnome.ui.About(          gnome.ui.About(
754              straw.APPNAME, straw.VERSION, "Copyright (c) 2002 Juri Pakaste", "",              straw.APPNAME, straw.VERSION, "Copyright (c) 2002-2003 Juri Pakaste", "",
755              ["Juri Pakaste <juri@iki.fi>",              ["Juri Pakaste <juri@iki.fi>",
756               "Jan Alonzo <jmalonzo@spaceants.org>",               "Jan Alonzo <jmalonzo@spaceants.org>",
757               "rssparser.py and rssfinder.py by Mark Pilgrim",               "rssparser.py and rssfinder.py by Mark Pilgrim",
# Line 736  class MainWindow: Line 759  class MainWindow:
759              [],              [],
760              "Juri Pakaste <juri@iki.fi>\n"              "Juri Pakaste <juri@iki.fi>\n"
761              "Martin Steldinger <tribble@hanfplantage.de>\n"              "Martin Steldinger <tribble@hanfplantage.de>\n"
762              "David Rousseau <boiteaflood@wanadoo.fr>",              "David Rousseau <boiteaflood@wanadoo.fr>\n"
763                "Sergei Vavinov <svv@cmc.msu.ru>\n"
764                 u"Terje Rosten <terjeros@phys.ntnu.no>",
765              gtk.gdk.pixbuf_new_from_file(straw.main._libdir +              gtk.gdk.pixbuf_new_from_file(straw.main._libdir +
766                                           "/straw.png")).show()                                           "/straw.png")).show()
767    

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26