summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Cort <tcort@gentoo.org>2006-09-09 12:57:11 +0000
committerThomas Cort <tcort@gentoo.org>2006-09-09 12:57:11 +0000
commitc1ed2594c60d41f6c141714ff36203934251f892 (patch)
tree037d52888eb678e89763b9271070e552c78d9a9d /media-plugins
parentHard mask OpenAFS' current development branch (diff)
downloadgentoo-2-c1ed2594c60d41f6c141714ff36203934251f892.tar.gz
gentoo-2-c1ed2594c60d41f6c141714ff36203934251f892.tar.bz2
gentoo-2-c1ed2594c60d41f6c141714ff36203934251f892.zip
Added ipod detection patch from Frittella Laurento <mrfree@infinito.it>.
(Portage version: 2.1-r2)
Diffstat (limited to 'media-plugins')
-rw-r--r--media-plugins/quodlibet-ipod/ChangeLog6
-rw-r--r--media-plugins/quodlibet-ipod/files/0.4-ipod-detect.patch133
-rw-r--r--media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild4
3 files changed, 140 insertions, 3 deletions
diff --git a/media-plugins/quodlibet-ipod/ChangeLog b/media-plugins/quodlibet-ipod/ChangeLog
index 501d332cfa00..88217a0a9b3d 100644
--- a/media-plugins/quodlibet-ipod/ChangeLog
+++ b/media-plugins/quodlibet-ipod/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for media-plugins/quodlibet-ipod
# Copyright 1999-2006 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-plugins/quodlibet-ipod/ChangeLog,v 1.1 2006/09/09 12:48:35 tcort Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-plugins/quodlibet-ipod/ChangeLog,v 1.2 2006/09/09 12:57:11 tcort Exp $
+
+ 09 Sep 2006; Thomas Cort <tcort@gentoo.org> +files/0.4-ipod-detect.patch,
+ quodlibet-ipod-0.4.ebuild:
+ Added ipod detection patch from Frittella Laurento <mrfree@infinito.it>.
*quodlibet-ipod-0.4 (09 Sep 2006)
diff --git a/media-plugins/quodlibet-ipod/files/0.4-ipod-detect.patch b/media-plugins/quodlibet-ipod/files/0.4-ipod-detect.patch
new file mode 100644
index 000000000000..df003e565305
--- /dev/null
+++ b/media-plugins/quodlibet-ipod/files/0.4-ipod-detect.patch
@@ -0,0 +1,133 @@
+--- ipod/main.old 2006-08-05 12:14:07.245399000 +0200
++++ ipod/main.py 2006-08-05 12:33:46.595399000 +0200
+@@ -23,6 +23,7 @@
+ from qltk import ErrorMessage
+
+ import gpod
++import dbus
+
+ class iPodMain(SongsMenuPlugin):
+ PLUGIN_VERSION = '0.4'
+@@ -34,18 +35,58 @@
+ win = None
+ complete = True
+
++ def detect_ipod(self):
++ bus = dbus.SystemBus()
++ try:
++ hal_manager_obj = bus.get_object('org.freedesktop.Hal',
++ '/org/freedesktop/Hal/Manager')
++ hal_manager = dbus.Interface(hal_manager_obj,
++ 'org.freedesktop.Hal.Manager')
++ dev_udi_list = hal_manager.FindDeviceStringMatch ('portable_audio_player.type', 'ipod')
++ for udi in dev_udi_list:
++ vol_udi_list = hal_manager.FindDeviceStringMatch ('info.parent', udi)
++
++ for vol_udi in vol_udi_list:
++ vol_obj = bus.get_object ('org.freedesktop.Hal', vol_udi)
++ vol = dbus.Interface (vol_obj, 'org.freedesktop.Hal.Device')
++
++ if not vol.GetProperty('volume.is_mounted'):
++ continue;
++
++ return (vol.GetProperty('block.device').encode('ascii'),
++ vol.GetProperty('volume.mount_point').encode('ascii'))
++ except None:
++ print 'HAL is down.'
++
++ return ('-', '-')
++
++ def get_ipod_path(self):
++ path = '-'
++ try:
++ path = config.get('plugins', 'ipod_path')
++ except: pass
++
++ if '-' == path:
++ (dev, path) = self.detect_ipod()
++
++ return path
++
++ def get_ipod_dev(self):
++ path = '-'
++ try:
++ path = config.get('plugins', 'ipod_device')
++ except: pass
++
++ if '-' == path:
++ (dev, path) = self.detect_ipod()
++
++ return dev
++
+ def plugin_songs(self, songs):
+ if self.win:
+ self.win.window.focus()
+ return
+
+- try: config.get('plugins', 'ipod_path')
+- except:
+- ErrorMessage(
+- widgets.main, 'Error', 'You have to set the mountpoint first!'
+- ).run()
+- return
+-
+ self.complete = True
+ self.win = self.create_window()
+ self.load_db()
+@@ -118,9 +159,9 @@
+ label = gtk.Label()
+ label.set_alignment(1, 0)
+ label.set_justify(gtk.JUSTIFY_RIGHT)
+- try: path = config.get('plugins', 'ipod_path')
++ try: path = self.get_ipod_path()
+ except: path = '-'
+- try: device = config.get('plugins', 'ipod_device')
++ try: device = self.get_ipod_dev()
+ except: device = '-'
+ label.set_markup('<span size="smaller">Mount point: <b>%s</b>\nDevice: <b>%s</b></span>'
+ % (path, device))
+@@ -223,7 +264,7 @@
+ buttons[0].set_sensitive(three)
+
+ def update_model(self):
+- path = config.get('plugins', 'ipod_path')
++ path = self.get_ipod_path()
+ if os.path.isdir(path):
+ try:
+ file = open(os.path.join(path, 'iPod_Control/Device/SysInfo'))
+@@ -242,7 +283,7 @@
+ self.refresh()
+
+ def update_space(self):
+- path = config.get('plugins', 'ipod_path')
++ path = self.get_ipod_path()
+ if os.path.isdir(path):
+ if self.db: songs = len(gpod.sw_get_tracks(self.db))
+ else: songs = '?'
+@@ -264,7 +305,7 @@
+ self.refresh()
+
+ def load_db(self):
+- path = config.get('plugins', 'ipod_path')
++ path = self.get_ipod_path()
+ self.db = gpod.itdb_parse(path, None)
+ if self.db:
+ return True
+@@ -291,7 +332,7 @@
+
+ def create_db(self):
+ db = gpod.itdb_new();
+- gpod.itdb_set_mountpoint(db, config.get('plugins', 'ipod_path'))
++ gpod.itdb_set_mountpoint(db, self.get_ipod_path())
+
+ master = gpod.itdb_playlist_new('iPod', False)
+ gpod.itdb_playlist_set_mpl(master)
+@@ -301,7 +342,7 @@
+
+ def eject(self):
+ try:
+- device = config.get('plugins', 'ipod_device')
++ device = self.get_ipod_dev()
+ except:
+ ErrorMessage(
+ widgets.main, 'Error', 'You have to set the device first!'
diff --git a/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild b/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild
index d21a82b053c0..d022e8707bf1 100644
--- a/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild
+++ b/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild,v 1.1 2006/09/09 12:48:35 tcort Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-plugins/quodlibet-ipod/quodlibet-ipod-0.4.ebuild,v 1.2 2006/09/09 12:57:11 tcort Exp $
inherit python eutils
@@ -28,7 +28,7 @@ pkg_setup() {
src_unpack() {
unpack "${A}"
- epatch "${FILESDIR}"/ipod-detect.patch
+ epatch "${FILESDIR}"/${PV}-ipod-detect.patch
}
src_install() {