Thu, 03 Jul 2008 20:09:18 -0400 <me@nikosapi.org>

Display message if user tries to sync to iPod without gpod installed

	* src/gpodder/gui.py: Add an informative self.notification() if the user
	attempts to sync an iPod without the libgpod python bindings installed
	* src/gpodder/sync.py: Add sync.gpod_available, Add Device.errors to
	prevent a crash in the event of an error



git-svn-id: svn://svn.berlios.de/gpodder/trunk@754 b0d088ad-0a06-0410-aad2-9ed5178a7e87
This commit is contained in:
Nick 2008-07-04 00:30:28 +00:00
parent 9f03a48832
commit 9eb1ade8f5
3 changed files with 18 additions and 2 deletions

View file

@ -1,3 +1,11 @@
Thu, 03 Jul 2008 20:09:18 -0400 <me@nikosapi.org>
Display message if user tries to sync to iPod without gpod installed
* src/gpodder/gui.py: Add an informative self.notification() if the user
attempts to sync an iPod without the libgpod python bindings installed
* src/gpodder/sync.py: Add sync.gpod_available, Add Device.errors to
prevent a crash in the event of an error
Thu, 03 Jul 2008 20:26:50 +0200 <thp@perli.net>
Update list of book donators

View file

@ -1668,7 +1668,13 @@ class gPodder(GladeWidget):
break
def on_sync_to_ipod_activate(self, widget, episodes=None):
Thread(target=self.sync_to_ipod_thread, args=(widget, episodes)).start()
# make sure gpod is available before even trying to sync
if gl.config.device_type == 'ipod' and not sync.gpod_available:
title = _('Cannot Sync To iPod')
message = _('Please install the libgpod python bindings (python-gpod) and restart gPodder to continue.')
self.notification( message, title )
else:
Thread(target=self.sync_to_ipod_thread, args=(widget, episodes)).start()
def sync_to_ipod_thread(self, widget, episodes=None):
device = sync.open_device()

View file

@ -32,9 +32,11 @@ from gpodder.liblogger import log
from gpodder.libgpodder import gl
from gpodder.dbsqlite import db
gpod_available = True
try:
import gpod
except:
gpod_available = False
log('(gpodder.sync) Could not find gpod')
try:
@ -134,7 +136,7 @@ class Device(services.ObservableService):
def __init__(self):
self.cancelled = False
self.allowed_types = ['audio', 'video']
self.errors = []
signals = ['progress', 'sub-progress', 'status', 'done']
services.ObservableService.__init__(self, signals)