Merge lp:~gary-lasker/software-center/disable-find-it-for-3.0 into lp:software-center/3.0

Proposed by Gary Lasker
Status: Merged
Merged at revision: 1120
Proposed branch: lp:~gary-lasker/software-center/disable-find-it-for-3.0
Merge into: lp:software-center/3.0
Diff against target: 78 lines (+27/-1)
3 files modified
debian/changelog (+8/-0)
softwarecenter/utils.py (+15/-0)
softwarecenter/view/appdetailsview_gtk.py (+4/-1)
To merge this branch: bzr merge lp:~gary-lasker/software-center/disable-find-it-for-3.0
Reviewer Review Type Date Requested Status
software-store-developers Pending
Review via email: mp+43306@code.launchpad.net

Description of the change

Disables the "find it in the menu" feature under Unity, targeted for maverick. This is a variant of the same fix in natty.

Fixes bug 639701.

Thanks!

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-12-02 19:50:35 +0000
3+++ debian/changelog 2010-12-09 23:02:56 +0000
4@@ -1,3 +1,11 @@
5+software-center (3.0.8) UNRELEASED; urgency=low
6+
7+ * softwarecenter/utils.py,
8+ softwarecenter/view/appdetailsview_gtk.py:
9+ - disable find-it-in-the-menu under Unity (LP: #639701)
10+
11+ -- Gary Lasker <gary.lasker@canonical.com> Thu, 09 Dec 2010 17:50:58 -0500
12+
13 software-center (3.0.7) maverick-proposed; urgency=low
14
15 [ Gary Lasker ]
16
17=== modified file 'softwarecenter/utils.py'
18--- softwarecenter/utils.py 2010-10-12 09:09:25 +0000
19+++ softwarecenter/utils.py 2010-12-09 23:02:56 +0000
20@@ -29,6 +29,7 @@
21 import time
22 import xml.sax.saxutils
23 import gtk
24+import dbus
25
26 from enums import USER_AGENT, IMAGE_LOADING_INSTALLED
27
28@@ -36,6 +37,8 @@
29 # because only '&amp;', '&lt;', and '&gt;' are included by default
30 ESCAPE_ENTITIES = {"&apos;":"'",
31 '&quot;':'"'}
32+
33+LOG = logging.getLogger("softwarecenter.utils")
34
35 class ExecutionTime(object):
36 """
37@@ -192,6 +195,18 @@
38 if locale[0] == "C":
39 return "en"
40 return locale[0]
41+
42+def is_unity_running():
43+ """
44+ return True if Unity is currently running
45+ """
46+ unity_running = False
47+ try:
48+ bus = dbus.SessionBus()
49+ unity_running = bus.name_has_owner("com.canonical.Unity")
50+ except:
51+ LOG.exception("could not check for Unity dbus service")
52+ return unity_running
53
54 # FIXME: why not call it a generic downloader?
55 class ImageDownloader(gobject.GObject):
56
57=== modified file 'softwarecenter/view/appdetailsview_gtk.py'
58--- softwarecenter/view/appdetailsview_gtk.py 2010-09-29 15:24:24 +0000
59+++ softwarecenter/view/appdetailsview_gtk.py 2010-12-09 23:02:56 +0000
60@@ -39,7 +39,7 @@
61 from softwarecenter.db.application import AppDetails, Application
62 from softwarecenter.enums import *
63 from softwarecenter.paths import SOFTWARE_CENTER_ICON_CACHE_DIR
64-from softwarecenter.utils import ImageDownloader, GMenuSearcher
65+from softwarecenter.utils import ImageDownloader, GMenuSearcher, is_unity_running
66 from softwarecenter.gwibber_helper import GWIBBER_SERVICE_AVAILABLE
67
68 from appdetailsview import AppDetailsViewBase
69@@ -1409,6 +1409,9 @@
70 return
71
72 def _configure_where_is_it(self):
73+ # disable where-is-it under Unity as it does not apply there
74+ if is_unity_running():
75+ return
76 # remove old content
77 self.desc_installed_where.foreach(lambda c: c.destroy())
78 self.desc_installed_where.set_property("can-focus", False)

Subscribers

People subscribed via source and target branches