Merge lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-2 into lp:ubuntu/natty/libubuntuone

Proposed by dobey
Status: Merged
Merged at revision: 85
Proposed branch: lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-2
Merge into: lp:ubuntu/natty/libubuntuone
Diff against target: 1798 lines (+1218/-223)
14 files modified
aclocal.m4 (+194/-194)
configure (+19/-19)
configure.ac (+2/-2)
data/Makefile.am (+1/-0)
data/Makefile.in (+1/-0)
debian/changelog (+9/-0)
debian/control (+3/-1)
debian/libubuntuone-1.0-1.install (+1/-1)
libubuntuone/Makefile.am (+2/-0)
libubuntuone/Makefile.in (+5/-1)
libubuntuone/u1-codec-installer.c (+650/-0)
libubuntuone/u1-codec-installer.h (+68/-0)
libubuntuone/u1-music-store.c (+262/-5)
po/POTFILES.in (+1/-0)
To merge this branch: bzr merge lp:~dobey/ubuntu/natty/libubuntuone/release-0-9-2
Reviewer Review Type Date Requested Status
Didier Roche-Tolomelli Approve
Ubuntu branches Pending
Review via email: mp+56797@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Didier Roche-Tolomelli (didrocks) wrote :

The branch looks good, and works, approved :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'aclocal.m4'
2--- aclocal.m4 2011-02-11 21:56:37 +0000
3+++ aclocal.m4 2011-04-07 16:11:09 +0000
4@@ -514,6 +514,200 @@
5 AM_CONDITIONAL([GTK_DOC_USE_REBASE], [test -n "$GTKDOC_REBASE"])
6 ])
7
8+
9+dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
10+# serial 40 IT_PROG_INTLTOOL
11+AC_DEFUN([IT_PROG_INTLTOOL], [
12+AC_PREREQ([2.50])dnl
13+AC_REQUIRE([AM_NLS])dnl
14+
15+case "$am__api_version" in
16+ 1.[01234])
17+ AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
18+ ;;
19+ *)
20+ ;;
21+esac
22+
23+if test -n "$1"; then
24+ AC_MSG_CHECKING([for intltool >= $1])
25+
26+ INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
27+ INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
28+ [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
29+ ]
30+ AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
31+ test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
32+ AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
33+fi
34+
35+AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
36+AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
37+AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
38+if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
39+ AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
40+fi
41+
42+ INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
43+INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
44+ INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
45+ INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
46+ INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
47+ INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
48+ INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
49+ INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
50+INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
51+ INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
52+ INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
53+ INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
54+ INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
55+ INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
56+ INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
57+ INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
58+ INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
59+ INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
60+ INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
61+
62+_IT_SUBST(INTLTOOL_DESKTOP_RULE)
63+_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
64+_IT_SUBST(INTLTOOL_KEYS_RULE)
65+_IT_SUBST(INTLTOOL_PROP_RULE)
66+_IT_SUBST(INTLTOOL_OAF_RULE)
67+_IT_SUBST(INTLTOOL_PONG_RULE)
68+_IT_SUBST(INTLTOOL_SERVER_RULE)
69+_IT_SUBST(INTLTOOL_SHEET_RULE)
70+_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
71+_IT_SUBST(INTLTOOL_UI_RULE)
72+_IT_SUBST(INTLTOOL_XAM_RULE)
73+_IT_SUBST(INTLTOOL_KBD_RULE)
74+_IT_SUBST(INTLTOOL_XML_RULE)
75+_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
76+_IT_SUBST(INTLTOOL_CAVES_RULE)
77+_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
78+_IT_SUBST(INTLTOOL_THEME_RULE)
79+_IT_SUBST(INTLTOOL_SERVICE_RULE)
80+_IT_SUBST(INTLTOOL_POLICY_RULE)
81+
82+# Check the gettext tools to make sure they are GNU
83+AC_PATH_PROG(XGETTEXT, xgettext)
84+AC_PATH_PROG(MSGMERGE, msgmerge)
85+AC_PATH_PROG(MSGFMT, msgfmt)
86+AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
87+if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
88+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
89+fi
90+xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
91+mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
92+mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
93+if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
94+ AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
95+fi
96+
97+AC_PATH_PROG(INTLTOOL_PERL, perl)
98+if test -z "$INTLTOOL_PERL"; then
99+ AC_MSG_ERROR([perl not found])
100+fi
101+AC_MSG_CHECKING([for perl >= 5.8.1])
102+$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
103+if test $? -ne 0; then
104+ AC_MSG_ERROR([perl 5.8.1 is required for intltool])
105+else
106+ IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
107+ AC_MSG_RESULT([$IT_PERL_VERSION])
108+fi
109+if test "x$2" != "xno-xml"; then
110+ AC_MSG_CHECKING([for XML::Parser])
111+ if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
112+ AC_MSG_RESULT([ok])
113+ else
114+ AC_MSG_ERROR([XML::Parser perl module is required for intltool])
115+ fi
116+fi
117+
118+# Substitute ALL_LINGUAS so we can use it in po/Makefile
119+AC_SUBST(ALL_LINGUAS)
120+
121+# Set DATADIRNAME correctly if it is not set yet
122+# (copied from glib-gettext.m4)
123+if test -z "$DATADIRNAME"; then
124+ AC_LINK_IFELSE(
125+ [AC_LANG_PROGRAM([[]],
126+ [[extern int _nl_msg_cat_cntr;
127+ return _nl_msg_cat_cntr]])],
128+ [DATADIRNAME=share],
129+ [case $host in
130+ *-*-solaris*)
131+ dnl On Solaris, if bind_textdomain_codeset is in libc,
132+ dnl GNU format message catalog is always supported,
133+ dnl since both are added to the libc all together.
134+ dnl Hence, we'd like to go with DATADIRNAME=share
135+ dnl in this case.
136+ AC_CHECK_FUNC(bind_textdomain_codeset,
137+ [DATADIRNAME=share], [DATADIRNAME=lib])
138+ ;;
139+ *)
140+ [DATADIRNAME=lib]
141+ ;;
142+ esac])
143+fi
144+AC_SUBST(DATADIRNAME)
145+
146+IT_PO_SUBDIR([po])
147+
148+])
149+
150+
151+# IT_PO_SUBDIR(DIRNAME)
152+# ---------------------
153+# All po subdirs have to be declared with this macro; the subdir "po" is
154+# declared by IT_PROG_INTLTOOL.
155+#
156+AC_DEFUN([IT_PO_SUBDIR],
157+[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
158+dnl
159+dnl The following CONFIG_COMMANDS should be executed at the very end
160+dnl of config.status.
161+AC_CONFIG_COMMANDS_PRE([
162+ AC_CONFIG_COMMANDS([$1/stamp-it], [
163+ if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
164+ AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
165+ fi
166+ rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
167+ >"$1/stamp-it.tmp"
168+ [sed '/^#/d
169+ s/^[[].*] *//
170+ /^[ ]*$/d
171+ '"s|^| $ac_top_srcdir/|" \
172+ "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
173+ ]
174+ [sed '/^POTFILES =/,/[^\\]$/ {
175+ /^POTFILES =/!d
176+ r $1/POTFILES
177+ }
178+ ' "$1/Makefile.in" >"$1/Makefile"]
179+ rm -f "$1/Makefile.tmp"
180+ mv "$1/stamp-it.tmp" "$1/stamp-it"
181+ ])
182+])dnl
183+])
184+
185+# _IT_SUBST(VARIABLE)
186+# -------------------
187+# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
188+#
189+AC_DEFUN([_IT_SUBST],
190+[
191+AC_SUBST([$1])
192+m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
193+]
194+)
195+
196+# deprecated macros
197+AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
198+# A hint is needed for aclocal from Automake <= 1.9.4:
199+# AC_DEFUN([AC_PROG_INTLTOOL], ...)
200+
201+
202 dnl -*- mode: autoconf -*-
203 dnl Copyright 2009 Johan Dahlin
204 dnl
205@@ -9957,197 +10151,3 @@
206 AC_SUBST([am__untar])
207 ]) # _AM_PROG_TAR
208
209-
210-dnl IT_PROG_INTLTOOL([MINIMUM-VERSION], [no-xml])
211-# serial 40 IT_PROG_INTLTOOL
212-AC_DEFUN([IT_PROG_INTLTOOL], [
213-AC_PREREQ([2.50])dnl
214-AC_REQUIRE([AM_NLS])dnl
215-
216-case "$am__api_version" in
217- 1.[01234])
218- AC_MSG_ERROR([Automake 1.5 or newer is required to use intltool])
219- ;;
220- *)
221- ;;
222-esac
223-
224-if test -n "$1"; then
225- AC_MSG_CHECKING([for intltool >= $1])
226-
227- INTLTOOL_REQUIRED_VERSION_AS_INT=`echo $1 | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
228- INTLTOOL_APPLIED_VERSION=`intltool-update --version | head -1 | cut -d" " -f3`
229- [INTLTOOL_APPLIED_VERSION_AS_INT=`echo $INTLTOOL_APPLIED_VERSION | awk -F. '{ print $ 1 * 1000 + $ 2 * 100 + $ 3; }'`
230- ]
231- AC_MSG_RESULT([$INTLTOOL_APPLIED_VERSION found])
232- test "$INTLTOOL_APPLIED_VERSION_AS_INT" -ge "$INTLTOOL_REQUIRED_VERSION_AS_INT" ||
233- AC_MSG_ERROR([Your intltool is too old. You need intltool $1 or later.])
234-fi
235-
236-AC_PATH_PROG(INTLTOOL_UPDATE, [intltool-update])
237-AC_PATH_PROG(INTLTOOL_MERGE, [intltool-merge])
238-AC_PATH_PROG(INTLTOOL_EXTRACT, [intltool-extract])
239-if test -z "$INTLTOOL_UPDATE" -o -z "$INTLTOOL_MERGE" -o -z "$INTLTOOL_EXTRACT"; then
240- AC_MSG_ERROR([The intltool scripts were not found. Please install intltool.])
241-fi
242-
243- INTLTOOL_DESKTOP_RULE='%.desktop: %.desktop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
244-INTLTOOL_DIRECTORY_RULE='%.directory: %.directory.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
245- INTLTOOL_KEYS_RULE='%.keys: %.keys.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -k -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
246- INTLTOOL_PROP_RULE='%.prop: %.prop.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
247- INTLTOOL_OAF_RULE='%.oaf: %.oaf.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -p $(top_srcdir)/po $< [$]@'
248- INTLTOOL_PONG_RULE='%.pong: %.pong.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
249- INTLTOOL_SERVER_RULE='%.server: %.server.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -o -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
250- INTLTOOL_SHEET_RULE='%.sheet: %.sheet.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
251-INTLTOOL_SOUNDLIST_RULE='%.soundlist: %.soundlist.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
252- INTLTOOL_UI_RULE='%.ui: %.ui.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
253- INTLTOOL_XML_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
254- INTLTOOL_XML_NOMERGE_RULE='%.xml: %.xml.in $(INTLTOOL_MERGE) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u /tmp $< [$]@'
255- INTLTOOL_XAM_RULE='%.xam: %.xml.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
256- INTLTOOL_KBD_RULE='%.kbd: %.kbd.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -m -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
257- INTLTOOL_CAVES_RULE='%.caves: %.caves.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
258- INTLTOOL_SCHEMAS_RULE='%.schemas: %.schemas.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -s -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
259- INTLTOOL_THEME_RULE='%.theme: %.theme.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
260- INTLTOOL_SERVICE_RULE='%.service: %.service.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -d -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
261- INTLTOOL_POLICY_RULE='%.policy: %.policy.in $(INTLTOOL_MERGE) $(wildcard $(top_srcdir)/po/*.po) ; LC_ALL=C $(INTLTOOL_MERGE) -x -u -c $(top_builddir)/po/.intltool-merge-cache $(top_srcdir)/po $< [$]@'
262-
263-_IT_SUBST(INTLTOOL_DESKTOP_RULE)
264-_IT_SUBST(INTLTOOL_DIRECTORY_RULE)
265-_IT_SUBST(INTLTOOL_KEYS_RULE)
266-_IT_SUBST(INTLTOOL_PROP_RULE)
267-_IT_SUBST(INTLTOOL_OAF_RULE)
268-_IT_SUBST(INTLTOOL_PONG_RULE)
269-_IT_SUBST(INTLTOOL_SERVER_RULE)
270-_IT_SUBST(INTLTOOL_SHEET_RULE)
271-_IT_SUBST(INTLTOOL_SOUNDLIST_RULE)
272-_IT_SUBST(INTLTOOL_UI_RULE)
273-_IT_SUBST(INTLTOOL_XAM_RULE)
274-_IT_SUBST(INTLTOOL_KBD_RULE)
275-_IT_SUBST(INTLTOOL_XML_RULE)
276-_IT_SUBST(INTLTOOL_XML_NOMERGE_RULE)
277-_IT_SUBST(INTLTOOL_CAVES_RULE)
278-_IT_SUBST(INTLTOOL_SCHEMAS_RULE)
279-_IT_SUBST(INTLTOOL_THEME_RULE)
280-_IT_SUBST(INTLTOOL_SERVICE_RULE)
281-_IT_SUBST(INTLTOOL_POLICY_RULE)
282-
283-# Check the gettext tools to make sure they are GNU
284-AC_PATH_PROG(XGETTEXT, xgettext)
285-AC_PATH_PROG(MSGMERGE, msgmerge)
286-AC_PATH_PROG(MSGFMT, msgfmt)
287-AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
288-if test -z "$XGETTEXT" -o -z "$MSGMERGE" -o -z "$MSGFMT"; then
289- AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
290-fi
291-xgversion="`$XGETTEXT --version|grep '(GNU ' 2> /dev/null`"
292-mmversion="`$MSGMERGE --version|grep '(GNU ' 2> /dev/null`"
293-mfversion="`$MSGFMT --version|grep '(GNU ' 2> /dev/null`"
294-if test -z "$xgversion" -o -z "$mmversion" -o -z "$mfversion"; then
295- AC_MSG_ERROR([GNU gettext tools not found; required for intltool])
296-fi
297-
298-AC_PATH_PROG(INTLTOOL_PERL, perl)
299-if test -z "$INTLTOOL_PERL"; then
300- AC_MSG_ERROR([perl not found])
301-fi
302-AC_MSG_CHECKING([for perl >= 5.8.1])
303-$INTLTOOL_PERL -e "use 5.8.1;" > /dev/null 2>&1
304-if test $? -ne 0; then
305- AC_MSG_ERROR([perl 5.8.1 is required for intltool])
306-else
307- IT_PERL_VERSION="`$INTLTOOL_PERL -e \"printf '%vd', $^V\"`"
308- AC_MSG_RESULT([$IT_PERL_VERSION])
309-fi
310-if test "x$2" != "xno-xml"; then
311- AC_MSG_CHECKING([for XML::Parser])
312- if `$INTLTOOL_PERL -e "require XML::Parser" 2>/dev/null`; then
313- AC_MSG_RESULT([ok])
314- else
315- AC_MSG_ERROR([XML::Parser perl module is required for intltool])
316- fi
317-fi
318-
319-# Substitute ALL_LINGUAS so we can use it in po/Makefile
320-AC_SUBST(ALL_LINGUAS)
321-
322-# Set DATADIRNAME correctly if it is not set yet
323-# (copied from glib-gettext.m4)
324-if test -z "$DATADIRNAME"; then
325- AC_LINK_IFELSE(
326- [AC_LANG_PROGRAM([[]],
327- [[extern int _nl_msg_cat_cntr;
328- return _nl_msg_cat_cntr]])],
329- [DATADIRNAME=share],
330- [case $host in
331- *-*-solaris*)
332- dnl On Solaris, if bind_textdomain_codeset is in libc,
333- dnl GNU format message catalog is always supported,
334- dnl since both are added to the libc all together.
335- dnl Hence, we'd like to go with DATADIRNAME=share
336- dnl in this case.
337- AC_CHECK_FUNC(bind_textdomain_codeset,
338- [DATADIRNAME=share], [DATADIRNAME=lib])
339- ;;
340- *)
341- [DATADIRNAME=lib]
342- ;;
343- esac])
344-fi
345-AC_SUBST(DATADIRNAME)
346-
347-IT_PO_SUBDIR([po])
348-
349-])
350-
351-
352-# IT_PO_SUBDIR(DIRNAME)
353-# ---------------------
354-# All po subdirs have to be declared with this macro; the subdir "po" is
355-# declared by IT_PROG_INTLTOOL.
356-#
357-AC_DEFUN([IT_PO_SUBDIR],
358-[AC_PREREQ([2.53])dnl We use ac_top_srcdir inside AC_CONFIG_COMMANDS.
359-dnl
360-dnl The following CONFIG_COMMANDS should be exetuted at the very end
361-dnl of config.status.
362-AC_CONFIG_COMMANDS_PRE([
363- AC_CONFIG_COMMANDS([$1/stamp-it], [
364- if [ ! grep "^# INTLTOOL_MAKEFILE$" "$1/Makefile.in" > /dev/null ]; then
365- AC_MSG_ERROR([$1/Makefile.in.in was not created by intltoolize.])
366- fi
367- rm -f "$1/stamp-it" "$1/stamp-it.tmp" "$1/POTFILES" "$1/Makefile.tmp"
368- >"$1/stamp-it.tmp"
369- [sed '/^#/d
370- s/^[[].*] *//
371- /^[ ]*$/d
372- '"s|^| $ac_top_srcdir/|" \
373- "$srcdir/$1/POTFILES.in" | sed '$!s/$/ \\/' >"$1/POTFILES"
374- ]
375- [sed '/^POTFILES =/,/[^\\]$/ {
376- /^POTFILES =/!d
377- r $1/POTFILES
378- }
379- ' "$1/Makefile.in" >"$1/Makefile"]
380- rm -f "$1/Makefile.tmp"
381- mv "$1/stamp-it.tmp" "$1/stamp-it"
382- ])
383-])dnl
384-])
385-
386-# _IT_SUBST(VARIABLE)
387-# -------------------
388-# Abstract macro to do either _AM_SUBST_NOTMAKE or AC_SUBST
389-#
390-AC_DEFUN([_IT_SUBST],
391-[
392-AC_SUBST([$1])
393-m4_ifdef([_AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE([$1])])
394-]
395-)
396-
397-# deprecated macros
398-AU_ALIAS([AC_PROG_INTLTOOL], [IT_PROG_INTLTOOL])
399-# A hint is needed for aclocal from Automake <= 1.9.4:
400-# AC_DEFUN([AC_PROG_INTLTOOL], ...)
401-
402-
403
404=== modified file 'configure'
405--- configure 2011-03-18 20:39:27 +0000
406+++ configure 2011-04-07 16:11:09 +0000
407@@ -1,6 +1,6 @@
408 #! /bin/sh
409 # Guess values for system-dependent variables and create Makefiles.
410-# Generated by GNU Autoconf 2.67 for libubuntuone 0.9.1.
411+# Generated by GNU Autoconf 2.67 for libubuntuone 0.9.2.
412 #
413 #
414 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
415@@ -698,8 +698,8 @@
416 # Identity of this package.
417 PACKAGE_NAME='libubuntuone'
418 PACKAGE_TARNAME='libubuntuone'
419-PACKAGE_VERSION='0.9.1'
420-PACKAGE_STRING='libubuntuone 0.9.1'
421+PACKAGE_VERSION='0.9.2'
422+PACKAGE_STRING='libubuntuone 0.9.2'
423 PACKAGE_BUGREPORT=''
424 PACKAGE_URL=''
425
426@@ -1535,7 +1535,7 @@
427 # Omit some internal or obsolete options to make the list less imposing.
428 # This message is too long to be a string in the A/UX 3.1 sh.
429 cat <<_ACEOF
430-\`configure' configures libubuntuone 0.9.1 to adapt to many kinds of systems.
431+\`configure' configures libubuntuone 0.9.2 to adapt to many kinds of systems.
432
433 Usage: $0 [OPTION]... [VAR=VALUE]...
434
435@@ -1605,7 +1605,7 @@
436
437 if test -n "$ac_init_help"; then
438 case $ac_init_help in
439- short | recursive ) echo "Configuration of libubuntuone 0.9.1:";;
440+ short | recursive ) echo "Configuration of libubuntuone 0.9.2:";;
441 esac
442 cat <<\_ACEOF
443
444@@ -1730,7 +1730,7 @@
445 test -n "$ac_init_help" && exit $ac_status
446 if $ac_init_version; then
447 cat <<\_ACEOF
448-libubuntuone configure 0.9.1
449+libubuntuone configure 0.9.2
450 generated by GNU Autoconf 2.67
451
452 Copyright (C) 2010 Free Software Foundation, Inc.
453@@ -2095,7 +2095,7 @@
454 This file contains any messages produced by compilers while
455 running configure, to aid debugging if configure makes a mistake.
456
457-It was created by libubuntuone $as_me 0.9.1, which was
458+It was created by libubuntuone $as_me 0.9.2, which was
459 generated by GNU Autoconf 2.67. Invocation command line was
460
461 $ $0 $@
462@@ -2918,7 +2918,7 @@
463
464 # Define the identity of the package.
465 PACKAGE='libubuntuone'
466- VERSION='0.9.1'
467+ VERSION='0.9.2'
468
469
470 cat >>confdefs.h <<_ACEOF
471@@ -12750,12 +12750,12 @@
472 pkg_cv_LIBUBUNTUONE_CFLAGS="$LIBUBUNTUONE_CFLAGS"
473 elif test -n "$PKG_CONFIG"; then
474 if test -n "$PKG_CONFIG" && \
475- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&5
476- ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&5
477+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10\""; } >&5
478+ ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10") 2>&5
479 ac_status=$?
480 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
481 test $ac_status = 0; }; then
482- pkg_cv_LIBUBUNTUONE_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`
483+ pkg_cv_LIBUBUNTUONE_CFLAGS=`$PKG_CONFIG --cflags "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10" 2>/dev/null`
484 else
485 pkg_failed=yes
486 fi
487@@ -12766,12 +12766,12 @@
488 pkg_cv_LIBUBUNTUONE_LIBS="$LIBUBUNTUONE_LIBS"
489 elif test -n "$PKG_CONFIG"; then
490 if test -n "$PKG_CONFIG" && \
491- { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2\""; } >&5
492- ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2") 2>&5
493+ { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10\""; } >&5
494+ ($PKG_CONFIG --exists --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10") 2>&5
495 ac_status=$?
496 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
497 test $ac_status = 0; }; then
498- pkg_cv_LIBUBUNTUONE_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>/dev/null`
499+ pkg_cv_LIBUBUNTUONE_LIBS=`$PKG_CONFIG --libs "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10" 2>/dev/null`
500 else
501 pkg_failed=yes
502 fi
503@@ -12791,14 +12791,14 @@
504 _pkg_short_errors_supported=no
505 fi
506 if test $_pkg_short_errors_supported = yes; then
507- LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`
508+ LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10" 2>&1`
509 else
510- LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2" 2>&1`
511+ LIBUBUNTUONE_PKG_ERRORS=`$PKG_CONFIG --print-errors "gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10" 2>&1`
512 fi
513 # Put the nasty error message in config.log where it belongs
514 echo "$LIBUBUNTUONE_PKG_ERRORS" >&5
515
516- as_fn_error $? "Package requirements (gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2) were not met:
517+ as_fn_error $? "Package requirements (gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10) were not met:
518
519 $LIBUBUNTUONE_PKG_ERRORS
520
521@@ -14638,7 +14638,7 @@
522 # report actual input values of CONFIG_FILES etc. instead of their
523 # values after options handling.
524 ac_log="
525-This file was extended by libubuntuone $as_me 0.9.1, which was
526+This file was extended by libubuntuone $as_me 0.9.2, which was
527 generated by GNU Autoconf 2.67. Invocation command line was
528
529 CONFIG_FILES = $CONFIG_FILES
530@@ -14704,7 +14704,7 @@
531 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
532 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
533 ac_cs_version="\\
534-libubuntuone config.status 0.9.1
535+libubuntuone config.status 0.9.2
536 configured by $0, generated by GNU Autoconf 2.67,
537 with options \\"\$ac_cs_config\\"
538
539
540=== modified file 'configure.ac'
541--- configure.ac 2011-03-18 20:30:19 +0000
542+++ configure.ac 2011-04-07 16:11:09 +0000
543@@ -1,4 +1,4 @@
544-AC_INIT([libubuntuone], [0.9.1], [], [libubuntuone])
545+AC_INIT([libubuntuone], [0.9.2], [], [libubuntuone])
546
547 AC_PREREQ([2.59])
548
549@@ -32,7 +32,7 @@
550 AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
551
552 dnl Look for needed modules
553-PKG_CHECK_MODULES(LIBUBUNTUONE, gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2)
554+PKG_CHECK_MODULES(LIBUBUNTUONE, gdk-pixbuf-2.0 webkit-1.0 >= 1.1.15 libxml-2.0 libsoup-2.4 >= 2.33.1 libsoup-gnome-2.4 libsyncdaemon-1.0 >= 1.4.2 gstreamer-0.10 gstreamer-pbutils-0.10)
555 AC_SUBST(LIBUBUNTUONE_CFLAGS)
556 AC_SUBST(LIBUBUNTUONE_LIBS)
557
558
559=== modified file 'data/Makefile.am'
560--- data/Makefile.am 2010-08-26 01:19:30 +0000
561+++ data/Makefile.am 2011-04-07 16:11:09 +0000
562@@ -1,5 +1,6 @@
563 jsdir = $(U1_JAVASCRIPT_DIR)
564 nobase_js_DATA = \
565+ empty.mp3 \
566 u1-library-override.js \
567 u1-preview.js \
568 u1-songs-clickable.js \
569
570=== modified file 'data/Makefile.in'
571--- data/Makefile.in 2011-01-14 22:24:48 +0000
572+++ data/Makefile.in 2011-04-07 16:11:09 +0000
573@@ -262,6 +262,7 @@
574 top_srcdir = @top_srcdir@
575 jsdir = $(U1_JAVASCRIPT_DIR)
576 nobase_js_DATA = \
577+ empty.mp3 \
578 u1-library-override.js \
579 u1-preview.js \
580 u1-songs-clickable.js \
581
582=== added file 'data/empty.mp3'
583Binary files data/empty.mp3 1970-01-01 00:00:00 +0000 and data/empty.mp3 2011-04-07 16:11:09 +0000 differ
584=== modified file 'debian/changelog'
585--- debian/changelog 2011-03-18 20:39:27 +0000
586+++ debian/changelog 2011-04-07 16:11:09 +0000
587@@ -1,3 +1,12 @@
588+libubuntuone (0.9.2-0ubuntu1) natty; urgency=low
589+
590+ * New upstream release.
591+ - Distribution series hardcoded for codec installation (LP: #693536)
592+ - [UIFE] Notify user of missing MP3 suupport (LP: #733327)
593+ - Music purchased from U1MS not appear in music library (LP: #604699)
594+
595+ -- Rodney Dawes <rodney.dawes@ubuntu.com> Thu, 07 Apr 2011 11:33:11 -0400
596+
597 libubuntuone (0.9.1-0ubuntu1) natty; urgency=low
598
599 * New upstream release.
600
601=== modified file 'debian/control'
602--- debian/control 2011-03-18 20:39:27 +0000
603+++ debian/control 2011-04-07 16:11:09 +0000
604@@ -8,9 +8,10 @@
605 Build-Depends: debhelper (>= 7.0.17),
606 cdbs,
607 python-support,
608+ libgstreamer0.10-dev,
609+ libgstreamer-plugins-base0.10-dev,
610 libwebkitgtk-dev,
611 libglib2.0-dev,
612- libebook1.2-dev,
613 gnome-doc-utils,
614 gtk-doc-tools,
615 intltool,
616@@ -107,3 +108,4 @@
617 .
618 It can be used by packages using the GIRepository format to generate
619 dynamic bindings.
620+
621
622=== modified file 'debian/libubuntuone-1.0-1.install'
623--- debian/libubuntuone-1.0-1.install 2010-02-17 16:07:01 +0000
624+++ debian/libubuntuone-1.0-1.install 2011-04-07 16:11:09 +0000
625@@ -1,3 +1,3 @@
626 debian/tmp/usr/lib/libubuntuone-1.0.so.*
627-debian/tmp/usr/share/libubuntuone/1/javascript/*
628+debian/tmp/usr/share/libubuntuone
629 debian/tmp/usr/share/locale/*
630
631=== modified file 'libubuntuone/Makefile.am'
632--- libubuntuone/Makefile.am 2011-03-18 20:30:19 +0000
633+++ libubuntuone/Makefile.am 2011-04-07 16:11:09 +0000
634@@ -19,6 +19,8 @@
635 $(MARSHAL_GENERATED) \
636 oauth.c \
637 oauth.h \
638+ u1-codec-installer.c \
639+ u1-codec-installer.h \
640 u1-music-store.c \
641 u1-request-chrome.c \
642 u1-request-chrome.h \
643
644=== modified file 'libubuntuone/Makefile.in'
645--- libubuntuone/Makefile.in 2011-03-18 20:39:27 +0000
646+++ libubuntuone/Makefile.in 2011-04-07 16:11:09 +0000
647@@ -79,7 +79,8 @@
648 $(am__DEPENDENCIES_1)
649 am__objects_1 = u1-marshal.lo
650 am_libubuntuone_1_0_la_OBJECTS = $(am__objects_1) oauth.lo \
651- u1-music-store.lo u1-request-chrome.lo xmalloc.lo
652+ u1-codec-installer.lo u1-music-store.lo u1-request-chrome.lo \
653+ xmalloc.lo
654 libubuntuone_1_0_la_OBJECTS = $(am_libubuntuone_1_0_la_OBJECTS)
655 AM_V_lt = $(am__v_lt_$(V))
656 am__v_lt_ = $(am__v_lt_$(AM_DEFAULT_VERBOSITY))
657@@ -318,6 +319,8 @@
658 $(MARSHAL_GENERATED) \
659 oauth.c \
660 oauth.h \
661+ u1-codec-installer.c \
662+ u1-codec-installer.h \
663 u1-music-store.c \
664 u1-request-chrome.c \
665 u1-request-chrome.h \
666@@ -426,6 +429,7 @@
667 -rm -f *.tab.c
668
669 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/oauth.Plo@am__quote@
670+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-codec-installer.Plo@am__quote@
671 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-marshal.Plo@am__quote@
672 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-music-store.Plo@am__quote@
673 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/u1-request-chrome.Plo@am__quote@
674
675=== added file 'libubuntuone/u1-codec-installer.c'
676--- libubuntuone/u1-codec-installer.c 1970-01-01 00:00:00 +0000
677+++ libubuntuone/u1-codec-installer.c 2011-04-07 16:11:09 +0000
678@@ -0,0 +1,650 @@
679+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
680+/*
681+ * Copyright (C) 2011 Canonical, Ltd.
682+ *
683+ * This library is free software; you can redistribute it and/or
684+ * modify it under the terms of version 2 of the GNU Lesser General Public
685+ * License as published by the Free Software Foundation.
686+ *
687+ * This program is distributed in the hope that it will be useful,
688+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
689+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
690+ * General Public License for more details.
691+ *
692+ * You should have received a copy of the GNU Lesser General Public
693+ * License along with this library; if not, write to the
694+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
695+ * Boston, MA 02110-1301, USA.
696+ */
697+
698+#ifdef HAVE_CONFIG_H
699+#include <config.h>
700+#endif
701+
702+#include <gio/gio.h>
703+#include <glib/gi18n-lib.h>
704+
705+#include "u1-codec-installer.h"
706+
707+#define U1MS_PARTNER_LIST_FILE "u1ms-partner-mp3.list"
708+#define U1MS_SOURCES_LIST_DIR "/etc/apt/sources.list.d/"
709+#define U1MS_SOURCES_LIST_FILE U1MS_SOURCES_LIST_DIR U1MS_PARTNER_LIST_FILE
710+#define U1MS_CODEC_PACKAGE "gstreamer0.10-fluendo-plugins-mp3-partner"
711+#define FLUENDO_CODEC_EULA "MPEG Layer-3 audio decoding technology " \
712+ "licensed from Fraunhofer IIS and Thomson. " \
713+ "This product cannot be installed in product other than Personal " \
714+ "Computers sold for general purpose usage, and not for set-top " \
715+ "boxes, embedded PCs, PCs which are sold and customized for " \
716+ "mainly audio or multimedia playback and/or registration, " \
717+ "unless the seller has received a license by Fraunhofer IIS " \
718+ "and Thomson and paid the relevant royalties to them."
719+
720+G_DEFINE_TYPE (U1CodecInstaller, u1_codec_installer, G_TYPE_OBJECT)
721+
722+struct _U1CodecInstallerPrivate {
723+ GDBusConnection *bus;
724+ GDBusProxy *ad_proxy;
725+ GDBusProxy *tr_proxy;
726+ gchar *tr_object_path;
727+
728+ /* Support information */
729+ gboolean is_supported;
730+ gchar *series;
731+
732+ /* Widgets for the install process */
733+ GtkWidget *progressbar;
734+};
735+
736+enum {
737+ STARTED_SIGNAL,
738+ FINISHED_SIGNAL,
739+ ERROR_SIGNAL,
740+ LAST_SIGNAL
741+};
742+
743+static guint installer_signals[LAST_SIGNAL] = { 0, };
744+
745+
746+static void
747+u1_codec_installer_init (U1CodecInstaller *installer)
748+{
749+ GError *error = NULL;
750+
751+ installer->priv = G_TYPE_INSTANCE_GET_PRIVATE (installer, U1_TYPE_CODEC_INSTALLER, U1CodecInstallerPrivate);
752+
753+ installer->priv->bus = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
754+ if (error != NULL) {
755+ g_warning ("Failed to connect to D-Bus system bus: %s",
756+ error->message);
757+ g_error_free (error);
758+ return;
759+ }
760+
761+ installer->priv->ad_proxy = g_dbus_proxy_new_sync (installer->priv->bus,
762+ 0, NULL,
763+ "org.debian.apt",
764+ "/org/debian/apt",
765+ "org.debian.apt",
766+ NULL,
767+ &error);
768+ if (error != NULL) {
769+ g_warning ("Failed to connect to Apt daemon: %s",
770+ error->message);
771+ g_error_free (error);
772+ return;
773+ }
774+
775+ installer->priv->progressbar = gtk_progress_bar_new ();
776+ gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (installer->priv->progressbar), PANGO_ELLIPSIZE_END);
777+ gtk_progress_bar_set_pulse_step (GTK_PROGRESS_BAR (installer->priv->progressbar), 0.05);
778+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (installer->priv->progressbar), "");
779+}
780+
781+static void
782+_u1_codec_installer_finalize (GObject *object)
783+{
784+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (object);
785+
786+ if (installer->priv != NULL) {
787+ if (installer->priv->bus)
788+ g_object_unref (installer->priv->bus);
789+
790+ if (installer->priv->tr_object_path)
791+ g_free (installer->priv->tr_object_path);
792+
793+ if (installer->priv->series)
794+ g_free (installer->priv->series);
795+
796+ if (GTK_IS_WIDGET (installer->priv->progressbar)) {
797+ gtk_widget_destroy (installer->priv->progressbar);
798+ }
799+ }
800+
801+ G_OBJECT_CLASS (u1_codec_installer_parent_class)->finalize (object);
802+}
803+
804+static void
805+u1_codec_installer_class_init (U1CodecInstallerClass *klass)
806+{
807+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
808+
809+ g_type_class_add_private (klass, sizeof (U1CodecInstallerClass));
810+
811+ /* Signals */
812+ installer_signals[STARTED_SIGNAL] = g_signal_new ("started",
813+ G_TYPE_FROM_CLASS (klass),
814+ (GSignalFlags) G_SIGNAL_RUN_LAST,
815+ G_STRUCT_OFFSET (U1CodecInstallerClass, started),
816+ NULL,
817+ NULL,
818+ g_cclosure_marshal_VOID__VOID,
819+ G_TYPE_NONE, 0,
820+ G_TYPE_NONE);
821+ installer_signals[FINISHED_SIGNAL] = g_signal_new ("finished",
822+ G_TYPE_FROM_CLASS (klass),
823+ (GSignalFlags) G_SIGNAL_RUN_LAST,
824+ G_STRUCT_OFFSET (U1CodecInstallerClass, finished),
825+ NULL,
826+ NULL,
827+ g_cclosure_marshal_VOID__VOID,
828+ G_TYPE_NONE, 0,
829+ G_TYPE_NONE);
830+ installer_signals[ERROR_SIGNAL] = g_signal_new ("error",
831+ G_TYPE_FROM_CLASS (klass),
832+ (GSignalFlags) G_SIGNAL_RUN_LAST,
833+ G_STRUCT_OFFSET (U1CodecInstallerClass, error),
834+ NULL,
835+ NULL,
836+ g_cclosure_marshal_VOID__POINTER,
837+ G_TYPE_NONE, 1,
838+ G_TYPE_POINTER);
839+
840+ object_class->finalize = _u1_codec_installer_finalize;
841+}
842+
843+static void
844+_get_ubuntu_release_series (U1CodecInstaller *installer)
845+{
846+ gchar *contents;
847+ gchar **lines;
848+ gint i;
849+
850+ if (!g_file_get_contents ("/etc/lsb-release", &contents, NULL, NULL))
851+ return;
852+
853+ lines = g_strsplit (contents, "\n", -1);
854+ g_free (contents);
855+
856+ for (i = 0; lines[i] != NULL; i++) {
857+ gchar **keyval = g_strsplit (lines[i], "=", 2);
858+ if (g_strcmp0 (keyval[0], "DISTRIB_ID") == 0 &&
859+ g_strcmp0 (keyval[1], "Ubuntu") == 0)
860+ installer->priv->is_supported = TRUE;
861+ else if (g_strcmp0 (keyval[0], "DISTRIB_CODENAME") == 0)
862+ installer->priv->series = g_strdup (keyval[1]);
863+
864+ g_strfreev (keyval);
865+ }
866+ g_strfreev (lines);
867+
868+ return;
869+}
870+
871+/**
872+ * u1_codec_installer_new:
873+ *
874+ * Create a new #U1CodecInstaller object.
875+ *
876+ * Return value: A new #U1CodecInstaller object.
877+ */
878+U1CodecInstaller *
879+u1_codec_installer_new (void)
880+{
881+ U1CodecInstaller *installer = g_object_new (U1_TYPE_CODEC_INSTALLER,
882+ NULL);
883+ _get_ubuntu_release_series (installer);
884+ return installer;
885+}
886+
887+static void
888+_transaction_progress_changed_cb (GDBusConnection *bus,
889+ const gchar *sender_name,
890+ const gchar *object_path,
891+ const gchar *interface_name,
892+ const gchar *signal_name,
893+ GVariant *parameters,
894+ gpointer user_data)
895+{
896+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
897+ gchar *property;
898+ GVariant *value;
899+
900+ g_variant_get (parameters, "(sv)", &property, &value);
901+
902+ if (g_strcmp0 (property, "ProgressDetails") == 0) {
903+ gint transaction, items_done, items_total;
904+ gint bytes_done, bytes_total, speed;
905+ g_variant_get (value, "(iiiiii)", &transaction,
906+ &items_done, &items_total,
907+ &bytes_done, &bytes_total,
908+ &speed);
909+
910+ if (items_total == 0 && bytes_total == 0)
911+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (installer->priv->progressbar), "");
912+ else {
913+ gchar *message;
914+ gchar *bd, *bt;
915+
916+ bd = g_format_size_for_display (bytes_done);
917+ bt = g_format_size_for_display (bytes_total);
918+ if (speed != 0) {
919+ gchar *ks = g_format_size_for_display (speed);
920+
921+ message = g_strdup_printf (_("Downloaded %sB of %sB at %sB/s"), bd, bt, ks);
922+ g_free (ks);
923+ } else
924+ message = g_strdup_printf (_("Downloaded %sB of %sB"), bd, bt);
925+
926+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (installer->priv->progressbar), message);
927+
928+ g_free (bd);
929+ g_free (bt);
930+ g_free (message);
931+ }
932+ } else if (g_strcmp0 (property, "Progress") == 0) {
933+ gint progress;
934+
935+ g_variant_get (value, "i", &progress);
936+ if (progress > 100)
937+ gtk_progress_bar_pulse (GTK_PROGRESS_BAR (installer->priv->progressbar));
938+ else
939+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (installer->priv->progressbar), (gdouble) progress / 100.0);
940+ } else if (g_strcmp0 (property, "ExitState") == 0) {
941+ gchar *exit_code;
942+
943+ g_variant_get (value, "s", &exit_code);
944+
945+ if (g_strcmp0 (exit_code, "exit-unfinished") != 0) {
946+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (installer->priv->progressbar), 1.0);
947+ if (g_strcmp0(object_path, installer->priv->tr_object_path) == 0) {
948+ g_signal_emit (installer, installer_signals[FINISHED_SIGNAL], 0, NULL);
949+ }
950+ }
951+ g_free (exit_code);
952+ } else if (g_strcmp0 (property, "Error") == 0) {
953+ gchar *error_code, *error_msg;
954+
955+ g_variant_get (value, "(ss)", &error_code, &error_msg);
956+
957+ if (g_strcmp0 (error_code, "error-package-already-installed") != 0) {
958+ GError *error = NULL;
959+
960+ g_set_error (&error,
961+ U1_CODEC_INSTALLER_ERROR,
962+ U1_CODEC_INSTALLER_ERROR_UNKNOWN,
963+ "%s", error_msg);
964+ g_signal_emit (installer,
965+ installer_signals[ERROR_SIGNAL], 0,
966+ error);
967+ }
968+
969+ g_free (error_code);
970+ g_free (error_msg);
971+ }
972+
973+ g_free (property);
974+ g_variant_unref (value);
975+}
976+
977+static void
978+_transaction_connect_progress_changed (U1CodecInstaller *installer)
979+{
980+ g_dbus_connection_signal_subscribe (installer->priv->bus,
981+ "org.debian.apt",
982+ "org.debian.apt.transaction",
983+ "PropertyChanged",
984+ g_dbus_proxy_get_object_path (installer->priv->tr_proxy),
985+ NULL,
986+ G_DBUS_SIGNAL_FLAGS_NONE,
987+ (GDBusSignalCallback) _transaction_progress_changed_cb,
988+ installer,
989+ NULL);
990+}
991+
992+static void
993+_update_install_finished_cb (GObject *object, GAsyncResult *result, gpointer user_data)
994+{
995+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
996+ GVariant *finished;
997+
998+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
999+ result, NULL);
1000+ g_object_unref (installer->priv->tr_proxy);
1001+ if (finished != NULL)
1002+ g_variant_unref (finished);
1003+}
1004+
1005+static void
1006+_update_install_cb (GObject *object, GAsyncResult *result, gpointer user_data)
1007+{
1008+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
1009+ GError *error = NULL;
1010+ GVariant *finished;
1011+ gchar *result_val;
1012+
1013+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
1014+ result, &error);
1015+ if (error != NULL) {
1016+ g_signal_emit (installer,
1017+ installer_signals[ERROR_SIGNAL], 0,
1018+ error);
1019+ return;
1020+ }
1021+
1022+ g_variant_get (finished, "(s)", &result_val);
1023+
1024+ installer->priv->tr_object_path = g_strdup (result_val);
1025+ installer->priv->tr_proxy = g_dbus_proxy_new_sync (installer->priv->bus,
1026+ 0, NULL,
1027+ "org.debian.apt",
1028+ result_val,
1029+ "org.debian.apt.transaction",
1030+ NULL,
1031+ &error);
1032+
1033+ g_free (result_val);
1034+ g_variant_unref (finished);
1035+
1036+ if (error != NULL) {
1037+ g_signal_emit (installer,
1038+ installer_signals[ERROR_SIGNAL], 0,
1039+ error);
1040+ return;
1041+ }
1042+
1043+ _transaction_connect_progress_changed (installer);
1044+
1045+ g_dbus_proxy_call (installer->priv->tr_proxy,
1046+ "Run",
1047+ NULL,
1048+ G_DBUS_CALL_FLAGS_NONE,
1049+ -1,
1050+ NULL,
1051+ (GAsyncReadyCallback) _update_install_finished_cb,
1052+ installer);
1053+}
1054+
1055+static void
1056+_update_cache_finished_cb (GObject *object, GAsyncResult *result, gpointer user_data)
1057+{
1058+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
1059+ GError *error = NULL;
1060+ GVariant *finished;
1061+ GVariant *params;
1062+ GVariantBuilder *builder;
1063+
1064+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
1065+ result, &error);
1066+ g_object_unref (installer->priv->tr_proxy);
1067+
1068+ if (error != NULL) {
1069+ g_signal_emit (installer,
1070+ installer_signals[ERROR_SIGNAL], 0,
1071+ error);
1072+ return;
1073+ }
1074+
1075+ g_variant_unref (finished);
1076+
1077+ builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
1078+ g_variant_builder_add (builder, "s", U1MS_CODEC_PACKAGE);
1079+
1080+ params = g_variant_new ("(as)", builder);
1081+
1082+ g_dbus_proxy_call (installer->priv->ad_proxy,
1083+ "InstallPackages",
1084+ params, 0, 86400, NULL,
1085+ (GAsyncReadyCallback) _update_install_cb,
1086+ installer);
1087+
1088+ g_variant_builder_unref (builder);
1089+ g_variant_unref (params);
1090+}
1091+
1092+static void
1093+_update_cache_cb (GObject *object, GAsyncResult *result, gpointer user_data)
1094+{
1095+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
1096+ GError *error = NULL;
1097+ GVariant *finished;
1098+ gchar *result_val;
1099+
1100+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
1101+ result, &error);
1102+ if (error != NULL) {
1103+ g_signal_emit (installer,
1104+ installer_signals[ERROR_SIGNAL], 0,
1105+ error);
1106+ return;
1107+ }
1108+
1109+ g_variant_get (finished, "(s)", &result_val);
1110+
1111+ installer->priv->tr_proxy = g_dbus_proxy_new_sync (installer->priv->bus,
1112+ 0, NULL,
1113+ "org.debian.apt",
1114+ result_val,
1115+ "org.debian.apt.transaction",
1116+ NULL,
1117+ &error);
1118+
1119+ g_free (result_val);
1120+ g_variant_unref (finished);
1121+
1122+ if (error != NULL) {
1123+ g_signal_emit (installer,
1124+ installer_signals[ERROR_SIGNAL], 0,
1125+ error);
1126+ return;
1127+ }
1128+
1129+ _transaction_connect_progress_changed (installer);
1130+
1131+ g_dbus_proxy_call (installer->priv->tr_proxy,
1132+ "Run",
1133+ NULL,
1134+ G_DBUS_CALL_FLAGS_NONE,
1135+ -1,
1136+ NULL,
1137+ (GAsyncReadyCallback) _update_cache_finished_cb,
1138+ installer);
1139+
1140+ g_signal_emit (installer, installer_signals[STARTED_SIGNAL], 0, NULL);
1141+}
1142+
1143+static void
1144+_repository_add_finished_cb (GObject *object, GAsyncResult *result, gpointer user_data)
1145+{
1146+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
1147+ GError *error = NULL;
1148+ GVariant *finished;
1149+ GVariant *params;
1150+ GVariantBuilder *builder;
1151+
1152+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
1153+ result, &error);
1154+ g_object_unref (installer->priv->tr_proxy);
1155+
1156+ if (error != NULL) {
1157+ g_signal_emit (installer,
1158+ installer_signals[ERROR_SIGNAL], 0,
1159+ g_error_copy (error));
1160+ return;
1161+ }
1162+
1163+ g_variant_unref (finished);
1164+
1165+ builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
1166+ g_variant_builder_add (builder, "s", U1MS_SOURCES_LIST_FILE);
1167+
1168+ params = g_variant_new ("(s)", U1MS_SOURCES_LIST_FILE);
1169+
1170+ g_dbus_proxy_call (installer->priv->ad_proxy,
1171+ "UpdateCachePartially",
1172+ params, 0, 86400, NULL,
1173+ (GAsyncReadyCallback) _update_cache_cb,
1174+ installer);
1175+
1176+ g_variant_builder_unref (builder);
1177+ g_variant_unref (params);
1178+}
1179+
1180+static void
1181+_repository_add_cb (GObject *object, GAsyncResult *result, gpointer user_data)
1182+{
1183+ U1CodecInstaller *installer = U1_CODEC_INSTALLER (user_data);
1184+ GError *error = NULL;
1185+ GVariant *finished;
1186+ gchar *result_val;
1187+
1188+ finished = g_dbus_proxy_call_finish (G_DBUS_PROXY (object),
1189+ result, &error);
1190+ if (error != NULL) {
1191+ g_signal_emit (installer,
1192+ installer_signals[ERROR_SIGNAL], 0,
1193+ error);
1194+ return;
1195+ }
1196+
1197+ g_variant_get (finished, "(s)", &result_val);
1198+
1199+ installer->priv->tr_proxy = g_dbus_proxy_new_sync (installer->priv->bus,
1200+ 0, NULL,
1201+ "org.debian.apt",
1202+ result_val,
1203+ "org.debian.apt.transaction",
1204+ NULL,
1205+ &error);
1206+ g_free (result_val);
1207+ g_variant_unref (finished);
1208+
1209+ if (error != NULL) {
1210+ g_signal_emit (installer,
1211+ installer_signals[ERROR_SIGNAL], 0,
1212+ error);
1213+ return;
1214+ }
1215+
1216+ g_dbus_proxy_call (installer->priv->tr_proxy,
1217+ "Run",
1218+ NULL,
1219+ G_DBUS_CALL_FLAGS_NONE,
1220+ -1,
1221+ NULL,
1222+ (GAsyncReadyCallback) _repository_add_finished_cb,
1223+ installer);
1224+
1225+}
1226+
1227+enum {
1228+ EULA_DIALOG_ACCEPT = -1,
1229+ EULA_DIALOG_CANCEL = -2
1230+};
1231+
1232+/**
1233+ * u1_codec_installer_install_codec:
1234+ *
1235+ * Begin the process to install the MP3 codec plug-in.
1236+ **/
1237+void
1238+u1_codec_installer_install_codec (U1CodecInstaller *installer,
1239+ GtkWindow *parent_window)
1240+{
1241+ GtkWidget *eula_dialog;
1242+
1243+ eula_dialog = gtk_message_dialog_new (parent_window,
1244+ GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
1245+ GTK_MESSAGE_OTHER,
1246+ GTK_BUTTONS_NONE,
1247+ "MPEG Layer-3 audio decoding technology notice");
1248+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (eula_dialog),
1249+ FLUENDO_CODEC_EULA);
1250+ gtk_dialog_add_buttons (GTK_DIALOG (eula_dialog),
1251+ _("Cancel"), EULA_DIALOG_CANCEL,
1252+ _("Accept"), EULA_DIALOG_ACCEPT,
1253+ NULL);
1254+ gtk_dialog_set_default_response (GTK_DIALOG (eula_dialog),
1255+ EULA_DIALOG_ACCEPT);
1256+
1257+ switch (gtk_dialog_run (GTK_DIALOG (eula_dialog))) {
1258+ case EULA_DIALOG_ACCEPT: {
1259+ GVariant *params;
1260+ GVariantBuilder *builder;
1261+
1262+ builder = g_variant_builder_new (G_VARIANT_TYPE ("as"));
1263+ g_variant_builder_add (builder, "s", "partner");
1264+
1265+ params = g_variant_new ("(sssasss)",
1266+ "deb",
1267+ "http://archive.canonical.com/",
1268+ installer->priv->series,
1269+ builder,
1270+ "added by Ubuntu One Music Store",
1271+ U1MS_PARTNER_LIST_FILE);
1272+
1273+ g_dbus_proxy_call (installer->priv->ad_proxy,
1274+ "AddRepository",
1275+ params, 0, 86400, NULL,
1276+ (GAsyncReadyCallback) _repository_add_cb,
1277+ installer);
1278+
1279+ g_variant_builder_unref (builder);
1280+ g_variant_unref (params);
1281+ }
1282+ case EULA_DIALOG_CANCEL:
1283+ default:
1284+ gtk_widget_destroy (eula_dialog);
1285+ break;
1286+ }
1287+}
1288+
1289+/**
1290+ * u1_codec_installer_get_progress_widget:
1291+ *
1292+ * The widget used for displaying progress of codec installation.
1293+ *
1294+ * Return value: The #GtkWidget used to display progress.
1295+ **/
1296+GtkWidget *
1297+u1_codec_installer_get_progress_widget (U1CodecInstaller *installer)
1298+{
1299+ return installer->priv->progressbar;
1300+}
1301+
1302+/**
1303+ * U1_CODEC_INSTALLER_ERROR:
1304+ *
1305+ * A #GError domain representing an MP3 codec install error.
1306+ * Used with #U1CodecInstallerError.
1307+ **/
1308+/**
1309+ * u1_codec_installer_error_quark:
1310+ *
1311+ * The #GQuark used as %U1_CODEC_INSTALLER_ERROR.
1312+ *
1313+ * Return value: The #GQuark used as %U1_CODEC_INSTALLER_ERROR.
1314+ **/
1315+GQuark
1316+u1_codec_installer_error_quark (void)
1317+{
1318+ return g_quark_from_static_string ("u1_codec_installer_error_quark");
1319+}
1320+
1321+/**
1322+ * U1CodecInstallerError:
1323+ * @U1_CODEC_INSTALLER_ERROR_UNKNOWN: Any otherwise unhandled error.
1324+ * @U1_CODEC_INSTALLER_ERROR_UNSUPPORTED: Indicates an unsupported version of
1325+ * Linux.
1326+ *
1327+ * Codec installation related errors.
1328+ **/
1329
1330=== added file 'libubuntuone/u1-codec-installer.h'
1331--- libubuntuone/u1-codec-installer.h 1970-01-01 00:00:00 +0000
1332+++ libubuntuone/u1-codec-installer.h 2011-04-07 16:11:09 +0000
1333@@ -0,0 +1,68 @@
1334+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
1335+/*
1336+ * Copyright (C) 2011 Canonical, Ltd.
1337+ *
1338+ * This library is free software; you can redistribute it and/or
1339+ * modify it under the terms of version 2 of the GNU Lesser General Public
1340+ * License as published by the Free Software Foundation.
1341+ *
1342+ * This program is distributed in the hope that it will be useful,
1343+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1344+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1345+ * General Public License for more details.
1346+ *
1347+ * You should have received a copy of the GNU Lesser General Public
1348+ * License along with this library; if not, write to the
1349+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
1350+ * Boston, MA 02110-1301, USA.
1351+ */
1352+
1353+#ifndef __U1_CODEC_INSTALLER_H__
1354+#define __U1_CODEC_INSTALLER_H__
1355+
1356+#include <glib-object.h>
1357+#include <gtk/gtk.h>
1358+
1359+#define U1_TYPE_CODEC_INSTALLER (u1_codec_installer_get_type ())
1360+#define U1_CODEC_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), U1_TYPE_CODEC_INSTALLER, U1CodecInstaller))
1361+#define U1_IS_CODEC_INSTALLER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), U1_TYPE_CODEC_INSTALLER))
1362+#define U1_CODEC_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), U1_TYPE_CODEC_INSTALLER, U1CodecInstaller))
1363+#define U1_IS_CODEC_INSTALLER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), U1_TYPE_CODEC_INSTALLER))
1364+#define U1_CODEC_INSTALLER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), U1_TYPE_CODEC_INSTALLER, U1CodecInstaller))
1365+#define U1_CODEC_INSTALLER_ERROR (u1_codec_installer_error_quark ())
1366+
1367+typedef struct _U1CodecInstaller U1CodecInstaller;
1368+typedef struct _U1CodecInstallerClass U1CodecInstallerClass;
1369+typedef struct _U1CodecInstallerPrivate U1CodecInstallerPrivate;
1370+typedef enum _U1CodecInstallerError U1CodecInstallerError;
1371+
1372+struct _U1CodecInstaller {
1373+ GObject parent;
1374+
1375+ U1CodecInstallerPrivate *priv;
1376+};
1377+
1378+struct _U1CodecInstallerClass {
1379+ GObjectClass parent_class;
1380+
1381+ void (* started) (U1CodecInstaller *installer);
1382+ void (* finished) (U1CodecInstaller *installer);
1383+ void (* error) (U1CodecInstaller *installer, GError *error);
1384+};
1385+
1386+enum _U1CodecInstallerError {
1387+ U1_CODEC_INSTALLER_ERROR_UNKNOWN = 0,
1388+ U1_CODEC_INSTALLER_ERROR_UNSUPPORTED
1389+};
1390+
1391+GType u1_codec_installer_get_type (void);
1392+
1393+U1CodecInstaller *u1_codec_installer_new (void);
1394+
1395+void u1_codec_installer_install_codec (U1CodecInstaller *installer,
1396+ GtkWindow *parent_window);
1397+GtkWidget *u1_codec_installer_get_progress_widget (U1CodecInstaller *installer);
1398+
1399+GQuark u1_codec_installer_error_quark (void);
1400+
1401+#endif
1402
1403=== modified file 'libubuntuone/u1-music-store.c'
1404--- libubuntuone/u1-music-store.c 2011-03-18 20:30:19 +0000
1405+++ libubuntuone/u1-music-store.c 2011-04-07 16:11:09 +0000
1406@@ -23,6 +23,8 @@
1407 #include <string.h>
1408 #include <libxml/HTMLparser.h>
1409 #include <glib/gi18n.h>
1410+#include <gst/gst.h>
1411+#include <gst/pbutils/pbutils.h>
1412 #include <webkit/webkit.h>
1413 #include <libsoup/soup-gnome-features.h>
1414 #include <libsoup/soup-uri.h>
1415@@ -30,6 +32,7 @@
1416 #include "oauth.h"
1417 #include "u1-music-store.h"
1418 #include "u1-marshal.h"
1419+#include "u1-codec-installer.h"
1420 #include "u1-request-chrome.h"
1421
1422 #define U1_MUSIC_LIBRARY_LOCATION ".ubuntuone/Purchased from Ubuntu One"
1423@@ -65,7 +68,16 @@
1424 GtkWidget *alertbar;
1425 GtkWidget *alert_label;
1426 GtkWidget *subscribe_btn;
1427+ GtkWidget *install_btn;
1428+ GtkWidget *install_progress;
1429 gboolean folder_subscribed;
1430+ gboolean codec_installed;
1431+
1432+ /* The installer object */
1433+ U1CodecInstaller *installer;
1434+
1435+ /* GStreamer pipeline used to check for the MP3 codec */
1436+ GstElement *pipeline;
1437
1438 guint watch_id;
1439 guint idle_cb;
1440@@ -107,6 +119,9 @@
1441 if (music_store->priv->syncdaemon != NULL)
1442 g_object_unref (G_OBJECT (music_store->priv->syncdaemon));
1443
1444+ if (music_store->priv->installer != NULL)
1445+ g_object_unref (music_store->priv->installer);
1446+
1447 g_free (music_store->priv);
1448 }
1449
1450@@ -514,6 +529,9 @@
1451 gchar *internal_uri;
1452 gboolean return_val = FALSE;
1453
1454+ /* Hide the alertbar in case we should show something else */
1455+ gtk_widget_hide (music_store->priv->alertbar);
1456+
1457 /* Remove watching callback for the page */
1458 if (music_store->priv->watch_id != 0) {
1459 g_source_remove (music_store->priv->watch_id);
1460@@ -826,6 +844,20 @@
1461 }
1462
1463 static void
1464+_show_missing_codec_warning (U1MusicStore *music_store)
1465+{
1466+ gtk_label_set_text (GTK_LABEL (music_store->priv->alert_label),
1467+ _("MP3 playback support is not available. It must be installed to play Previews and Purchased Music on this computer."));
1468+
1469+ if (music_store->priv->install_progress)
1470+ gtk_widget_hide (music_store->priv->install_progress);
1471+
1472+ gtk_widget_hide (music_store->priv->subscribe_btn);
1473+ gtk_widget_show (music_store->priv->install_btn);
1474+ gtk_widget_show (music_store->priv->alertbar);
1475+}
1476+
1477+static void
1478 load_finished_cb (WebKitWebView *web_view, WebKitWebFrame *frame, gpointer user_data)
1479 {
1480 const gchar *library_override;
1481@@ -858,6 +890,7 @@
1482 if (!music_store->priv->folder_subscribed) {
1483 gtk_label_set_text (GTK_LABEL (music_store->priv->alert_label),
1484 _("Your 'Purchased Music' folder is not subscribed. New purchases will not download to this computer."));
1485+ gtk_widget_hide (music_store->priv->install_btn);
1486 gtk_widget_show (music_store->priv->subscribe_btn);
1487 gtk_widget_show (music_store->priv->alertbar);
1488 }
1489@@ -871,6 +904,12 @@
1490
1491 /* Poll syncdaemon for downloads while the page is loaded */
1492 music_store->priv->watch_id = g_timeout_add (1000, (GSourceFunc) poll_downloads_cb, music_store);
1493+ } else if (g_strcmp0 (uri->path, "/default.aspx") == 0 ||
1494+ g_strcmp0 (uri->path, "/stores/default.aspx") == 0) {
1495+ /* Show the alert bar for codec installation */
1496+ if (!music_store->priv->codec_installed) {
1497+ _show_missing_codec_warning (music_store);
1498+ }
1499 }
1500
1501 /* Signal users the URL finished loading */
1502@@ -890,23 +929,32 @@
1503 if (g_str_has_prefix (text, "u1preview:::")) {
1504 gchar **args;
1505
1506+ /* Show the alert bar for codec installation */
1507+ if (!music_store->priv->codec_installed) {
1508+ _show_missing_codec_warning (music_store);
1509+ return;
1510+ }
1511+
1512 args = g_strsplit (text, ":::", 0);
1513 if (args != NULL) {
1514 g_signal_emit (music_store, u1_music_store_signals[PREVIEW_MP3_SIGNAL], 0, args[1], args[2]);
1515 g_strfreev (args);
1516 }
1517- }
1518- if (g_str_has_prefix (text, "u1playlibrary:::")) {
1519+ } else if (g_str_has_prefix (text, "u1playlibrary:::")) {
1520 gchar **args;
1521
1522+ /* Show the alert bar for codec installation */
1523+ if (!music_store->priv->codec_installed) {
1524+ _show_missing_codec_warning (music_store);
1525+ return;
1526+ }
1527+
1528 args = g_strsplit (text, ":::", 2);
1529 if (args != NULL) {
1530 g_signal_emit (music_store, u1_music_store_signals[PLAY_LIBRARY_SIGNAL], 0, args[1]);
1531 g_strfreev (args);
1532 }
1533- }
1534-
1535- if (g_str_has_prefix (text, "u1showcertificate:::")) {
1536+ } else if (g_str_has_prefix (text, "u1showcertificate:::")) {
1537 /* should show certificate here in its own window. */
1538 }
1539
1540@@ -976,6 +1024,130 @@
1541 }
1542
1543 static void
1544+got_gst_element_message (GstBus *bus, GstMessage *msg, gpointer user_data)
1545+{
1546+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1547+ gboolean is_missing = FALSE;
1548+
1549+ is_missing = gst_is_missing_plugin_message (msg);
1550+ if (is_missing) {
1551+ g_debug ("MP3 playback is missing.");
1552+ gst_element_set_state (music_store->priv->pipeline,
1553+ GST_STATE_NULL);
1554+ music_store->priv->codec_installed = FALSE;
1555+ }
1556+}
1557+
1558+static void
1559+got_gst_eos_message (GstBus *bus, GstMessage *msg, gpointer user_data)
1560+{
1561+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1562+
1563+ gst_element_set_state (music_store->priv->pipeline, GST_STATE_NULL);
1564+ if (g_getenv ("U1INSTALLMP3ANYWAY") != NULL)
1565+ music_store->priv->codec_installed = FALSE;
1566+ else
1567+ music_store->priv->codec_installed = TRUE;
1568+}
1569+
1570+static gboolean
1571+check_mp3_support (gpointer user_data)
1572+{
1573+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1574+ GstBus *bus;
1575+ GError *error = NULL;
1576+ gchar *empty_file;
1577+ gchar *empty_uri;
1578+ gchar *launch;
1579+
1580+ empty_file = g_build_filename (U1_JAVASCRIPT_DIR, "empty.mp3", NULL);
1581+ empty_uri = g_filename_to_uri (empty_file, NULL, NULL);
1582+ g_free (empty_file);
1583+
1584+ launch = g_strdup_printf ("uridecodebin uri=%s ! fakesink", empty_uri);
1585+ g_free (empty_uri);
1586+
1587+ music_store->priv->pipeline = gst_parse_launch (launch, &error);
1588+ if (error != NULL) {
1589+ g_warning ("Error checking for MP3 support: %s",
1590+ error->message);
1591+ music_store->priv->codec_installed = FALSE;
1592+ return FALSE;
1593+ }
1594+ bus = gst_element_get_bus (music_store->priv->pipeline);
1595+ gst_bus_add_signal_watch (bus);
1596+ g_signal_connect (G_OBJECT (bus), "message::element",
1597+ G_CALLBACK (got_gst_element_message), music_store);
1598+ g_signal_connect (G_OBJECT (bus), "message::eos",
1599+ G_CALLBACK (got_gst_eos_message), music_store);
1600+ gst_element_set_state (music_store->priv->pipeline, GST_STATE_PLAYING);
1601+
1602+ return FALSE;
1603+}
1604+
1605+static void
1606+_install_codec_error (U1CodecInstaller *installer, GError *error,
1607+ gpointer user_data)
1608+{
1609+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1610+
1611+ music_store->priv->codec_installed = FALSE;
1612+ if (music_store->priv->install_progress) {
1613+ gtk_widget_hide (music_store->priv->install_progress);
1614+ }
1615+
1616+ if (music_store->priv->install_btn)
1617+ gtk_widget_hide (music_store->priv->install_btn);
1618+
1619+ if (error->domain == U1_CODEC_INSTALLER_ERROR &&
1620+ error->code == U1_CODEC_INSTALLER_ERROR_UNSUPPORTED) {
1621+ gtk_label_set_text (GTK_LABEL (music_store->priv->alert_label),
1622+ _("MP3 codec cannot be installed. Install is only supported on Ubuntu Linux."));
1623+ } else {
1624+ _show_missing_codec_warning (music_store);
1625+ }
1626+
1627+ g_error_free (error);
1628+}
1629+
1630+static void
1631+_install_codec_started (U1CodecInstaller *installer, gpointer user_data)
1632+{
1633+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1634+
1635+ if (music_store->priv->install_progress == NULL) {
1636+ music_store->priv->install_progress = u1_codec_installer_get_progress_widget (installer);
1637+ gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1638+ music_store->priv->install_progress,
1639+ TRUE, TRUE, 0);
1640+ }
1641+
1642+ gtk_widget_hide (music_store->priv->install_btn);
1643+ gtk_widget_show (music_store->priv->install_progress);
1644+}
1645+
1646+static void
1647+_install_codec_finished (U1CodecInstaller *installer, gpointer user_data)
1648+{
1649+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1650+
1651+ gtk_widget_hide (music_store->priv->alertbar);
1652+ gtk_widget_hide (music_store->priv->install_btn);
1653+ gtk_widget_hide (music_store->priv->install_progress);
1654+
1655+ music_store->priv->codec_installed = TRUE;
1656+}
1657+
1658+static void
1659+_install_missing_codec (GtkButton *button, gpointer user_data)
1660+{
1661+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1662+
1663+ u1_codec_installer_install_codec (music_store->priv->installer,
1664+ GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (music_store))));
1665+}
1666+
1667+static void
1668 subscribe_purchased_folder (GtkButton *button, gpointer user_data)
1669 {
1670 U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1671@@ -988,6 +1160,67 @@
1672 }
1673
1674 static void
1675+_u1_purchased_enumerate (GObject *source, GAsyncResult *result,
1676+ gpointer user_data)
1677+{
1678+ U1MusicStore *music_store = U1_MUSIC_STORE (user_data);
1679+ GFile *dir = G_FILE (source);
1680+ GFileEnumerator *files;
1681+ GFileInfo *info;
1682+ GError *error = NULL;
1683+
1684+ files = g_file_enumerate_children_finish (dir, result, &error);
1685+
1686+ if (error != NULL) {
1687+ g_warning ("Error rescanning Purchased Music: %s", error->message);
1688+ g_error_free (error);
1689+ return;
1690+ }
1691+
1692+ while ((info = g_file_enumerator_next_file (files, NULL, NULL)) != NULL) {
1693+ gchar *path;
1694+
1695+ path = g_build_filename (g_file_get_path (dir),
1696+ g_file_info_get_name (info),
1697+ NULL);
1698+ if (g_file_test (path, G_FILE_TEST_IS_DIR)) {
1699+ GFile *subdir = g_file_new_for_path (path);
1700+ g_file_enumerate_children_async (subdir,
1701+ G_FILE_ATTRIBUTE_STANDARD_NAME,
1702+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
1703+ G_PRIORITY_DEFAULT, NULL,
1704+ (GAsyncReadyCallback) _u1_purchased_enumerate,
1705+ music_store);
1706+ } else if (g_file_test (path, G_FILE_TEST_IS_REGULAR)) {
1707+ g_signal_emit (music_store,
1708+ u1_music_store_signals[DOWNLOAD_FINISHED_SIGNAL], 0,
1709+ (const gchar *) path);
1710+ }
1711+
1712+ g_free (path);
1713+ g_object_unref (info);
1714+ }
1715+ g_file_enumerator_close (files, NULL, NULL);
1716+ g_object_unref (dir);
1717+}
1718+
1719+static void
1720+_u1_music_store_rescan_purchased_folder (U1MusicStore *music_store)
1721+{
1722+ GFile *dir;
1723+ const gchar *path;
1724+
1725+ path = u1_music_store_get_library_location (music_store);
1726+ dir = g_file_new_for_path (path);
1727+ g_file_enumerate_children_async (dir,
1728+ G_FILE_ATTRIBUTE_STANDARD_NAME,
1729+ G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
1730+ G_PRIORITY_DEFAULT, NULL,
1731+ (GAsyncReadyCallback) _u1_purchased_enumerate,
1732+ music_store);
1733+}
1734+
1735+static void
1736 u1_music_store_init (U1MusicStore *music_store)
1737 {
1738 gchar *new_user_agent;
1739@@ -999,6 +1232,8 @@
1740 if (!g_thread_get_initialized ())
1741 g_thread_init (NULL);
1742
1743+ gst_init (NULL, NULL);
1744+
1745 music_store->priv = g_new0 (U1MusicStorePrivate, 1);
1746 music_store->priv->watched_downloads = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
1747 music_store->priv->syncdaemon = syncdaemon_daemon_new ();
1748@@ -1007,6 +1242,15 @@
1749 "folder_subscribed",
1750 G_CALLBACK (sd_folder_subscribed_cb), music_store);
1751
1752+ /* Set up the installer in case we need it */
1753+ music_store->priv->installer = u1_codec_installer_new ();
1754+ g_signal_connect (G_OBJECT (music_store->priv->installer), "error",
1755+ G_CALLBACK (_install_codec_error), music_store);
1756+ g_signal_connect (G_OBJECT (music_store->priv->installer), "started",
1757+ G_CALLBACK (_install_codec_started), music_store);
1758+ g_signal_connect (G_OBJECT (music_store->priv->installer), "finished",
1759+ G_CALLBACK (_install_codec_finished), music_store);
1760+
1761 /* If U1MUSICSTOREURL is defined, use that instead of the real URL */
1762 if (! (url_to_use = g_getenv ("U1MUSICSTOREURL")))
1763 url_to_use = "https://one.ubuntu.com";
1764@@ -1075,6 +1319,17 @@
1765 TRUE, TRUE, 0);
1766 gtk_widget_show (music_store->priv->alert_label);
1767
1768+ /* Button to install MP3 codec if missing */
1769+ music_store->priv->install_btn = gtk_button_new_with_label (_("Install"));
1770+ gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1771+ music_store->priv->install_btn,
1772+ FALSE, FALSE, 6);
1773+ g_signal_connect (G_OBJECT (music_store->priv->install_btn), "clicked",
1774+ G_CALLBACK (_install_missing_codec), music_store);
1775+
1776+ /* Check that MP3 codec is available */
1777+ g_timeout_add_seconds (3, (GSourceFunc) check_mp3_support, music_store);
1778+
1779 /* Button to subscribe the Purchased Music folder */
1780 music_store->priv->subscribe_btn = gtk_button_new_with_label (_("Subscribe"));
1781 gtk_box_pack_end (GTK_BOX (music_store->priv->alertbar),
1782@@ -1099,6 +1354,8 @@
1783 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->alertbar, FALSE, FALSE, 6);
1784 gtk_box_pack_start (GTK_BOX (music_store), music_store->priv->scroll, TRUE, TRUE, 0);
1785 gtk_box_pack_end (GTK_BOX (music_store), music_store->priv->progress, FALSE, FALSE, 0);
1786+
1787+ _u1_music_store_rescan_purchased_folder (music_store);
1788 }
1789
1790 /**
1791
1792=== modified file 'po/POTFILES.in'
1793--- po/POTFILES.in 2010-02-12 16:26:46 +0000
1794+++ po/POTFILES.in 2011-04-07 16:11:09 +0000
1795@@ -1,2 +1,3 @@
1796+libubuntuone/u1-codec-installer.c
1797 libubuntuone/u1-music-store.c
1798 libubuntuone/xmalloc.c

Subscribers

People subscribed via source and target branches

to all changes: