Merge lp:~gtg-user/gtg/urgency-color-api into lp:~gtg/gtg/old-trunk
- urgency-color-api
- Merge into old-trunk
Status: | Merged | ||||||||
---|---|---|---|---|---|---|---|---|---|
Merged at revision: | 1103 | ||||||||
Proposed branch: | lp:~gtg-user/gtg/urgency-color-api | ||||||||
Merge into: | lp:~gtg/gtg/old-trunk | ||||||||
Diff against target: |
927 lines (+576/-0) 9 files modified
AUTHORS (+1/-0) CHANGELOG (+1/-0) GTG/core/plugins/api.py (+22/-0) GTG/gtk/browser/treeview_factory.py (+10/-0) GTG/plugins/urgency-color.gtg-plugin (+16/-0) GTG/plugins/urgency_color/__init__.py (+21/-0) GTG/plugins/urgency_color/preferences.ui (+302/-0) GTG/plugins/urgency_color/urgency_color.py (+201/-0) setup.py (+2/-0) |
||||||||
To merge this branch: | bzr merge lp:~gtg-user/gtg/urgency-color-api | ||||||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Wolter HV (community) | Approve | ||
Izidor Matušov | running, code | Approve | |
Lionel Dricot (community) | Needs Fixing | ||
Review via email: mp+91517@code.launchpad.net |
Commit message
Description of the change
The branch implements a new way of handling task background colors, which is accessible from the plugin API.
It also includes a plugin, Urgency Color, which lets the user color tasks according to their urgency instead of tag color.
Lionel Dricot (ploum-deactivatedaccount) wrote : | # |
Wolter HV (wolterh) wrote : | # |
Weird, I have not come across this, will fix as soon as possible. Thanks for reporting!
- 1059. By Lionel Dricot
-
This commit upgrade liblarch and fixes bug #924323
Wolter HV (wolterh) wrote : | # |
Hi Lionel, I just pushed a new revision where I swapped the ddate.offset for ddate.days_left(). I don't really know if this will fix the problem as I couldn't reproduce it, but perhaps it will prevent the object from becoming an integer. Could you please tell me how to reproduce this bug so I can fix it properly?
- 1060. By Lionel Dricot
-
restoring the priority queue
- 1061. By Lionel Dricot
-
fixed the infamous bug where child-parent relationship were lost
- 1062. By Lionel Dricot
-
make actions on active tasks high priority in all cases
- 1063. By Izidor Matušov
-
Refractoring & polishing awesome work of Joao from GSoC 2011
- 1064. By Izidor Matušov
-
Merging AUTHORS and CHANGELOG from GTG 0.2.5
- 1065. By Lionel Dricot
-
Merging all the hard polishing work done by Jean-François. Thanks, highly appreciate because I suck at doing that
- 1066. By Izidor Matušov
-
Updated CHANGELOG, sorted AUTHORS by name and putting them also in GTG/info.py
- 1067. By Izidor Matušov
-
Merging translations
- 1068. By Izidor Matušov
-
Making liblarch independent. Bye bye liblarch
- 1069. By Izidor Matušov
-
Ignore task_added for nonexisting tasks in notification area
- 1070. By Izidor Matušov
-
Liblarch is no longer part of GTG code base
- 1071. By Izidor Matušov
-
import_liblarch(): bad indentation, transforming a comment into a docstring
- 1072. By Izidor Matušov
-
Updated changelog
- 1073. By Lionel Dricot
-
support for . and / in tags except if they are at the end of the tag
- 1074. By Lionel Dricot
-
we now close all deleted tasks if they are open
- 1075. By Izidor Matušov
-
Change in parsing tags had to be also reflected in GTG/tools/tags.py
- 1076. By Izidor Matušov
-
Closing taskeditors after marking as done/dismissing
/deleting parents. There is a fix from rev1074 when many tasks are deleted, some of them are not closed - 1077. By Izidor Matušov
-
Small cleaning of get_cannonical_date
- 1078. By Izidor Matušov
-
Cleaning GTG codebase a little bit
- 1079. By Izidor Matušov
-
Do not set name, parent of tag afterwards
- 1080. By Izidor Matušov
-
Merging a fix for focus issues of task browser, LP #917988. Thanks to dAnjou
- 1081. By Izidor Matušov
-
Regenerate pot file
- 1082. By Izidor Matušov
-
Renaming tagstore into tag
- 1083. By Izidor Matušov
-
Removed unused code & clean the rest of task_label_column
- 1084. By Izidor Matušov
-
Mark bold also tasks with previous due dates
- 1085. By Izidor Matušov
-
Hide tasks with due date someday, solves #931376
- 1086. By Luca Falavigna
-
Make gtcli_bash_
completion executable - 1087. By Luca Falavigna
-
/bin/env -> /usr/bin/env
- 1088. By Luca Falavigna
-
Fix some groff warnings in gtg_new_task man page
- 1089. By Izidor Matušov
-
Merging new Date class based on branch from Paul Kishimoto + many of my edits
- 1090. By Izidor Matušov
-
Remove unused backups of bryce test set
- 1091. By Izidor Matušov
-
Solved a regression from new date class merge
- 1092. By Izidor Matušov
-
First work on having robust XML support
- 1093. By Izidor Matušov
-
Remove redundant setlocale from dates (it makes GTG crash with set locale)
- 1094. By Izidor Matušov
-
I forgot to skip elements in localfile backend :-(
- 1095. By Izidor Matušov
-
Minor cleaning backend_
localfile. py - 1096. By Izidor Matušov
-
Get rid of legacy task-* and tag-* tasks, solving LP #908184
Wolter HV (wolterh) wrote : | # |
Lionel, please guide me towards fixing this error.
Lionel Dricot (ploum-deactivatedaccount) wrote : | # |
Hi Wolter, just trying to enable the plugin with your branch, I've that crash:
urgency-
'preferences.
I also have some other when you close/reopen the preferences window but I suspect it is a GTG bug, not your fault ;-)
Another change I would appreciate to see is, in the about box, an explanation on how the plugin computes the urgency.
Wolter HV (wolterh) wrote : | # |
On Tue, 2012-02-28 at 09:23 +0000, Lionel Dricot wrote:
> Hi Wolter, just trying to enable the plugin with your branch, I've that crash:
>
> urgency-
> 'preferences.ui'))
Fix released :) Removed the property from the UI file. Can you confirm
the crashes have stopped?
> Another change I would appreciate to see is, in the about box, an explanation on how the plugin computes the urgency.
I have added the explanation as requested. Feedback is welcome!
- 1097. By Izidor Matušov
-
Repair preselecting tomboy note. Solving LP#689743
- 1098. By Izidor Matušov
-
Better semantic for Date.days_left(), solves #942953
Izidor Matušov (izidor) wrote : | # |
I've fixed the offset problem, merged with the newest trunk because handling dates was changed. It works fine for me, all ploum's comments are solved.
Wolter mentioned a bug when activating a plugin, it is the last "problem". (although I am not able to reproduce it)
- 1099. By Izidor Matušov
-
Description for ValueErrors in Date class
- 1100. By Izidor Matušov
-
Solved Date regression in 'Remove old closed tasks' plugin, solves #941769
Wolter HV (wolterh) wrote : | # |
I pointlessly gave a "Needs information" review type, so I will correct that by approving :)
- 1101. By Izidor Matušov
-
Merging translations and fixing a typo in GTG/tools/dates.py
- 1102. By Izidor Matušov
-
Regenerated POT for translation
Preview Diff
1 | === modified file '.bzrignore' (properties changed: -x to +x) | |||
2 | === modified file 'AUTHORS' (properties changed: -x to +x) | |||
3 | --- AUTHORS 2012-02-17 12:05:18 +0000 | |||
4 | +++ AUTHORS 2012-02-29 10:16:18 +0000 | |||
5 | @@ -94,3 +94,4 @@ | |||
6 | 94 | -------- | 94 | -------- |
7 | 95 | * dAnjou <https://launchpad.net/~danjou> (no email provided) | 95 | * dAnjou <https://launchpad.net/~danjou> (no email provided) |
8 | 96 | * Paul Kishimoto <mail@paul.kishimoto.name> | 96 | * Paul Kishimoto <mail@paul.kishimoto.name> |
9 | 97 | * Wolter Hellmund <wolterh6@gmail.com> | ||
10 | 97 | 98 | ||
11 | === modified file 'CHANGELOG' (properties changed: -x to +x) | |||
12 | --- CHANGELOG 2012-02-17 12:05:18 +0000 | |||
13 | +++ CHANGELOG 2012-02-29 10:16:18 +0000 | |||
14 | @@ -1,6 +1,7 @@ | |||
15 | 1 | 2012-0?-?? Getting Things GNOME! 0.3 | 1 | 2012-0?-?? Getting Things GNOME! 0.3 |
16 | 2 | * Hide tasks with due date someday, #931376 | 2 | * Hide tasks with due date someday, #931376 |
17 | 3 | * New Date class by Paul Kishimoto and Izidor Matušov | 3 | * New Date class by Paul Kishimoto and Izidor Matušov |
18 | 4 | * Urgency Color plugin by Wolter Hellmund | ||
19 | 4 | 5 | ||
20 | 5 | 2012-02-13 Getting Things GNOME! 0.2.9 | 6 | 2012-02-13 Getting Things GNOME! 0.2.9 |
21 | 6 | * Big refractorization of code, now using liblarch | 7 | * Big refractorization of code, now using liblarch |
22 | 7 | 8 | ||
23 | === modified file 'GTG/__init__.py' (properties changed: -x to +x) | |||
24 | === modified file 'GTG/backends/__init__.py' (properties changed: -x to +x) | |||
25 | === modified file 'GTG/backends/backend_evolution.py' (properties changed: -x to +x) | |||
26 | === modified file 'GTG/backends/backend_gnote.py' (properties changed: -x to +x) | |||
27 | === modified file 'GTG/backends/backend_identica.py' (properties changed: -x to +x) | |||
28 | === modified file 'GTG/backends/backend_launchpad.py' (properties changed: -x to +x) | |||
29 | === modified file 'GTG/backends/backend_localfile.py' (properties changed: -x to +x) | |||
30 | === modified file 'GTG/backends/backend_mantis.py' (properties changed: -x to +x) | |||
31 | === modified file 'GTG/backends/backend_rtm.py' (properties changed: -x to +x) | |||
32 | === modified file 'GTG/backends/backend_tomboy.py' (properties changed: -x to +x) | |||
33 | === modified file 'GTG/backends/backend_twitter.py' (properties changed: -x to +x) | |||
34 | === modified file 'GTG/backends/backendsignals.py' (properties changed: -x to +x) | |||
35 | === modified file 'GTG/backends/genericbackend.py' (properties changed: -x to +x) | |||
36 | === modified file 'GTG/backends/generictomboy.py' (properties changed: -x to +x) | |||
37 | === modified file 'GTG/backends/periodicimportbackend.py' (properties changed: -x to +x) | |||
38 | === modified file 'GTG/backends/rtm/__init__.py' (properties changed: -x to +x) | |||
39 | === modified file 'GTG/backends/syncengine.py' (properties changed: -x to +x) | |||
40 | === modified file 'GTG/backends/tweepy/__init__.py' (properties changed: -x to +x) | |||
41 | === modified file 'GTG/backends/tweepy/api.py' (properties changed: -x to +x) | |||
42 | === modified file 'GTG/backends/tweepy/auth.py' (properties changed: -x to +x) | |||
43 | === modified file 'GTG/backends/tweepy/binder.py' (properties changed: -x to +x) | |||
44 | === modified file 'GTG/backends/tweepy/cache.py' (properties changed: -x to +x) | |||
45 | === modified file 'GTG/backends/tweepy/cursor.py' (properties changed: -x to +x) | |||
46 | === modified file 'GTG/backends/tweepy/error.py' (properties changed: -x to +x) | |||
47 | === modified file 'GTG/backends/tweepy/models.py' (properties changed: -x to +x) | |||
48 | === modified file 'GTG/backends/tweepy/oauth.py' (properties changed: -x to +x) | |||
49 | === modified file 'GTG/backends/tweepy/parsers.py' (properties changed: -x to +x) | |||
50 | === modified file 'GTG/backends/tweepy/streaming.py' (properties changed: -x to +x) | |||
51 | === modified file 'GTG/backends/tweepy/utils.py' (properties changed: -x to +x) | |||
52 | === modified file 'GTG/core/__init__.py' (properties changed: -x to +x) | |||
53 | === modified file 'GTG/core/datastore.py' (properties changed: -x to +x) | |||
54 | === modified file 'GTG/core/firstrun_tasks.py' (properties changed: -x to +x) | |||
55 | === modified file 'GTG/core/plugins/api.py' (properties changed: -x to +x) | |||
56 | --- GTG/core/plugins/api.py 2011-11-14 18:53:53 +0000 | |||
57 | +++ GTG/core/plugins/api.py 2012-02-29 10:16:18 +0000 | |||
58 | @@ -176,6 +176,28 @@ | |||
59 | 176 | Log.debug("Error removing the toolbar item in the TaskEditor:" | 176 | Log.debug("Error removing the toolbar item in the TaskEditor:" |
60 | 177 | "%s" % e) | 177 | "%s" % e) |
61 | 178 | 178 | ||
62 | 179 | def set_bgcolor_func(self, func=None): | ||
63 | 180 | """ Set a function which defines a background color for each task """ | ||
64 | 181 | # NOTE: this function is strongly dependend of browser structure | ||
65 | 182 | # after refaractoring browser, this might need to review | ||
66 | 183 | browser = self.__ui | ||
67 | 184 | |||
68 | 185 | # set default bgcolor? | ||
69 | 186 | if func is None: | ||
70 | 187 | func = browser.tv_factory.task_bg_color | ||
71 | 188 | info_col = 'tags' | ||
72 | 189 | else: | ||
73 | 190 | info_col = 'task_id' | ||
74 | 191 | |||
75 | 192 | for pane in browser.vtree_panes: | ||
76 | 193 | pane = browser.vtree_panes[pane] | ||
77 | 194 | pane.set_bg_color(func, info_col) | ||
78 | 195 | # FIXME: Added a parameter to the reset_filters call because | ||
79 | 196 | # otherwise all old completed tasks are re-shown and unable | ||
80 | 197 | # to be marked as done | ||
81 | 198 | #pane.basetree.reset_filters() | ||
82 | 199 | pane.basetree.reset_filters(transparent_only=True) | ||
83 | 200 | |||
84 | 179 | #=== file saving/loading ====================================================== | 201 | #=== file saving/loading ====================================================== |
85 | 180 | 202 | ||
86 | 181 | def load_configuration_object(self, plugin_name, filename, \ | 203 | def load_configuration_object(self, plugin_name, filename, \ |
87 | 182 | 204 | ||
88 | === modified file 'GTG/core/requester.py' (properties changed: -x to +x) | |||
89 | === modified file 'GTG/core/search.py' (properties changed: -x to +x) | |||
90 | === modified file 'GTG/core/tag.py' (properties changed: -x to +x) | |||
91 | === modified file 'GTG/core/task.py' (properties changed: -x to +x) | |||
92 | === modified file 'GTG/core/treefactory.py' (properties changed: -x to +x) | |||
93 | === modified file 'GTG/gtk/__init__.py' (properties changed: -x to +x) | |||
94 | === modified file 'GTG/gtk/backends_dialog.glade' (properties changed: -x to +x) | |||
95 | === modified file 'GTG/gtk/backends_dialog/__init__.py' (properties changed: -x to +x) | |||
96 | === modified file 'GTG/gtk/backends_dialog/addpanel.py' (properties changed: -x to +x) | |||
97 | === modified file 'GTG/gtk/backends_dialog/backendscombo.py' (properties changed: -x to +x) | |||
98 | === modified file 'GTG/gtk/backends_dialog/backendstree.py' (properties changed: -x to +x) | |||
99 | === modified file 'GTG/gtk/backends_dialog/configurepanel.py' (properties changed: -x to +x) | |||
100 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/__init__.py' (properties changed: -x to +x) | |||
101 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/checkboxui.py' (properties changed: -x to +x) | |||
102 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/importtagsui.py' (properties changed: -x to +x) | |||
103 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/passwordui.py' (properties changed: -x to +x) | |||
104 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/pathui.py' (properties changed: -x to +x) | |||
105 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/periodui.py' (properties changed: -x to +x) | |||
106 | === modified file 'GTG/gtk/backends_dialog/parameters_ui/textui.py' (properties changed: -x to +x) | |||
107 | === modified file 'GTG/gtk/browser/CellRendererTags.py' (properties changed: -x to +x) | |||
108 | === modified file 'GTG/gtk/browser/__init__.py' (properties changed: -x to +x) | |||
109 | === modified file 'GTG/gtk/browser/browser.py' (properties changed: -x to +x) | |||
110 | === modified file 'GTG/gtk/browser/custominfobar.py' (properties changed: -x to +x) | |||
111 | === modified file 'GTG/gtk/browser/taskbrowser.glade' (properties changed: -x to +x) | |||
112 | === modified file 'GTG/gtk/browser/treeview_factory.py' (properties changed: -x to +x) | |||
113 | --- GTG/gtk/browser/treeview_factory.py 2012-02-29 09:59:27 +0000 | |||
114 | +++ GTG/gtk/browser/treeview_factory.py 2012-02-29 10:16:18 +0000 | |||
115 | @@ -411,6 +411,16 @@ | |||
116 | 411 | #to both active and closed tasks treeview | 411 | #to both active and closed tasks treeview |
117 | 412 | def common_desc_for_tasks(self,tree): | 412 | def common_desc_for_tasks(self,tree): |
118 | 413 | desc = {} | 413 | desc = {} |
119 | 414 | |||
120 | 415 | #invisible 'task_id' column | ||
121 | 416 | col_name = 'task_id' | ||
122 | 417 | col = {} | ||
123 | 418 | col['renderer'] = ['markup', gtk.CellRendererText()] | ||
124 | 419 | col['value'] = [str, lambda node: node.get_id()] | ||
125 | 420 | col['visible'] = False | ||
126 | 421 | col['order'] = 0 | ||
127 | 422 | desc[col_name] = col | ||
128 | 423 | |||
129 | 414 | #invisible 'title' column | 424 | #invisible 'title' column |
130 | 415 | col_name = 'title' | 425 | col_name = 'title' |
131 | 416 | col = {} | 426 | col = {} |
132 | 417 | 427 | ||
133 | === modified file 'GTG/gtk/colors.py' (properties changed: -x to +x) | |||
134 | === modified file 'GTG/gtk/crashhandler.py' (properties changed: -x to +x) | |||
135 | === modified file 'GTG/gtk/dbuswrapper.py' (properties changed: -x to +x) | |||
136 | === modified file 'GTG/gtk/delete_dialog.py' (properties changed: -x to +x) | |||
137 | === modified file 'GTG/gtk/deletion.glade' (properties changed: -x to +x) | |||
138 | === modified file 'GTG/gtk/editor/__init__.py' (properties changed: -x to +x) | |||
139 | === modified file 'GTG/gtk/editor/calendar.py' (properties changed: -x to +x) | |||
140 | === modified file 'GTG/gtk/editor/editor.py' (properties changed: -x to +x) | |||
141 | === modified file 'GTG/gtk/editor/taskeditor.glade' (properties changed: -x to +x) | |||
142 | === modified file 'GTG/gtk/editor/taskview.py' (properties changed: -x to +x) | |||
143 | === modified file 'GTG/gtk/editor/taskviewserial.py' (properties changed: -x to +x) | |||
144 | === modified file 'GTG/gtk/manager.py' (properties changed: -x to +x) | |||
145 | === modified file 'GTG/gtk/preferences.glade' (properties changed: -x to +x) | |||
146 | === modified file 'GTG/gtk/preferences.py' (properties changed: -x to +x) | |||
147 | === modified file 'GTG/info.py' (properties changed: -x to +x) | |||
148 | === modified file 'GTG/plugins/__init__.py' (properties changed: -x to +x) | |||
149 | === modified file 'GTG/plugins/bugzilla.gtg-plugin' (properties changed: -x to +x) | |||
150 | === modified file 'GTG/plugins/bugzilla/__init__.py' (properties changed: -x to +x) | |||
151 | === modified file 'GTG/plugins/bugzilla/bug.py' (properties changed: -x to +x) | |||
152 | === modified file 'GTG/plugins/bugzilla/server.py' (properties changed: -x to +x) | |||
153 | === modified file 'GTG/plugins/export.gtg-plugin' (properties changed: -x to +x) | |||
154 | === modified file 'GTG/plugins/export/__init__.py' (properties changed: -x to +x) | |||
155 | === modified file 'GTG/plugins/export/export.ui' (properties changed: -x to +x) | |||
156 | === modified file 'GTG/plugins/export/export_templates/description_pocketmod.py' (properties changed: -x to +x) | |||
157 | === modified file 'GTG/plugins/export/export_templates/description_sexy.py' (properties changed: -x to +x) | |||
158 | === modified file 'GTG/plugins/export/export_templates/description_simple.py' (properties changed: -x to +x) | |||
159 | === modified file 'GTG/plugins/export/export_templates/description_statusrpt.py' (properties changed: -x to +x) | |||
160 | === modified file 'GTG/plugins/export/export_templates/description_textual.py' (properties changed: -x to +x) | |||
161 | === modified file 'GTG/plugins/export/export_templates/graphics_pocketmod.svg' (properties changed: -x to +x) | |||
162 | === modified file 'GTG/plugins/export/export_templates/template_pocketmod.tex' (properties changed: -x to +x) | |||
163 | === modified file 'GTG/plugins/export/export_templates/template_sexy.html' (properties changed: -x to +x) | |||
164 | === modified file 'GTG/plugins/export/export_templates/template_simple.html' (properties changed: -x to +x) | |||
165 | === modified file 'GTG/plugins/export/export_templates/template_statusrpt.txt' (properties changed: -x to +x) | |||
166 | === modified file 'GTG/plugins/export/export_templates/template_textual.txt' (properties changed: -x to +x) | |||
167 | === modified file 'GTG/plugins/export/export_templates/thumbnail_pocketmod.png' (properties changed: -x to +x) | |||
168 | === modified file 'GTG/plugins/export/export_templates/thumbnail_sexy.png' (properties changed: -x to +x) | |||
169 | === modified file 'GTG/plugins/export/export_templates/thumbnail_simple.png' (properties changed: -x to +x) | |||
170 | === modified file 'GTG/plugins/export/export_templates/thumbnail_statusrpt.png' (properties changed: -x to +x) | |||
171 | === modified file 'GTG/plugins/export/export_templates/thumbnail_textual.png' (properties changed: -x to +x) | |||
172 | === modified file 'GTG/plugins/export/task_str.py' (properties changed: -x to +x) | |||
173 | === modified file 'GTG/plugins/export/templates.py' (properties changed: -x to +x) | |||
174 | === modified file 'GTG/plugins/geolocalized-tasks.gtg-plugin' (properties changed: -x to +x) | |||
175 | === modified file 'GTG/plugins/geolocalized_tasks/__init__.py' (properties changed: -x to +x) | |||
176 | === modified file 'GTG/plugins/geolocalized_tasks/geolocalized.glade' (properties changed: -x to +x) | |||
177 | === modified file 'GTG/plugins/geolocalized_tasks/geolocalized_tasks.py' (properties changed: -x to +x) | |||
178 | === modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/16x16/assign-location.png' (properties changed: -x to +x) | |||
179 | === modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/24x24/geolocalization.png' (properties changed: -x to +x) | |||
180 | === modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/svg/assign-location.svg' (properties changed: -x to +x) | |||
181 | === modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/svg/geolocalization.svg' (properties changed: -x to +x) | |||
182 | === modified file 'GTG/plugins/geolocalized_tasks/marker.py' (properties changed: -x to +x) | |||
183 | === modified file 'GTG/plugins/hamster.gtg-plugin' (properties changed: -x to +x) | |||
184 | === modified file 'GTG/plugins/hamster/__init__.py' (properties changed: -x to +x) | |||
185 | === modified file 'GTG/plugins/hamster/prefs.ui' (properties changed: -x to +x) | |||
186 | === modified file 'GTG/plugins/import-json.gtg-plugin' (properties changed: -x to +x) | |||
187 | === modified file 'GTG/plugins/import_json/__init__.py' (properties changed: -x to +x) | |||
188 | === modified file 'GTG/plugins/import_json/import_json.ui' (properties changed: -x to +x) | |||
189 | === modified file 'GTG/plugins/notification-area.gtg-plugin' (properties changed: -x to +x) | |||
190 | === modified file 'GTG/plugins/notification_area/__init__.py' (properties changed: -x to +x) | |||
191 | === modified file 'GTG/plugins/notification_area/notification_area.py' (properties changed: -x to +x) | |||
192 | === modified file 'GTG/plugins/notification_area/notification_area.ui' (properties changed: -x to +x) | |||
193 | === modified file 'GTG/plugins/send-email.gtg-plugin' (properties changed: -x to +x) | |||
194 | === modified file 'GTG/plugins/send_email/__init__.py' (properties changed: -x to +x) | |||
195 | === modified file 'GTG/plugins/task-reaper.gtg-plugin' (properties changed: -x to +x) | |||
196 | === modified file 'GTG/plugins/task_reaper/__init__.py' (properties changed: -x to +x) | |||
197 | === modified file 'GTG/plugins/task_reaper/reaper.ui' (properties changed: -x to +x) | |||
198 | === modified file 'GTG/plugins/tomboy.gtg-plugin' (properties changed: -x to +x) | |||
199 | === modified file 'GTG/plugins/tomboy/__init__.py' (properties changed: -x to +x) | |||
200 | === modified file 'GTG/plugins/tomboy/combobox_enhanced.py' (properties changed: -x to +x) | |||
201 | === modified file 'GTG/plugins/tomboy/tomboy.ui' (properties changed: -x to +x) | |||
202 | === added file 'GTG/plugins/urgency-color.gtg-plugin' | |||
203 | --- GTG/plugins/urgency-color.gtg-plugin 1970-01-01 00:00:00 +0000 | |||
204 | +++ GTG/plugins/urgency-color.gtg-plugin 2012-02-29 10:16:18 +0000 | |||
205 | @@ -0,0 +1,16 @@ | |||
206 | 1 | [GTG Plugin] | ||
207 | 2 | Module=urgency_color | ||
208 | 3 | Name=Urgency Color | ||
209 | 4 | Short-description="Task urgency color-coding" | ||
210 | 5 | Description='''This plugin will calculate the urgency status of every of your currently active tasks and color-code it accordingly. | ||
211 | 6 | |||
212 | 7 | Color code | ||
213 | 8 | |||
214 | 9 | Assuming your settings are default: | ||
215 | 10 | Red means you are within the last 30% of days between the start-date and due-date, or your task is overdue. | ||
216 | 11 | Yellow means your task's start-date has passed. | ||
217 | 12 | Green means your task's start-date is oncoming. | ||
218 | 13 | ''' | ||
219 | 14 | Authors=Wolter Hellmund <wolterh6@gmail.com> | ||
220 | 15 | Version=0.1 | ||
221 | 16 | Enabled=False | ||
222 | 0 | 17 | ||
223 | === added directory 'GTG/plugins/urgency_color' | |||
224 | === added file 'GTG/plugins/urgency_color/__init__.py' | |||
225 | --- GTG/plugins/urgency_color/__init__.py 1970-01-01 00:00:00 +0000 | |||
226 | +++ GTG/plugins/urgency_color/__init__.py 2012-02-29 10:16:18 +0000 | |||
227 | @@ -0,0 +1,21 @@ | |||
228 | 1 | # -*- coding: utf-8 -*- | ||
229 | 2 | # Copyright (c) 2012 - Wolter Hellmund <wolterh6@gmail.com> | ||
230 | 3 | # | ||
231 | 4 | # This program is free software: you can redistribute it and/or modify it under | ||
232 | 5 | # the terms of the GNU General Public License as published by the Free Software | ||
233 | 6 | # Foundation, either version 3 of the License, or (at your option) any later | ||
234 | 7 | # version. | ||
235 | 8 | # | ||
236 | 9 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||
237 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
238 | 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
239 | 12 | # details. | ||
240 | 13 | # | ||
241 | 14 | # You should have received a copy of the GNU General Public License along with | ||
242 | 15 | # this program. If not, see <http://www.gnu.org/licenses/>. | ||
243 | 16 | |||
244 | 17 | from GTG.plugins.urgency_color.urgency_color import pluginUrgencyColor | ||
245 | 18 | |||
246 | 19 | #suppress pyflakes warning (given by make lint) | ||
247 | 20 | if False == True: | ||
248 | 21 | pluginUrgencyColor() | ||
249 | 0 | 22 | ||
250 | === added file 'GTG/plugins/urgency_color/preferences.ui' | |||
251 | --- GTG/plugins/urgency_color/preferences.ui 1970-01-01 00:00:00 +0000 | |||
252 | +++ GTG/plugins/urgency_color/preferences.ui 2012-02-29 10:16:18 +0000 | |||
253 | @@ -0,0 +1,302 @@ | |||
254 | 1 | <?xml version="1.0" encoding="UTF-8"?> | ||
255 | 2 | <interface> | ||
256 | 3 | <!-- interface-requires gtk+ 3.0 --> | ||
257 | 4 | <object class="GtkAdjustment" id="spinbutton_reddays_adjustment"> | ||
258 | 5 | <property name="upper">100</property> | ||
259 | 6 | <property name="step_increment">5</property> | ||
260 | 7 | <property name="page_increment">10</property> | ||
261 | 8 | </object> | ||
262 | 9 | <object class="GtkWindow" id="prefs_window"> | ||
263 | 10 | <property name="can_focus">False</property> | ||
264 | 11 | <property name="border_width">5</property> | ||
265 | 12 | <property name="type_hint">dialog</property> | ||
266 | 13 | <signal name="delete-event" handler="on_prefs_window_delete_event" swapped="no"/> | ||
267 | 14 | <child> | ||
268 | 15 | <object class="GtkVBox" id="vbox_main"> | ||
269 | 16 | <property name="can_focus">False</property> | ||
270 | 17 | <property name="spacing">2</property> | ||
271 | 18 | <child> | ||
272 | 19 | <object class="GtkFrame" id="frame_reddays"> | ||
273 | 20 | <property name="visible">True</property> | ||
274 | 21 | <property name="can_focus">False</property> | ||
275 | 22 | <property name="label_xalign">0</property> | ||
276 | 23 | <property name="shadow_type">in</property> | ||
277 | 24 | <child> | ||
278 | 25 | <object class="GtkAlignment" id="alignment1"> | ||
279 | 26 | <property name="visible">True</property> | ||
280 | 27 | <property name="can_focus">False</property> | ||
281 | 28 | <property name="top_padding">5</property> | ||
282 | 29 | <property name="bottom_padding">5</property> | ||
283 | 30 | <property name="left_padding">12</property> | ||
284 | 31 | <child> | ||
285 | 32 | <object class="GtkHBox" id="hbox_reddays"> | ||
286 | 33 | <property name="visible">True</property> | ||
287 | 34 | <property name="can_focus">False</property> | ||
288 | 35 | <child> | ||
289 | 36 | <object class="GtkLabel" id="label3"> | ||
290 | 37 | <property name="visible">True</property> | ||
291 | 38 | <property name="can_focus">False</property> | ||
292 | 39 | <property name="label" translatable="yes">Danger zone span</property> | ||
293 | 40 | </object> | ||
294 | 41 | <packing> | ||
295 | 42 | <property name="expand">True</property> | ||
296 | 43 | <property name="fill">True</property> | ||
297 | 44 | <property name="position">0</property> | ||
298 | 45 | </packing> | ||
299 | 46 | </child> | ||
300 | 47 | <child> | ||
301 | 48 | <object class="GtkSpinButton" id="spinbutton_reddays"> | ||
302 | 49 | <property name="visible">True</property> | ||
303 | 50 | <property name="can_focus">True</property> | ||
304 | 51 | <property name="invisible_char">•</property> | ||
305 | 52 | <property name="adjustment">spinbutton_reddays_adjustment</property> | ||
306 | 53 | <property name="climb_rate">10</property> | ||
307 | 54 | <property name="numeric">True</property> | ||
308 | 55 | <signal name="value-changed" handler="on_prefs_spinbutton_reddays_changed" swapped="no"/> | ||
309 | 56 | </object> | ||
310 | 57 | <packing> | ||
311 | 58 | <property name="expand">False</property> | ||
312 | 59 | <property name="fill">True</property> | ||
313 | 60 | <property name="position">1</property> | ||
314 | 61 | </packing> | ||
315 | 62 | </child> | ||
316 | 63 | <child> | ||
317 | 64 | <object class="GtkLabel" id="label4"> | ||
318 | 65 | <property name="visible">True</property> | ||
319 | 66 | <property name="can_focus">False</property> | ||
320 | 67 | <property name="label" translatable="yes">%</property> | ||
321 | 68 | </object> | ||
322 | 69 | <packing> | ||
323 | 70 | <property name="expand">False</property> | ||
324 | 71 | <property name="fill">True</property> | ||
325 | 72 | <property name="padding">5</property> | ||
326 | 73 | <property name="position">2</property> | ||
327 | 74 | </packing> | ||
328 | 75 | </child> | ||
329 | 76 | </object> | ||
330 | 77 | </child> | ||
331 | 78 | </object> | ||
332 | 79 | </child> | ||
333 | 80 | <child type="label"> | ||
334 | 81 | <object class="GtkLabel" id="label1"> | ||
335 | 82 | <property name="visible">True</property> | ||
336 | 83 | <property name="can_focus">False</property> | ||
337 | 84 | <property name="label" translatable="yes"><b>Danger zone</b></property> | ||
338 | 85 | <property name="use_markup">True</property> | ||
339 | 86 | </object> | ||
340 | 87 | </child> | ||
341 | 88 | </object> | ||
342 | 89 | <packing> | ||
343 | 90 | <property name="expand">False</property> | ||
344 | 91 | <property name="fill">True</property> | ||
345 | 92 | <property name="position">0</property> | ||
346 | 93 | </packing> | ||
347 | 94 | </child> | ||
348 | 95 | <child> | ||
349 | 96 | <object class="GtkFrame" id="frame_colors"> | ||
350 | 97 | <property name="visible">True</property> | ||
351 | 98 | <property name="can_focus">False</property> | ||
352 | 99 | <property name="label_xalign">0</property> | ||
353 | 100 | <property name="shadow_type">in</property> | ||
354 | 101 | <child> | ||
355 | 102 | <object class="GtkAlignment" id="alignment2"> | ||
356 | 103 | <property name="visible">True</property> | ||
357 | 104 | <property name="can_focus">False</property> | ||
358 | 105 | <property name="top_padding">5</property> | ||
359 | 106 | <property name="bottom_padding">5</property> | ||
360 | 107 | <property name="left_padding">12</property> | ||
361 | 108 | <child> | ||
362 | 109 | <object class="GtkVBox" id="vbox_colors"> | ||
363 | 110 | <property name="visible">True</property> | ||
364 | 111 | <property name="can_focus">False</property> | ||
365 | 112 | <property name="spacing">5</property> | ||
366 | 113 | <child> | ||
367 | 114 | <object class="GtkHBox" id="hbox_colors_red"> | ||
368 | 115 | <property name="visible">True</property> | ||
369 | 116 | <property name="can_focus">False</property> | ||
370 | 117 | <child> | ||
371 | 118 | <object class="GtkColorButton" id="colorbutton_red"> | ||
372 | 119 | <property name="use_action_appearance">False</property> | ||
373 | 120 | <property name="visible">True</property> | ||
374 | 121 | <property name="can_focus">True</property> | ||
375 | 122 | <property name="receives_default">True</property> | ||
376 | 123 | <property name="use_action_appearance">False</property> | ||
377 | 124 | <signal name="color-set" handler="on_prefs_colorbutton_red_changed" swapped="no"/> | ||
378 | 125 | </object> | ||
379 | 126 | <packing> | ||
380 | 127 | <property name="expand">False</property> | ||
381 | 128 | <property name="fill">True</property> | ||
382 | 129 | <property name="position">0</property> | ||
383 | 130 | </packing> | ||
384 | 131 | </child> | ||
385 | 132 | <child> | ||
386 | 133 | <object class="GtkLabel" id="label5"> | ||
387 | 134 | <property name="visible">True</property> | ||
388 | 135 | <property name="can_focus">False</property> | ||
389 | 136 | <property name="label" translatable="yes">In danger zone</property> | ||
390 | 137 | </object> | ||
391 | 138 | <packing> | ||
392 | 139 | <property name="expand">True</property> | ||
393 | 140 | <property name="fill">True</property> | ||
394 | 141 | <property name="position">1</property> | ||
395 | 142 | </packing> | ||
396 | 143 | </child> | ||
397 | 144 | </object> | ||
398 | 145 | <packing> | ||
399 | 146 | <property name="expand">False</property> | ||
400 | 147 | <property name="fill">True</property> | ||
401 | 148 | <property name="position">0</property> | ||
402 | 149 | </packing> | ||
403 | 150 | </child> | ||
404 | 151 | <child> | ||
405 | 152 | <object class="GtkHBox" id="hbox_colors_yellow"> | ||
406 | 153 | <property name="visible">True</property> | ||
407 | 154 | <property name="can_focus">False</property> | ||
408 | 155 | <child> | ||
409 | 156 | <object class="GtkColorButton" id="colorbutton_yellow"> | ||
410 | 157 | <property name="use_action_appearance">False</property> | ||
411 | 158 | <property name="visible">True</property> | ||
412 | 159 | <property name="can_focus">True</property> | ||
413 | 160 | <property name="receives_default">True</property> | ||
414 | 161 | <property name="use_action_appearance">False</property> | ||
415 | 162 | <signal name="color-set" handler="on_prefs_colorbutton_yellow_changed" swapped="no"/> | ||
416 | 163 | </object> | ||
417 | 164 | <packing> | ||
418 | 165 | <property name="expand">False</property> | ||
419 | 166 | <property name="fill">True</property> | ||
420 | 167 | <property name="position">0</property> | ||
421 | 168 | </packing> | ||
422 | 169 | </child> | ||
423 | 170 | <child> | ||
424 | 171 | <object class="GtkLabel" id="label6"> | ||
425 | 172 | <property name="visible">True</property> | ||
426 | 173 | <property name="can_focus">False</property> | ||
427 | 174 | <property name="label" translatable="yes">Should work on it</property> | ||
428 | 175 | </object> | ||
429 | 176 | <packing> | ||
430 | 177 | <property name="expand">True</property> | ||
431 | 178 | <property name="fill">True</property> | ||
432 | 179 | <property name="position">1</property> | ||
433 | 180 | </packing> | ||
434 | 181 | </child> | ||
435 | 182 | </object> | ||
436 | 183 | <packing> | ||
437 | 184 | <property name="expand">False</property> | ||
438 | 185 | <property name="fill">True</property> | ||
439 | 186 | <property name="position">1</property> | ||
440 | 187 | </packing> | ||
441 | 188 | </child> | ||
442 | 189 | <child> | ||
443 | 190 | <object class="GtkHBox" id="hbox_colors_green"> | ||
444 | 191 | <property name="visible">True</property> | ||
445 | 192 | <property name="can_focus">False</property> | ||
446 | 193 | <child> | ||
447 | 194 | <object class="GtkColorButton" id="colorbutton_green"> | ||
448 | 195 | <property name="use_action_appearance">False</property> | ||
449 | 196 | <property name="visible">True</property> | ||
450 | 197 | <property name="can_focus">True</property> | ||
451 | 198 | <property name="receives_default">True</property> | ||
452 | 199 | <property name="use_action_appearance">False</property> | ||
453 | 200 | <signal name="color-set" handler="on_prefs_colorbutton_green_changed" swapped="no"/> | ||
454 | 201 | </object> | ||
455 | 202 | <packing> | ||
456 | 203 | <property name="expand">False</property> | ||
457 | 204 | <property name="fill">True</property> | ||
458 | 205 | <property name="position">0</property> | ||
459 | 206 | </packing> | ||
460 | 207 | </child> | ||
461 | 208 | <child> | ||
462 | 209 | <object class="GtkLabel" id="label7"> | ||
463 | 210 | <property name="visible">True</property> | ||
464 | 211 | <property name="can_focus">False</property> | ||
465 | 212 | <property name="label" translatable="yes">Don't worry about it</property> | ||
466 | 213 | </object> | ||
467 | 214 | <packing> | ||
468 | 215 | <property name="expand">True</property> | ||
469 | 216 | <property name="fill">True</property> | ||
470 | 217 | <property name="position">1</property> | ||
471 | 218 | </packing> | ||
472 | 219 | </child> | ||
473 | 220 | </object> | ||
474 | 221 | <packing> | ||
475 | 222 | <property name="expand">False</property> | ||
476 | 223 | <property name="fill">True</property> | ||
477 | 224 | <property name="position">2</property> | ||
478 | 225 | </packing> | ||
479 | 226 | </child> | ||
480 | 227 | </object> | ||
481 | 228 | </child> | ||
482 | 229 | </object> | ||
483 | 230 | </child> | ||
484 | 231 | <child type="label"> | ||
485 | 232 | <object class="GtkLabel" id="label2"> | ||
486 | 233 | <property name="visible">True</property> | ||
487 | 234 | <property name="can_focus">False</property> | ||
488 | 235 | <property name="label" translatable="yes"><b>Colors</b></property> | ||
489 | 236 | <property name="use_markup">True</property> | ||
490 | 237 | </object> | ||
491 | 238 | </child> | ||
492 | 239 | </object> | ||
493 | 240 | <packing> | ||
494 | 241 | <property name="expand">False</property> | ||
495 | 242 | <property name="fill">True</property> | ||
496 | 243 | <property name="position">1</property> | ||
497 | 244 | </packing> | ||
498 | 245 | </child> | ||
499 | 246 | <child> | ||
500 | 247 | <object class="GtkAlignment" id="alignment3"> | ||
501 | 248 | <property name="visible">True</property> | ||
502 | 249 | <property name="can_focus">False</property> | ||
503 | 250 | <property name="top_padding">5</property> | ||
504 | 251 | <child> | ||
505 | 252 | <object class="GtkHButtonBox" id="hbuttonbox"> | ||
506 | 253 | <property name="can_focus">False</property> | ||
507 | 254 | <property name="border_width">6</property> | ||
508 | 255 | <property name="homogeneous">True</property> | ||
509 | 256 | <child> | ||
510 | 257 | <object class="GtkButton" id="button_reset"> | ||
511 | 258 | <property name="label">gtk-revert-to-saved</property> | ||
512 | 259 | <property name="use_action_appearance">False</property> | ||
513 | 260 | <property name="visible">True</property> | ||
514 | 261 | <property name="can_focus">True</property> | ||
515 | 262 | <property name="receives_default">True</property> | ||
516 | 263 | <property name="use_action_appearance">False</property> | ||
517 | 264 | <property name="use_stock">True</property> | ||
518 | 265 | <signal name="clicked" handler="on_prefs_reset_event" swapped="no"/> | ||
519 | 266 | </object> | ||
520 | 267 | <packing> | ||
521 | 268 | <property name="expand">False</property> | ||
522 | 269 | <property name="fill">True</property> | ||
523 | 270 | <property name="position">0</property> | ||
524 | 271 | </packing> | ||
525 | 272 | </child> | ||
526 | 273 | <child> | ||
527 | 274 | <object class="GtkButton" id="button_apply"> | ||
528 | 275 | <property name="label">gtk-apply</property> | ||
529 | 276 | <property name="use_action_appearance">False</property> | ||
530 | 277 | <property name="visible">True</property> | ||
531 | 278 | <property name="can_focus">True</property> | ||
532 | 279 | <property name="receives_default">True</property> | ||
533 | 280 | <property name="use_action_appearance">False</property> | ||
534 | 281 | <property name="use_stock">True</property> | ||
535 | 282 | <signal name="clicked" handler="on_prefs_apply_event" swapped="no"/> | ||
536 | 283 | </object> | ||
537 | 284 | <packing> | ||
538 | 285 | <property name="expand">False</property> | ||
539 | 286 | <property name="fill">True</property> | ||
540 | 287 | <property name="position">1</property> | ||
541 | 288 | </packing> | ||
542 | 289 | </child> | ||
543 | 290 | </object> | ||
544 | 291 | </child> | ||
545 | 292 | </object> | ||
546 | 293 | <packing> | ||
547 | 294 | <property name="expand">True</property> | ||
548 | 295 | <property name="fill">True</property> | ||
549 | 296 | <property name="position">3</property> | ||
550 | 297 | </packing> | ||
551 | 298 | </child> | ||
552 | 299 | </object> | ||
553 | 300 | </child> | ||
554 | 301 | </object> | ||
555 | 302 | </interface> | ||
556 | 0 | 303 | ||
557 | === added file 'GTG/plugins/urgency_color/urgency_color.py' | |||
558 | --- GTG/plugins/urgency_color/urgency_color.py 1970-01-01 00:00:00 +0000 | |||
559 | +++ GTG/plugins/urgency_color/urgency_color.py 2012-02-29 10:16:18 +0000 | |||
560 | @@ -0,0 +1,201 @@ | |||
561 | 1 | # -*- coding: utf-8 -*- | ||
562 | 2 | # Copyright (c) 2012 - Wolter Hellmund <wolterh6@gmail.com> | ||
563 | 3 | # | ||
564 | 4 | # This program is free software: you can redistribute it and/or modify it under | ||
565 | 5 | # the terms of the GNU General Public License as published by the Free Software | ||
566 | 6 | # Foundation, either version 3 of the License, or (at your option) any later | ||
567 | 7 | # version. | ||
568 | 8 | # | ||
569 | 9 | # This program is distributed in the hope that it will be useful, but WITHOUT | ||
570 | 10 | # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
571 | 11 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
572 | 12 | # details. | ||
573 | 13 | # | ||
574 | 14 | # You should have received a copy of the GNU General Public License along with | ||
575 | 15 | # this program. If not, see <http://www.gnu.org/licenses/>. | ||
576 | 16 | |||
577 | 17 | from math import ceil | ||
578 | 18 | import gtk | ||
579 | 19 | import os | ||
580 | 20 | |||
581 | 21 | from GTG.tools.dates import Date | ||
582 | 22 | |||
583 | 23 | class pluginUrgencyColor: | ||
584 | 24 | |||
585 | 25 | PLUGIN_NAME = 'Urgency Color' | ||
586 | 26 | DEFAULT_PREFS = { | ||
587 | 27 | 'reddays': 30, | ||
588 | 28 | 'color_green': '#cfff84', | ||
589 | 29 | 'color_yellow': '#ffed84', | ||
590 | 30 | 'color_red': '#ff9784'} | ||
591 | 31 | |||
592 | 32 | def __init__(self): | ||
593 | 33 | self._plugin_api = None | ||
594 | 34 | self.req = None | ||
595 | 35 | |||
596 | 36 | def activate(self, plugin_api): | ||
597 | 37 | """ Plugin is activated """ | ||
598 | 38 | self._plugin_api = plugin_api | ||
599 | 39 | self.req = self._plugin_api.get_requester() | ||
600 | 40 | self.prefs_load() | ||
601 | 41 | self.prefs_init() | ||
602 | 42 | # Set color function | ||
603 | 43 | self._plugin_api.set_bgcolor_func(self.bgcolor) | ||
604 | 44 | |||
605 | 45 | def _get_color(self, colindex): | ||
606 | 46 | if colindex == 0: | ||
607 | 47 | return self._pref_data['color_green'] | ||
608 | 48 | elif colindex == 1: | ||
609 | 49 | return self._pref_data['color_yellow'] | ||
610 | 50 | elif colindex == 2: | ||
611 | 51 | return self._pref_data['color_red'] | ||
612 | 52 | else: | ||
613 | 53 | return None | ||
614 | 54 | |||
615 | 55 | def bgcolor(self, node_id, standard_color): | ||
616 | 56 | node = self.req.get_task(node_id) | ||
617 | 57 | sdate = node.get_start_date() | ||
618 | 58 | ddate = node.get_due_date() | ||
619 | 59 | if (sdate != Date.no_date() != ddate): | ||
620 | 60 | dayspan = (ddate - sdate).days | ||
621 | 61 | daysleft = ddate.days_left() | ||
622 | 62 | |||
623 | 63 | redf = self._pref_data['reddays'] | ||
624 | 64 | reddays = int(ceil(redf*dayspan/100)) | ||
625 | 65 | color = 0 | ||
626 | 66 | if daysleft <= dayspan: | ||
627 | 67 | color = 1 | ||
628 | 68 | if daysleft <= reddays: | ||
629 | 69 | color = 2 | ||
630 | 70 | # This list should be implemented in the settings | ||
631 | 71 | #print "Giving color" | ||
632 | 72 | return self._get_color(color) | ||
633 | 73 | else: | ||
634 | 74 | # Return color for this node | ||
635 | 75 | return None | ||
636 | 76 | |||
637 | 77 | def deactivate(self, plugin_api): | ||
638 | 78 | """ Plugin is deactivated """ | ||
639 | 79 | self._plugin_api.set_bgcolor_func() | ||
640 | 80 | |||
641 | 81 | # Preferences dialog | ||
642 | 82 | def is_configurable(self): | ||
643 | 83 | """Requisite function for configurable plugins""" | ||
644 | 84 | return True | ||
645 | 85 | |||
646 | 86 | def configure_dialog(self, manager_dialog): | ||
647 | 87 | self._pref_data_potential = self._pref_data | ||
648 | 88 | self.prefs_window.show_all() | ||
649 | 89 | #self.prefs_window.set_transient_for(manager_dialog) | ||
650 | 90 | pass | ||
651 | 91 | |||
652 | 92 | def prefs_init(self): | ||
653 | 93 | self.builder = gtk.Builder() | ||
654 | 94 | self.builder.add_from_file(os.path.join( | ||
655 | 95 | os.path.dirname(os.path.abspath(__file__)), | ||
656 | 96 | 'preferences.ui')) | ||
657 | 97 | |||
658 | 98 | # Get the widgets | ||
659 | 99 | # Window | ||
660 | 100 | self.prefs_window = self.builder.get_object('prefs_window') | ||
661 | 101 | self.prefs_window.set_title(('GTG - %s preferences' \ | ||
662 | 102 | % self.PLUGIN_NAME)) | ||
663 | 103 | self.prefs_window.set_size_request(300, -1) | ||
664 | 104 | self.prefs_window.hide_on_delete() | ||
665 | 105 | |||
666 | 106 | # Spin button | ||
667 | 107 | self.spinbutton_reddays = self.builder.get_object('spinbutton_reddays') | ||
668 | 108 | |||
669 | 109 | # Colorbutton - RED | ||
670 | 110 | self.colorbutton_red = self.builder.get_object('colorbutton_red') | ||
671 | 111 | |||
672 | 112 | # Colorbutton - YELLOW | ||
673 | 113 | self.colorbutton_yellow = self.builder.get_object('colorbutton_yellow') | ||
674 | 114 | |||
675 | 115 | # Colorbutton - GREEN | ||
676 | 116 | self.colorbutton_green = self.builder.get_object('colorbutton_green') | ||
677 | 117 | |||
678 | 118 | # Buttons | ||
679 | 119 | self.button_apply = self.builder.get_object('button_apply') | ||
680 | 120 | self.button_reset = self.builder.get_object('button_reset') | ||
681 | 121 | |||
682 | 122 | # Update widget's values | ||
683 | 123 | self.prefs_update_widgets() | ||
684 | 124 | |||
685 | 125 | # Signal connections | ||
686 | 126 | SIGNAL_CONNECTIONS_DIC = { | ||
687 | 127 | 'on_prefs_window_delete_event': | ||
688 | 128 | self.on_prefs_cancel, | ||
689 | 129 | 'on_prefs_apply_event': | ||
690 | 130 | self.on_prefs_apply, | ||
691 | 131 | 'on_prefs_reset_event': | ||
692 | 132 | self.on_prefs_reset, | ||
693 | 133 | 'on_prefs_spinbutton_reddays_changed': | ||
694 | 134 | self.on_prefs_spinbutton_reddays_changed, | ||
695 | 135 | 'on_prefs_colorbutton_red_changed': | ||
696 | 136 | self.on_prefs_colorbutton_red_changed, | ||
697 | 137 | 'on_prefs_colorbutton_yellow_changed': | ||
698 | 138 | self.on_prefs_colorbutton_yellow_changed, | ||
699 | 139 | 'on_prefs_colorbutton_green_changed': | ||
700 | 140 | self.on_prefs_colorbutton_green_changed} | ||
701 | 141 | self.builder.connect_signals(SIGNAL_CONNECTIONS_DIC) | ||
702 | 142 | |||
703 | 143 | def prefs_update_widgets(self): | ||
704 | 144 | """ Synchronizes the widgets with the data in _pref_data """ | ||
705 | 145 | # Spin button | ||
706 | 146 | self.spinbutton_reddays.set_value(self._pref_data['reddays']) | ||
707 | 147 | # Colorbutton - RED | ||
708 | 148 | self.colorbutton_red.set_color( \ | ||
709 | 149 | gtk.gdk.color_parse(self._pref_data['color_red'])) | ||
710 | 150 | # Colorbutton - YELLOW | ||
711 | 151 | self.colorbutton_yellow.set_color( \ | ||
712 | 152 | gtk.gdk.color_parse(self._pref_data['color_yellow'])) | ||
713 | 153 | # Colorbutton - GREEN | ||
714 | 154 | self.colorbutton_green.set_color( \ | ||
715 | 155 | gtk.gdk.color_parse(self._pref_data['color_green'])) | ||
716 | 156 | |||
717 | 157 | def on_prefs_cancel(self, widget=None, data=None): | ||
718 | 158 | self.prefs_update_widgets() | ||
719 | 159 | self.prefs_window.hide() | ||
720 | 160 | return True | ||
721 | 161 | |||
722 | 162 | def on_prefs_apply(self, widget=None, data=None): | ||
723 | 163 | self._pref_data = self._pref_data_potential | ||
724 | 164 | self.prefs_store() | ||
725 | 165 | self.prefs_window.hide() | ||
726 | 166 | |||
727 | 167 | def on_prefs_reset(self, widget=None, data=None): | ||
728 | 168 | # Restore the default plugin settings | ||
729 | 169 | self._pref_data = self._pref_data_potential = dict(self.DEFAULT_PREFS) | ||
730 | 170 | self.prefs_update_widgets() | ||
731 | 171 | |||
732 | 172 | def prefs_load(self): | ||
733 | 173 | data = self._plugin_api.load_configuration_object( \ | ||
734 | 174 | self.PLUGIN_NAME, | ||
735 | 175 | 'preferences') | ||
736 | 176 | if not data or not isinstance(data, dict): | ||
737 | 177 | self._pref_data = dict(self.DEFAULT_PREFS) | ||
738 | 178 | else: | ||
739 | 179 | self._pref_data = data | ||
740 | 180 | |||
741 | 181 | def prefs_store(self): | ||
742 | 182 | self._plugin_api.save_configuration_object( \ | ||
743 | 183 | self.PLUGIN_NAME, | ||
744 | 184 | 'preferences', | ||
745 | 185 | self._pref_data) | ||
746 | 186 | |||
747 | 187 | def on_prefs_spinbutton_reddays_changed(self, widget=None, data=None): | ||
748 | 188 | self._pref_data_potential['reddays'] = \ | ||
749 | 189 | self.spinbutton_reddays.get_value() | ||
750 | 190 | |||
751 | 191 | def on_prefs_colorbutton_red_changed(self, widget=None, data=None): | ||
752 | 192 | self._pref_data_potential['color_red'] = \ | ||
753 | 193 | self.colorbutton_red.get_color().to_string() | ||
754 | 194 | |||
755 | 195 | def on_prefs_colorbutton_yellow_changed(self, widget=None, data=None): | ||
756 | 196 | self._pref_data_potential['color_yellow'] = \ | ||
757 | 197 | self.colorbutton_yellow.get_color().to_string() | ||
758 | 198 | |||
759 | 199 | def on_prefs_colorbutton_green_changed(self, widget=None, data=None): | ||
760 | 200 | self._pref_data_potential['color_green'] = \ | ||
761 | 201 | self.colorbutton_green.get_color().to_string() | ||
762 | 0 | 202 | ||
763 | === modified file 'GTG/tests/__init__.py' (properties changed: -x to +x) | |||
764 | === modified file 'GTG/tests/signals_testing.py' (properties changed: -x to +x) | |||
765 | === modified file 'GTG/tests/test_apidocs.py' (properties changed: -x to +x) | |||
766 | === modified file 'GTG/tests/test_backend_tomboy.py' (properties changed: -x to +x) | |||
767 | === modified file 'GTG/tests/test_backends.py' (properties changed: -x to +x) | |||
768 | === modified file 'GTG/tests/test_bidict.py' (properties changed: -x to +x) | |||
769 | === modified file 'GTG/tests/test_datastore.py' (properties changed: -x to +x) | |||
770 | === modified file 'GTG/tests/test_dates.py' (properties changed: -x to +x) | |||
771 | === modified file 'GTG/tests/test_interruptible.py' (properties changed: -x to +x) | |||
772 | === modified file 'GTG/tests/test_signal_testing.py' (properties changed: -x to +x) | |||
773 | === modified file 'GTG/tests/test_syncengine.py' (properties changed: -x to +x) | |||
774 | === modified file 'GTG/tests/test_syncmeme.py' (properties changed: -x to +x) | |||
775 | === modified file 'GTG/tests/test_tagstore.py' (properties changed: -x to +x) | |||
776 | === modified file 'GTG/tests/test_taskviewserial.py' (properties changed: -x to +x) | |||
777 | === modified file 'GTG/tests/test_tool_tags.py' (properties changed: -x to +x) | |||
778 | === modified file 'GTG/tests/test_twokeydict.py' (properties changed: -x to +x) | |||
779 | === modified file 'GTG/tests/tree_testing.py' (properties changed: -x to +x) | |||
780 | === modified file 'GTG/tests/xdg/xdg.txt' (properties changed: -x to +x) | |||
781 | === modified file 'GTG/tools/__init__.py' (properties changed: -x to +x) | |||
782 | === modified file 'GTG/tools/bidict.py' (properties changed: -x to +x) | |||
783 | === modified file 'GTG/tools/borg.py' (properties changed: -x to +x) | |||
784 | === modified file 'GTG/tools/cleanxml.py' (properties changed: -x to +x) | |||
785 | === modified file 'GTG/tools/clipboard.py' (properties changed: -x to +x) | |||
786 | === modified file 'GTG/tools/dates.py' (properties changed: -x to +x) | |||
787 | === modified file 'GTG/tools/interruptible.py' (properties changed: -x to +x) | |||
788 | === modified file 'GTG/tools/keyring.py' (properties changed: -x to +x) | |||
789 | === modified file 'GTG/tools/logger.py' (properties changed: -x to +x) | |||
790 | === modified file 'GTG/tools/networkmanager.py' (properties changed: -x to +x) | |||
791 | === modified file 'GTG/tools/openurl.py' (properties changed: -x to +x) | |||
792 | === modified file 'GTG/tools/readurl.py' (properties changed: -x to +x) | |||
793 | === modified file 'GTG/tools/synchronized.py' (properties changed: -x to +x) | |||
794 | === modified file 'GTG/tools/tags.py' (properties changed: -x to +x) | |||
795 | === modified file 'GTG/tools/taskxml.py' (properties changed: -x to +x) | |||
796 | === modified file 'GTG/tools/testingmode.py' (properties changed: -x to +x) | |||
797 | === modified file 'GTG/tools/twokeydict.py' (properties changed: -x to +x) | |||
798 | === modified file 'GTG/tools/urlregex.py' (properties changed: -x to +x) | |||
799 | === modified file 'GTG/tools/watchdog.py' (properties changed: -x to +x) | |||
800 | === modified file 'HACKING' (properties changed: -x to +x) | |||
801 | === modified file 'LICENSE' (properties changed: -x to +x) | |||
802 | === modified file 'MANIFEST.in' (properties changed: -x to +x) | |||
803 | === modified file 'Makefile' (properties changed: -x to +x) | |||
804 | === modified file 'README' (properties changed: -x to +x) | |||
805 | === modified file 'data/icons/hicolor/16x16/actions/gtg-note-new.png' (properties changed: -x to +x) | |||
806 | === modified file 'data/icons/hicolor/16x16/actions/gtg-plugin.png' (properties changed: -x to +x) | |||
807 | === modified file 'data/icons/hicolor/16x16/actions/gtg-tag-new.png' (properties changed: -x to +x) | |||
808 | === modified file 'data/icons/hicolor/16x16/actions/gtg-tag.png' (properties changed: -x to +x) | |||
809 | === modified file 'data/icons/hicolor/16x16/actions/gtg-task-dismiss.png' (properties changed: -x to +x) | |||
810 | === modified file 'data/icons/hicolor/16x16/actions/gtg-task-done.png' (properties changed: -x to +x) | |||
811 | === modified file 'data/icons/hicolor/16x16/actions/gtg-task-new.png' (properties changed: -x to +x) | |||
812 | === modified file 'data/icons/hicolor/16x16/actions/gtg-task-undismiss.png' (properties changed: -x to +x) | |||
813 | === modified file 'data/icons/hicolor/16x16/actions/gtg-task-undone.png' (properties changed: -x to +x) | |||
814 | === modified file 'data/icons/hicolor/16x16/apps/gtg.png' (properties changed: -x to +x) | |||
815 | === modified file 'data/icons/hicolor/16x16/categories/gtg-tags-all.png' (properties changed: -x to +x) | |||
816 | === modified file 'data/icons/hicolor/16x16/categories/gtg-tags-none.png' (properties changed: -x to +x) | |||
817 | === modified file 'data/icons/hicolor/16x16/categories/search.png' (properties changed: -x to +x) | |||
818 | === modified file 'data/icons/hicolor/16x16/emblems/gtg-home.png' (properties changed: -x to +x) | |||
819 | === modified file 'data/icons/hicolor/16x16/emblems/gtg-people.png' (properties changed: -x to +x) | |||
820 | === modified file 'data/icons/hicolor/16x16/emblems/gtg-work.png' (properties changed: -x to +x) | |||
821 | === modified file 'data/icons/hicolor/22x22/actions/gtg-note-new.png' (properties changed: -x to +x) | |||
822 | === modified file 'data/icons/hicolor/22x22/actions/gtg-plugin.png' (properties changed: -x to +x) | |||
823 | === modified file 'data/icons/hicolor/22x22/actions/gtg-tag-new.png' (properties changed: -x to +x) | |||
824 | === modified file 'data/icons/hicolor/22x22/actions/gtg-tag.png' (properties changed: -x to +x) | |||
825 | === modified file 'data/icons/hicolor/22x22/actions/gtg-task-dismiss.png' (properties changed: -x to +x) | |||
826 | === modified file 'data/icons/hicolor/22x22/actions/gtg-task-done.png' (properties changed: -x to +x) | |||
827 | === modified file 'data/icons/hicolor/22x22/actions/gtg-task-new.png' (properties changed: -x to +x) | |||
828 | === modified file 'data/icons/hicolor/22x22/actions/gtg-task-undismiss.png' (properties changed: -x to +x) | |||
829 | === modified file 'data/icons/hicolor/22x22/actions/gtg-task-undone.png' (properties changed: -x to +x) | |||
830 | === modified file 'data/icons/hicolor/22x22/apps/gtg.png' (properties changed: -x to +x) | |||
831 | === modified file 'data/icons/hicolor/22x22/categories/items-tags.png' (properties changed: -x to +x) | |||
832 | === modified file 'data/icons/hicolor/24x24/actions/gtg-tag-new.png' (properties changed: -x to +x) | |||
833 | === modified file 'data/icons/hicolor/24x24/apps/gtg.png' (properties changed: -x to +x) | |||
834 | === modified file 'data/icons/hicolor/32x32/actions/gtg-plugin.png' (properties changed: -x to +x) | |||
835 | === modified file 'data/icons/hicolor/32x32/apps/gtg.png' (properties changed: -x to +x) | |||
836 | === modified file 'data/icons/hicolor/scalable/apps/backend_evolution.png' (properties changed: -x to +x) | |||
837 | === modified file 'data/icons/hicolor/scalable/apps/backend_gnote.png' (properties changed: -x to +x) | |||
838 | === modified file 'data/icons/hicolor/scalable/apps/backend_identica.png' (properties changed: -x to +x) | |||
839 | === modified file 'data/icons/hicolor/scalable/apps/backend_launchpad.png' (properties changed: -x to +x) | |||
840 | === modified file 'data/icons/hicolor/scalable/apps/backend_localfile.png' (properties changed: -x to +x) | |||
841 | === modified file 'data/icons/hicolor/scalable/apps/backend_localfile.svg' (properties changed: -x to +x) | |||
842 | === modified file 'data/icons/hicolor/scalable/apps/backend_mantis.png' (properties changed: -x to +x) | |||
843 | === modified file 'data/icons/hicolor/scalable/apps/backend_rtm.png' (properties changed: -x to +x) | |||
844 | === modified file 'data/icons/hicolor/scalable/apps/backend_tomboy.png' (properties changed: -x to +x) | |||
845 | === modified file 'data/icons/hicolor/scalable/apps/backend_twitter.png' (properties changed: -x to +x) | |||
846 | === modified file 'data/icons/hicolor/scalable/apps/gtg.svg' (properties changed: -x to +x) | |||
847 | === modified file 'data/icons/hicolor/svg/gtg-plugin.svg' (properties changed: -x to +x) | |||
848 | === modified file 'data/icons/hicolor/svg/gtg.svg' (properties changed: -x to +x) | |||
849 | === modified file 'doc/gtg.1' (properties changed: -x to +x) | |||
850 | === modified file 'doc/gtg_new_task.1' (properties changed: -x to +x) | |||
851 | === modified file 'gtg.desktop' (properties changed: -x to +x) | |||
852 | === modified file 'org.gnome.GTG.service' (properties changed: -x to +x) | |||
853 | === modified file 'po/af.po' (properties changed: -x to +x) | |||
854 | === modified file 'po/ar.po' (properties changed: -x to +x) | |||
855 | === modified file 'po/ast.po' (properties changed: -x to +x) | |||
856 | === modified file 'po/be.po' (properties changed: -x to +x) | |||
857 | === modified file 'po/bg.po' (properties changed: -x to +x) | |||
858 | === modified file 'po/bn.po' (properties changed: -x to +x) | |||
859 | === modified file 'po/ca.po' (properties changed: -x to +x) | |||
860 | === modified file 'po/cs.po' (properties changed: -x to +x) | |||
861 | === modified file 'po/da.po' (properties changed: -x to +x) | |||
862 | === modified file 'po/de.po' (properties changed: -x to +x) | |||
863 | === modified file 'po/en_CA.po' (properties changed: -x to +x) | |||
864 | === modified file 'po/en_GB.po' (properties changed: -x to +x) | |||
865 | === modified file 'po/es.po' (properties changed: -x to +x) | |||
866 | === modified file 'po/eu.po' (properties changed: -x to +x) | |||
867 | === modified file 'po/fi.po' (properties changed: -x to +x) | |||
868 | === modified file 'po/fr.po' (properties changed: -x to +x) | |||
869 | === modified file 'po/gl.po' (properties changed: -x to +x) | |||
870 | === modified file 'po/gtg.pot' (properties changed: -x to +x) | |||
871 | === modified file 'po/he.po' (properties changed: -x to +x) | |||
872 | === modified file 'po/hr.po' (properties changed: -x to +x) | |||
873 | === modified file 'po/hu.po' (properties changed: -x to +x) | |||
874 | === modified file 'po/id.po' (properties changed: -x to +x) | |||
875 | === modified file 'po/is.po' (properties changed: -x to +x) | |||
876 | === modified file 'po/it.po' (properties changed: -x to +x) | |||
877 | === modified file 'po/ja.po' (properties changed: -x to +x) | |||
878 | === modified file 'po/jbo.po' (properties changed: -x to +x) | |||
879 | === modified file 'po/lt.po' (properties changed: -x to +x) | |||
880 | === modified file 'po/ms.po' (properties changed: -x to +x) | |||
881 | === modified file 'po/nb.po' (properties changed: -x to +x) | |||
882 | === modified file 'po/nds.po' (properties changed: -x to +x) | |||
883 | === modified file 'po/nl.po' (properties changed: -x to +x) | |||
884 | === modified file 'po/pl.po' (properties changed: -x to +x) | |||
885 | === modified file 'po/pt.po' (properties changed: -x to +x) | |||
886 | === modified file 'po/pt_BR.po' (properties changed: -x to +x) | |||
887 | === modified file 'po/ro.po' (properties changed: -x to +x) | |||
888 | === modified file 'po/ru.po' (properties changed: -x to +x) | |||
889 | === modified file 'po/si.po' (properties changed: -x to +x) | |||
890 | === modified file 'po/sl.po' (properties changed: -x to +x) | |||
891 | === modified file 'po/sq.po' (properties changed: -x to +x) | |||
892 | === modified file 'po/sv.po' (properties changed: -x to +x) | |||
893 | === modified file 'po/te.po' (properties changed: -x to +x) | |||
894 | === modified file 'po/tr.po' (properties changed: -x to +x) | |||
895 | === modified file 'po/uk.po' (properties changed: -x to +x) | |||
896 | === modified file 'po/zh_CN.po' (properties changed: -x to +x) | |||
897 | === modified file 'setup.py' (properties changed: -x to +x) | |||
898 | --- setup.py 2012-02-13 09:44:15 +0000 | |||
899 | +++ setup.py 2012-02-29 10:16:18 +0000 | |||
900 | @@ -142,6 +142,7 @@ | |||
901 | 142 | 'GTG.plugins.send_email', | 142 | 'GTG.plugins.send_email', |
902 | 143 | 'GTG.plugins.tomboy', | 143 | 'GTG.plugins.tomboy', |
903 | 144 | 'GTG.plugins.import_json', | 144 | 'GTG.plugins.import_json', |
904 | 145 | 'GTG.plugins.urgency_color' | ||
905 | 145 | ], | 146 | ], |
906 | 146 | package_data = { | 147 | package_data = { |
907 | 147 | 'GTG.core.plugins': ['pluginmanager.glade'], | 148 | 'GTG.core.plugins': ['pluginmanager.glade'], |
908 | @@ -158,6 +159,7 @@ | |||
909 | 158 | 'send-email.gtg-plugin', | 159 | 'send-email.gtg-plugin', |
910 | 159 | 'tomboy.gtg-plugin', | 160 | 'tomboy.gtg-plugin', |
911 | 160 | 'import-json.gtg-plugin', | 161 | 'import-json.gtg-plugin', |
912 | 162 | 'urgency-color.gtg-plugin' | ||
913 | 161 | ], | 163 | ], |
914 | 162 | 'GTG.plugins.export': ['export.ui', | 164 | 'GTG.plugins.export': ['export.ui', |
915 | 163 | './export_templates/description_pocketmod.py', | 165 | './export_templates/description_pocketmod.py', |
916 | 164 | 166 | ||
917 | === modified file 'test/data/bryce/xdg/config/gtg/gtg.conf' (properties changed: -x to +x) | |||
918 | === modified file 'test/data/bryce/xdg/config/gtg/tasks.conf' (properties changed: -x to +x) | |||
919 | === modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml' (properties changed: -x to +x) | |||
920 | === modified file 'test/data/bryce/xdg/data/gtg/projects.xml' (properties changed: -x to +x) | |||
921 | === modified file 'test/data/bryce/xdg/data/gtg/tags.xml' (properties changed: -x to +x) | |||
922 | === modified file 'test/data/standard/xdg/config/gtg/gtg.conf' (properties changed: -x to +x) | |||
923 | === modified file 'test/data/standard/xdg/config/gtg/tasks.conf' (properties changed: -x to +x) | |||
924 | === modified file 'test/data/standard/xdg/data/gtg/866eace6-7482-41e9-b450-e9664a5d1602.xml' (properties changed: -x to +x) | |||
925 | === modified file 'test/data/standard/xdg/data/gtg/gtg.pid' (properties changed: -x to +x) | |||
926 | === modified file 'test/data/standard/xdg/data/gtg/projects.xml' (properties changed: -x to +x) | |||
927 | === modified file 'test/data/standard/xdg/data/gtg/tags.xml' (properties changed: -x to +x) |
Traceback (most recent call last): ploum/urgency- color-api/ GTG/gtk/ liblarch_ gtk/__init_ _.py", line 318, in _celldatafunction color_func( value, bgcolor) ploum/urgency- color-api/ GTG/plugins/ urgency_ color/urgency_ color.py" , line 67, in bgcolor
File "/home/
color = self.bg_
File "/home/
daysleft = (ddate.offset - date.today()).days
TypeError: unsupported operand type(s) for -: 'int' and 'datetime.date