Don't allow removing system-installed activities.

This commit is contained in:
Tomeu Vizoso 2007-08-31 20:37:44 +02:00
parent 0e60f07dd2
commit ecbbcb0026
2 changed files with 6 additions and 4 deletions

1
NEWS
View File

@ -1,3 +1,4 @@
* Don't allow removing system-installed activities. (tomeu)
* #3063: Make the 'Keep' button in the activity toolbar create a copy of the * #3063: Make the 'Keep' button in the activity toolbar create a copy of the
activity in the journal. Add a copy() method for activities to use. (tomeu) activity in the journal. Add a copy() method for activities to use. (tomeu)
* #3045: Fix issues with the clipboard icons and palettes. (tomeu) * #3045: Fix issues with the clipboard icons and palettes. (tomeu)

View File

@ -54,10 +54,11 @@ class ActivityButton(TrayButton, gobject.GObject):
self.set_palette(palette) self.set_palette(palette)
palette.props.invoker = FrameWidgetInvoker(self) palette.props.invoker = FrameWidgetInvoker(self)
menu_item = gtk.MenuItem(_('Remove')) if os.path.dirname(self._activity_info.path) == os.path.expanduser('~/Activities'):
menu_item.connect('activate', self.item_remove_cb) menu_item = gtk.MenuItem(_('Remove'))
palette.menu.append(menu_item) menu_item.connect('activate', self.item_remove_cb)
menu_item.show() palette.menu.append(menu_item)
menu_item.show()
def item_remove_cb(self, widget): def item_remove_cb(self, widget):
self.emit('remove_activity') self.emit('remove_activity')