gtg-user team mailing list archive
-
gtg-user team
-
Mailing list archive
-
Message #00386
[Merge] lp:~gtg-user/gtg/urgency-color-api into lp:gtg
Wolter Hellmund has proposed merging lp:~gtg-user/gtg/urgency-color-api into lp:gtg.
Requested reviews:
Izidor Matušov (izidor)
For more details, see:
https://code.launchpad.net/~gtg-user/gtg/urgency-color-api/+merge/91517
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.
--
https://code.launchpad.net/~gtg-user/gtg/urgency-color-api/+merge/91517
Your team Gtg users is subscribed to branch lp:~gtg-user/gtg/urgency-color-api.
=== modified file '.bzrignore' (properties changed: -x to +x)
=== modified file 'AUTHORS' (properties changed: -x to +x)
=== modified file 'CHANGELOG' (properties changed: -x to +x)
=== modified file 'GTG/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_evolution.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_gnote.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_identica.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_launchpad.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_localfile.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_mantis.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_rtm.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_tomboy.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backend_twitter.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/backendsignals.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/genericbackend.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/generictomboy.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/periodicimportbackend.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/rtm/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/syncengine.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/api.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/auth.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/binder.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/cache.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/cursor.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/error.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/models.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/oauth.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/parsers.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/streaming.py' (properties changed: -x to +x)
=== modified file 'GTG/backends/tweepy/utils.py' (properties changed: -x to +x)
=== modified file 'GTG/core/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/core/datastore.py' (properties changed: -x to +x)
=== modified file 'GTG/core/firstrun_tasks.py' (properties changed: -x to +x)
=== modified file 'GTG/core/plugins/api.py' (properties changed: -x to +x)
--- GTG/core/plugins/api.py 2011-11-14 18:53:53 +0000
+++ GTG/core/plugins/api.py 2012-02-03 23:22:21 +0000
@@ -176,6 +176,24 @@
Log.debug("Error removing the toolbar item in the TaskEditor:"
"%s" % e)
+ def set_bgcolor_func(self, func=None):
+ """ Set a function which defines a background color for each task """
+ # NOTE: this function is strongly dependend of browser structure
+ # after refaractoring browser, this might need to review
+ browser = self.__ui
+
+ # set default bgcolor?
+ if func is None:
+ func = browser.tv_factory.task_bg_color
+ info_col = 'tags'
+ else:
+ info_col = 'task_id'
+
+ for pane in browser.vtree_panes:
+ pane = browser.vtree_panes[pane]
+ pane.set_bg_color(func, info_col)
+ pane.basetree.reset_filters()
+
#=== file saving/loading ======================================================
def load_configuration_object(self, plugin_name, filename, \
=== modified file 'GTG/core/requester.py' (properties changed: -x to +x)
=== modified file 'GTG/core/search.py' (properties changed: -x to +x)
=== modified file 'GTG/core/tagstore.py' (properties changed: -x to +x)
=== modified file 'GTG/core/task.py' (properties changed: -x to +x)
=== modified file 'GTG/core/treefactory.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog.glade' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/addpanel.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/backendscombo.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/backendstree.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/configurepanel.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/checkboxui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/importtagsui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/passwordui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/pathui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/periodui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/backends_dialog/parameters_ui/textui.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/CellRendererTags.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/browser.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/custominfobar.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/taskbrowser.glade' (properties changed: -x to +x)
=== modified file 'GTG/gtk/browser/treeview_factory.py' (properties changed: -x to +x)
--- GTG/gtk/browser/treeview_factory.py 2011-12-23 08:03:21 +0000
+++ GTG/gtk/browser/treeview_factory.py 2012-02-03 23:22:21 +0000
@@ -404,6 +404,16 @@
#to both active and closed tasks treeview
def common_desc_for_tasks(self,tree):
desc = {}
+
+ #invisible 'task_id' column
+ col_name = 'task_id'
+ col = {}
+ col['renderer'] = ['markup', gtk.CellRendererText()]
+ col['value'] = [str, lambda node: node.get_id()]
+ col['visible'] = False
+ col['order'] = 0
+ desc[col_name] = col
+
#invisible 'title' column
col_name = 'title'
col = {}
=== modified file 'GTG/gtk/colors.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/crashhandler.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/dbuswrapper.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/delete_dialog.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/deletion.glade' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/calendar.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/editor.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/taskeditor.glade' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/taskview.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/editor/taskviewserial.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/liblarch_gtk/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/liblarch_gtk/treemodel.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/manager.py' (properties changed: -x to +x)
=== modified file 'GTG/gtk/preferences.glade' (properties changed: -x to +x)
=== modified file 'GTG/gtk/preferences.py' (properties changed: -x to +x)
=== modified file 'GTG/info.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/bugzilla.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/bugzilla/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/bugzilla/bug.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/bugzilla/server.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export.ui' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/description_pocketmod.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/description_sexy.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/description_simple.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/description_statusrpt.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/description_textual.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/graphics_pocketmod.svg' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/template_pocketmod.tex' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/template_sexy.html' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/template_simple.html' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/template_statusrpt.txt' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/template_textual.txt' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/thumbnail_pocketmod.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/thumbnail_sexy.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/thumbnail_simple.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/thumbnail_statusrpt.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/export_templates/thumbnail_textual.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/task_str.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/export/templates.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized-tasks.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/geolocalized.glade' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/geolocalized_tasks.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/16x16/assign-location.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/24x24/geolocalization.png' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/svg/assign-location.svg' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/icons/hicolor/svg/geolocalization.svg' (properties changed: -x to +x)
=== modified file 'GTG/plugins/geolocalized_tasks/marker.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/hamster.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/hamster/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/hamster/prefs.ui' (properties changed: -x to +x)
=== modified file 'GTG/plugins/import-json.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/import_json/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/import_json/import_json.ui' (properties changed: -x to +x)
=== modified file 'GTG/plugins/notification-area.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/notification_area/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/notification_area/notification_area.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/notification_area/notification_area.ui' (properties changed: -x to +x)
=== modified file 'GTG/plugins/send-email.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/send_email/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/task-reaper.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/task_reaper/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/task_reaper/reaper.ui' (properties changed: -x to +x)
=== modified file 'GTG/plugins/tomboy.gtg-plugin' (properties changed: -x to +x)
=== modified file 'GTG/plugins/tomboy/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/tomboy/combobox_enhanced.py' (properties changed: -x to +x)
=== modified file 'GTG/plugins/tomboy/tomboy.ui' (properties changed: -x to +x)
=== added file 'GTG/plugins/urgency-color.gtg-plugin'
--- GTG/plugins/urgency-color.gtg-plugin 1970-01-01 00:00:00 +0000
+++ GTG/plugins/urgency-color.gtg-plugin 2012-02-03 23:22:21 +0000
@@ -0,0 +1,9 @@
+[GTG Plugin]
+Module=urgency_color
+Name=Urgency Color
+Short-description="Task urgency color-coding"
+Description='''This plugin will calculate the urgency status of every of your currently active tasks and color-code it accordingly'''
+Authors=Wolter Hellmund <wolterh6@xxxxxxxxx>
+Version=0.1
+Enabled=False
+Dependencies=
=== added directory 'GTG/plugins/urgency_color'
=== added file 'GTG/plugins/urgency_color/__init__.py'
--- GTG/plugins/urgency_color/__init__.py 1970-01-01 00:00:00 +0000
+++ GTG/plugins/urgency_color/__init__.py 2012-02-03 23:22:21 +0000
@@ -0,0 +1,20 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2012 - XYZ <xyz@xxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+from GTG.plugins.urgency_color.urgency_color import pluginUrgencyColor
+
+#suppress pyflakes warning (given by make lint)
+if False == True: pluginUrgencyColor()
=== added file 'GTG/plugins/urgency_color/preferences.ui'
--- GTG/plugins/urgency_color/preferences.ui 1970-01-01 00:00:00 +0000
+++ GTG/plugins/urgency_color/preferences.ui 2012-02-03 23:22:21 +0000
@@ -0,0 +1,303 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <!-- interface-requires gtk+ 3.0 -->
+ <object class="GtkAdjustment" id="spinbutton_reddays_adjustment">
+ <property name="upper">100</property>
+ <property name="step_increment">5</property>
+ <property name="page_increment">10</property>
+ </object>
+ <object class="GtkWindow" id="prefs_window">
+ <property name="can_focus">False</property>
+ <property name="border_width">5</property>
+ <property name="type_hint">dialog</property>
+ <property name="has_resize_grip">False</property>
+ <signal name="delete-event" handler="on_prefs_window_delete_event" swapped="no"/>
+ <child>
+ <object class="GtkVBox" id="vbox_main">
+ <property name="can_focus">False</property>
+ <property name="spacing">2</property>
+ <child>
+ <object class="GtkFrame" id="frame_reddays">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">5</property>
+ <property name="bottom_padding">5</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkHBox" id="hbox_reddays">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkLabel" id="label3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Danger zone span</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="spinbutton_reddays">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="adjustment">spinbutton_reddays_adjustment</property>
+ <property name="climb_rate">10</property>
+ <property name="numeric">True</property>
+ <signal name="value-changed" handler="on_prefs_spinbutton_reddays_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">%</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="padding">5</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label1">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes"><b>Danger zone</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkFrame" id="frame_colors">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label_xalign">0</property>
+ <property name="shadow_type">in</property>
+ <child>
+ <object class="GtkAlignment" id="alignment2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">5</property>
+ <property name="bottom_padding">5</property>
+ <property name="left_padding">12</property>
+ <child>
+ <object class="GtkVBox" id="vbox_colors">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="spacing">5</property>
+ <child>
+ <object class="GtkHBox" id="hbox_colors_red">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkColorButton" id="colorbutton_red">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <signal name="color-set" handler="on_prefs_colorbutton_red_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">In danger zone</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_colors_yellow">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkColorButton" id="colorbutton_yellow">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <signal name="color-set" handler="on_prefs_colorbutton_yellow_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label6">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Should work on it</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="hbox_colors_green">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkColorButton" id="colorbutton_green">
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <signal name="color-set" handler="on_prefs_colorbutton_green_changed" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="label7">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">Don't worry about it</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ </child>
+ <child type="label">
+ <object class="GtkLabel" id="label2">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes"><b>Colors</b></property>
+ <property name="use_markup">True</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="top_padding">5</property>
+ <child>
+ <object class="GtkHButtonBox" id="hbuttonbox">
+ <property name="can_focus">False</property>
+ <property name="border_width">6</property>
+ <property name="homogeneous">True</property>
+ <child>
+ <object class="GtkButton" id="button_reset">
+ <property name="label">gtk-revert-to-saved</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_prefs_reset_event" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="button_apply">
+ <property name="label">gtk-apply</property>
+ <property name="use_action_appearance">False</property>
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <property name="use_action_appearance">False</property>
+ <property name="use_stock">True</property>
+ <signal name="clicked" handler="on_prefs_apply_event" swapped="no"/>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ </object>
+</interface>
=== added file 'GTG/plugins/urgency_color/urgency_color.py'
--- GTG/plugins/urgency_color/urgency_color.py 1970-01-01 00:00:00 +0000
+++ GTG/plugins/urgency_color/urgency_color.py 2012-02-03 23:22:21 +0000
@@ -0,0 +1,199 @@
+# -*- coding: utf-8 -*-
+# Copyright (c) 2012 - XYZ <xyz@xxxxxxxx>
+#
+# This program is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free Software
+# Foundation, either version 3 of the License, or (at your option) any later
+# version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program. If not, see <http://www.gnu.org/licenses/>.
+
+from GTG.tools.dates import date, no_date
+from math import ceil
+
+import gtk
+import os
+
+class pluginUrgencyColor:
+
+ PLUGIN_NAME = 'Urgency Color'
+ DEFAULT_PREFS = {
+ 'reddays':30,
+ 'color_green':'#cfff84',
+ 'color_yellow':'#ffed84',
+ 'color_red':'#ff9784'
+ }
+
+ def __init__(self):
+ self._plugin_api = None
+ self.req = None
+
+ def activate(self, plugin_api):
+ """ Plugin is activated """
+ self._plugin_api = plugin_api
+ self.req = self._plugin_api.get_requester()
+ self.prefs_load()
+ self.prefs_init()
+ # Set color function
+ self._plugin_api.set_bgcolor_func(self.bgcolor)
+
+ def _get_color(self, colindex):
+ if colindex == 0:
+ return self._pref_data['color_green']
+ elif colindex == 1:
+ return self._pref_data['color_yellow']
+ elif colindex == 2:
+ return self._pref_data['color_red']
+ else: return None
+
+ def bgcolor(self, node_id, standard_color):
+ node = self.req.get_task(node_id)
+ sdate = node.get_start_date()
+ ddate = node.get_due_date()
+ if (sdate != no_date != ddate):
+ dayspan = (ddate - sdate).days
+ redf = self._pref_data['reddays']
+ reddays = ceil(redf*dayspan/100)
+ daysleft = ddate.days_left()
+
+ if daysleft == None \
+ and ddate.__class__.__name__ != 'RealDate':
+ daysleft = (ddate.offset - date.today()).days
+ color = 0
+ if daysleft <= dayspan:
+ color = 1
+ if daysleft <= reddays:
+ color = 2
+ # This list should be implemented in the settings
+ #print "Giving color"
+ return self._get_color(color)
+ else:
+ # Return color for this node
+ return None
+
+ def deactivate(self, plugin_api):
+ """ Plugin is deactivated """
+ self._plugin_api.set_bgcolor_func()
+
+# Preferences dialog
+ def is_configurable(self):
+ """Requisite function for configurable plugins"""
+ return True
+
+ def configure_dialog(self, manager_dialog):
+ self._pref_data_potential = self._pref_data
+ self.prefs_window.show_all()
+ #self.prefs_window.set_transient_for(manager_dialog)
+
+ def prefs_init(self):
+ self.builder = gtk.Builder()
+ self.builder.add_from_file(os.path.join(
+ os.path.dirname(os.path.abspath(__file__)),
+ 'preferences.ui'))
+
+ # Get the widgets
+ # Window
+ self.prefs_window = self.builder.get_object('prefs_window')
+ self.prefs_window.set_title(('GTG - %s preferences' % self.PLUGIN_NAME))
+ self.prefs_window.set_size_request(300,-1)
+ self.prefs_window.hide_on_delete()
+
+ # Spin button
+ self.spinbutton_reddays = self.builder.get_object('spinbutton_reddays')
+
+ # Colorbutton - RED
+ self.colorbutton_red = self.builder.get_object('colorbutton_red')
+
+ # Colorbutton - YELLOW
+ self.colorbutton_yellow = self.builder.get_object('colorbutton_yellow')
+
+ # Colorbutton - GREEN
+ self.colorbutton_green = self.builder.get_object('colorbutton_green')
+
+ # Buttons
+ self.button_apply = self.builder.get_object('button_apply')
+ self.button_reset = self.builder.get_object('button_reset')
+
+ # Update widget's values
+ self.prefs_update_widgets()
+
+ # Signal connections
+ SIGNAL_CONNECTIONS_DIC = {
+ 'on_prefs_window_delete_event':
+ self.on_prefs_cancel,
+ 'on_prefs_apply_event':
+ self.on_prefs_apply,
+ 'on_prefs_reset_event':
+ self.on_prefs_reset,
+ 'on_prefs_spinbutton_reddays_changed':
+ self.on_prefs_spinbutton_reddays_changed,
+ 'on_prefs_colorbutton_red_changed':
+ self.on_prefs_colorbutton_red_changed,
+ 'on_prefs_colorbutton_yellow_changed':
+ self.on_prefs_colorbutton_yellow_changed,
+ 'on_prefs_colorbutton_green_changed':
+ self.on_prefs_colorbutton_green_changed
+ }
+ self.builder.connect_signals(SIGNAL_CONNECTIONS_DIC)
+
+ def prefs_update_widgets(self):
+ """ Synchronizes the widgets with the data in _pref_data """
+ # Spin button
+ self.spinbutton_reddays.set_value(self._pref_data['reddays'])
+ # Colorbutton - RED
+ self.colorbutton_red.set_color( \
+ gtk.gdk.color_parse(self._pref_data['color_red']))
+ # Colorbutton - YELLOW
+ self.colorbutton_yellow.set_color( \
+ gtk.gdk.color_parse(self._pref_data['color_yellow']))
+ # Colorbutton - GREEN
+ self.colorbutton_green.set_color( \
+ gtk.gdk.color_parse(self._pref_data['color_green']))
+
+ def on_prefs_cancel(self, widget=None, data=None):
+ self.prefs_update_widgets()
+ self.prefs_window.hide()
+ return True
+
+ def on_prefs_apply(self, widget=None, data=None):
+ self._pref_data = self._pref_data_potential
+ self.prefs_store()
+ self.prefs_window.hide()
+
+ def on_prefs_reset(self, widget=None, data=None):
+ # Restore the default plugin settings
+ self._pref_data = self._pref_data_potential = self.DEFAULT_PREFS
+ self.prefs_update_widgets()
+
+ def prefs_load(self):
+ data = self._plugin_api.load_configuration_object( \
+ self.PLUGIN_NAME,
+ 'preferences')
+ if not data or not isinstance(data, dict):
+ self._pref_data = self.DEFAULT_PREFS
+ else:
+ self._pref_data = data
+
+ def prefs_store(self):
+ self._plugin_api.save_configuration_object( \
+ self.PLUGIN_NAME,
+ 'preferences',
+ self._pref_data)
+
+ def on_prefs_spinbutton_reddays_changed(self, widget=None, data=None):
+ self._pref_data_potential['reddays'] = self.spinbutton_reddays.get_value()
+
+ def on_prefs_colorbutton_red_changed(self, widget=None, data=None):
+ self._pref_data_potential['color_red'] = self.colorbutton_red.get_color().to_string()
+
+ def on_prefs_colorbutton_yellow_changed(self, widget=None, data=None):
+ self._pref_data_potential['color_yellow'] = self.colorbutton_yellow.get_color().to_string()
+
+ def on_prefs_colorbutton_green_changed(self, widget=None, data=None):
+ self._pref_data_potential['color_green'] = self.colorbutton_green.get_color().to_string()
=== modified file 'GTG/tests/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/signals_testing.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_apidocs.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_backend_tomboy.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_backends.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_bidict.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_datastore.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_dates.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_interruptible.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_liblarch.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_signal_testing.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_syncengine.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_syncmeme.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_tagstore.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_taskviewserial.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_tool_tags.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/test_twokeydict.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/tree_testing.py' (properties changed: -x to +x)
=== modified file 'GTG/tests/xdg/xdg.txt' (properties changed: -x to +x)
=== modified file 'GTG/tools/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/bidict.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/borg.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/cleanxml.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/clipboard.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/dates.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/interruptible.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/keyring.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/liblarch/__init__.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/liblarch/filteredtree.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/liblarch/filters_bank.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/liblarch/tree.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/logger.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/networkmanager.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/openurl.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/readurl.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/synchronized.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/tags.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/taskxml.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/testingmode.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/twokeydict.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/urlregex.py' (properties changed: -x to +x)
=== modified file 'GTG/tools/watchdog.py' (properties changed: -x to +x)
=== modified file 'HACKING' (properties changed: -x to +x)
=== modified file 'LICENSE' (properties changed: -x to +x)
=== modified file 'MANIFEST.in' (properties changed: -x to +x)
=== modified file 'Makefile' (properties changed: -x to +x)
=== modified file 'README' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-note-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-plugin.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-tag-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-tag.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-task-dismiss.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-task-done.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-task-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-task-undismiss.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/actions/gtg-task-undone.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/apps/gtg.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/categories/gtg-tags-all.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/categories/gtg-tags-none.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/categories/search.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/emblems/gtg-home.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/emblems/gtg-people.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/16x16/emblems/gtg-work.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-note-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-plugin.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-tag-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-tag.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-task-dismiss.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-task-done.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-task-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-task-undismiss.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/actions/gtg-task-undone.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/apps/gtg.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/22x22/categories/items-tags.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/24x24/actions/gtg-tag-new.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/24x24/apps/gtg.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/32x32/actions/gtg-plugin.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/32x32/apps/gtg.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_evolution.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_gnote.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_identica.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_launchpad.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_localfile.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_localfile.svg' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_mantis.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_rtm.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_tomboy.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/backend_twitter.png' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/scalable/apps/gtg.svg' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/svg/gtg-plugin.svg' (properties changed: -x to +x)
=== modified file 'data/icons/hicolor/svg/gtg.svg' (properties changed: -x to +x)
=== modified file 'doc/gtg.1' (properties changed: -x to +x)
=== modified file 'doc/gtg_new_task.1' (properties changed: -x to +x)
=== modified file 'gtcli_bash_completion' (properties changed: -x to +x)
=== modified file 'gtg.desktop' (properties changed: -x to +x)
=== modified file 'org.gnome.GTG.service' (properties changed: -x to +x)
=== modified file 'po/af.po' (properties changed: -x to +x)
=== modified file 'po/ar.po' (properties changed: -x to +x)
=== modified file 'po/ast.po' (properties changed: -x to +x)
=== modified file 'po/be.po' (properties changed: -x to +x)
=== modified file 'po/bg.po' (properties changed: -x to +x)
=== modified file 'po/bn.po' (properties changed: -x to +x)
=== modified file 'po/ca.po' (properties changed: -x to +x)
=== modified file 'po/cs.po' (properties changed: -x to +x)
=== modified file 'po/da.po' (properties changed: -x to +x)
=== modified file 'po/de.po' (properties changed: -x to +x)
=== modified file 'po/en_CA.po' (properties changed: -x to +x)
=== modified file 'po/en_GB.po' (properties changed: -x to +x)
=== modified file 'po/es.po' (properties changed: -x to +x)
=== modified file 'po/eu.po' (properties changed: -x to +x)
=== modified file 'po/fi.po' (properties changed: -x to +x)
=== modified file 'po/fr.po' (properties changed: -x to +x)
=== modified file 'po/gl.po' (properties changed: -x to +x)
=== modified file 'po/gtg.pot' (properties changed: -x to +x)
=== modified file 'po/he.po' (properties changed: -x to +x)
=== modified file 'po/hr.po' (properties changed: -x to +x)
=== modified file 'po/hu.po' (properties changed: -x to +x)
=== modified file 'po/id.po' (properties changed: -x to +x)
=== modified file 'po/is.po' (properties changed: -x to +x)
=== modified file 'po/it.po' (properties changed: -x to +x)
=== modified file 'po/ja.po' (properties changed: -x to +x)
=== modified file 'po/jbo.po' (properties changed: -x to +x)
=== modified file 'po/lt.po' (properties changed: -x to +x)
=== modified file 'po/ms.po' (properties changed: -x to +x)
=== modified file 'po/nb.po' (properties changed: -x to +x)
=== modified file 'po/nds.po' (properties changed: -x to +x)
=== modified file 'po/nl.po' (properties changed: -x to +x)
=== modified file 'po/pl.po' (properties changed: -x to +x)
=== modified file 'po/pt.po' (properties changed: -x to +x)
=== modified file 'po/pt_BR.po' (properties changed: -x to +x)
=== modified file 'po/ro.po' (properties changed: -x to +x)
=== modified file 'po/ru.po' (properties changed: -x to +x)
=== modified file 'po/si.po' (properties changed: -x to +x)
=== modified file 'po/sk.po' (properties changed: -x to +x)
=== modified file 'po/sl.po' (properties changed: -x to +x)
=== modified file 'po/sq.po' (properties changed: -x to +x)
=== modified file 'po/sv.po' (properties changed: -x to +x)
=== modified file 'po/te.po' (properties changed: -x to +x)
=== modified file 'po/tr.po' (properties changed: -x to +x)
=== modified file 'po/uk.po' (properties changed: -x to +x)
=== modified file 'po/zh_CN.po' (properties changed: -x to +x)
=== modified file 'po/zh_TW.po' (properties changed: -x to +x)
=== modified file 'setup.py' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/config/gtg/gtg.conf' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/config/gtg/tasks.conf' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml.bak.0' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml.bak.1' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml.bak.2' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/d4657d9f-3440-4791-a3d7-63cb4f00012e.xml.bak.3' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/gtg.pid' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/projects.xml' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/projectstest.xml' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/tags.xml' (properties changed: -x to +x)
=== modified file 'test/data/bryce/xdg/data/gtg/test.xml' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/config/gtg/gtg.conf' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/config/gtg/tasks.conf' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/data/gtg/866eace6-7482-41e9-b450-e9664a5d1602.xml' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/data/gtg/gtg.pid' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/data/gtg/projects.xml' (properties changed: -x to +x)
=== modified file 'test/data/standard/xdg/data/gtg/tags.xml' (properties changed: -x to +x)
Follow ups