Merge branch 'master' of git+ssh://dev.laptop.org/git/sugar

This commit is contained in:
Marco Pesenti Gritti 2007-03-15 17:10:27 +01:00
commit 9f5d642591
3 changed files with 15 additions and 3 deletions

View File

@ -110,7 +110,7 @@ class HomeModel(gobject.GObject):
self._current_activity = act self._current_activity = act
else: else:
self._current_activity = None self._current_activity = None
logging.error('Actiivty for window %d was not yet launched.' % xid) logging.error('Activity for window %d was not yet launched.' % xid)
else: else:
self._current_activity = None self._current_activity = None
logging.error('Model for window %d does not exist.' % xid) logging.error('Model for window %d does not exist.' % xid)

View File

@ -14,6 +14,7 @@
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from sets import Set
import logging import logging
import gobject import gobject
@ -32,6 +33,7 @@ class Shell(gobject.GObject):
def __init__(self, model): def __init__(self, model):
gobject.GObject.__init__(self) gobject.GObject.__init__(self)
self._activities_starting = Set()
self._model = model self._model = model
self._hosts = {} self._hosts = {}
self._screen = wnck.screen_get_default() self._screen = wnck.screen_get_default()
@ -60,8 +62,12 @@ class Shell(gobject.GObject):
def _activity_added_cb(self, home_model, home_activity): def _activity_added_cb(self, home_model, home_activity):
activity_host = ActivityHost(home_activity) activity_host = ActivityHost(home_activity)
self._hosts[activity_host.get_xid()] = activity_host self._hosts[activity_host.get_xid()] = activity_host
if home_activity.get_type() in self._activities_starting:
self._activities_starting.remove(home_activity.get_type())
def _activity_removed_cb(self, home_model, home_activity): def _activity_removed_cb(self, home_model, home_activity):
if home_activity.get_type() in self._activities_starting:
self._activities_starting.remove(home_activity.get_type())
if not home_activity.get_launched(): if not home_activity.get_launched():
return return
xid = home_activity.get_xid() xid = home_activity.get_xid()
@ -127,8 +133,14 @@ class Shell(gobject.GObject):
home_model.notify_activity_launch_failed(handler.get_activity_id()) home_model.notify_activity_launch_failed(handler.get_activity_id())
def start_activity(self, activity_type): def start_activity(self, activity_type):
if activity_type in self._activities_starting:
logging.debug("This activity is still launching.")
return
logging.debug('Shell.start_activity') logging.debug('Shell.start_activity')
self._activities_starting.add(activity_type)
handler = activityfactory.create(activity_type) handler = activityfactory.create(activity_type)
home_model = self._model.get_home() home_model = self._model.get_home()

View File

@ -73,14 +73,14 @@ class SnowflakeBox(hippo.CanvasBox, hippo.CanvasItem):
max_child_size = 0 max_child_size = 0
for child in self.get_children(): for child in self.get_children():
[min_w, natural_w] = child.get_width_request() [min_w, natural_w] = child.get_width_request()
[min_h, natural_h] = child.get_height_request(width) [min_h, natural_h] = child.get_height_request(min_w)
max_child_size = max (max_child_size, min_w) max_child_size = max (max_child_size, min_w)
max_child_size = max (max_child_size, min_h) max_child_size = max (max_child_size, min_h)
width = self._get_radius() * 2 + \ width = self._get_radius() * 2 + \
max_child_size + _FLAKE_DISTANCE * 2 max_child_size + _FLAKE_DISTANCE * 2
return [width, width] return (width, width)
def do_allocate(self, width, height, origin_changed): def do_allocate(self, width, height, origin_changed):
hippo.CanvasBox.do_allocate(self, width, height, origin_changed) hippo.CanvasBox.do_allocate(self, width, height, origin_changed)