Merge lp:~mvo/software-center/lp913966 into lp:software-center

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3093
Proposed branch: lp:~mvo/software-center/lp913966
Merge into: lp:software-center
Diff against target: 70 lines (+22/-8)
2 files modified
softwarecenter/ui/gtk3/views/appdetailsview.py (+8/-1)
softwarecenter/utils.py (+14/-7)
To merge this branch: bzr merge lp:~mvo/software-center/lp913966
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+119697@code.launchpad.net

Description of the change

Tiny branch that takes the new gnome 3 into consideration for the
"Where is it".

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Looks good, approved, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'softwarecenter/ui/gtk3/views/appdetailsview.py'
2--- softwarecenter/ui/gtk3/views/appdetailsview.py 2012-06-28 08:51:44 +0000
3+++ softwarecenter/ui/gtk3/views/appdetailsview.py 2012-08-15 10:37:19 +0000
4@@ -42,6 +42,7 @@
5 Icons,
6 SOFTWARE_CENTER_PKGNAME)
7 from softwarecenter.utils import (is_unity_running,
8+ is_gnome_shell_running,
9 upstream_version,
10 get_exec_line_from_desktop,
11 SimpleFileDownloader,
12@@ -1610,6 +1611,11 @@
13 # display launcher location
14 label = Gtk.Label(label=_("Find it in the menu: "))
15 self.installed_where_hbox.pack_start(label, False, False, 0)
16+ if is_gnome_shell_running():
17+ class ActivitiesPseudoItem(object):
18+ def get_icon(self): return ""
19+ def get_name(self): return _("Activities")
20+ where.insert(0, ActivitiesPseudoItem())
21 for (i, item) in enumerate(where):
22 icon = None
23 iconname = None
24@@ -1671,7 +1677,8 @@
25 self.installed_where_hbox.set_property("can-focus", False)
26 self.installed_where_hbox.a11y.set_name('')
27
28- # display where-is-it for non-Unity configurations only
29+ # exit here early if unity is running (but still
30+ # show commandline args)
31 if is_unity_running():
32 # but still display available commands, even in unity
33 # because these are not easily discoverable and we don't
34
35=== modified file 'softwarecenter/utils.py'
36--- softwarecenter/utils.py 2012-07-19 09:29:16 +0000
37+++ softwarecenter/utils.py 2012-08-15 10:37:19 +0000
38@@ -366,18 +366,25 @@
39 name = "%s_dists_%s_Release" % (uri_to_filename(entry.uri), entry.dist)
40 return name
41
42+def is_dbus_service_running(service_name):
43+ running = False
44+ try:
45+ bus = dbus.SessionBus()
46+ running = bus.name_has_owner(service_name)
47+ except:
48+ LOG.exception("could not check for dbus service %s" % service_name)
49+ return running
50+
51+
52+def is_gnome_shell_running():
53+ return is_dbus_service_running("org.gnome.Shell")
54+
55
56 def is_unity_running():
57 """
58 return True if Unity is currently running
59 """
60- unity_running = False
61- try:
62- bus = dbus.SessionBus()
63- unity_running = bus.name_has_owner("com.canonical.Unity")
64- except:
65- LOG.exception("could not check for Unity dbus service")
66- return unity_running
67+ return is_dbus_service_running("com.canonical.Unity")
68
69
70 def get_icon_from_theme(icons, iconname=None, iconsize=Icons.APP_ICON_SIZE,

Subscribers

People subscribed via source and target branches