Bug #7346: GPodder should allow to update the feeds cache at startup

git-svn-id: svn://svn.berlios.de/gpodder@105 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2006-05-01 21:12:34 +00:00
parent 2cb3d40647
commit 6cf9709bde
5 changed files with 51 additions and 13 deletions

View File

@ -1,3 +1,8 @@
Mon, 01 May 2006 21:28:24 +0200 <thp@perli.net>
* Applied patch from Adrien Beaucreux <informancer at web.de>
to support "update on startup" option (updates feed cache)
(fixes bug #7346)
Fri, 14 Apr 2006 14:40:47 +0200 <thp@perli.net>
* Commented-out the "eject" call on end of iPod sync for now
* Fallback to default download dir if not able to create it

View File

@ -26,8 +26,8 @@
# PLEASE DO NOT CHANGE FORMAT OF __version__ LINE (setup.py reads this)
__author__ = "Thomas Perl <thp@perli.net>"
__version__ = "0.7+svn20060409"
__date__ = "2006-04-09"
__version__ = "0.7+svn20060501"
__date__ = "2006-05-01"
__copyright__ = "Copyright (c) 2005-2006 %s. All rights reserved." % __author__
__licence__ = "GPL"

View File

@ -1725,7 +1725,7 @@
<widget class="GtkTable" id="table2">
<property name="border_width">10</property>
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_rows">4</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">5</property>
@ -1871,6 +1871,28 @@
<property name="y_options"></property>
</packing>
</child>
<child>
<widget class="GtkCheckButton" id="updateonstartup">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label" translatable="yes">Update channels on startup</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
</widget>
<packing>
<property name="left_attach">1</property>
<property name="right_attach">2</property>
<property name="top_attach">3</property>
<property name="bottom_attach">4</property>
<property name="x_options">fill</property>
<property name="y_options"></property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>

View File

@ -208,6 +208,9 @@ class Gpodder(SimpleGladeApp):
# if we are running a SVN-based version, notify the user :)
if app_version.rfind( "svn") != -1:
self.showMessage( _("<b>gPodder development version %s</b>\nUse at your own risk, but also enjoy new features :)") % app_version)
# Update the feed list if the user has set it up
if gPodderLib().update_on_startup:
self.update_feed_cache()
#-- Gpodder.new }
#-- Gpodder custom methods {
@ -380,6 +383,19 @@ class Gpodder(SimpleGladeApp):
return False
sync.clean_playlist()
sync.close()
def update_feed_cache(self):
reader = gPodderChannelReader()
#self.channels = reader.read( True)
#self.labelStatus.set_text( "Updating feed cache...")
please_wait = gtk.MessageDialog()
please_wait.set_markup( _("<big><b>Updating feed cache</b></big>\n\nPlease wait while gPodder is\nupdating the feed cache..."))
please_wait.show()
self.channels = reader.read( True)
please_wait.destroy()
#self.labelStatus.set_text( "")
self.updateComboBox()
#-- Gpodder custom methods }
#-- Gpodder.close_gpodder {
@ -401,16 +417,7 @@ class Gpodder(SimpleGladeApp):
def on_itemUpdate_activate(self, widget, *args):
if libgpodder.isDebugging():
print "on_itemUpdate_activate called with self.%s" % widget.get_name()
reader = gPodderChannelReader()
#self.channels = reader.read( True)
#self.labelStatus.set_text( "Updating feed cache...")
please_wait = gtk.MessageDialog()
please_wait.set_markup( _("<big><b>Updating feed cache</b></big>\n\nPlease wait while gPodder is\nupdating the feed cache..."))
please_wait.show()
self.channels = reader.read( True)
please_wait.destroy()
#self.labelStatus.set_text( "")
self.updateComboBox()
self.update_feed_cache()
#-- Gpodder.on_itemUpdate_activate }
#-- Gpodder.on_sync_to_ipod_activate {
@ -825,6 +832,7 @@ class Gpodderproperties(SimpleGladeApp):
self.ftpProxy.set_text( gl.ftp_proxy)
self.openApp.set_text( gl.open_app)
self.iPodMountpoint.set_text( gl.ipod_mount)
self.updateonstartup.set_active(gl.update_on_startup)
# the use proxy env vars check box
self.cbEnvironmentVariables.set_active( gl.proxy_use_environment)
# if the symlink exists, set the checkbox active
@ -916,6 +924,7 @@ class Gpodderproperties(SimpleGladeApp):
gl.open_app = self.openApp.get_text()
gl.proxy_use_environment = self.cbEnvironmentVariables.get_active()
gl.ipod_mount = self.iPodMountpoint.get_text()
gl.update_on_startup = self.updateonstartup.get_active()
gl.propertiesChanged()
# create or remove symlink to download dir on desktop
if self.cbDesktopSymlink.get_active():

View File

@ -145,6 +145,7 @@ class gPodderLibClass( object):
self.write_to_parser( parser, 'player', self.open_app)
self.write_to_parser( parser, 'proxy_use_env', self.proxy_use_environment)
self.write_to_parser( parser, 'ipod_mount', self.ipod_mount)
self.write_to_parser( parser, 'update_on_startup', self.update_on_startup)
fn = self.getConfigFilename()
fp = open( fn, "w")
parser.write( fp)
@ -197,6 +198,7 @@ class gPodderLibClass( object):
app = self.get_from_parser( parser, 'player', 'gnome-open')
self.proxy_use_environment = self.get_boolean_from_parser( parser, 'proxy_use_env', True)
self.ipod_mount = self.get_from_parser( parser, 'ipod_mount', '/media/ipod/')
self.update_on_startup = self.get_boolean_from_parser(parser, 'update_on_startup', default=False)
else:
if isDebugging():
print "config file %s has no section %s" % (fn, gpodderconf_section)