Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Implemented showing and editing the time estimate
Browse files Browse the repository at this point in the history
  • Loading branch information
mbunkus committed Apr 6, 2011
1 parent 4f83984 commit 9c58fb1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ Planned features
* Show full task details in other buffer
* Show/edit/delete notes
* Add docstrings to all interactive functions
* Show/edit time estimations
* Show/edit tags

Bugs and issues
Expand Down
21 changes: 21 additions & 0 deletions lisp/simple-rtm.el
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@
"Face for a task's URL."
:group 'simple-rtm-faces)

(defface simple-rtm-task-time-estimate
'((((class color) (background light))
:foreground "#ff00ff" :inherit simple-rtm-task)
(((class color) (background dark))
:foreground "#ff00ff" :inherit simple-rtm-task))
"Face for the task's time estimate."
:group 'simple-rtm-faces)

(defvar simple-rtm-lists)
(defvar simple-rtm-locations)
(defvar simple-rtm-tasks)
Expand Down Expand Up @@ -146,6 +154,7 @@
(define-key map (kbd "a") 'simple-rtm-task-select-all-in-list)
(define-key map (kbd "c") 'simple-rtm-task-complete)
(define-key map (kbd "d") 'simple-rtm-task-set-duedate)
(define-key map (kbd "g") 'simple-rtm-task-set-time-estimate)
(define-key map (kbd "l") 'simple-rtm-task-set-location)
(define-key map (kbd "m") 'simple-rtm-task-move)
(define-key map (kbd "n") 'simple-rtm-task-select-none-in-list)
Expand Down Expand Up @@ -387,6 +396,7 @@
(url (xml-get-attribute taskseries-node 'url))
(location (simple-rtm--find-location-by 'id (xml-get-attribute taskseries-node 'location_id)))
(duedate (simple-rtm--task-duedate task-node))
(time-estimate (xml-get-attribute task-node 'estimate))
(num-notes (- (length (car (xml-get-children taskseries-node 'notes))) 2))
(today (format-time-string "%Y-%m-%d")))
(insert (propertize (concat (mapconcat 'identity
Expand All @@ -400,6 +410,8 @@
'simple-rtm-task-duedate
'simple-rtm-task-duedate-due)))
(propertize name 'face 'simple-rtm-task)
(if (not (string= time-estimate ""))
(propertize time-estimate 'face 'simple-rtm-task-time-estimate))
(if (not (string= url ""))
(propertize url 'face 'simple-rtm-task-url))
(if location
Expand Down Expand Up @@ -606,6 +618,15 @@
:args (setq duedate (simple-rtm--read "New due date: "
:initial-input (simple-rtm--task-duedate (car (xml-get-children (getf first-task :xml) 'task))))))

(simple-rtm--defun-task-action
"set-time-estimate"
"Set the time estimate of the selected tasks."
(unless (string= time-estimate (xml-get-attribute task-node 'estimate))
(rtm-tasks-set-estimate list-id taskseries-id task-id time-estimate))
:args (setq time-estimate (simple-rtm--read "New time estimate: "
:initial-input (xml-get-attribute (car (xml-get-children (getf first-task :xml) 'task))
'estimate))))

(simple-rtm--defun-task-action
"set-url"
"Set the URL of the selected tasks."
Expand Down

0 comments on commit 9c58fb1

Please sign in to comment.