diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-18 23:29:42 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-08-18 23:29:42 (GMT) |
commit | 24dae31a9d1bb2141db3bfd0364f2d95219fc7fa (patch) | |
tree | da9a75e64a4dfda0d6535959e9bf03c5aefbf213 /shell | |
parent | 825758018df41500182c8834dc19e7893d353b3a (diff) |
Starting to create the mesh view...
Diffstat (limited to 'shell')
-rw-r--r-- | shell/Makefile.am | 4 | ||||
-rwxr-xr-x | shell/Shell.py | 2 | ||||
-rw-r--r-- | shell/home/ActivitiesModel.py (renamed from shell/ActivitiesModel.py) | 0 | ||||
-rw-r--r-- | shell/home/HomeView.py (renamed from shell/HomeWindow.py) | 23 | ||||
-rw-r--r-- | shell/home/HomeWindow.py | 35 | ||||
-rw-r--r-- | shell/home/Makefile.am | 6 | ||||
-rw-r--r-- | shell/home/MeshView.py | 20 | ||||
-rw-r--r-- | shell/home/__init__.py | 0 |
8 files changed, 67 insertions, 23 deletions
diff --git a/shell/Makefile.am b/shell/Makefile.am index 5642a4a..61caa3a 100644 --- a/shell/Makefile.am +++ b/shell/Makefile.am @@ -1,4 +1,4 @@ -SUBDIRS = data session PresenceService +SUBDIRS = data session home PresenceService bin_SCRIPTS = \ sugar \ @@ -11,13 +11,11 @@ bin_SCRIPTS = \ sugardir = $(pkgdatadir)/shell sugar_PYTHON = \ __init__.py \ - ActivitiesModel.py \ ActivityHost.py \ ActivityRegistry.py \ ChatController.py \ ConsoleWindow.py \ Owner.py \ - HomeWindow.py \ PeopleWindow.py \ PresenceView.py \ Shell.py diff --git a/shell/Shell.py b/shell/Shell.py index 50072fb..ad4db5b 100755 --- a/shell/Shell.py +++ b/shell/Shell.py @@ -8,7 +8,7 @@ import gobject import wnck from ActivityRegistry import ActivityRegistry -from HomeWindow import HomeWindow +from home.HomeWindow import HomeWindow from sugar import env from Owner import ShellOwner from sugar.presence.PresenceService import PresenceService diff --git a/shell/ActivitiesModel.py b/shell/home/ActivitiesModel.py index c46256d..c46256d 100644 --- a/shell/ActivitiesModel.py +++ b/shell/home/ActivitiesModel.py diff --git a/shell/HomeWindow.py b/shell/home/HomeView.py index 3790bf0..29f2e23 100644 --- a/shell/HomeWindow.py +++ b/shell/home/HomeView.py @@ -95,27 +95,15 @@ class Model(goocanvas.CanvasModelSimple): tasks.translate(600, 450) root.add_child(tasks) -class HomeWindow(gtk.Window): +class HomeView(goocanvas.CanvasView): def __init__(self, shell): - gtk.Window.__init__(self) - + goocanvas.CanvasView.__init__(self) self._shell = shell - self.connect('realize', self.__realize_cb) - - canvas = goocanvas.CanvasView() + self.connect("item_view_created", self.__item_view_created_cb) canvas_model = Model(shell) - canvas.set_bounds(0, 0, 1200, 900) - canvas.set_scale(float(800) / float(1200)) - canvas.set_size_request(800, 600) - - canvas.connect("item_view_created", self.__item_view_created_cb) - - self.add(canvas) - canvas.show() - - canvas.set_model(canvas_model) + self.set_model(canvas_model) def __item_view_created_cb(self, view, item_view, item): if isinstance(item, ActivityItem): @@ -133,6 +121,3 @@ class HomeWindow(gtk.Window): def __task_button_press_cb(self, view, target, event): activity = view.get_item().get_data('activity') activity.present() - - def __realize_cb(self, window): - self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP) diff --git a/shell/home/HomeWindow.py b/shell/home/HomeWindow.py new file mode 100644 index 0000000..d66020e --- /dev/null +++ b/shell/home/HomeWindow.py @@ -0,0 +1,35 @@ +import gtk + +from home.MeshView import MeshView +from home.HomeView import HomeView + +class HomeWindow(gtk.Window): + def __init__(self, shell): + gtk.Window.__init__(self) + + self.connect('realize', self.__realize_cb) + + self._nb = gtk.Notebook() + self._nb.set_show_tabs(False) + self._nb.set_show_border(False) + + home_view = HomeView(shell) + self._nb.append_page(home_view) + self._setup_canvas(home_view) + home_view.show() + + mesh_view = MeshView(shell) + self._setup_canvas(mesh_view) + self._nb.append_page(mesh_view) + mesh_view.show() + + self.add(self._nb) + self._nb.show() + + def _setup_canvas(self, canvas): + canvas.set_bounds(0, 0, 1200, 900) + canvas.set_scale(float(800) / float(1200)) + canvas.set_size_request(800, 600) + + def __realize_cb(self, window): + self.window.set_type_hint(gtk.gdk.WINDOW_TYPE_HINT_DESKTOP) diff --git a/shell/home/Makefile.am b/shell/home/Makefile.am new file mode 100644 index 0000000..184570e --- /dev/null +++ b/shell/home/Makefile.am @@ -0,0 +1,6 @@ +sugardir = $(pkgdatadir)/shell +sugar_PYTHON = \ + __init__.py \ + MeshView.py \ + HomeView.py \ + Window.py diff --git a/shell/home/MeshView.py b/shell/home/MeshView.py new file mode 100644 index 0000000..7b2e5f6 --- /dev/null +++ b/shell/home/MeshView.py @@ -0,0 +1,20 @@ +import goocanvas + +class Model(goocanvas.CanvasModelSimple): + def __init__(self, shell): + goocanvas.CanvasModelSimple.__init__(self) + + root = self.get_root_item() + +class MeshView(goocanvas.CanvasView): + def __init__(self, shell): + goocanvas.CanvasView.__init__(self) + self._shell = shell + + self.connect("item_view_created", self.__item_view_created_cb) + + canvas_model = Model(shell) + self.set_model(canvas_model) + + def __item_view_created_cb(self, view, item_view, item): + pass diff --git a/shell/home/__init__.py b/shell/home/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/shell/home/__init__.py |