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-24 13:11:14 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2006-07-24 13:11:14 (GMT)
commitd2f76cc41db72721d435f33f2f16f5d75a738203 (patch)
tree4cf137eb87150928c79942c83f97704e9fc9a9ac /shell
parent1acd82599aa1c90faae98843c017263b93268190 (diff)
More work on the new home page.
Remove obsolete import.
Diffstat (limited to 'shell')
-rw-r--r--shell/HomeWindow2.py68
-rwxr-xr-xshell/Shell.py3
-rw-r--r--shell/data/Makefile.am6
-rw-r--r--shell/data/activity-placeholder.pngbin0 -> 3163 bytes
-rw-r--r--shell/data/home-background.pngbin0 -> 70665 bytes
5 files changed, 57 insertions, 20 deletions
diff --git a/shell/HomeWindow2.py b/shell/HomeWindow2.py
index d9a9a0c..e04afe8 100644
--- a/shell/HomeWindow2.py
+++ b/shell/HomeWindow2.py
@@ -1,8 +1,12 @@
import gtk
from sugar.scene.Stage import Stage
-from sugar.scene.SceneView import SceneView
+from sugar.scene.StageView import StageView
+from sugar.scene.PixbufActor import PixbufActor
+from sugar.scene.CircleLayout import CircleLayout
+from sugar.scene.Group import Group
from sugar.activity import Activity
+from sugar import env
class ActivityLauncher(gtk.HButtonBox):
def __init__(self, shell):
@@ -11,36 +15,66 @@ class ActivityLauncher(gtk.HButtonBox):
self._shell = shell
for module in shell.get_registry().list_activities():
- button = gtk.Button(module.get_name())
- activity_id = module.get_id()
- button.connect('clicked', self.__clicked_cb, activity_id)
- self.pack_start(button)
- button.show()
+ if module.get_show_launcher():
+ self._add_activity(module)
+
+ def _add_activity(self, module):
+ button = gtk.Button(module.get_name())
+ activity_id = module.get_id()
+ button.connect('clicked', self.__clicked_cb, activity_id)
+ self.pack_start(button)
+ button.show()
def __clicked_cb(self, button, activity_id):
Activity.create(activity_id)
-class HomeScene(SceneView):
+class HomeScene(StageView):
def __init__(self, shell):
- self._stage = Stage()
+ self._stage = self._create_stage()
+ StageView.__init__(self, self._stage)
+ self._shell = shell
+
+ launcher = ActivityLauncher(shell)
+ self.put(launcher, 10, 440)
+ launcher.show()
- SceneView.__init__(self, self._stage)
+ def _create_stage(self):
+ stage = Stage()
- self._shell = shell
+ background = env.get_data_file('home-background.png')
+ pixbuf = gtk.gdk.pixbuf_new_from_file(background)
+ stage.add(PixbufActor(pixbuf))
+
+ icons_group = Group()
+ icons_group.set_position(310, 80)
+
+ pholder = env.get_data_file('activity-placeholder.png')
+ pholder_pixbuf = gtk.gdk.pixbuf_new_from_file(pholder)
+
+ i = 0
+ while i < 7:
+ icons_group.add(PixbufActor(pholder_pixbuf))
+ i += 1
+
+ layout = CircleLayout(110)
+ icons_group.set_layout(layout)
+
+ stage.add(icons_group)
+
+ return stage
class HomeWindow(gtk.Window):
def __init__(self, shell):
gtk.Window.__init__(self)
+ self.connect('realize', self.__realize_cb)
+
fixed = gtk.Fixed()
scene = HomeScene(shell)
- fixed.put(scene, 0, 0)
+ scene.set_size_request(640, 480)
+ self.add(scene)
scene.show()
- launcher = ActivityLauncher(shell)
- fixed.put(launcher, 0, 0)
- launcher.show()
-
- self.add(fixed)
- fixed.show()
+ def __realize_cb(self, window):
+ self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP)
diff --git a/shell/Shell.py b/shell/Shell.py
index 6866cc4..cd8f4f4 100755
--- a/shell/Shell.py
+++ b/shell/Shell.py
@@ -8,7 +8,6 @@ import wnck
import gobject
from sugar.LogWriter import LogWriter
-from ConsoleLogger import ConsoleLogger
from ActivityRegistry import ActivityRegistry
from HomeWindow import HomeWindow
from sugar import env
@@ -56,7 +55,7 @@ class Shell:
bus_name = dbus.service.BusName('com.redhat.Sugar.Shell', bus=session_bus)
ShellDbusService(self, bus_name)
- self._owner = ShellOwner()
+ #self._owner = ShellOwner()
self._registry = ActivityRegistry()
self._registry.scan_directory(env.get_activities_dir())
diff --git a/shell/data/Makefile.am b/shell/data/Makefile.am
index 244b09e..349aea0 100644
--- a/shell/data/Makefile.am
+++ b/shell/data/Makefile.am
@@ -1,4 +1,8 @@
confdir = $(datadir)
conf_DATA = kbdconfig
-EXTRA_DIST = kbdconfig
+imagesdir = $(imagesdir)
+images_DATA = \
+ home-background.png
+
+EXTRA_DIST = $(conf_DATA) $(images_DATA)
diff --git a/shell/data/activity-placeholder.png b/shell/data/activity-placeholder.png
new file mode 100644
index 0000000..9fea97b
--- /dev/null
+++ b/shell/data/activity-placeholder.png
Binary files differ
diff --git a/shell/data/home-background.png b/shell/data/home-background.png
new file mode 100644
index 0000000..346b5dc
--- /dev/null
+++ b/shell/data/home-background.png
Binary files differ