autoimport a bit better, no?
This commit is contained in:
parent
fe2c806822
commit
7803f52307
|
@ -104,9 +104,12 @@ class GuiAutoImport (threading.Thread):
|
|||
|
||||
def do_import(self):
|
||||
"""Callback for timer to do an import iteration."""
|
||||
if self.doAutoImportBool:
|
||||
self.importer.runUpdated()
|
||||
print "GuiAutoImport.import_dir done"
|
||||
return self.doAutoImportBool
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def startClicked(self, widget, data):
|
||||
"""runs when user clicks start on auto import tab"""
|
||||
|
@ -150,11 +153,14 @@ class GuiAutoImport (threading.Thread):
|
|||
gobject.timeout_add(interval*1000, self.do_import)
|
||||
else: # toggled off
|
||||
self.doAutoImportBool = False # do_import will return this and stop the gobject callback timer
|
||||
#TODO: other clean up, such as killing HUD
|
||||
print "Stopping autoimport"
|
||||
self.pipe_to_hud.communicate('\n') # waits for process to terminate
|
||||
print >>self.pipe_to_hud.stdin, "\n"
|
||||
#self.pipe_to_hud.communicate('\n') # waits for process to terminate
|
||||
self.pipe_to_hud = None
|
||||
widget.set_label(u'Start Autoimport')
|
||||
self.startButton.set_label(u'Start Autoimport')
|
||||
|
||||
|
||||
|
||||
#end def GuiAutoImport.startClicked
|
||||
|
||||
def get_vbox(self):
|
||||
|
|
Loading…
Reference in New Issue
Block a user