GTG

Merge lp:~kjmikkel/gtg/removeSubtasks into lp:~gtg/gtg/old-trunk

Proposed by silentStatic
Status: Merged
Merged at revision: not available
Proposed branch: lp:~kjmikkel/gtg/removeSubtasks
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 173 lines
5 files modified
AUTHORS (+1/-0)
CHANGELOG (+81/-0)
GTG/core/task.py (+9/-4)
GTG/taskbrowser/browser.py (+12/-0)
GTG/taskbrowser/taskbrowser.glade (+1/-1)
To merge this branch: bzr merge lp:~kjmikkel/gtg/removeSubtasks
Reviewer Review Type Date Requested Status
Lionel Dricot (community) Needs Fixing
Review via email: mp+12495@code.launchpad.net
To post a comment you must log in.
Revision history for this message
silentStatic (kjmikkel) wrote :

Purpose:
When deleting a task, all of its subtasks will be deleted as well, unlike 1.2, where they just loose their parent.

Notes:
No errors or strange behaviour. The warning message that appears when deleting a task might be improved though.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

The diff doesn't look good as it contains +<<<<<<< TREE stuffs. Can you fix that please?

Also, we should really put the titles of tasks that will be deleted in the Warning box.

review: Needs Fixing
lp:~kjmikkel/gtg/removeSubtasks updated
326. By Mikkel Kjær Jensen <mikkel@mikkel-laptop>

tidied a bit up

Revision history for this message
silentStatic (kjmikkel) wrote :

> The diff doesn't look good as it contains +<<<<<<< TREE stuffs. Can you fix
> that please?

Of course

> Also, we should really put the titles of tasks that will be deleted in the
> Warning box.

Again, I agree, but I do not know how to add the warning dialogue and add the information to the label - since it is made using glade, it uses static information, and the parts of the dialogue do not seem accessible.

Revision history for this message
Lionel Dricot (ploum-deactivatedaccount) wrote :

> Again, I agree, but I do not know how to add the warning dialogue and add the
> information to the label - since it is made using glade, it uses static
> information, and the parts of the dialogue do not seem accessible.

This will be a great PyGTK training for you :-)

Changing the text is not hard. First, you have to retrieve the widget from the glade file.
It will looks something like : label = self.wTree.get_widget("name_of_widget") (self.wTree should be already set, look for it in other source file that are using glade)

Then, you just have to use the built-in method of the retrieved widget. Something like label.set_label("my text"). To know the methods of a given object, use the documentation on pygtk.org (or in devhelp).

A great tutorial can be found at http://www.learningpython.com/2006/05/07/creating-a-gui-using-pygtk-and-glade/ and, more generally on http://www.learningpython.com/category/python/pygtk/

If you have question, ask on #gtg (or on #pygtk).

lp:~kjmikkel/gtg/removeSubtasks updated
327. By Mikkel Kjær Jensen <mikkel@mikkel-laptop>

more tidying up

328. By Mikkel Kjær Jensen <mikkel@mikkel-laptop>

even more tidying up

329. By Mikkel Kjær Jensen <mikkel@mikkel-laptop>

The delete notice now finds the titles of the tasks to be deleted. The reason for the use of substring and find in browser.py, is because otherwise the text of the label would keep the text from the last iteration

330. By Mikkel Kjær Jensen <mikkel@mikkel-laptop>

Changed order of when subtasks are deleted, and when a tasks parrents are removed

331. By silentStatic

aNOT* Patch from mrk to improve compatibility with non GNU systems

332. By silentStatic

Another attempt to avoid bzr stuff

333. By silentStatic

clean CHANGELOG slate for conflict resolution

334. By silentStatic

clean changelog

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'AUTHORS'
2--- AUTHORS 2009-09-11 22:58:12 +0000
3+++ AUTHORS 2009-10-05 09:33:13 +0000
4@@ -37,3 +37,4 @@
5 * Paulo Cabido <paulo.cabido@gmail.com>
6 * Patrick Coleman <blinken@gmail.com>
7 * Luca Invernizzi <invernizzi.l@gmail.com>
8+* Mikkel Kjær Jensen <kjmikkel@gmail.com>
9\ No newline at end of file
10
11=== added file 'CHANGELOG'
12--- CHANGELOG 1970-01-01 00:00:00 +0000
13+++ CHANGELOG 2009-10-05 09:33:13 +0000
14@@ -0,0 +1,81 @@
15+ * When a task is deleted, all subtask are deleted as well by Mikkel Kjær Jensen
16+ * Empty new tasks are deleted when editor is closed
17+ * lot of bug fixed in the editor while playing with subtasks
18+ * Works well with the "text besides icon" GNOME option
19+ * Merge RTM plugin branch from Luca Invernizzi
20+ * i18n: fixed window title in GTG/taskbrowser/browser.py, by Dario Bertini
21+ * Patch from Luca Invernizzi to add XDG_CACHE redefinition in script/debug.sh
22+ * Patch from Luca Invernizzi to remove unsued get_closed_date
23+ * Added filtering capabilities by Paulo Cabido
24+ - Filter callbacks were added to the task browser
25+ - Filters were also added to the requester
26+ * Fixed #406851, incorrect behaviour marking a dismissed task as done by Patrick Coleman
27+ * Added accelerators to the task editor by Patrick Coleman
28+ * Add plugin engine by Paulo Cabido
29+ * When GTG is already running, use DBUS to raise existing instance rather than failing silently
30+ * Refactorization and PEP8ification work by Jonathan Lange
31+ * New keyboard bindings for 'Mark as done' and 'Dismiss' actions
32+ * New keyboard bindings and accelerators by Jonathan Lange
33+ * DBus interface by Ryan Paul
34+ * Remove the 'Delete' button from the toolbar by Jonathan Lange
35+ * Fix a spelling mistake in the manpage by Jonathan Lange
36+ * Allow quickadd of capitalized date by remy@frerebeau.org
37+
38+2009-07-04 Getting Things GNOME! 0.1.2
39+ * Available in 18 languages, with 12 languages being more than 99% translated
40+ * Shadows around the listview widgets, by Jean-François Fortin Tam
41+ * Fixes package dependencies
42+ * Tooltips for button
43+ * Automatically select title in task editor
44+ * Crash on startup with non empty LANGUAGE envvar
45+ * Use GNOME settings for toolbar, by Anton Rebguns
46+ * Better tag markup handling
47+ * No more multiple instances
48+ * HTTP link parsing by Ben Dowling
49+ * Update README by Michael Vogt
50+ * Update XML files sooner by Michael Vogt
51+ * Remember color (by Zach Sheperd)
52+ * URLs can now include ';' characters. Fixes bug 360969
53+ * Added support for opening subtasks and links with the keyboard: Fixes bug 369272, by Ben Dowling
54+ * Add polish translation by Tomasz Maciejewski
55+ * Apply patch to fix bug #326388 by Brian Kennedy
56+ * Apply patch to fix bug #374745 by Brian Kennedy
57+ * Title for newly created task is now selected to allow easy editing
58+ * Apply patch to fix bug #374745 by Brian Kennedy
59+ * Fixed some bugs in the task editor
60+
61+2009-04-01 Getting Things GNOME! 0.1.1
62+ * New icon from Kalle Persson
63+ * Translations are now possible
64+ * New features :
65+ - Quickadd now accepts attributes (by Jonathan Barnoud)
66+ - http:// links now open in the browser
67+ - Shortcut for sidebar (F9): fixes bug #339710
68+ - Some UI love for the sidebar and the tag icons, shamelessy copied from f-spot
69+ - Hotkeys goodness (patches from Antons Rebguns)
70+ - Edit buttons : patches from Antons Rebguns
71+ - Bug #339583, Bug #336314 : patches delete key and
72+ * Bug fixes :
73+ - Calendar open at the correct date
74+ - TaskSerial refactorization (by Jonathan Barnoud)
75+ - Tooltips on buttons (thanks to Jerome Guelfucci)
76+ - First unit tests by Carl Chenet
77+ - Error, no crash if the XML file cannot be read (thanks to Carl Chenet)
78+ - fix bug #339383 (delete subtask when deleting first char)
79+ - Escape title in the treeview : Bug #339874
80+ - Focus in the editor : Bug #339269, Bug #339195, Bug #339389
81+ - Bug #339269 : Quickadd has the focus on launch
82+ enter key to confirm a delete (thanks Gérôme Fournier)
83+ - Typos : Bug #339268 Bug #339492 and other patches from Gérôme Fournier.
84+
85+2009-03-06 Getting Things Gnome ! 0.1
86+ * Bumping version number. First release of GTG
87+
88+2009-03-01 Getting Things Gnome! 0.0.9rc3
89+ * pane/sidebar not saved
90+
91+2009-03-01 Getting Things Gnome! 0.0.9rc2
92+ * firstrun_tasks.xml not found on first launch
93+
94+2009-03-01 Getting Things Gnome! 0.0.9rc1
95+ * First official release 0.1rc1
96
97=== renamed file 'CHANGELOG' => 'CHANGELOG.THIS'
98=== modified file 'GTG/core/task.py'
99--- GTG/core/task.py 2009-10-01 16:23:03 +0000
100+++ GTG/core/task.py 2009-10-05 09:33:14 +0000
101@@ -96,6 +96,12 @@
102
103 def get_title(self):
104 return self.title
105+
106+ def get_titles(self, list):
107+ list.append(", " + self.title)
108+ for task in self.get_subtasks():
109+ list = task.get_titles(list)
110+ return list
111
112 #Return True if the title was changed.
113 #False if the title was already the same.
114@@ -476,13 +482,12 @@
115 #Use the requester
116 def delete(self):
117 self.set_sync_func(None, callsync=False)
118+ for task in self.get_subtasks():
119+ self.req.delete_task(task.get_id())
120 for i in self.get_parents():
121 task = self.req.get_task(i)
122 task.remove_subtask(self.get_id())
123- for task in self.get_subtasks():
124- task.remove_parent(self.get_id())
125- #then we remove effectively the task
126- #self.req.delete_task(self.get_id())
127+
128
129 #This is a callback. The "sync" function has to be set
130 def set_sync_func(self, sync, callsync=True):
131
132=== modified file 'GTG/taskbrowser/browser.py'
133--- GTG/taskbrowser/browser.py 2009-09-25 16:22:02 +0000
134+++ GTG/taskbrowser/browser.py 2009-10-05 09:33:14 +0000
135@@ -719,6 +719,12 @@
136 task = self.req.get_task(tid)
137 return task.get_title()
138
139+ def get_task_and_subtask_titles(self, tid):
140+ task = self.req.get_task(tid)
141+ titles_list = task.get_titles([])
142+ titles_list[0] = titles_list[0][2:]
143+ return "".join(titles_list)
144+
145 def close_task(self, tid):
146 # When an editor is closed, it should deregister itself.
147 if tid in self.opened_task:
148@@ -1229,6 +1235,12 @@
149 self.tid_todelete = tid
150 #We must at least have something to delete !
151 if self.tid_todelete:
152+ label = self.wTree.get_widget("label1")
153+ label_text = label.get_text()
154+ label_text = label_text[0:label_text.find(":") + 1]
155+ # I find the tasks that are going to be deleted
156+ titles = self.get_task_and_subtask_titles(self.tid_todelete)
157+ label.set_text("%s %s." % (label_text, titles))
158 delete_dialog = self.wTree.get_widget("confirm_delete")
159 delete_dialog.run()
160 delete_dialog.hide()
161
162=== modified file 'GTG/taskbrowser/taskbrowser.glade'
163--- GTG/taskbrowser/taskbrowser.glade 2009-09-25 14:48:08 +0000
164+++ GTG/taskbrowser/taskbrowser.glade 2009-10-05 09:33:14 +0000
165@@ -678,7 +678,7 @@
166 <property name="visible">True</property>
167 <property name="label" translatable="yes">&lt;span weight="bold" size="large"&gt;Are you sure you want delete this task?&lt;/span&gt;
168
169-Deleting a task cannot be undone.</property>
170+Deleting a task cannot be undone, and will delete the following tasks: </property>
171 <property name="use_markup">True</property>
172 <property name="wrap">True</property>
173 </widget>

Subscribers

People subscribed via source and target branches

to status/vote changes: