Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/home/HomeBox.py
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2007-01-11 10:20:08 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2007-01-11 10:20:08 (GMT)
commit297381cad771c3ac9c728ae784e8ea9c325184c4 (patch)
tree18bccae2bc2f0eee59936dadaab9edc5a622e018 /shell/view/home/HomeBox.py
parentdda16d83c0fe754eb697c5ceb0bb952bfd15a70f (diff)
Basic implementation of the shutdown graphics
Diffstat (limited to 'shell/view/home/HomeBox.py')
-rw-r--r--shell/view/home/HomeBox.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py
index 48069ea..daef97d 100644
--- a/shell/view/home/HomeBox.py
+++ b/shell/view/home/HomeBox.py
@@ -18,8 +18,10 @@ import hippo
from view.home.activitiesdonut import ActivitiesDonut
from view.home.MyIcon import MyIcon
+from model.ShellModel import ShellModel
from sugar.graphics.grid import Grid
from sugar.graphics import style
+from sugar.graphics.iconcolor import IconColor
class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
__gtype_name__ = 'SugarHomeBox'
@@ -36,6 +38,17 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
style.apply_stylesheet(self._my_icon, 'home.MyIcon')
self.append(self._my_icon, hippo.PACK_FIXED)
+ shell.get_model().connect('notify::state',
+ self._shell_state_changed_cb)
+
+ def _shell_state_changed_cb(self, model, pspec):
+ # FIXME handle all possible mode switches
+ if model.props.state == ShellModel.STATE_SHUTDOWN:
+ if self._donut:
+ self.remove(self._donut)
+ self._donut = None
+ self._my_icon.props.color = IconColor('insensitive')
+
def do_allocate(self, width, height):
hippo.CanvasBox.do_allocate(self, width, height)