From 9f92f8cd6107a7d4757077cdfe5b7e2015cb9bec Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Wed, 29 Aug 2012 07:44:46 +0200 Subject: [PATCH] List filling works. Got to change their color now --- ivolution/FacemovieThread.py | 8 ++++++-- ivolution/Facemovie_lib.py | 1 + ivolution/gui_wx/IvolutionWindow.py | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ivolution/FacemovieThread.py b/ivolution/FacemovieThread.py index ed8785b..6843548 100644 --- a/ivolution/FacemovieThread.py +++ b/ivolution/FacemovieThread.py @@ -64,8 +64,12 @@ class FacemovieThread(threading.Thread, Observable, Observer): #self.console_logger.debug(message) self.my_logger.debug(message) - # notify gui about small updates - self.notify(["Lib", ["STATUS", message[0], message[1]]]) + if message[0] == "FILEADD": + print "got it !" + self.notify(["Interface", [message[0], message[1], 0]]) + else: + # notify gui about small updates + self.notify(["Interface", ["STATUS", message[0], message[1]]]) # checking for fatal error if message[0] == "Error": diff --git a/ivolution/Facemovie_lib.py b/ivolution/Facemovie_lib.py index 4a3ca51..a30d4b9 100644 --- a/ivolution/Facemovie_lib.py +++ b/ivolution/Facemovie_lib.py @@ -121,6 +121,7 @@ class FaceMovie(object, Observable, Observer): # populating guys self.guys.append(a_guy) + self.notify(["Application", ["FILEADD", guy_name]]) except: self.console_logger.info("Skipping %s. Not an image file" % (guy_source)) self.my_logger.info("Skipping %s. Not an image file" % (guy_source)) diff --git a/ivolution/gui_wx/IvolutionWindow.py b/ivolution/gui_wx/IvolutionWindow.py index adf70ee..3609704 100644 --- a/ivolution/gui_wx/IvolutionWindow.py +++ b/ivolution/gui_wx/IvolutionWindow.py @@ -294,6 +294,12 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable): wx.MutexGuiEnter() # to avoid thread problems self.statusbar.SetStatusText(message[1], 1) wx.MutexGuiLeave() + elif message[0] == "FILEADD": + item = wx.ListItem() + item.SetText(message[1]) + wx.MutexGuiEnter() # to avoid thread problems + self.filelist.InsertItem(item) + wx.MutexGuiLeave() elif len(message) > 1: # system commands shall be ignored self.console_logger.debug("Unrecognized command")