GTG

Merge lp:~cyberone-mail/gtg/fix-316922 into lp:~gtg/gtg/old-trunk

Proposed by A. S. Popov
Status: Rejected
Rejected by: Izidor Matušov
Proposed branch: lp:~cyberone-mail/gtg/fix-316922
Merge into: lp:~gtg/gtg/old-trunk
Diff against target: 94 lines (+45/-2)
2 files modified
GTG/gtk/editor/editor.py (+28/-2)
GTG/gtk/editor/taskeditor.glade (+17/-0)
To merge this branch: bzr merge lp:~cyberone-mail/gtg/fix-316922
Reviewer Review Type Date Requested Status
Izidor Matušov Disapprove
Luca Invernizzi (community) Needs Fixing
Review via email: mp+55038@code.launchpad.net

Description of the change

To post a comment you must log in.
Revision history for this message
Izidor Matušov (izidor) wrote :

The code looks good for me. One of the GTG features is Multi-parent tasks (one task could be a child for more parents). You need allow choose which parent do you want to open. You can inspire by the way tag button in task editor works. When you click on tag, it opens the first tag, when you press the arrow, you can choose which parent task you want.

review: Needs Fixing (code review,running code)
Revision history for this message
A. S. Popov (cyberone-mail) wrote :

Just give me an example how do I make multi-parent task. Or maybe XML. I need one for testing.

lp:~cyberone-mail/gtg/fix-316922 updated
932. By A. S. Popov

Reworked to support miltiple tasks. Needs testing

Revision history for this message
Luca Invernizzi (invernizzi) wrote :

First of all, thanks a lot for working on this and sorry for the delay.

For making a multi-parent task, you just have to copy and paste its textual link from the task parent to another task text (for now, the process is completely based on copying the link, maybe we'll add something more discoverable later). XML is at the end of the comment.

Code looks good. A couple of issues:
 - a task with no parent should not have the button
 - signals need to be added for handling task modifications (new parents..)
 - of course, multiparent support.

<?xml version="1.0" ?>
<project>
 <task id="0@1" status="Active" tags="" uuid="89a7b71c-12b2-4806-8941-12870e42f47a">
  <title>
   Getting started with GTG
  </title>
  <modified>
   2011-04-03T23:56:57
  </modified>
  <subtask>
   6@1
  </subtask>
  <content>
   → &lt;subtask&gt;4@1&lt;/subtask&gt;

→ &lt;subtask&gt;6@1&lt;/subtask&gt;

  </content>
  <task-remote-ids/>
 </task>
 <task id="4@1" status="Active" tags="" uuid="2b3d128f-c3ad-4387-aac6-c8df3f3b331e">
  <title>
   Learn how to use Plugins
  </title>
  <modified>
   2011-04-03T23:57:14
  </modified>
  <subtask>
   5@1
  </subtask>
  <content>

→ multi-parents task

  </content>
  <task-remote-ids/>
 </task>
 <task id="5@1" status="Active" tags="" uuid="86e2c05b-d3da-4f31-aadb-18d441fc3536">
  <title>
   multi-parents task
  </title>
  <modified>
   2011-04-03T23:57:02
  </modified>
  <task-remote-ids/>
 </task>
 <task id="6@1" status="Active" tags="" uuid="d994bbe2-c8cf-4540-8dc4-69327518a7ee">
  <title>
   Learn how to use the QuickAdd Entry
  </title>
  <modified>
   2011-04-03T23:57:08
  </modified>
  <subtask>
   5@1
  </subtask>
  <subtask>
   4@1
  </subtask>
  <content>

→ multi-parents task

  </content>
  <task-remote-ids/>
 </task>
</project>

review: Needs Fixing
Revision history for this message
Izidor Matušov (izidor) wrote :

> Code looks good. A couple of issues:
> - a task with no parent should not have the button

Or the button could be disabled (It wouldn't mess UI)

lp:~cyberone-mail/gtg/fix-316922 updated
933. By A. S. Popov

Now parentless tasks have "go to parent" button disaled.

Revision history for this message
Izidor Matušov (izidor) wrote :

Hi, I found a traceback:

Traceback (most recent call last):
  File "/home/iyo/downloads/fix-316922/GTG/gtk/editor/taskview.py", line 1279, in _tag_event
    self.open_task(anchor)
  File "/home/iyo/downloads/fix-316922/GTG/gtk/manager.py", line 168, in open_task
    clipboard = self.clipboard)
  File "/home/iyo/downloads/fix-316922/GTG/gtk/editor/editor.py", line 168, in __init__
    self.refresh_editor()
  File "/home/iyo/downloads/fix-316922/GTG/gtk/editor/editor.py", line 352, in refresh_editor
    mi = gtk.MenuItem(label = t.get_title(), use_underline=False)
AttributeError: 'NoneType' object has no attribute 'get_title'

Which prevents me from opening a task with multiple parents. It is probably a bug of other parts of GTG.

Otherwise it works good!

Revision history for this message
Izidor Matušov (izidor) wrote :

There was no further activity in more than a year, there is still a discussion how to solve this problem (see comments in the bug). Closing this merge request as rejected. Feel free to finish your patch and reopen it.

review: Disapprove

Unmerged revisions

933. By A. S. Popov

Now parentless tasks have "go to parent" button disaled.

932. By A. S. Popov

Reworked to support miltiple tasks. Needs testing

931. By A. S. Popov

Assigned stock image to icon

930. By A. S. Popov

Made taskeditor.glade change more minor.

929. By A. S. Popov

Ctrl-P to go to parent rocks.

928. By A. S. Popov

About to make a link to parent task.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'GTG/gtk/editor/editor.py'
2--- GTG/gtk/editor/editor.py 2010-09-15 05:02:01 +0000
3+++ GTG/gtk/editor/editor.py 2011-04-06 01:31:42 +0000
4@@ -16,6 +16,8 @@
5 # You should have received a copy of the GNU General Public License along with
6 # this program. If not, see <http://www.gnu.org/licenses/>.
7 # -----------------------------------------------------------------------------
8+from GTG.core.datastore import DataStore
9+from GTG.core import CoreConfig
10 """
11 This is the TaskEditor
12
13@@ -72,6 +74,7 @@
14 self.subtask_button.set_tooltip_text(GnomeConfig.SUBTASK_TOOLTIP)
15 self.inserttag_button = self.builder.get_object("inserttag")
16 self.inserttag_button.set_tooltip_text(GnomeConfig.TAG_TOOLTIP)
17+ self.gotoparent_button = self.builder.get_object("gotoparent")
18 #Create our dictionary and connect it
19 dic = {
20 "mark_as_done_clicked" : self.change_status,
21@@ -93,6 +96,7 @@
22 "on_insert_subtask_clicked" : self.insert_subtask,
23 "on_inserttag_clicked" : self.inserttag_clicked,
24 "on_move" : self.on_move,
25+ "on_gotoparent_clicked" : self.goto_first_parent,
26 }
27 self.builder.connect_signals(dic)
28 self.window = self.builder.get_object("TaskEditor")
29@@ -338,6 +342,21 @@
30 menu.append(mi)
31 if tag_count > 0 :
32 self.inserttag_button.set_menu(menu)
33+
34+ self.gotoparent_button.set_sensitive(len(self.task.get_parents()) >= 1)
35+ if len(self.task.get_parents()) > 1:
36+ menu = gtk.Menu()
37+ ds = DataStore(CoreConfig())
38+ for i in self.task.get_parents():
39+ t = ds.get_task(i)
40+ mi = gtk.MenuItem(label = t.get_title(), use_underline=False)
41+ mi.connect("activate", self.goto_parent, i)
42+ mi.activate()
43+ mi.show()
44+ menu.append(mi)
45+ # TODO: Connect signal with a task
46+ pass
47+ self.gotoparent_button.set_menu(menu)
48
49 if refreshtext:
50 self.textview.modified(refresheditor=False)
51@@ -546,6 +565,13 @@
52
53 def get_window(self):
54 return self.window
55-
56-
57+
58+ def goto_first_parent(self, event):
59+ parent = self.task.get_parent()
60+ if parent != None:
61+ tid = parent
62+ self.vmanager.open_task(tid)
63+
64+ def goto_parent(self, widget, tid):
65+ self.vmanager.open_task(tid)
66
67
68=== modified file 'GTG/gtk/editor/taskeditor.glade'
69--- GTG/gtk/editor/taskeditor.glade 2010-09-16 14:12:35 +0000
70+++ GTG/gtk/editor/taskeditor.glade 2011-04-06 01:31:42 +0000
71@@ -85,6 +85,23 @@
72 </packing>
73 </child>
74 <child>
75+ <object class="GtkMenuToolButton" id="gotoparent">
76+ <property name="visible">True</property>
77+ <property name="can_focus">False</property>
78+ <property name="tooltip_text" translatable="yes">Go to parent task</property>
79+ <property name="use_action_appearance">False</property>
80+ <property name="label" translatable="yes">Go to parent task</property>
81+ <property name="use_underline">True</property>
82+ <property name="stock_id">gtk-go-up</property>
83+ <accelerator key="p" signal="clicked" modifiers="GDK_CONTROL_MASK"/>
84+ <signal name="clicked" handler="on_gotoparent_clicked" swapped="no"/>
85+ </object>
86+ <packing>
87+ <property name="expand">False</property>
88+ <property name="homogeneous">True</property>
89+ </packing>
90+ </child>
91+ <child>
92 <object class="GtkSeparatorToolItem" id="separator_note">
93 <property name="visible">True</property>
94 </object>

Subscribers

People subscribed via source and target branches

to status/vote changes: