Merge lp:~invernizzi/gnome-activity-journal/GAJ-todo-gtg into lp:gnome-activity-journal

Proposed by Luca Invernizzi
Status: Merged
Merge reported by: Randal Barlow
Merged at revision: not available
Proposed branch: lp:~invernizzi/gnome-activity-journal/GAJ-todo-gtg
Merge into: lp:gnome-activity-journal
Diff against target: 47 lines (+22/-1)
2 files modified
src/config.py (+1/-0)
src/content_objects.py (+21/-1)
To merge this branch: bzr merge lp:~invernizzi/gnome-activity-journal/GAJ-todo-gtg
Reviewer Review Type Date Requested Status
Randal Barlow Pending
Review via email: mp+28799@code.launchpad.net

Description of the change

Hello there,
This adds support for TODO elements in GAJ, in particular those coming from "Getting Things GNOME!".
The code to export GTG tasks to zeitgeist is available in [0], and will land in GTG trunk in less than a month.

I'll take this occasion to ask: how can I control the length of the yellow bar in [1] (which "Interpetation" do you use for that)? Yes, I could read your code, just a bit lazy :)

[0] lp:~gtg-user/gtg/multi-backends__invernizzi_gsoc/
[1] http://yfrog.com/3uscreenshottkp

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/config.py'
2--- src/config.py 2010-06-19 19:21:44 +0000
3+++ src/config.py 2010-06-29 21:05:40 +0000
4@@ -244,5 +244,6 @@
5 Interpretation.IMMESSAGE.uri: Source(Interpretation.IMMESSAGE, "applications-internet", _("Conversation"), _("Conversations")),
6 Interpretation.WEBSITE.uri: Source(Interpretation.WEBSITE, "gnome-mime-html", _("Website"), _("Websites")),
7 Interpretation.EMAIL.uri: Source(Interpretation.EMAIL, "applications-internet", _("Email"), _("Emails")),
8+ Interpretation.TODO.uri: Source(Interpretation.TODO, "applications-office", _("Todo"), _("Todos")),
9 INTERPRETATION_UNKNOWN: Source("Unknown", "applications-other", _("Other Activity"), _("Other Activities")),
10 }
11
12=== modified file 'src/content_objects.py'
13--- src/content_objects.py 2010-05-30 03:23:30 +0000
14+++ src/content_objects.py 2010-06-29 21:05:40 +0000
15@@ -709,6 +709,26 @@
16 common.launch_command("tomboy", ["--open-note", self.uri])
17
18
19+class GTGContentObject(BaseContentType):
20+ @classmethod
21+ def use_class(cls, event):
22+ """ Used by the content object chooser to check if the content object will work for the event"""
23+ if event.actor == "application://gtg.desktop":
24+ return cls
25+ return False
26+
27+ icon_name = "$ACTOR"
28+ text = _("{source._desc_sing} {event.subjects[0].text}")
29+ timelineview_text = _("GTG\n{source._desc_sing} {event.subjects[0].text}")
30+ thumbview_text = _("GTG\n{source._desc_sing} {event.subjects[0].text}")
31+
32+ type_color_representation = common.TANGOCOLORS[0], common.TANGOCOLORS[2]
33+
34+ def launch(self):
35+ if common.is_command_available("gtg"):
36+ common.launch_command("gtg", [self.uri])
37+
38+
39 class MusicPlayerContentObject(BaseContentType):
40 """Used by music players when the backing subject is not a file"""
41
42@@ -741,5 +761,5 @@
43 # Content object list used by the section function. Should use Subclasses but I like to have some order in which these should be used
44 if sys.version_info >= (2,6):
45 map(AbstractContentObject.content_object_types.append, (MusicPlayerContentObject, BzrContentObject, WebContentObject,
46- IMContentObject, TomboyContentObject, EmailContentObject, HamsterContentObject))
47+ IMContentObject, TomboyContentObject, GTGContentObject, EmailContentObject, HamsterContentObject))
48