- del self.history[-1]
- #Add lines to history. The last line contains no "\n" at the end!
- self.history += [l+"\n" for l in lines[:-1]]
- self.history += [lines[-1]]
+ len = max(0,self.getHistoryLen())
+ self.history[-1] = lines[0]
+ self.history += lines[1:]
+
+
+ #Check if activity status has been changed
+ for i in range(len, self.getHistoryLen()):
+ line = self.history[i]
+
+ res = self.testForInactivity(i)
+ if res != None:
+ while self.activityChanged != None:
+ print "wait for pending activity"
+ gtk.main_iteration()
+
+ self.setActive(False)
+ self.activityChanged = res
+
+ res = self.testForActivity(i)
+ if res != None:
+ while self.activityChanged != None:
+ print "wait for pending activity"
+ gtk.main_iteration()
+
+ self.setActive(True)
+ self.activityChanged = res
+