added start time parameter to CmdWindow

This commit is contained in:
Josh Holtrop 2011-01-03 11:05:40 -05:00
parent 4d641af494
commit 99d37c6268
2 changed files with 7 additions and 2 deletions

View File

@ -2,7 +2,7 @@
import gtk import gtk
class CmdWindow: class CmdWindow:
def __init__(self, status = ''): def __init__(self, status = '', starttime = None):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_geometry_hints(min_width = 350); self.window.set_geometry_hints(min_width = 350);
self.window.connect("delete_event", self.delete_event) self.window.connect("delete_event", self.delete_event)
@ -17,6 +17,9 @@ class CmdWindow:
hbox = gtk.HBox() hbox = gtk.HBox()
lbl = gtk.Label(status) lbl = gtk.Label(status)
hbox.pack_start(lbl, expand = False) hbox.pack_start(lbl, expand = False)
if starttime is not None:
lbl = gtk.Label('Start: ' + starttime.strftime('%I:%M%p'))
hbox.pack_end(lbl, expand = False)
vbox.pack_start(hbox) vbox.pack_start(hbox)
hbox = gtk.HBox() hbox = gtk.HBox()

4
dwtt
View File

@ -39,10 +39,12 @@ def main(argv):
while True: while True:
status = '' status = ''
starttime = None
ct = ds.getCurrentTask() ct = ds.getCurrentTask()
if ct is not None: if ct is not None:
status = 'Current Task: ' + ds.getTaskByID(ct.taskid).name status = 'Current Task: ' + ds.getTaskByID(ct.taskid).name
cw = CmdWindow(status) starttime = ct.time
cw = CmdWindow(status, starttime)
cmdline = cw.main() cmdline = cw.main()
if cmdline.strip() == '': if cmdline.strip() == '':
break break