From 488402df7d37cf68d421229968632696a2a97bd7 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Wed, 06 Feb 2008 09:20:33 +0000 Subject: Split sugar-toolkit out of sugar shell. --- (limited to 'src/view/frame/activitybutton.py') diff --git a/src/view/frame/activitybutton.py b/src/view/frame/activitybutton.py deleted file mode 100644 index 0c7c7fb..0000000 --- a/src/view/frame/activitybutton.py +++ /dev/null @@ -1,65 +0,0 @@ -# Copyright (C) 2007, One Laptop Per Child -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place - Suite 330, -# Boston, MA 02111-1307, USA. - -import gtk -import os -import gobject -from gettext import gettext as _ - -from sugar.graphics.palette import Palette -from sugar.graphics.tray import TrayButton -from sugar.graphics.icon import Icon -from sugar.graphics import style - -from view.frame.frameinvoker import FrameWidgetInvoker - -class ActivityButton(TrayButton, gobject.GObject): - __gtype_name__ = 'SugarActivityButton' - __gsignals__ = { - 'remove_activity': (gobject.SIGNAL_RUN_FIRST, - gobject.TYPE_NONE, ([])) - } - - def __init__(self, activity_info): - TrayButton.__init__(self) - - icon = Icon(file=activity_info.icon, - stroke_color=style.COLOR_WHITE.get_svg(), - fill_color=style.COLOR_TRANSPARENT.get_svg()) - self.set_icon_widget(icon) - icon.show() - - self._activity_info = activity_info - self.setup_rollover_options() - - def get_bundle_id(self): - return self._activity_info.bundle_id - - def setup_rollover_options(self): - palette = Palette(self._activity_info.name) - self.set_palette(palette) - palette.props.invoker = FrameWidgetInvoker(self) - -#TODO: Disabled this until later, see #4967 -# if os.path.dirname(self._activity_info.path) == os.path.expanduser('~/Activities'): -# menu_item = gtk.MenuItem(_('Remove')) -# menu_item.connect('activate', self.item_remove_cb) -# palette.menu.append(menu_item) -# menu_item.show() - - def item_remove_cb(self, widget): - self.emit('remove_activity') -- cgit v0.9.1