Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-20 08:35:41 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-20 08:35:41 (GMT)
commit2a28ea38b12f617a1b78b8a0f8eb96e2536394cf (patch)
tree326d92c332b7a97778760a15a268aeb8f3f1a80f /shell
parenta06d75bd56b73c4703513454a35225d92759b6ef (diff)
Add a show_launcher property. Show only the web activity
Diffstat (limited to 'shell')
-rw-r--r--shell/ActivityRegistry.py14
-rw-r--r--shell/HomeWindow.py12
2 files changed, 20 insertions, 6 deletions
diff --git a/shell/ActivityRegistry.py b/shell/ActivityRegistry.py
index e9bd250..2b3efde 100644
--- a/shell/ActivityRegistry.py
+++ b/shell/ActivityRegistry.py
@@ -13,7 +13,8 @@ class ActivityModule:
self._id = activity_id
self._directory = directory
self._exec = activity_exec
-
+ self._show_launcher = False
+
def get_name(self):
"""Get the activity user visible name."""
return self._name
@@ -38,6 +39,14 @@ class ActivityModule:
"""Set the the type of the default activity service."""
self._default_type = default_type
+ def get_show_launcher(self):
+ """Get whether there should be a visible launcher for the activity"""
+ return self._show_launcher
+
+ def set_show_launcher(self, show_launcher):
+ """Set whether there should be a visible launcher for the activity"""
+ self._show_launcher = show_launcher
+
class ActivityRegistry:
"""Service that tracks the available activities"""
@@ -102,6 +111,9 @@ class ActivityRegistry:
module = ActivityModule(name, activity_id, activity_exec, directory)
self._activities.append(module)
+ if cp.has_option('Activity', 'show_launcher'):
+ module.set_show_launcher(True)
+
module.set_default_type(default_type)
return True
diff --git a/shell/HomeWindow.py b/shell/HomeWindow.py
index 47717f7..3d1fdc7 100644
--- a/shell/HomeWindow.py
+++ b/shell/HomeWindow.py
@@ -19,11 +19,13 @@ class NewActivityButton(gtk.MenuToolButton):
menu = gtk.Menu()
for module in self._home.list_activities():
- item = gtk.MenuItem(module.get_name(), False)
- activity_id = module.get_id()
- item.connect('activate', self.__menu_item_activate_cb, activity_id)
- menu.append(item)
- item.show()
+ if module.get_show_launcher():
+ item = gtk.MenuItem(module.get_name(), False)
+ activity_id = module.get_id()
+ item.connect('activate',
+ self.__menu_item_activate_cb, activity_id)
+ menu.append(item)
+ item.show()
self.set_menu(menu)