Merge lp:~nimit-svnit/gtg/bug into lp:~gtg/gtg/old-trunk
- bug
- Merge into old-trunk
Status: | Merged |
---|---|
Approved by: | Izidor Matušov |
Approved revision: | 1103 |
Merged at revision: | 1127 |
Proposed branch: | lp:~nimit-svnit/gtg/bug |
Merge into: | lp:~gtg/gtg/old-trunk |
Diff against target: |
326 lines (+130/-97) 2 files modified
GTG/gtk/delete_dialog.py (+3/-3) GTG/gtk/deletion.glade (+127/-94) |
To merge this branch: | bzr merge lp:~nimit-svnit/gtg/bug |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Izidor Matušov | r | Approve | |
Review via email: mp+98586@code.launchpad.net |
Commit message
Description of the change
In the deletion UI class,
I have made the task array "tasklist" global instead of local to the delete_tasks method
I have added on_delete_cancel handler to the cancel signal which empties the tasklist so the task window is not closed when deletion is cancelled
Izidor Matušov (izidor) wrote : | # |
Nimit Shah (nimit-svnit) wrote : | # |
my laptop broke down yesterday evening. so will have to wait for it to get
repaired. Then I will edit the code and resubmit. This computer doesnot
have IRC clients and hence not able to discuss it there.
Nimit Shah,
B Tech 3rd year,
Computer Engineering Department,
SVNIT Surat
Secretary ACM-NIT Surat
www.dude-
2012/3/22 Izidor Matušov <email address hidden>
> Review: Resubmit code
>
> Please edit your solution to instead of having global tasklist, check the
> return value of delete_dialog.run() -- as we talked about it on IRC.
> --
> https:/
> You are the owner of lp:~nimit-svnit/gtg/bug.
>
- 1102. By Nimit Shah
-
my local commit
- 1103. By Nimit Shah
-
my local commit
Izidor Matušov (izidor) wrote : | # |
It looks good to me now :-)
Preview Diff
1 | === modified file 'GTG/gtk/delete_dialog.py' |
2 | --- GTG/gtk/delete_dialog.py 2012-03-05 15:23:05 +0000 |
3 | +++ GTG/gtk/delete_dialog.py 2012-03-26 14:54:21 +0000 |
4 | @@ -26,7 +26,6 @@ |
5 | class DeletionUI(): |
6 | |
7 | MAXIMUM_TIDS_TO_SHOW = 5 |
8 | - |
9 | def __init__(self, req): |
10 | self.req = req |
11 | self.tids_todelete = [] |
12 | @@ -58,7 +57,7 @@ |
13 | self.tids_todelete = tids |
14 | #We must at least have something to delete ! |
15 | if len(self.tids_todelete) > 0: |
16 | - tasklist = [] |
17 | + tasklist=[] |
18 | self.update_tags = [] |
19 | for tid in self.tids_todelete: |
20 | def recursive_list_tasks(task_list, root): |
21 | @@ -123,7 +122,8 @@ |
22 | delete_dialog.resize(1, 1) |
23 | cancel_button = self.builder.get_object("cancel") |
24 | cancel_button.grab_focus() |
25 | - delete_dialog.run() |
26 | + if delete_dialog.run() != 1: |
27 | + tasklist = [] |
28 | delete_dialog.hide() |
29 | return tasklist |
30 | else: |
31 | |
32 | === modified file 'GTG/gtk/deletion.glade' |
33 | --- GTG/gtk/deletion.glade 2012-03-05 15:23:05 +0000 |
34 | +++ GTG/gtk/deletion.glade 2012-03-26 14:54:21 +0000 |
35 | @@ -1,164 +1,197 @@ |
36 | -<?xml version="1.0"?> |
37 | +<?xml version="1.0" encoding="UTF-8"?> |
38 | <interface> |
39 | <requires lib="gtk+" version="2.16"/> |
40 | - <!-- interface-naming-policy toplevel-contextual --> |
41 | <object class="GtkDialog" id="confirm_delete"> |
42 | + <property name="can_focus">False</property> |
43 | <property name="border_width">5</property> |
44 | <property name="title" translatable="yes">Confirm task deletion</property> |
45 | <property name="window_position">center-on-parent</property> |
46 | <property name="type_hint">dialog</property> |
47 | - <property name="has_separator">False</property> |
48 | - <signal name="close" handler="on_delete_cancel"/> |
49 | + <signal name="close" handler="on_delete_cancel" swapped="no"/> |
50 | <child internal-child="vbox"> |
51 | - <object class="GtkVBox" id="cd-vbox1"> |
52 | + <object class="GtkBox" id="cd-vbox1"> |
53 | <property name="visible">True</property> |
54 | + <property name="can_focus">False</property> |
55 | <property name="orientation">vertical</property> |
56 | <property name="spacing">2</property> |
57 | + <child internal-child="action_area"> |
58 | + <object class="GtkButtonBox" id="cd-action_area1"> |
59 | + <property name="visible">True</property> |
60 | + <property name="can_focus">False</property> |
61 | + <property name="layout_style">end</property> |
62 | + <child> |
63 | + <object class="GtkButton" id="cancel"> |
64 | + <property name="use_action_appearance">False</property> |
65 | + <property name="visible">True</property> |
66 | + <property name="can_focus">True</property> |
67 | + <property name="receives_default">True</property> |
68 | + <property name="use_action_appearance">False</property> |
69 | + <signal name="released" handler="on_delete_cancel" swapped="no"/> |
70 | + <child> |
71 | + <object class="GtkHBox" id="cd-hbox2"> |
72 | + <property name="visible">True</property> |
73 | + <property name="can_focus">False</property> |
74 | + <child> |
75 | + <object class="GtkImage" id="cd_img_keep"> |
76 | + <property name="visible">True</property> |
77 | + <property name="can_focus">False</property> |
78 | + <property name="stock">gtk-cancel</property> |
79 | + </object> |
80 | + <packing> |
81 | + <property name="expand">True</property> |
82 | + <property name="fill">True</property> |
83 | + <property name="position">0</property> |
84 | + </packing> |
85 | + </child> |
86 | + <child> |
87 | + <object class="GtkLabel" id="cd-label3"> |
88 | + <property name="visible">True</property> |
89 | + <property name="can_focus">False</property> |
90 | + <property name="xalign">0</property> |
91 | + <property name="use_underline">True</property> |
92 | + </object> |
93 | + <packing> |
94 | + <property name="expand">True</property> |
95 | + <property name="fill">True</property> |
96 | + <property name="position">1</property> |
97 | + </packing> |
98 | + </child> |
99 | + </object> |
100 | + </child> |
101 | + </object> |
102 | + <packing> |
103 | + <property name="expand">False</property> |
104 | + <property name="fill">False</property> |
105 | + <property name="position">0</property> |
106 | + </packing> |
107 | + </child> |
108 | + <child> |
109 | + <object class="GtkButton" id="delete"> |
110 | + <property name="use_action_appearance">False</property> |
111 | + <property name="visible">True</property> |
112 | + <property name="can_focus">True</property> |
113 | + <property name="receives_default">True</property> |
114 | + <property name="use_action_appearance">False</property> |
115 | + <signal name="activate" handler="on_delete_confirm" swapped="no"/> |
116 | + <signal name="released" handler="on_delete_confirm" swapped="no"/> |
117 | + <child> |
118 | + <object class="GtkHBox" id="cd-hbox3"> |
119 | + <property name="visible">True</property> |
120 | + <property name="can_focus">False</property> |
121 | + <child> |
122 | + <object class="GtkImage" id="cd_img_delete"> |
123 | + <property name="visible">True</property> |
124 | + <property name="can_focus">False</property> |
125 | + <property name="stock">gtk-delete</property> |
126 | + </object> |
127 | + <packing> |
128 | + <property name="expand">True</property> |
129 | + <property name="fill">True</property> |
130 | + <property name="position">0</property> |
131 | + </packing> |
132 | + </child> |
133 | + <child> |
134 | + <object class="GtkLabel" id="cd-label4"> |
135 | + <property name="visible">True</property> |
136 | + <property name="can_focus">False</property> |
137 | + <property name="use_underline">True</property> |
138 | + </object> |
139 | + <packing> |
140 | + <property name="expand">True</property> |
141 | + <property name="fill">True</property> |
142 | + <property name="position">1</property> |
143 | + </packing> |
144 | + </child> |
145 | + </object> |
146 | + </child> |
147 | + </object> |
148 | + <packing> |
149 | + <property name="expand">False</property> |
150 | + <property name="fill">False</property> |
151 | + <property name="position">1</property> |
152 | + </packing> |
153 | + </child> |
154 | + </object> |
155 | + <packing> |
156 | + <property name="expand">False</property> |
157 | + <property name="fill">True</property> |
158 | + <property name="pack_type">end</property> |
159 | + <property name="position">0</property> |
160 | + </packing> |
161 | + </child> |
162 | <child> |
163 | <object class="GtkHBox" id="cd-hbox1"> |
164 | <property name="visible">True</property> |
165 | + <property name="can_focus">False</property> |
166 | <child> |
167 | <object class="GtkImage" id="cd_img_ask"> |
168 | <property name="visible">True</property> |
169 | + <property name="can_focus">False</property> |
170 | <property name="yalign">0</property> |
171 | <property name="xpad">16</property> |
172 | <property name="stock">gtk-dialog-question</property> |
173 | <property name="icon-size">6</property> |
174 | </object> |
175 | <packing> |
176 | + <property name="expand">True</property> |
177 | + <property name="fill">True</property> |
178 | <property name="position">0</property> |
179 | </packing> |
180 | </child> |
181 | <child> |
182 | <object class="GtkVBox" id="cd-vbox2"> |
183 | <property name="visible">True</property> |
184 | - <property name="orientation">vertical</property> |
185 | + <property name="can_focus">False</property> |
186 | <property name="spacing">16</property> |
187 | <child> |
188 | <object class="GtkLabel" id="cd-label2"> |
189 | <property name="visible">True</property> |
190 | + <property name="can_focus">False</property> |
191 | <attributes> |
192 | <attribute name="weight" value="bold"/> |
193 | - <attribute name="scale" value="1,000000"/> |
194 | + <attribute name="scale" value="1"/> |
195 | </attributes> |
196 | </object> |
197 | <packing> |
198 | <property name="expand">False</property> |
199 | + <property name="fill">True</property> |
200 | <property name="position">0</property> |
201 | </packing> |
202 | </child> |
203 | <child> |
204 | <object class="GtkLabel" id="label1"> |
205 | <property name="visible">True</property> |
206 | + <property name="can_focus">False</property> |
207 | <property name="yalign">0</property> |
208 | <property name="wrap">True</property> |
209 | <property name="wrap_mode">word-char</property> |
210 | </object> |
211 | <packing> |
212 | + <property name="expand">True</property> |
213 | + <property name="fill">True</property> |
214 | <property name="position">1</property> |
215 | </packing> |
216 | </child> |
217 | </object> |
218 | <packing> |
219 | + <property name="expand">True</property> |
220 | + <property name="fill">True</property> |
221 | <property name="position">1</property> |
222 | </packing> |
223 | </child> |
224 | </object> |
225 | <packing> |
226 | + <property name="expand">False</property> |
227 | + <property name="fill">True</property> |
228 | <property name="padding">16</property> |
229 | <property name="position">1</property> |
230 | </packing> |
231 | </child> |
232 | - <child internal-child="action_area"> |
233 | - <object class="GtkHButtonBox" id="cd-action_area1"> |
234 | - <property name="visible">True</property> |
235 | - <property name="layout_style">end</property> |
236 | - <child> |
237 | - <object class="GtkButton" id="cancel"> |
238 | - <property name="visible">True</property> |
239 | - <property name="can_focus">True</property> |
240 | - <property name="receives_default">True</property> |
241 | - <signal name="released" handler="on_delete_cancel"/> |
242 | - <child> |
243 | - <object class="GtkHBox" id="cd-hbox2"> |
244 | - <property name="visible">True</property> |
245 | - <child> |
246 | - <object class="GtkImage" id="cd_img_keep"> |
247 | - <property name="visible">True</property> |
248 | - <property name="stock">gtk-cancel</property> |
249 | - </object> |
250 | - <packing> |
251 | - <property name="position">0</property> |
252 | - </packing> |
253 | - </child> |
254 | - <child> |
255 | - <object class="GtkLabel" id="cd-label3"> |
256 | - <property name="visible">True</property> |
257 | - <property name="xalign">0</property> |
258 | - <property name="use_underline">True</property> |
259 | - </object> |
260 | - <packing> |
261 | - <property name="position">1</property> |
262 | - </packing> |
263 | - </child> |
264 | - </object> |
265 | - </child> |
266 | - </object> |
267 | - <packing> |
268 | - <property name="expand">False</property> |
269 | - <property name="fill">False</property> |
270 | - <property name="position">0</property> |
271 | - </packing> |
272 | - </child> |
273 | - <child> |
274 | - <object class="GtkButton" id="delete"> |
275 | - <property name="visible">True</property> |
276 | - <property name="can_focus">True</property> |
277 | - <property name="receives_default">True</property> |
278 | - <signal name="released" handler="on_delete_confirm"/> |
279 | - <signal name="activate" handler="on_delete_confirm"/> |
280 | - <child> |
281 | - <object class="GtkHBox" id="cd-hbox3"> |
282 | - <property name="visible">True</property> |
283 | - <child> |
284 | - <object class="GtkImage" id="cd_img_delete"> |
285 | - <property name="visible">True</property> |
286 | - <property name="stock">gtk-delete</property> |
287 | - </object> |
288 | - <packing> |
289 | - <property name="position">0</property> |
290 | - </packing> |
291 | - </child> |
292 | - <child> |
293 | - <object class="GtkLabel" id="cd-label4"> |
294 | - <property name="visible">True</property> |
295 | - <property name="use_underline">True</property> |
296 | - </object> |
297 | - <packing> |
298 | - <property name="position">1</property> |
299 | - </packing> |
300 | - </child> |
301 | - </object> |
302 | - </child> |
303 | - </object> |
304 | - <packing> |
305 | - <property name="expand">False</property> |
306 | - <property name="fill">False</property> |
307 | - <property name="position">1</property> |
308 | - </packing> |
309 | - </child> |
310 | - </object> |
311 | - <packing> |
312 | - <property name="expand">False</property> |
313 | - <property name="pack_type">end</property> |
314 | - <property name="position">0</property> |
315 | - </packing> |
316 | - </child> |
317 | </object> |
318 | </child> |
319 | <action-widgets> |
320 | - <action-widget response="0">cancel</action-widget> |
321 | - <action-widget response="0">delete</action-widget> |
322 | + <action-widget response="-1">cancel</action-widget> |
323 | + <action-widget response="1">delete</action-widget> |
324 | </action-widgets> |
325 | </object> |
326 | </interface> |
Please edit your solution to instead of having global tasklist, check the return value of delete_dialog.run() -- as we talked about it on IRC.