Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/addons/bubblemessage.py
diff options
context:
space:
mode:
Diffstat (limited to 'addons/bubblemessage.py')
-rw-r--r--addons/bubblemessage.py28
1 files changed, 16 insertions, 12 deletions
diff --git a/addons/bubblemessage.py b/addons/bubblemessage.py
index 4e37274..1b495d4 100644
--- a/addons/bubblemessage.py
+++ b/addons/bubblemessage.py
@@ -15,8 +15,7 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
from ..actions import Action, DragWrapper
from ..properties import TStringProperty, TArrayProperty
-from .. import overlayer
-from ..services import ObjectStore
+from ..overlayer import TextBubble
class BubbleMessage(Action):
message = TStringProperty("Message")
@@ -42,21 +41,22 @@ class BubbleMessage(Action):
self._bubble = None
self._speaker = None
- def do(self, activity=None, **kwargs):
+ def do(self, overlayer=None, **kwargs):
"""
- Show the dialog
+ Show the dialog
+ @param overlayer Overlayer to draw on
"""
- if activity is None:
- raise TypeError("Missing argument activity")
+ if overlayer is None:
+ raise TypeError("Missing argument overlayer")
# get overlayer
- self.overlay = activity._overlayer
+ self.overlay = overlayer
if not self._bubble:
x, y = self.position
# TODO: tails are relative to tailpos. They should be relative to
# the speaking widget. Same of the bubble position.
- self._bubble = overlayer.TextBubble(text=self.message,
+ self._bubble = TextBubble(text=self.message,
tailpos=self.tail_pos)
self._bubble.show()
self.overlay.put(self._bubble, x, y)
@@ -71,16 +71,20 @@ class BubbleMessage(Action):
self._bubble.destroy()
self._bubble = None
- def enter_editmode(self, *args):
+ def enter_editmode(self, overlayer=None, *args, **kwargs):
"""
Enters edit mode. The action should display itself in some way,
without affecting the currently running application.
+ @param overlayer Overlayer to draw on
"""
- if not self.overlay:
- self.overlay = ObjectStore().activity._overlayer
+ if not overlayer:
+ raise TypeError("Missing argument overlayer")
+
+ self.overlay = overlayer
+
assert not self._drag, "bubble action set to editmode twice"
x, y = self.position
- self._bubble = overlayer.TextBubble(text=self.message,
+ self._bubble = TextBubble(text=self.message,
tailpos=self.tail_pos)
self.overlay.put(self._bubble, x, y)
self._bubble.show()