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 <mpg@redhat.com>2007-02-20 10:48:03 (GMT)
committer Marco Pesenti Gritti <mpg@redhat.com>2007-02-20 10:48:03 (GMT)
commite0dd1f52322090687410cc20a4255a8eb00f8928 (patch)
tree6a3b86d69d2f484b891320bd76ba9227e6234f5d /shell/view/home/HomeBox.py
parente24193c5511ac236c1f3014debf797d07f56dae2 (diff)
Infrastructure for the home page devices
Diffstat (limited to 'shell/view/home/HomeBox.py')
-rw-r--r--shell/view/home/HomeBox.py18
1 files changed, 14 insertions, 4 deletions
diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py
index bdc6621..13032a6 100644
--- a/shell/view/home/HomeBox.py
+++ b/shell/view/home/HomeBox.py
@@ -16,11 +16,13 @@
import hippo
+from sugar.graphics import units
+from sugar.graphics.iconcolor import IconColor
+
from view.home.activitiesdonut import ActivitiesDonut
+from view.devices import deviceview
from view.home.MyIcon import MyIcon
from model.ShellModel import ShellModel
-from sugar.graphics import units
-from sugar.graphics.iconcolor import IconColor
class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
__gtype_name__ = 'SugarHomeBox'
@@ -36,8 +38,16 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem):
self._my_icon = MyIcon(units.XLARGE_ICON_SCALE)
self.append(self._my_icon, hippo.PACK_FIXED)
- shell.get_model().connect('notify::state',
- self._shell_state_changed_cb)
+ shell_model = shell.get_model()
+ shell_model.connect('notify::state',
+ self._shell_state_changed_cb)
+
+ for device in shell_model.get_devices():
+ self._add_device(device)
+
+ def _add_device(self, device):
+ view = deviceview.create(device)
+ self.append(view, hippo.PACK_FIXED)
def _shell_state_changed_cb(self, model, pspec):
# FIXME handle all possible mode switches