← Back to team overview

gtg team mailing list archive

[Merge] lp:~gtg-user/gtg/ivanov_branch into lp:gtg

 

Paul Ivanov has proposed merging lp:~gtg-user/gtg/ivanov_branch into lp:gtg.

Requested reviews:
  Gtg developers (gtg)
Related bugs:
  #593396 Notification plugin should use filters
  https://bugs.launchpad.net/bugs/593396
  #615159 notification plugin crash "no attribute 'get_active_tasks_list'" (with fix)
  https://bugs.launchpad.net/bugs/615159


fixes #593396 and #615159
-- 
https://code.launchpad.net/~gtg-user/gtg/ivanov_branch/+merge/32059
Your team Gtg developers is requested to review the proposed merge of lp:~gtg-user/gtg/ivanov_branch into lp:gtg.
=== modified file 'GTG/plugins/notification_area/notification_area.py'
--- GTG/plugins/notification_area/notification_area.py	2010-03-22 05:07:37 +0000
+++ GTG/plugins/notification_area/notification_area.py	2010-08-08 23:23:39 +0000
@@ -108,7 +108,15 @@
         self.requester.connect("task-modified", self.on_task_modified)
         #initial menu populate, just in case the plugin is not activated at GTG
         # startup time
-        task_list = self.requester.get_active_tasks_list(workable = True)
+
+        # FIXME: I don't fully grok if I'm doing the right thing below, but the
+        # get_active_tasks_list method no longer exists, so I'm trying to
+        # do something that does the same thing that method used to do
+        #task_list = self.requester.get_active_tasks_list(workable = True)
+        customtree = self.requester.get_custom_tasks_tree()
+        customtree.apply_filter("workview")
+        customtree.apply_filter("no_disabled_tag")
+        task_list = customtree.displayed_nodes
         map(lambda tid: self.on_task_added(self.requester, tid), task_list)
         #realizing the menu
         self.menu.show_all()
@@ -118,8 +126,8 @@
         in the notification menu - currently only if it's in the
         workview"""
         task = self.plugin_api.get_requester().get_task(tid)
-        return task.is_workable() and task.is_started()\
-                        and task.get_status() == "Active"
+        return self.requester.filters.workview(task) and \
+                self.requester.filters.no_disabled_tag(task)