|
From: <cl...@us...> - 2002-12-02 19:12:40
|
Update of /cvsroot/todo-manager/todo-manager
In directory sc8-pr-cvs1:/tmp/cvs-serv24639
Modified Files:
main.py
Log Message:
Basic core functionality for task groups
Index: main.py
===================================================================
RCS file: /cvsroot/todo-manager/todo-manager/main.py,v
retrieving revision 1.60
retrieving revision 1.61
diff -u -d -r1.60 -r1.61
--- main.py 26 Nov 2002 23:00:57 -0000 1.60
+++ main.py 2 Dec 2002 19:12:28 -0000 1.61
@@ -192,6 +192,8 @@
self.interface_call(ui, "display_error", _("Invalid Format"), _("The due date "\
"is not in the correct format.\nThe format is %s") %self.fmttime(curtime()))
return FALSE
+ elif key == "Group" and (value == "ALL" or value == "None"):
+ value = ""
t[key] = value
@@ -206,6 +208,9 @@
self.interface_call(ALL, "set_list_item_value", name, "finisheddate",
self.fmttime(t["FinishedDate"]))
+ if key == "Group":
+ self.interface_call(ALL, "update_list_groups", self.__get_task_groups())
+
self.__file_modified = TRUE
return TRUE
@@ -530,6 +535,7 @@
# The contents of the task list
self.interface_call(interface, "update_list_items", self.__get_task_names())
+ self.interface_call(interface, "update_list_groups", self.__get_task_groups())
# Plugins that are loaded
if self.get_setting("Core", "loadplugins", TRUE):
@@ -814,6 +820,16 @@
# Tell the interface what tasks are available
self.interface_call(ui, "update_list_items", names)
+
+ def __get_task_groups(self):
+ groups = []
+
+ for t in self.__tasks:
+ if t["Group"]:
+ if not t["Group"] in groups:
+ groups.append(t["Group"])
+
+ return groups
def fmttime(self, t):
"""Format a time structure based on the user's settings"""
|