From 491b17602031161fd2e6a4707de79f41b25189f5 Mon Sep 17 00:00:00 2001 From: Julien Lengrand-Lambert Date: Wed, 29 Aug 2012 13:29:05 +0200 Subject: [PATCH] Green color switch when a face is found --- ivolution/FacemovieThread.py | 8 ++++---- ivolution/gui_wx/IvolutionWindow.py | 8 +++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ivolution/FacemovieThread.py b/ivolution/FacemovieThread.py index a0e4209..9a9faeb 100644 --- a/ivolution/FacemovieThread.py +++ b/ivolution/FacemovieThread.py @@ -66,9 +66,6 @@ class FacemovieThread(threading.Thread, Observable, Observer): self.my_logger.debug(message) if message[0] == "FILEADD": self.notify(["Interface", [message[0], message[1], 0]]) - elif message[0] == "FILEDONE": - print "tointerface" - self.notify(["Interface", message]) else: # notify gui about small updates self.notify(["Interface", ["STATUS", message[0], message[1]]]) @@ -80,6 +77,10 @@ class FacemovieThread(threading.Thread, Observable, Observer): self.stop_process = True self.notify(["Lib", ["STOP"]]) + elif len(message) == 3: # notifications + if message[0] == "FILEDONE": + self.notify(["Interface", message]) + else: self.console_logger.debug("Unrecognized command") self.my_logger.debug("Unrecognized command") @@ -87,7 +88,6 @@ class FacemovieThread(threading.Thread, Observable, Observer): self.my_logger.debug(message) def run(self): - # FIXME : Quite ugly way of doing. Find better! if not self.stop_process: self.my_logger.debug("Listing pictures") diff --git a/ivolution/gui_wx/IvolutionWindow.py b/ivolution/gui_wx/IvolutionWindow.py index 947b7c4..98e25a0 100644 --- a/ivolution/gui_wx/IvolutionWindow.py +++ b/ivolution/gui_wx/IvolutionWindow.py @@ -301,7 +301,13 @@ class IvolutionWindow(IvolutionTemplate, Observer, Observable): self.filelist.InsertItem(item) wx.MutexGuiLeave() elif message[0] == "FILEDONE": - print "Done : %s" % (message[1]) + for i in range(self.filelist.GetItemCount()): + if message[1] == self.filelist.GetItemText(i): + print "FUCKKKKKK" + wx.MutexGuiEnter() # to avoid thread problems + #self.filelist.GetItem(i).SetBackgroundColour('green'), 1) + self.filelist.SetItemTextColour(i, "green") + wx.MutexGuiLeave() elif len(message) > 1: # system commands shall be ignored self.console_logger.debug("Unrecognized command")