Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2006-07-08 09:56:13 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-08 09:56:13 (GMT)
commit0cbe559dbf6a5a324828a94e28fe06e9fbb26f9c (patch)
treefd4dd3ff89f8d765977df145d76dbdff460c6323 /shell
parent2999244b54848d989894c19664a3b0da2454d469 (diff)
Forgot to add these
Diffstat (limited to 'shell')
-rw-r--r--shell/ActivityRegistry.py30
-rw-r--r--shell/HomeWindow.py45
2 files changed, 75 insertions, 0 deletions
diff --git a/shell/ActivityRegistry.py b/shell/ActivityRegistry.py
new file mode 100644
index 0000000..2f40640
--- /dev/null
+++ b/shell/ActivityRegistry.py
@@ -0,0 +1,30 @@
+import dbus
+
+class ActivityInfo:
+ def __init__(self, name, title):
+ self._name = name
+ self._title = title
+
+ def get_name(self):
+ return self._name
+
+ def get_title(self):
+ return self._title
+
+class ActivityRegistry(dbus.service.Object):
+ """Dbus service that tracks the available activities"""
+
+ def __init__(self):
+ self._activities = []
+
+ bus = dbus.SessionBus()
+ bus_name = dbus.service.BusName('com.redhat.Sugar.ActivityRegistry', bus = bus)
+ dbus.service.Object.__init__(self, bus_name, '/com/redhat/Sugar/ActivityRegistry')
+
+ @dbus.service.method("com.redhat.Sugar.ActivityRegistry")
+ def add(self, name, title):
+ self._activities.append(ActivityInfo(name, title))
+
+ @dbus.service.method("com.redhat.Sugar.ActivityRegistry")
+ def list_activities(self):
+ return self._activities
diff --git a/shell/HomeWindow.py b/shell/HomeWindow.py
new file mode 100644
index 0000000..de26498
--- /dev/null
+++ b/shell/HomeWindow.py
@@ -0,0 +1,45 @@
+import gtk
+
+from sugar.activity import Activity
+
+class NewActivityButton(gtk.Button):
+ def __init__(self):
+ gtk.Button.__init__(self)
+
+ hbox = gtk.HBox(False, 6)
+
+ label = gtk.Label("New Activity")
+ hbox.pack_start(label)
+ label.show()
+
+ arrow = gtk.Arrow(gtk.ARROW_DOWN, gtk.SHADOW_NONE)
+ hbox.pack_start(arrow)
+ arrow.show()
+
+ self.set_image(hbox)
+
+ self.connect("clicked", self.__clicked_cb)
+
+ def __clicked_cb(self, button):
+ print Activity.list_activities
+
+class Toolbar(gtk.HBox):
+ def __init__(self):
+ gtk.HBox.__init__(self)
+
+ new_activity_button = NewActivityButton()
+ self.pack_start(new_activity_button)
+ new_activity_button.show()
+
+class HomeWindow(gtk.Window):
+ def __init__(self):
+ gtk.Window.__init__(self)
+
+ vbox = gtk.VBox()
+
+ toolbar = Toolbar()
+ vbox.pack_start(toolbar)
+ toolbar.show()
+
+ self.add(vbox)
+