/offlineimap/head: changeset 292

Beginning of work to make it work with a threaded Tcl/Tk Tkinter.
This commit is contained in:
jgoerzen 2003-01-03 03:00:23 +01:00
parent 99352a39c2
commit bbbb13f52a
2 changed files with 15 additions and 3 deletions

View File

@ -1,3 +1,9 @@
offlineimap (3.99.6) unstable; urgency=low
* Beginnings of work to make it work with a threaded Tcl/Tk Tkinter.
-- John Goerzen <jgoerzen@complete.org> Thu, 2 Jan 2003 13:59:44 -0600
offlineimap (3.99.5) unstable; urgency=low offlineimap (3.99.5) unstable; urgency=low
* Added ability to disable expunging on the server. * Added ability to disable expunging on the server.

View File

@ -19,7 +19,7 @@
from Tkinter import * from Tkinter import *
import tkFont import tkFont
from threading import * from threading import *
import thread, traceback, time import thread, traceback, time, threading
from StringIO import StringIO from StringIO import StringIO
from ScrolledText import ScrolledText from ScrolledText import ScrolledText
from offlineimap import threadutil, version from offlineimap import threadutil, version
@ -152,18 +152,20 @@ class VerboseUI(UIBase):
return 0 return 0
def _createTopWindow(self, doidlevac = 1): def _createTopWindow(self, doidlevac = 1):
self.top = Tk()
self.top.title(version.productname + " " + version.versionstr)
self.threadframes = {} self.threadframes = {}
self.availablethreadframes = [] self.availablethreadframes = []
self.tflock = Lock() self.tflock = Lock()
self.notdeleted = 1 self.notdeleted = 1
self.created = threading.Event()
t = threadutil.ExitNotifyThread(target = self._runmainloop, t = threadutil.ExitNotifyThread(target = self._runmainloop,
name = "Tk Mainloop") name = "Tk Mainloop")
t.setDaemon(1) t.setDaemon(1)
t.start() t.start()
self.created.wait()
del self.created
if doidlevac: if doidlevac:
t = threadutil.ExitNotifyThread(target = self.idlevacuum, t = threadutil.ExitNotifyThread(target = self.idlevacuum,
name = "Tk idle vacuum") name = "Tk idle vacuum")
@ -171,6 +173,9 @@ class VerboseUI(UIBase):
t.start() t.start()
def _runmainloop(s): def _runmainloop(s):
s.top = Tk()
s.top.title(version.productname + " " + version.versionstr)
s.created.set()
s.top.mainloop() s.top.mainloop()
s.notdeleted = 0 s.notdeleted = 0
@ -364,6 +369,7 @@ class Blinkenlights(VerboseUI):
s.fontfamily = config.get('ui.Tk.Blinkenlights', 'fontfamily') s.fontfamily = config.get('ui.Tk.Blinkenlights', 'fontfamily')
if config.has_option('ui.Tk.Blinkenlights', 'fontsize'): if config.has_option('ui.Tk.Blinkenlights', 'fontsize'):
s.fontsize = config.getint('ui.Tk.Blinkenlights', 'fontsize') s.fontsize = config.getint('ui.Tk.Blinkenlights', 'fontsize')
def _createTopWindow(self): def _createTopWindow(self):
VerboseUI._createTopWindow(self, 0) VerboseUI._createTopWindow(self, 0)
#self.top.resizable(width = 0, height = 0) #self.top.resizable(width = 0, height = 0)