From d9d7792a8227939b2486bc7728279cf69bef916d Mon Sep 17 00:00:00 2001 From: noisymime Date: Tue, 19 Feb 2008 00:42:18 +0000 Subject: [PATCH] - fixed warning for duplicate stage adds - Added UI messaging queue --- GlossMgr.py | 19 +++++++++++++++++-- modules/slideshow/slideshow.py | 3 ++- myth/MythMySQL.pyc | Bin 3562 -> 3565 bytes 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/GlossMgr.py b/GlossMgr.py index 5f4377c..45aad61 100644 --- a/GlossMgr.py +++ b/GlossMgr.py @@ -307,6 +307,7 @@ class message(): def __init__(self, stage): self.stage = stage self.active = False + self.msgQueue = [] self.backdrop = clutter.Rectangle() self.backdrop.set_color(clutter.color_parse('Black')) @@ -352,8 +353,10 @@ class message(): self.main_group.set_position(group_x, group_y) def display_msg(self, title, text): - self.active = True - + if self.active: + self.msgQueue.append((title, text)) + return + self.message.set_text(title) self.detail.set_text(text) width = int(self.box.get_width() * 0.80) #Width is 80% of the box, giving 10% gap each side @@ -375,11 +378,14 @@ class message(): self.behaviour_group.apply(self.main_group) self.behaviour_backdrop.apply(self.backdrop) self.timeline.start() + + self.active = True def hide_msg(self): self.active = False self.timeline = clutter.Timeline(10,30) + self.timeline.connect("completed", self.remove_from_stage) alpha = clutter.Alpha(self.timeline, clutter.ramp_inc_func) self.behaviour_group = clutter.BehaviourOpacity(opacity_start=255, opacity_end=0, alpha=alpha) self.behaviour_backdrop = clutter.BehaviourOpacity(opacity_start=180, opacity_end=0, alpha=alpha) @@ -387,5 +393,14 @@ class message(): self.behaviour_backdrop.apply(self.backdrop) self.timeline.start() + def remove_from_stage(self, timeline): + self.stage.remove(self.backdrop) + self.stage.remove(self.main_group) + + #if there's messages in the queue, run through them + if len(self.msgQueue) > 0: + (title, text) = self.msgQueue.pop() + self.display_msg(title, text) + def on_key_press_event (self, stage, event): self.hide_msg() \ No newline at end of file diff --git a/modules/slideshow/slideshow.py b/modules/slideshow/slideshow.py index 8344342..fdd5b86 100644 --- a/modules/slideshow/slideshow.py +++ b/modules/slideshow/slideshow.py @@ -363,6 +363,7 @@ class Module: tempMenu = self.glossMgr.create_menu() #Menu(self.glossMgr) self.menu = tempMenu + #print self.baseDir #This occurs when there are not slideshows or we could not connect to the db to establish baseDir if self.baseDir is None: @@ -398,6 +399,6 @@ class Module: tempItem.add_image_from_path(imgPath, 0, 0) tempItem.setAction(self) - + return tempMenu diff --git a/myth/MythMySQL.pyc b/myth/MythMySQL.pyc index 5a61a8da85ff75a1638faaa9a5a1d818f310ec70..c0221f0ecd8a38382b5bb93a26700bb28cdd89ff 100644 GIT binary patch delta 54 zcmaDQ{Z^WN^Cw;|w%RQl*>|wXxG^v=gytnC<)kW<|u>Ix{dZgytnC<)kW<t@lx3!*=5M~uCd3W^ Dow^XI