tagging fixes; window size/position save/restore; treeview column sizing; translations

git-svn-id: svn://svn.berlios.de/gpodder/trunk@297 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Thomas Perl 2007-04-01 17:53:04 +00:00
parent 99ce33a6a6
commit 73289acb60
15 changed files with 6049 additions and 2889 deletions

View file

@ -1,3 +1,24 @@
Sun, 1 Apr 2007 19:45:28 +0200 <thp@perli.net>
* src/gpodder/libtagupdate.py: Return false on error
* src/gpodder/libpodcasts.py: Don't set the album tag to "gPodder
podcasts" when tagging downloaded files
* src/gpodder/libgpodder.py: save/restore main window size and position
* src/gpodder/libipodsync.py: Update tags on converted MP3 files, so
applications accessing files on the iPod without reading the meta-
data in the iTunesDB will be able to correctly identify the episodes;
do not set the track artist to "gPodder podcast" when syncing to the
podcasts playlist
* src/gpodder/gpodder.py: Fix bad behaviour of the available podcasts
treeview (thanks to Pieter De Decker [pdedecker gmail com] for
bringing this problem to my attention); save and restore window size
and position of gPodder's main window; fix some strings to ease
translations
* data/gpodder.glade: Make certain strings in the toolbar translatable
thanks to Pieter De Decker for pointing that out :)
* data/messages.pot: Updated translation template from new code
* data/po/de.po: Updated German translation
* data/po/*.po: Updated translations from new code
Sat, 31 Mar 2007 03:56:48 +0200 <thp@perli.net>
* src/gpodder/gpodder.py: Fixed some UI changes, add support for
new toolbar in GUI; add title in the information and confirmation

View file

@ -686,7 +686,7 @@
<child>
<widget class="GtkToolButton" id="toolUpdate">
<property name="visible">True</property>
<property name="label">Update feeds</property>
<property name="label" translatable="yes">Update feeds</property>
<property name="stock_id">gtk-refresh</property>
<signal name="clicked" handler="on_itemUpdate_activate"/>
</widget>
@ -706,7 +706,7 @@
<child>
<widget class="GtkToolButton" id="toolDownload">
<property name="visible">True</property>
<property name="label">Download</property>
<property name="label" translatable="yes">Download</property>
<property name="stock_id">gtk-go-down</property>
<signal name="clicked" handler="on_btnDownload_clicked"/>
</widget>
@ -727,7 +727,7 @@
<child>
<widget class="GtkToolButton" id="toolTransfer">
<property name="visible">True</property>
<property name="label">Transfer</property>
<property name="label" translatable="yes">Transfer</property>
<property name="stock_id">gtk-network</property>
<signal name="clicked" handler="on_btnTransfer_clicked"/>
</widget>
@ -738,7 +738,7 @@
<child>
<widget class="GtkToolButton" id="toolCancel">
<property name="visible">True</property>
<property name="label">Cancel</property>
<property name="label" translatable="yes">Cancel</property>
<property name="stock_id">gtk-stop</property>
<property name="sensitive">False</property>
<signal name="clicked" handler="on_btnCancelDownloadStatus_clicked"/>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,4 +1,4 @@
# -*- coding: UTF8 -*-
# -*- coding: utf-8 -*-
# Python module src/gpodder/gpodder.py
# Autogenerated from gpodder.glade
@ -99,6 +99,12 @@ class Gpodder(SimpleGladeApp):
#-- Gpodder.new {
def new(self):
gl = gPodderLib()
self.gPodder.resize( gl.main_window_width, gl.main_window_height)
self.gPodder.move( gl.main_window_x, gl.main_window_y)
while gtk.events_pending():
gtk.main_iteration( False)
if app_version.rfind( "svn") != -1:
self.gPodder.set_title( 'gPodder %s' % ( app_version, ))
@ -110,8 +116,9 @@ class Gpodder(SimpleGladeApp):
# See http://www.pygtk.org/pygtk2tutorial/sec-CellRenderers.html
namecell = gtk.CellRendererText()
namecell.set_property('cell-background', 'white')
namecell.set_property('ellipsize', pango.ELLIPSIZE_END)
#namecell.set_property('ellipsize', pango.ELLIPSIZE_END)
namecolumn = gtk.TreeViewColumn( _("Episode"), namecell, text=1)
namecolumn.set_sizing( gtk.TREE_VIEW_COLUMN_AUTOSIZE)
namecolumn.add_attribute(namecell, "cell-background", 4)
sizecell = gtk.CellRendererText()
@ -167,8 +174,6 @@ class Gpodder(SimpleGladeApp):
self.main_widget.connect("drag_data_received", self.drag_data_received)
self.wNotebook.connect("switch-page", self.switched_notebook)
gl = gPodderLib()
# Subscribed channels
self.active_channel = None
self.channels = gPodderChannelReader().read( force_update = False)
@ -238,6 +243,7 @@ class Gpodder(SimpleGladeApp):
while gtk.events_pending():
gtk.main_iteration( False)
self.treeAvailable.scroll_to_point( rect.x, rect.y)
self.treeAvailable.columns_autosize()
self.play_or_download()
else:
if self.treeAvailable.get_model():
@ -482,6 +488,16 @@ class Gpodder(SimpleGladeApp):
if self.download_status_manager:
self.download_status_manager.cancelAll()
gl = gPodderLib()
size = self.gPodder.get_size()
pos = self.gPodder.get_position()
gl.main_window_width = size[0]
gl.main_window_height = size[1]
gl.main_window_x = pos[0]
gl.main_window_y = pos[1]
gl.propertiesChanged()
self.gtk_main_quit()
#-- Gpodder.close_gpodder }
@ -519,10 +535,10 @@ class Gpodder(SimpleGladeApp):
to_download.append( ( channel, episode ))
s += 1
if s:
new_part = _(' <b>%d</b> new episodes in <b>%s</b>') % ( s, channel.title, )
new_part = ' ' + _('<b>%d</b> new episodes in <b>%s</b>') % ( s, channel.title, )
if s == 1:
new_part = _(' <b>1</b> new episode in <b>%s</b>') % ( channel.title, )
new_part = ' ' + _('<b>1</b> new episode in <b>%s</b>') % ( channel.title, )
message_part += new_part + "\n"
new_sum += s
@ -853,7 +869,7 @@ class Gpodder(SimpleGladeApp):
else:
e_str = '\n'.join( [ ' <b>'+e.title+'</b>' for e in episodes_to_download[:7] ] )
e_str_2 = _('(...%d more episodes...)') % ( len(episodes_to_download)-7, )
e_str = _('%s\n <i>%s</i>') % ( e_str, e_str_2, )
e_str = '%s\n <i>%s</i>' % ( e_str, e_str_2, )
title = _('Download new episodes?')
message = _('New episodes are available for download. If you want, you can download these episodes to your computer now.')
message = '%s\n\n%s' % ( message, e_str, )

View file

@ -136,6 +136,10 @@ class gPodderLibClass( object):
self.update_tags = False
self.desktop_link = _("gPodder downloads")
self.device_type = None
self.main_window_width = 600
self.main_window_height = 450
self.main_window_x = 0
self.main_window_y = 0
self.mp3_player_folder = ""
self.colors = {}
for key in default_colors.keys():
@ -214,6 +218,10 @@ class gPodderLibClass( object):
self.write_to_parser( parser, 'opml_url', self.opml_url)
self.write_to_parser( parser, 'download_dir', self.downloaddir)
self.write_to_parser( parser, 'device_type', self.device_type)
self.write_to_parser( parser, 'main_window_width', self.main_window_width)
self.write_to_parser( parser, 'main_window_height', self.main_window_height)
self.write_to_parser( parser, 'main_window_x', self.main_window_x)
self.write_to_parser( parser, 'main_window_y', self.main_window_y)
self.write_to_parser( parser, 'mp3_player_folder', self.mp3_player_folder)
for color in self.colors.keys():
self.write_to_parser( parser, 'color_' + color, self.colors[color])
@ -284,6 +292,13 @@ class gPodderLibClass( object):
except:
return default
def get_int_from_parser( self, parser, option, default = 0):
try:
result = int(parser.get( self.gpodderconf_section, option))
return result
except:
return default
def get_boolean_from_parser( self, parser, option, default = False):
try:
result = parser.getboolean( self.gpodderconf_section, option)
@ -328,6 +343,10 @@ class gPodderLibClass( object):
self.update_tags = self.get_boolean_from_parser(parser, 'update_tags', default=False)
self.downloaddir = self.get_from_parser( parser, 'download_dir', expanduser('~/gpodder-downloads'))
self.device_type = self.get_from_parser( parser, 'device_type', 'none')
self.main_window_width = self.get_int_from_parser( parser, 'main_window_width', 600)
self.main_window_height = self.get_int_from_parser( parser, 'main_window_height', 450)
self.main_window_x = self.get_int_from_parser( parser, 'main_window_x', 0)
self.main_window_y = self.get_int_from_parser( parser, 'main_window_y', 0)
self.mp3_player_folder = self.get_from_parser( parser, 'mp3_player_folder', '/media/usbdisk')
for color in self.colors.keys():
self.colors[color] = self.get_from_parser( parser, 'color_'+color, default_colors[color])
@ -349,6 +368,10 @@ class gPodderLibClass( object):
self.open_app = 'gnome-open'
self.ipod_mount = '/media/ipod'
self.device_type = 'none'
self.main_window_width = 600
self.main_window_height = 450
self.main_window_x = 0
self.main_window_y = 0
self.mp3_player_folder = '/media/usbdisk'
self.opml_url = default_opml_directory
self.downloaddir = expanduser('~/gpodder-downloads')

View file

@ -93,6 +93,7 @@ import liblocaldb
import libpodcasts
import libgpodder
import libconverter
import libtagupdate
import gobject
@ -373,6 +374,8 @@ class gPodder_iPodSync( gPodderSyncMethod):
log('(ipodsync) Converting: %s', original_filename)
callback_status = lambda percentage: self.set_episode_convert_status( episode.title, percentage)
local_filename = str( libconverter.converters.convert( original_filename, callback = callback_status))
if not libtagupdate.update_metadata_on_file( local_filename, title = episode.title, artist = channel.title):
log('(ipodsync) Could not set metadata on converted file %s', local_filename)
self.set_episode_status( episode.title)
if not local_filename:
log('(ipodsync) Error while converting file %s', original_filename)
@ -404,10 +407,8 @@ class gPodder_iPodSync( gPodderSyncMethod):
track = gpod.itdb_track_new()
track.artist = str(channel.title)
if channel.is_music_channel:
track.artist = str(channel.title)
else:
track.artist = 'gPodder podcast'
self.set_podcast_flags( track)
# Add release time to track if pubDate is parseable

View file

@ -201,7 +201,7 @@ class podcastChannel(ListType):
if libgpodder.gPodderLib().update_tags and tagging_supported():
filename = self.getPodcastFilename( item.url)
try:
update_metadata_on_file( filename, title = item.title, artist = self.title, album = _('gPodder podcasts'))
update_metadata_on_file( filename, title = item.title, artist = self.title)
except:
log('Error while calling update_metadata_on_file() :(')

View file

@ -59,6 +59,7 @@ def update_metadata_on_file( filename, **metadata):
return tag_update_methods[ext]( filename, **metadata)
log('Do not know how to update file extension %s :/', ext)
return False
def update_tag_ogg( filename, **metadata):