/offlineimap/head: changeset 315
Fixed up the VerboseUI for new account system. All that really needed updating with the "Sync immediately" button, to cope with syncing different accounts at different times. It's better now.
This commit is contained in:
parent
9c761cddad
commit
99e9c22cec
@ -16,6 +16,8 @@
|
|||||||
# along with this program; if not, write to the Free Software
|
# along with this program; if not, write to the Free Software
|
||||||
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
|
||||||
|
from __future__ import nested_scopes
|
||||||
|
|
||||||
from Tkinter import *
|
from Tkinter import *
|
||||||
import tkFont
|
import tkFont
|
||||||
from threading import *
|
from threading import *
|
||||||
@ -270,32 +272,39 @@ class VerboseUI(UIBase):
|
|||||||
|
|
||||||
b = Button(tf, text = "Exit", command = s.terminate)
|
b = Button(tf, text = "Exit", command = s.terminate)
|
||||||
b.pack(side = RIGHT)
|
b.pack(side = RIGHT)
|
||||||
|
s.sleeping_abort = {}
|
||||||
|
|
||||||
def deletingmessages(s, uidlist, destlist):
|
def deletingmessages(s, uidlist, destlist):
|
||||||
ds = s.folderlist(destlist)
|
ds = s.folderlist(destlist)
|
||||||
s._msg("Deleting %d messages in %s" % (len(uidlist), ds))
|
s._msg("Deleting %d messages in %s" % (len(uidlist), ds))
|
||||||
|
|
||||||
def _sleep_cancel(s, args = None):
|
def _sleep_cancel(s, args = None):
|
||||||
s.sleeping_abort = 1
|
s.sleeping_abort[thread.get_ident()] = 1
|
||||||
|
|
||||||
def sleep(s, sleepsecs):
|
def sleep(s, sleepsecs):
|
||||||
s.sleeping_abort = 0
|
threadid = thread.get_ident()
|
||||||
|
s.sleeping_abort[threadid] = 0
|
||||||
tf = s.gettf().getthreadextraframe()
|
tf = s.gettf().getthreadextraframe()
|
||||||
|
|
||||||
|
def sleep_cancel():
|
||||||
|
s.sleeping_abort[threadid] = 1
|
||||||
|
|
||||||
sleepbut = Button(tf, text = 'Sync immediately',
|
sleepbut = Button(tf, text = 'Sync immediately',
|
||||||
command = s._sleep_cancel)
|
command = sleep_cancel)
|
||||||
sleepbut.pack()
|
sleepbut.pack()
|
||||||
UIBase.sleep(s, sleepsecs)
|
UIBase.sleep(s, sleepsecs)
|
||||||
|
|
||||||
def sleeping(s, sleepsecs, remainingsecs):
|
def sleeping(s, sleepsecs, remainingsecs):
|
||||||
|
retval = s.sleeping_abort[thread.get_ident()]
|
||||||
if remainingsecs:
|
if remainingsecs:
|
||||||
s._msg("Next sync in %d:%02d" % (remainingsecs / 60,
|
s._msg("Next sync in %d:%02d" % (remainingsecs / 60,
|
||||||
remainingsecs % 60))
|
remainingsecs % 60))
|
||||||
else:
|
else:
|
||||||
s._msg("Wait done; synchronizing now.")
|
s._msg("Wait done; synchronizing now.")
|
||||||
s.gettf().destroythreadextraframe()
|
s.gettf().destroythreadextraframe()
|
||||||
|
del s.sleeping_abort[thread.get_ident()]
|
||||||
time.sleep(sleepsecs)
|
time.sleep(sleepsecs)
|
||||||
return s.sleeping_abort
|
return retval
|
||||||
|
|
||||||
TkUI = VerboseUI
|
TkUI = VerboseUI
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user