diff --git a/CmdWindow.py b/CmdWindow.py index 6c5ed73..ce94859 100644 --- a/CmdWindow.py +++ b/CmdWindow.py @@ -2,7 +2,7 @@ import gtk class CmdWindow: - def __init__(self): + def __init__(self, status = ''): self.window = gtk.Window(gtk.WINDOW_TOPLEVEL) self.window.set_geometry_hints(min_width = 350); self.window.connect("delete_event", self.delete_event) @@ -11,10 +11,20 @@ class CmdWindow: self.entry.connect("activate", self.activate_event) self.button = gtk.Button(stock = gtk.STOCK_OK) self.button.connect("clicked", self.activate_event) - self.hbox = gtk.HBox() - self.hbox.pack_start(self.entry) - self.hbox.pack_start(self.button, expand = False) - self.window.add(self.hbox) + + vbox = gtk.VBox() + if status != '': + hbox = gtk.HBox() + lbl = gtk.Label(status) + hbox.pack_start(lbl, expand = False) + vbox.pack_start(hbox) + + hbox = gtk.HBox() + hbox.pack_start(self.entry) + hbox.pack_start(self.button, expand = False) + vbox.pack_start(hbox) + + self.window.add(vbox) self.window.show_all() def main(self): diff --git a/dwtt b/dwtt index a6512a6..2817737 100755 --- a/dwtt +++ b/dwtt @@ -38,7 +38,12 @@ def main(argv): ds = DataStore(timedbfile) while True: - cmdline = doCmdWindow() + status = '' + ct = ds.getCurrentTask() + if ct is not None: + status = 'Current Task: ' + ds.getTaskByID(ct.taskid).name + cw = CmdWindow(status) + cmdline = cw.main() if cmdline.strip() == '': break cmd = Command(cmdline) @@ -52,10 +57,6 @@ def main(argv): else: print "Unknown return type '%s'" % type(res).__name__ -def doCmdWindow(): - c = CmdWindow() - return c.main() - def processStart(cmd, store): processOut(cmd, store) task = store.getTaskByName(cmd.argstr)