From 297381cad771c3ac9c728ae784e8ea9c325184c4 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Thu, 11 Jan 2007 10:20:08 +0000 Subject: Basic implementation of the shutdown graphics --- (limited to 'shell/view/home/HomeBox.py') 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) -- cgit v0.9.1