Merge lp:~roadmr/checkbox/925603 into lp:checkbox

Proposed by Daniel Manrique
Status: Merged
Merged at revision: 1228
Proposed branch: lp:~roadmr/checkbox/925603
Merge into: lp:checkbox
Diff against target: 53 lines (+12/-7)
2 files modified
checkbox/user_interface.py (+6/-6)
debian/changelog (+6/-1)
To merge this branch: bzr merge lp:~roadmr/checkbox/925603
Reviewer Review Type Date Requested Status
Marc Tardif (community) Approve
Review via email: mp+91710@code.launchpad.net

Description of the change

Fixes the linked bug with a way of retrieving the user's preferred browser in a way that works better with Gnome3. The actual culprit is the Chromium package which assumes the user *wants* it as the default browser and configures itself in /etc/alternatives, which doesn't match up with Gnome's way of configuring the default browser.

To post a comment you must log in.
Revision history for this message
Marc Tardif (cr3) wrote :

Ugh, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'checkbox/user_interface.py'
2--- checkbox/user_interface.py 2011-12-15 15:55:25 +0000
3+++ checkbox/user_interface.py 2012-02-06 20:08:46 +0000
4@@ -1,7 +1,7 @@
5 #
6 # This file is part of Checkbox.
7 #
8-# Copyright 2008 Canonical Ltd.
9+# Copyright 2008-2012 Canonical Ltd.
10 #
11 # Checkbox is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13@@ -27,6 +27,8 @@
14 import gettext
15 from gettext import gettext as _
16
17+from gi.repository import Gio
18+
19 from checkbox.contrib.REThread import REThread
20
21 from checkbox.lib.environ import add_variable, get_variable, remove_variable
22@@ -177,11 +179,9 @@
23 if os.getenv("DISPLAY") and \
24 subprocess.call(["pgrep", "-x", "-u", str(uid), "gnome-panel|gconfd-2"],
25 stdout=subprocess.PIPE, stderr=subprocess.PIPE) == 0:
26- gct = subprocess.Popen(sudo_prefix + ["gconftool", "--get",
27- "/desktop/gnome/url-handlers/http/command"],
28- stdout=subprocess.PIPE, stderr=subprocess.PIPE)
29- if gct.wait() == 0:
30- preferred_browser = gct.communicate()[0]
31+ preferred_xml_app = Gio.app_info_get_default_for_type("application/xml",False)
32+ if preferred_xml_app:
33+ preferred_browser = preferred_xml_app.get_executable()
34 browser = re.match("((firefox|seamonkey|flock)[^\s]*)", preferred_browser)
35 if browser:
36 subprocess.call(sudo_prefix + [browser.group(0), "-new-window", url])
37
38=== modified file 'debian/changelog'
39--- debian/changelog 2012-02-03 23:08:37 +0000
40+++ debian/changelog 2012-02-06 20:08:46 +0000
41@@ -9,7 +9,12 @@
42 * Removed trailing directories from the devpath of disk devices (LP: #925582)
43 * Fixed awk regular expression in max_diskspace_used script (LP: #926312)
44
45- -- Marc Tardif <marc@ubuntu.com> Fri, 03 Feb 2012 15:23:06 -0500
46+ [Daniel Manrique]
47+ * Changed way of obtaining preferred browser to ensure we honor the user's
48+ preference rather than Chromium's clobbering of
49+ /etc/alternatives/gnome-www-browser (LP: #925603)
50+
51+ -- Daniel Manrique <daniel.manrique@canonical.com> Mon, 06 Feb 2012 14:55:58 -0500
52
53 checkbox (0.13.1) precise; urgency=low
54

Subscribers

People subscribed via source and target branches