Use Window, add a compatibility hack to not break API

This commit is contained in:
Marco Pesenti Gritti 2007-02-27 15:05:44 +01:00
parent 2e2db562c5
commit e478de4224

View File

@ -19,15 +19,17 @@ import logging
import os import os
import gtk import gtk
import hippo
from sugar.presence import PresenceService from sugar.presence import PresenceService
from sugar.activity.activityservice import ActivityService from sugar.activity.activityservice import ActivityService
from sugar.graphics.window import Window
class Activity(gtk.Window): class Activity(Window, gtk.Container):
"""Base Activity class that all other Activities derive from.""" """Base Activity class that all other Activities derive from."""
__gtype_name__ = 'SugarActivity'
def __init__(self, handle): def __init__(self, handle):
gtk.Window.__init__(self) Window.__init__(self)
self.connect('destroy', self._destroy_cb) self.connect('destroy', self._destroy_cb)
@ -47,6 +49,12 @@ class Activity(gtk.Window):
self._bus = ActivityService(self) self._bus = ActivityService(self)
# DEPRECATED It will be removed after 3-6-2007 stable image
def do_add(self, widget):
if self.child:
self.remove(self.child)
gtk.Window.do_add(self, widget)
def get_service_name(self): def get_service_name(self):
"""Gets the activity service name.""" """Gets the activity service name."""
return os.environ['SUGAR_BUNDLE_SERVICE_NAME'] return os.environ['SUGAR_BUNDLE_SERVICE_NAME']