Renamed Rollover to Popup.

This commit is contained in:
Tomeu Vizoso
2007-02-21 10:16:03 +01:00
parent affba784cf
commit bbfe539429
7 changed files with 61 additions and 61 deletions
+4 -4
View File
@@ -21,7 +21,7 @@ import wnck
from view.home.HomeWindow import HomeWindow
from sugar.presence import PresenceService
from sugar.graphics.rollovercontext import RolloverContext
from sugar.graphics.popupcontext import PopupContext
from view.ActivityHost import ActivityHost
from sugar.activity import ActivityFactory
from view.frame.frame import Frame
@@ -55,7 +55,7 @@ class Shell(gobject.GObject):
home_model.connect('active-activity-changed',
self._active_activity_changed_cb)
self._rollover_context = RolloverContext()
self._popup_context = PopupContext()
self._frame = Frame(self)
self._frame.show_and_hide(3)
@@ -102,8 +102,8 @@ class Shell(gobject.GObject):
def get_frame(self):
return self._frame
def get_rollover_context(self):
return self._rollover_context
def get_popup_context(self):
return self._popup_context
def _join_success_cb(self, handler, activity, activity_ps, activity_id, activity_type):
logging.debug("Joining activity %s (%s)" % (activity_id, activity_type))
+13 -13
View File
@@ -19,25 +19,25 @@ from gettext import gettext as _
import hippo
from sugar.graphics.rollover import Rollover
from sugar.graphics.popup import Popup
from sugar.graphics.menuicon import MenuIcon
from sugar.graphics.menu import Menu
from sugar.graphics.iconcolor import IconColor
from sugar.graphics.button import Button
import sugar
class ActivityRollover(Rollover):
class ActivityPopup(Popup):
ACTION_SHARE = 1
ACTION_CLOSE = 2
def __init__(self, activity_model):
Rollover.__init__(self, activity_model.get_title())
Popup.__init__(self, activity_model.get_title())
if not activity_model.get_shared():
self.add_item(ActivityRollover.ACTION_SHARE, _('Share'),
self.add_item(ActivityPopup.ACTION_SHARE, _('Share'),
'theme:stock-share-mesh')
self.add_item(ActivityRollover.ACTION_CLOSE, _('Close'),
self.add_item(ActivityPopup.ACTION_CLOSE, _('Close'),
'theme:stock-close')
class ActivityButton(Button):
@@ -50,13 +50,13 @@ class ActivityButton(Button):
Button.__init__(self, icon_name=icon_name, color=icon_color)
def get_rollover(self):
rollover = ActivityRollover(self._activity_model)
#rollover.connect('action', self._action_cb)
return rollover
def get_popup(self):
popup = ActivityPopup(self._activity_model)
#popup.connect('action', self._action_cb)
return popup
def get_rollover_context(self):
return self._shell.get_rollover_context()
def get_popup_context(self):
return self._shell.get_popup_context()
def _action_cb(self, menu, data):
[action_id, label] = data
@@ -68,9 +68,9 @@ class ActivityButton(Button):
logging.error('No active activity.')
return
if action_id == ActivityRollover.ACTION_SHARE:
if action_id == ActivityPopup.ACTION_SHARE:
activity.share()
elif action_id == ActivityRollover.ACTION_CLOSE:
elif action_id == ActivityPopup.ACTION_CLOSE:
activity.close()
class ZoomBox(hippo.CanvasBox):
+8 -8
View File
@@ -70,11 +70,11 @@ class Frame:
shell.get_model().connect('notify::state',
self._shell_state_changed_cb)
rollover_context = shell.get_rollover_context()
rollover_context.connect('activated',
self._rollover_context_activated_cb)
rollover_context.connect('deactivated',
self._rollover_context_deactivated_cb)
popup_context = shell.get_popup_context()
popup_context.connect('activated',
self._popup_context_activated_cb)
popup_context.connect('deactivated',
self._popup_context_deactivated_cb)
def _create_top_panel(self):
panel = self._create_panel(hippo.ORIENTATION_HORIZONTAL)
@@ -171,10 +171,10 @@ class Frame:
if self._mode != Frame.STICKY and not self._hover_frame:
self._timeline.play('before_slide_out', 'slide_out')
def _rollover_context_activated_cb(self, rollover_context):
def _popup_context_activated_cb(self, popup_context):
self._timeline.goto('slide_in', True)
def _rollover_context_deactivated_cb(self, rollover_context):
def _popup_context_deactivated_cb(self, popup_context):
if self._mode != Frame.STICKY and not self._hover_frame:
self._timeline.play('before_slide_out', 'slide_out')
@@ -206,7 +206,7 @@ class Frame:
def _leave_notify(self, panel):
self._hover_frame = False
if not panel.get_menu_shell().is_active() and \
not self._shell.get_rollover_context().is_active() and \
not self._shell.get_popup_context().is_active() and \
(self._mode == Frame.HIDE_ON_LEAVE or \
self._mode == Frame.AUTOMATIC):
self._timeline.play('before_slide_out', 'slide_out')