Merge lp:~nataliabidart/magicicada-gui/progress into lp:magicicada-gui
- progress
- Merge into trunk
Proposed by
Natalia Bidart
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Facundo Batista | ||||
Approved revision: | 130 | ||||
Merged at revision: | 127 | ||||
Proposed branch: | lp:~nataliabidart/magicicada-gui/progress | ||||
Merge into: | lp:magicicada-gui | ||||
Diff against target: |
663 lines (+197/-142) 9 files modified
data/ui/folders.ui (+16/-13) data/ui/main.ui (+7/-8) data/ui/metadata.ui (+4/-6) data/ui/operations.ui (+33/-18) data/ui/public_files.ui (+14/-13) data/ui/shares_to_me.ui (+4/-4) data/ui/shares_to_others.ui (+4/-4) data/ui/status.ui (+71/-71) magicicada/gui/gtk/operations.py (+44/-5) |
||||
To merge this branch: | bzr merge lp:~nataliabidart/magicicada-gui/progress | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Facundo Batista | Approve | ||
Review via email: mp+120649@code.launchpad.net |
Commit message
- Added progress bar to the operations list to show Upload/Download transfer info
(LP: #599491).
- Glade UI files ported to GTK 3.
Description of the change
To post a comment you must log in.
- 130. By Natalia Bidart
-
Lint fix.
Revision history for this message
Facundo Batista (facundo) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'data/ui/folders.ui' |
2 | --- data/ui/folders.ui 2012-01-10 03:12:06 +0000 |
3 | +++ data/ui/folders.ui 2012-08-21 20:18:20 +0000 |
4 | @@ -1,9 +1,9 @@ |
5 | <?xml version="1.0" encoding="UTF-8"?> |
6 | <interface> |
7 | - <requires lib="gtk+" version="2.22"/> |
8 | - <!-- interface-naming-policy project-wide --> |
9 | + <!-- interface-requires gtk+ 3.0 --> |
10 | <object class="GtkButton" id="add_folder_button"> |
11 | <property name="label">gtk-add</property> |
12 | + <property name="use_action_appearance">False</property> |
13 | <property name="visible">True</property> |
14 | <property name="can_focus">True</property> |
15 | <property name="receives_default">True</property> |
16 | @@ -13,6 +13,7 @@ |
17 | </object> |
18 | <object class="GtkButton" id="remove_folder_button"> |
19 | <property name="label">gtk-remove</property> |
20 | + <property name="use_action_appearance">False</property> |
21 | <property name="visible">True</property> |
22 | <property name="can_focus">True</property> |
23 | <property name="receives_default">True</property> |
24 | @@ -20,10 +21,19 @@ |
25 | <property name="use_stock">True</property> |
26 | <signal name="clicked" handler="on_remove_folder_button_clicked" swapped="no"/> |
27 | </object> |
28 | + <object class="GtkListStore" id="store"> |
29 | + <columns> |
30 | + <!-- column-name suggested_path --> |
31 | + <column type="gchararray"/> |
32 | + <!-- column-name subscribed --> |
33 | + <column type="gboolean"/> |
34 | + <!-- column-name id --> |
35 | + <column type="gchararray"/> |
36 | + </columns> |
37 | + </object> |
38 | <object class="GtkScrolledWindow" id="root"> |
39 | <property name="visible">True</property> |
40 | <property name="can_focus">True</property> |
41 | - <property name="hscrollbar_policy">automatic</property> |
42 | <child> |
43 | <object class="GtkTreeView" id="view"> |
44 | <property name="visible">True</property> |
45 | @@ -35,6 +45,9 @@ |
46 | <property name="enable_grid_lines">both</property> |
47 | <property name="enable_tree_lines">True</property> |
48 | <signal name="cursor-changed" handler="on_view_cursor_changed" swapped="no"/> |
49 | + <child internal-child="selection"> |
50 | + <object class="GtkTreeSelection" id="treeview-selection1"/> |
51 | + </child> |
52 | <child> |
53 | <object class="GtkTreeViewColumn" id="folders_path"> |
54 | <property name="resizable">True</property> |
55 | @@ -71,14 +84,4 @@ |
56 | </object> |
57 | </child> |
58 | </object> |
59 | - <object class="GtkListStore" id="store"> |
60 | - <columns> |
61 | - <!-- column-name suggested_path --> |
62 | - <column type="gchararray"/> |
63 | - <!-- column-name subscribed --> |
64 | - <column type="gboolean"/> |
65 | - <!-- column-name id --> |
66 | - <column type="gchararray"/> |
67 | - </columns> |
68 | - </object> |
69 | </interface> |
70 | |
71 | === modified file 'data/ui/main.ui' |
72 | --- data/ui/main.ui 2012-02-12 15:17:07 +0000 |
73 | +++ data/ui/main.ui 2012-08-21 20:18:20 +0000 |
74 | @@ -1,7 +1,6 @@ |
75 | <?xml version="1.0" encoding="UTF-8"?> |
76 | <interface> |
77 | - <requires lib="gtk+" version="2.18"/> |
78 | - <!-- interface-naming-policy project-wide --> |
79 | + <!-- interface-requires gtk+ 3.0 --> |
80 | <object class="GtkAboutDialog" id="about_dialog"> |
81 | <property name="can_focus">False</property> |
82 | <property name="border_width">5</property> |
83 | @@ -27,12 +26,12 @@ |
84 | <property name="authors">Natalia Bidart <nataliabidart@gmail.com> |
85 | Facundo Batista <facundo@taniquetil.com.ar></property> |
86 | <child internal-child="vbox"> |
87 | - <object class="GtkVBox" id="dialog-vbox1"> |
88 | + <object class="GtkBox" id="dialog-vbox1"> |
89 | <property name="visible">True</property> |
90 | <property name="can_focus">False</property> |
91 | <property name="spacing">2</property> |
92 | <child internal-child="action_area"> |
93 | - <object class="GtkHButtonBox" id="dialog-action_area1"> |
94 | + <object class="GtkButtonBox" id="dialog-action_area1"> |
95 | <property name="visible">True</property> |
96 | <property name="can_focus">False</property> |
97 | <property name="layout_style">end</property> |
98 | @@ -68,9 +67,9 @@ |
99 | <property name="can_focus">False</property> |
100 | <child> |
101 | <object class="GtkMenuItem" id="menuitem1"> |
102 | + <property name="use_action_appearance">False</property> |
103 | <property name="visible">True</property> |
104 | <property name="can_focus">False</property> |
105 | - <property name="use_action_appearance">False</property> |
106 | <property name="label" translatable="yes">_File</property> |
107 | <property name="use_underline">True</property> |
108 | <child type="submenu"> |
109 | @@ -80,9 +79,9 @@ |
110 | <child> |
111 | <object class="GtkImageMenuItem" id="quit"> |
112 | <property name="label">gtk-quit</property> |
113 | + <property name="use_action_appearance">False</property> |
114 | <property name="visible">True</property> |
115 | <property name="can_focus">False</property> |
116 | - <property name="use_action_appearance">False</property> |
117 | <property name="use_underline">True</property> |
118 | <property name="use_stock">True</property> |
119 | <signal name="activate" handler="on_quit_activate" swapped="no"/> |
120 | @@ -94,9 +93,9 @@ |
121 | </child> |
122 | <child> |
123 | <object class="GtkMenuItem" id="menuitem4"> |
124 | + <property name="use_action_appearance">False</property> |
125 | <property name="visible">True</property> |
126 | <property name="can_focus">False</property> |
127 | - <property name="use_action_appearance">False</property> |
128 | <property name="label" translatable="yes">_Help</property> |
129 | <property name="use_underline">True</property> |
130 | <child type="submenu"> |
131 | @@ -106,9 +105,9 @@ |
132 | <child> |
133 | <object class="GtkImageMenuItem" id="about"> |
134 | <property name="label">gtk-about</property> |
135 | + <property name="use_action_appearance">False</property> |
136 | <property name="visible">True</property> |
137 | <property name="can_focus">False</property> |
138 | - <property name="use_action_appearance">False</property> |
139 | <property name="use_underline">True</property> |
140 | <property name="use_stock">True</property> |
141 | <signal name="activate" handler="on_about_activate" swapped="no"/> |
142 | |
143 | === modified file 'data/ui/metadata.ui' |
144 | --- data/ui/metadata.ui 2011-10-05 21:43:00 +0000 |
145 | +++ data/ui/metadata.ui 2012-08-21 20:18:20 +0000 |
146 | @@ -1,7 +1,6 @@ |
147 | <?xml version="1.0" encoding="UTF-8"?> |
148 | <interface> |
149 | - <requires lib="gtk+" version="2.22"/> |
150 | - <!-- interface-naming-policy project-wide --> |
151 | + <!-- interface-requires gtk+ 3.0 --> |
152 | <object class="GtkDialog" id="dialog"> |
153 | <property name="can_focus">False</property> |
154 | <property name="border_width">5</property> |
155 | @@ -14,7 +13,7 @@ |
156 | <signal name="close" handler="on_dialog_close" swapped="no"/> |
157 | <signal name="response" handler="on_dialog_close" swapped="no"/> |
158 | <child internal-child="vbox"> |
159 | - <object class="GtkVBox" id="dialog-vbox1"> |
160 | + <object class="GtkBox" id="dialog-vbox1"> |
161 | <property name="visible">True</property> |
162 | <property name="can_focus">False</property> |
163 | <property name="spacing">10</property> |
164 | @@ -112,8 +111,6 @@ |
165 | <object class="GtkScrolledWindow" id="scrolledwindow1"> |
166 | <property name="visible">True</property> |
167 | <property name="can_focus">True</property> |
168 | - <property name="hscrollbar_policy">automatic</property> |
169 | - <property name="vscrollbar_policy">automatic</property> |
170 | <child> |
171 | <object class="GtkTextView" id="detailed_info_textview"> |
172 | <property name="visible">True</property> |
173 | @@ -139,7 +136,7 @@ |
174 | </packing> |
175 | </child> |
176 | <child internal-child="action_area"> |
177 | - <object class="GtkHButtonBox" id="dialog-action_area1"> |
178 | + <object class="GtkButtonBox" id="dialog-action_area1"> |
179 | <property name="visible">True</property> |
180 | <property name="can_focus">False</property> |
181 | <property name="layout_style">end</property> |
182 | @@ -149,6 +146,7 @@ |
183 | <child> |
184 | <object class="GtkButton" id="close_button"> |
185 | <property name="label">gtk-close</property> |
186 | + <property name="use_action_appearance">False</property> |
187 | <property name="visible">True</property> |
188 | <property name="can_focus">True</property> |
189 | <property name="receives_default">True</property> |
190 | |
191 | === modified file 'data/ui/operations.ui' |
192 | --- data/ui/operations.ui 2011-10-05 21:43:00 +0000 |
193 | +++ data/ui/operations.ui 2012-08-21 20:18:20 +0000 |
194 | @@ -1,9 +1,9 @@ |
195 | <?xml version="1.0" encoding="UTF-8"?> |
196 | <interface> |
197 | - <requires lib="gtk+" version="2.22"/> |
198 | - <!-- interface-naming-policy project-wide --> |
199 | + <!-- interface-requires gtk+ 3.0 --> |
200 | <object class="GtkLinkButton" id="clear_button"> |
201 | <property name="label" translatable="yes">Clear all done</property> |
202 | + <property name="use_action_appearance">False</property> |
203 | <property name="visible">True</property> |
204 | <property name="can_focus">True</property> |
205 | <property name="receives_default">True</property> |
206 | @@ -12,6 +12,24 @@ |
207 | <property name="relief">none</property> |
208 | <signal name="clicked" handler="on_clear_button_clicked" swapped="no"/> |
209 | </object> |
210 | + <object class="GtkTreeStore" id="ops_store"> |
211 | + <columns> |
212 | + <!-- column-name name --> |
213 | + <column type="gchararray"/> |
214 | + <!-- column-name operations --> |
215 | + <column type="gchararray"/> |
216 | + <!-- column-name icon --> |
217 | + <column type="GdkPixbuf"/> |
218 | + <!-- column-name icon_name --> |
219 | + <column type="gchararray"/> |
220 | + <!-- column-name icon_size --> |
221 | + <column type="gint"/> |
222 | + <!-- column-name transfer_progress --> |
223 | + <column type="gint"/> |
224 | + <!-- column-name show_transfer --> |
225 | + <column type="gboolean"/> |
226 | + </columns> |
227 | + </object> |
228 | <object class="GtkVBox" id="itself"> |
229 | <property name="visible">True</property> |
230 | <property name="can_focus">False</property> |
231 | @@ -19,8 +37,6 @@ |
232 | <object class="GtkScrolledWindow" id="scrolledwindow1"> |
233 | <property name="visible">True</property> |
234 | <property name="can_focus">True</property> |
235 | - <property name="hscrollbar_policy">automatic</property> |
236 | - <property name="vscrollbar_policy">automatic</property> |
237 | <child> |
238 | <object class="GtkTreeView" id="ops_view"> |
239 | <property name="visible">True</property> |
240 | @@ -29,6 +45,9 @@ |
241 | <property name="headers_clickable">False</property> |
242 | <property name="rules_hint">True</property> |
243 | <property name="search_column">0</property> |
244 | + <child internal-child="selection"> |
245 | + <object class="GtkTreeSelection" id="treeview-selection1"/> |
246 | + </child> |
247 | <child> |
248 | <object class="GtkTreeViewColumn" id="treeviewcolumn1"> |
249 | <property name="resizable">True</property> |
250 | @@ -53,12 +72,22 @@ |
251 | <child> |
252 | <object class="GtkTreeViewColumn" id="treeviewcolumn2"> |
253 | <property name="resizable">True</property> |
254 | + <property name="min_width">300</property> |
255 | <property name="title" translatable="yes">Operation</property> |
256 | <property name="clickable">True</property> |
257 | <property name="widget">clear_button</property> |
258 | <property name="alignment">1</property> |
259 | <signal name="clicked" handler="on_clear_button_clicked" swapped="no"/> |
260 | <child> |
261 | + <object class="GtkCellRendererProgress" id="cellrendererprogress1"> |
262 | + <property name="width">100</property> |
263 | + </object> |
264 | + <attributes> |
265 | + <attribute name="visible">6</attribute> |
266 | + <attribute name="value">5</attribute> |
267 | + </attributes> |
268 | + </child> |
269 | + <child> |
270 | <object class="GtkCellRendererText" id="cellrenderertext2"/> |
271 | <attributes> |
272 | <attribute name="markup">1</attribute> |
273 | @@ -76,18 +105,4 @@ |
274 | </packing> |
275 | </child> |
276 | </object> |
277 | - <object class="GtkTreeStore" id="ops_store"> |
278 | - <columns> |
279 | - <!-- column-name name --> |
280 | - <column type="gchararray"/> |
281 | - <!-- column-name operations --> |
282 | - <column type="gchararray"/> |
283 | - <!-- column-name icon --> |
284 | - <column type="GdkPixbuf"/> |
285 | - <!-- column-name icon_name --> |
286 | - <column type="gchararray"/> |
287 | - <!-- column-name icon_size --> |
288 | - <column type="gint"/> |
289 | - </columns> |
290 | - </object> |
291 | </interface> |
292 | |
293 | === modified file 'data/ui/public_files.ui' |
294 | --- data/ui/public_files.ui 2011-10-11 23:51:51 +0000 |
295 | +++ data/ui/public_files.ui 2012-08-21 20:18:20 +0000 |
296 | @@ -1,11 +1,19 @@ |
297 | <?xml version="1.0" encoding="UTF-8"?> |
298 | <interface> |
299 | - <requires lib="gtk+" version="2.22"/> |
300 | - <!-- interface-naming-policy project-wide --> |
301 | + <!-- interface-requires gtk+ 3.0 --> |
302 | + <object class="GtkListStore" id="store"> |
303 | + <columns> |
304 | + <!-- column-name path --> |
305 | + <column type="gchararray"/> |
306 | + <!-- column-name public_url --> |
307 | + <column type="gchararray"/> |
308 | + <!-- column-name id --> |
309 | + <column type="gchararray"/> |
310 | + </columns> |
311 | + </object> |
312 | <object class="GtkScrolledWindow" id="root"> |
313 | <property name="visible">True</property> |
314 | <property name="can_focus">True</property> |
315 | - <property name="hscrollbar_policy">automatic</property> |
316 | <child> |
317 | <object class="GtkTreeView" id="view"> |
318 | <property name="visible">True</property> |
319 | @@ -16,6 +24,9 @@ |
320 | <property name="search_column">0</property> |
321 | <property name="enable_grid_lines">both</property> |
322 | <property name="enable_tree_lines">True</property> |
323 | + <child internal-child="selection"> |
324 | + <object class="GtkTreeSelection" id="treeview-selection1"/> |
325 | + </child> |
326 | <child> |
327 | <object class="GtkTreeViewColumn" id="public_files_path"> |
328 | <property name="resizable">True</property> |
329 | @@ -50,14 +61,4 @@ |
330 | </object> |
331 | </child> |
332 | </object> |
333 | - <object class="GtkListStore" id="store"> |
334 | - <columns> |
335 | - <!-- column-name path --> |
336 | - <column type="gchararray"/> |
337 | - <!-- column-name public_url --> |
338 | - <column type="gchararray"/> |
339 | - <!-- column-name id --> |
340 | - <column type="gchararray"/> |
341 | - </columns> |
342 | - </object> |
343 | </interface> |
344 | |
345 | === modified file 'data/ui/shares_to_me.ui' |
346 | --- data/ui/shares_to_me.ui 2012-01-10 03:18:56 +0000 |
347 | +++ data/ui/shares_to_me.ui 2012-08-21 20:18:20 +0000 |
348 | @@ -1,12 +1,9 @@ |
349 | <?xml version="1.0" encoding="UTF-8"?> |
350 | <interface> |
351 | - <requires lib="gtk+" version="2.22"/> |
352 | - <!-- interface-naming-policy project-wide --> |
353 | + <!-- interface-requires gtk+ 3.0 --> |
354 | <object class="GtkScrolledWindow" id="root"> |
355 | <property name="visible">True</property> |
356 | <property name="can_focus">True</property> |
357 | - <property name="hscrollbar_policy">automatic</property> |
358 | - <property name="vscrollbar_policy">automatic</property> |
359 | <child> |
360 | <object class="GtkTreeView" id="view"> |
361 | <property name="visible">True</property> |
362 | @@ -17,6 +14,9 @@ |
363 | <property name="search_column">0</property> |
364 | <property name="enable_grid_lines">both</property> |
365 | <property name="enable_tree_lines">True</property> |
366 | + <child internal-child="selection"> |
367 | + <object class="GtkTreeSelection" id="treeview-selection1"/> |
368 | + </child> |
369 | <child> |
370 | <object class="GtkTreeViewColumn" id="shares_to_me_name"> |
371 | <property name="title">Name</property> |
372 | |
373 | === modified file 'data/ui/shares_to_others.ui' |
374 | --- data/ui/shares_to_others.ui 2011-10-11 23:51:51 +0000 |
375 | +++ data/ui/shares_to_others.ui 2012-08-21 20:18:20 +0000 |
376 | @@ -1,12 +1,9 @@ |
377 | <?xml version="1.0" encoding="UTF-8"?> |
378 | <interface> |
379 | - <requires lib="gtk+" version="2.22"/> |
380 | - <!-- interface-naming-policy project-wide --> |
381 | + <!-- interface-requires gtk+ 3.0 --> |
382 | <object class="GtkScrolledWindow" id="root"> |
383 | <property name="visible">True</property> |
384 | <property name="can_focus">True</property> |
385 | - <property name="hscrollbar_policy">automatic</property> |
386 | - <property name="vscrollbar_policy">automatic</property> |
387 | <child> |
388 | <object class="GtkTreeView" id="view"> |
389 | <property name="visible">True</property> |
390 | @@ -17,6 +14,9 @@ |
391 | <property name="search_column">0</property> |
392 | <property name="enable_grid_lines">both</property> |
393 | <property name="enable_tree_lines">True</property> |
394 | + <child internal-child="selection"> |
395 | + <object class="GtkTreeSelection" id="treeview-selection1"/> |
396 | + </child> |
397 | <child> |
398 | <object class="GtkTreeViewColumn" id="shares_to_others_name"> |
399 | <property name="title">Name</property> |
400 | |
401 | === modified file 'data/ui/status.ui' |
402 | --- data/ui/status.ui 2012-02-12 15:17:07 +0000 |
403 | +++ data/ui/status.ui 2012-08-21 20:18:20 +0000 |
404 | @@ -1,6 +1,76 @@ |
405 | <?xml version="1.0" encoding="UTF-8"?> |
406 | <interface> |
407 | - <requires lib="gtk+" version="2.22"/> |
408 | + <!-- interface-requires gtk+ 3.0 --> |
409 | + <object class="GtkFileChooserDialog" id="file_chooser"> |
410 | + <property name="can_focus">False</property> |
411 | + <property name="border_width">5</property> |
412 | + <property name="window_position">center</property> |
413 | + <property name="type_hint">normal</property> |
414 | + <property name="create_folders">False</property> |
415 | + <signal name="file-activated" handler="on_file_chooser_open_clicked" swapped="no"/> |
416 | + <signal name="show" handler="on_file_chooser_show" swapped="no"/> |
417 | + <child internal-child="vbox"> |
418 | + <object class="GtkBox" id="dialog-vbox7"> |
419 | + <property name="visible">True</property> |
420 | + <property name="can_focus">False</property> |
421 | + <property name="spacing">2</property> |
422 | + <child internal-child="action_area"> |
423 | + <object class="GtkButtonBox" id="dialog-action_area7"> |
424 | + <property name="visible">True</property> |
425 | + <property name="can_focus">False</property> |
426 | + <property name="layout_style">end</property> |
427 | + <child> |
428 | + <object class="GtkButton" id="file_chooser_cancel"> |
429 | + <property name="label">gtk-cancel</property> |
430 | + <property name="use_action_appearance">False</property> |
431 | + <property name="visible">True</property> |
432 | + <property name="can_focus">True</property> |
433 | + <property name="receives_default">True</property> |
434 | + <property name="use_action_appearance">False</property> |
435 | + <property name="use_stock">True</property> |
436 | + </object> |
437 | + <packing> |
438 | + <property name="expand">False</property> |
439 | + <property name="fill">False</property> |
440 | + <property name="position">0</property> |
441 | + </packing> |
442 | + </child> |
443 | + <child> |
444 | + <object class="GtkButton" id="file_chooser_open"> |
445 | + <property name="label">gtk-open</property> |
446 | + <property name="use_action_appearance">False</property> |
447 | + <property name="visible">True</property> |
448 | + <property name="can_focus">True</property> |
449 | + <property name="receives_default">True</property> |
450 | + <property name="use_action_appearance">False</property> |
451 | + <property name="use_stock">True</property> |
452 | + <signal name="activate" handler="on_file_chooser_open_clicked" swapped="no"/> |
453 | + <signal name="clicked" handler="on_file_chooser_open_clicked" swapped="no"/> |
454 | + </object> |
455 | + <packing> |
456 | + <property name="expand">False</property> |
457 | + <property name="fill">False</property> |
458 | + <property name="position">1</property> |
459 | + </packing> |
460 | + </child> |
461 | + </object> |
462 | + <packing> |
463 | + <property name="expand">False</property> |
464 | + <property name="fill">True</property> |
465 | + <property name="pack_type">end</property> |
466 | + <property name="position">0</property> |
467 | + </packing> |
468 | + </child> |
469 | + <child> |
470 | + <placeholder/> |
471 | + </child> |
472 | + </object> |
473 | + </child> |
474 | + <action-widgets> |
475 | + <action-widget response="-6">file_chooser_cancel</action-widget> |
476 | + <action-widget response="0">file_chooser_open</action-widget> |
477 | + </action-widgets> |
478 | + </object> |
479 | <object class="GtkHBox" id="info"> |
480 | <property name="visible">True</property> |
481 | <property name="can_focus">False</property> |
482 | @@ -118,74 +188,4 @@ |
483 | </packing> |
484 | </child> |
485 | </object> |
486 | - <object class="GtkFileChooserDialog" id="file_chooser"> |
487 | - <property name="can_focus">False</property> |
488 | - <property name="border_width">5</property> |
489 | - <property name="window_position">center</property> |
490 | - <property name="type_hint">normal</property> |
491 | - <property name="create_folders">False</property> |
492 | - <signal name="file-activated" handler="on_file_chooser_open_clicked" swapped="no"/> |
493 | - <signal name="show" handler="on_file_chooser_show" swapped="no"/> |
494 | - <child internal-child="vbox"> |
495 | - <object class="GtkVBox" id="dialog-vbox7"> |
496 | - <property name="visible">True</property> |
497 | - <property name="can_focus">False</property> |
498 | - <property name="spacing">2</property> |
499 | - <child internal-child="action_area"> |
500 | - <object class="GtkHButtonBox" id="dialog-action_area7"> |
501 | - <property name="visible">True</property> |
502 | - <property name="can_focus">False</property> |
503 | - <property name="layout_style">end</property> |
504 | - <child> |
505 | - <object class="GtkButton" id="file_chooser_cancel"> |
506 | - <property name="label">gtk-cancel</property> |
507 | - <property name="use_action_appearance">False</property> |
508 | - <property name="visible">True</property> |
509 | - <property name="can_focus">True</property> |
510 | - <property name="receives_default">True</property> |
511 | - <property name="use_action_appearance">False</property> |
512 | - <property name="use_stock">True</property> |
513 | - </object> |
514 | - <packing> |
515 | - <property name="expand">False</property> |
516 | - <property name="fill">False</property> |
517 | - <property name="position">0</property> |
518 | - </packing> |
519 | - </child> |
520 | - <child> |
521 | - <object class="GtkButton" id="file_chooser_open"> |
522 | - <property name="label">gtk-open</property> |
523 | - <property name="use_action_appearance">False</property> |
524 | - <property name="visible">True</property> |
525 | - <property name="can_focus">True</property> |
526 | - <property name="receives_default">True</property> |
527 | - <property name="use_action_appearance">False</property> |
528 | - <property name="use_stock">True</property> |
529 | - <signal name="activate" handler="on_file_chooser_open_clicked" swapped="no"/> |
530 | - <signal name="clicked" handler="on_file_chooser_open_clicked" swapped="no"/> |
531 | - </object> |
532 | - <packing> |
533 | - <property name="expand">False</property> |
534 | - <property name="fill">False</property> |
535 | - <property name="position">1</property> |
536 | - </packing> |
537 | - </child> |
538 | - </object> |
539 | - <packing> |
540 | - <property name="expand">False</property> |
541 | - <property name="fill">True</property> |
542 | - <property name="pack_type">end</property> |
543 | - <property name="position">0</property> |
544 | - </packing> |
545 | - </child> |
546 | - <child> |
547 | - <placeholder/> |
548 | - </child> |
549 | - </object> |
550 | - </child> |
551 | - <action-widgets> |
552 | - <action-widget response="-6">file_chooser_cancel</action-widget> |
553 | - <action-widget response="0">file_chooser_open</action-widget> |
554 | - </action-widgets> |
555 | - </object> |
556 | </interface> |
557 | |
558 | === modified file 'magicicada/gui/gtk/operations.py' |
559 | --- magicicada/gui/gtk/operations.py 2012-02-18 18:15:21 +0000 |
560 | +++ magicicada/gui/gtk/operations.py 2012-08-21 20:18:20 +0000 |
561 | @@ -42,6 +42,7 @@ |
562 | MAX_OP_LEN = 30 |
563 | REMOTE_ICON_NAME = 'folder-remote' |
564 | TIME_UNITS = {0: _('second'), 1: _('minute'), 2: _('hour'), 3: _('day')} |
565 | +TRANSFER_OPS = ('Upload', 'Download') |
566 | |
567 | |
568 | logger = logging.getLogger('magicicada.gui.gtk.operations') |
569 | @@ -114,12 +115,14 @@ |
570 | self.add(self.itself) |
571 | self.ops_store = self.builder.get_object('ops_store') |
572 | self._can_clear = False |
573 | + self._store_idx = {} |
574 | |
575 | if syncdaemon_instance is not None: |
576 | self.sd = syncdaemon_instance |
577 | else: |
578 | self.sd = syncdaemon.SyncDaemon() |
579 | self.sd.on_node_ops_changed_callback = self.on_node_ops_changed |
580 | + self.sd.on_transfers_callback = self.on_transfers |
581 | |
582 | self.clear_button.set_sensitive(False) |
583 | self.show_all() |
584 | @@ -154,12 +157,35 @@ |
585 | |
586 | return OPS_MARKUP % result |
587 | |
588 | + def _append_row(self, parent_iter, row, row_info=None): |
589 | + """Append 'row' to the ops store, having 'parent_iter' as parent.""" |
590 | + row_key = None |
591 | + transfer_ops = [] |
592 | + show_transfer = False |
593 | + |
594 | + if row_info is not None: |
595 | + transfer_ops = filter(lambda op: op[1] in TRANSFER_OPS, |
596 | + row_info.operations) |
597 | + |
598 | + if transfer_ops: |
599 | + row_key = transfer_ops[0][2]['path'] |
600 | + all_done = all(op[2][queue_content.DONE] for op in transfer_ops) |
601 | + show_transfer = not all_done |
602 | + |
603 | + row = row + (0, show_transfer) |
604 | + tree_iter = self.ops_store.append(parent_iter, row) |
605 | + |
606 | + if row_key is not None: |
607 | + self._store_idx[row_key] = tree_iter |
608 | + |
609 | + return tree_iter |
610 | + |
611 | def _append_file_row(self, file_name, file_info, parent): |
612 | """Append a new row to the store representing a file.""" |
613 | assert file_info.children == {} |
614 | row = (file_name, self._process_operations(file_info), |
615 | None, FILE_ICON_NAME, gtk.ICON_SIZE_SMALL_TOOLBAR) |
616 | - self.ops_store.append(parent, row) |
617 | + self._append_row(parent, row, file_info) |
618 | |
619 | def _append_folder_row(self, folder_name, folder_info, parent): |
620 | """Append a new row to the store representing a folder.""" |
621 | @@ -167,7 +193,7 @@ |
622 | ##pixbuf = NumberedFolder.new_from_amount(children) |
623 | row = (folder_name, self._process_operations(folder_info), |
624 | None, FOLDER_ICON_NAME, gtk.ICON_SIZE_SMALL_TOOLBAR) |
625 | - parent = self.ops_store.append(parent, row) |
626 | + parent = self._append_row(parent, row, folder_info) |
627 | |
628 | self._append_root_row(folder_info.children, parent) |
629 | |
630 | @@ -199,12 +225,12 @@ |
631 | self._can_clear = False |
632 | |
633 | for root_kind, root_info in items: |
634 | - # icon name should depend on root_kind |
635 | icon_name = HOME_ICON_NAME \ |
636 | if root_kind == queue_content.ROOT_HOME \ |
637 | else REMOTE_ICON_NAME |
638 | - row = ('', '', None, icon_name, gtk.ICON_SIZE_LARGE_TOOLBAR) |
639 | - parent = self.ops_store.append(None, row) |
640 | + row = ('', '', None, icon_name, |
641 | + gtk.ICON_SIZE_LARGE_TOOLBAR) |
642 | + parent = self._append_row(None, row) |
643 | self._append_root_row(root_info, parent) |
644 | |
645 | self.ops_view.set_model(self.ops_store) |
646 | @@ -222,4 +248,17 @@ |
647 | |
648 | def load(self): |
649 | """Update UI based on SD current state.""" |
650 | + self.sd.get_current_transfers() |
651 | self.on_node_ops_changed(self.sd.queue_content.node_ops) |
652 | + |
653 | + def on_transfers(self, uploads, downloads): |
654 | + """Process progress for uploads and downloads.""" |
655 | + for fname, transfered, total in uploads + downloads: |
656 | + try: |
657 | + row_iter = self._store_idx[fname] |
658 | + except KeyError: |
659 | + logger.exception('on_transfers: failed to retrive node from ' |
660 | + 'local index to process transfer progress:') |
661 | + else: |
662 | + transfer = int((transfered / float(total)) * 100) |
663 | + self.ops_store.set_value(row_iter, 5, transfer) |