Merge lp:~xnox/usb-creator/infobarui into lp:usb-creator
- infobarui
- Merge into trunk
Status: | Work in progress |
---|---|
Proposed branch: | lp:~xnox/usb-creator/infobarui |
Merge into: | lp:usb-creator |
Diff against target: |
869 lines (+390/-379) 3 files modified
debian/changelog (+2/-0) gui/usbcreator-gtk.ui (+369/-372) usbcreator/frontends/gtk/frontend.py (+19/-7) |
To merge this branch: | bzr merge lp:~xnox/usb-creator/infobarui |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Evan (community) | Needs Fixing | ||
usb-creator hackers | Pending | ||
Review via email: mp+26558@code.launchpad.net |
Commit message
Description of the change
The install button has sensitivity set to false in UI xml by default, because update_target might not run (no usb device attached).
Pre-populated images from --iso switch or from downloads dir where added to the backend's pool of source images, but none of them where set current while the UI had first one selected. Fixed by calling changed_source callback after the images are populated.
The above two were causing logic breakage in the update_target when it was calculating whether install button should be sensitive of not.
Also update_target was only checking if the current_source as seen by backend is SOURCE_IMG while SOURCE_ISO is a valid choice as well. Fixed that as well.
When testing all of this I've realised that there is no feedback to the user if the image supplied by --iso is indeed valid one. So if the image supplied by a switch, it becomes first choice and preselected as current_source, and other images are shown as well. If the image cannot be used the label next to the other tells that =) test with:
$ touch bla.iso
$ usb-creator-gtk -i bla.iso
Overall this bug in usb-creator-gtk caused me loads of head-keyboard banging while trying to test & compare with my infant cli frontend.
Should we scan ~/.cache/
Dimitri John Ledkov (xnox) wrote : | # |
On 4 June 2010 15:07, Evan Dandrea <email address hidden> wrote:
> Review: Needs Fixing
> Could we make the 'cannot use' message a dialog instead? If we set the source status label to this message it will persist, in all likelihood, for the duration of the program before the user presses install. This strikes me as confusing.
>
=) my first iterration had a dialog =) but i thought it's too much.
Sure, will hunt dead heads in my branches ;-)
> Otherwise, it looks good! Nice catches on those bugs.
> --
> https:/
> You are the owner of lp:~dmitrij.ledkov/usb-creator/install-button.
>
I'm not a massive fan of dialogs either. Sometimes they're the best quick option available, though. :)
- 315. By Dimitri John Ledkov
-
Added one more toplevel vbox for infobar
- 316. By Dimitri John Ledkov
-
Nice GtkInfoBar for non-working iso
Dimitri John Ledkov (xnox) wrote : | # |
> I'm not a massive fan of dialogs either. Sometimes they're the best quick
> option available, though. :)
Update branch.
Unmerged revisions
- 316. By Dimitri John Ledkov
-
Nice GtkInfoBar for non-working iso
- 315. By Dimitri John Ledkov
-
Added one more toplevel vbox for infobar
- 314. By Dimitri John Ledkov
-
Improve command line supplied --iso handling in gtk frontend
Preview Diff
1 | === modified file 'debian/changelog' |
2 | --- debian/changelog 2010-05-27 15:13:58 +0000 |
3 | +++ debian/changelog 2010-06-12 04:08:24 +0000 |
4 | @@ -42,6 +42,8 @@ |
5 | |
6 | * Use XDG_CACHE_DIR for usb-creator.log |
7 | * Use XDG IconTheme spec for window icons (LP: #535061) |
8 | + * Fix install button sensetivity (LP: #582531) |
9 | + * Improve command line supplied --iso handling in gtk frontend |
10 | |
11 | [ Ignace Mouzannar ] |
12 | * Initial Debian release (Closes: #582884, #576359) |
13 | |
14 | === modified file 'gui/usbcreator-gtk.ui' |
15 | --- gui/usbcreator-gtk.ui 2010-05-18 16:00:05 +0000 |
16 | +++ gui/usbcreator-gtk.ui 2010-06-12 04:08:24 +0000 |
17 | @@ -16,396 +16,397 @@ |
18 | <object class="GtkAlignment" id="alignment1"> |
19 | <property name="visible">True</property> |
20 | <child> |
21 | - <object class="GtkVBox" id="main_vbox"> |
22 | + <object class="GtkVBox" id="infobar_vbox"> |
23 | <property name="visible">True</property> |
24 | - <property name="border_width">12</property> |
25 | - <property name="orientation">vertical</property> |
26 | - <property name="spacing">18</property> |
27 | - <child> |
28 | - <object class="GtkLabel" id="intro_label"> |
29 | - <property name="visible">True</property> |
30 | - <property name="xalign">0</property> |
31 | - <property name="yalign">0</property> |
32 | - <property name="label" translatable="yes">To try or install Ubuntu from a removable disk, it needs to be set up as a startup disk.</property> |
33 | - <property name="wrap">True</property> |
34 | - <property name="selectable">True</property> |
35 | - </object> |
36 | - <packing> |
37 | - <property name="expand">False</property> |
38 | - <property name="position">0</property> |
39 | - </packing> |
40 | - </child> |
41 | - <child> |
42 | - <object class="GtkVBox" id="source_vbox"> |
43 | - <property name="visible">True</property> |
44 | - <property name="orientation">vertical</property> |
45 | - <property name="spacing">6</property> |
46 | - <child> |
47 | - <object class="GtkHBox" id="hbox4"> |
48 | - <property name="visible">True</property> |
49 | - <child> |
50 | - <object class="GtkLabel" id="label2"> |
51 | - <property name="visible">True</property> |
52 | - <property name="label" translatable="yes">Source disc image (.iso) or CD:</property> |
53 | - <property name="selectable">True</property> |
54 | - </object> |
55 | - <packing> |
56 | - <property name="expand">False</property> |
57 | - <property name="position">0</property> |
58 | - </packing> |
59 | - </child> |
60 | - </object> |
61 | - <packing> |
62 | - <property name="expand">False</property> |
63 | - <property name="position">0</property> |
64 | - </packing> |
65 | - </child> |
66 | - <child> |
67 | - <object class="GtkScrolledWindow" id="scrolledwindow1"> |
68 | - <property name="visible">True</property> |
69 | - <property name="can_focus">True</property> |
70 | - <property name="hscrollbar_policy">never</property> |
71 | - <property name="vscrollbar_policy">automatic</property> |
72 | - <property name="shadow_type">in</property> |
73 | - <child> |
74 | - <object class="GtkTreeView" id="source_treeview"> |
75 | - <property name="height_request">50</property> |
76 | - <property name="visible">True</property> |
77 | - <property name="can_focus">True</property> |
78 | - <property name="headers_clickable">False</property> |
79 | - <property name="rubber_banding">True</property> |
80 | - </object> |
81 | - </child> |
82 | - </object> |
83 | - <packing> |
84 | - <property name="position">1</property> |
85 | - </packing> |
86 | - </child> |
87 | - <child> |
88 | - <object class="GtkHBox" id="hbox1"> |
89 | - <property name="visible">True</property> |
90 | - <child> |
91 | - <object class="GtkLabel" id="source_status"> |
92 | - <property name="visible">True</property> |
93 | - </object> |
94 | - <packing> |
95 | - <property name="expand">False</property> |
96 | - <property name="fill">False</property> |
97 | - <property name="position">1</property> |
98 | - </packing> |
99 | - </child> |
100 | - <child> |
101 | - <object class="GtkButton" id="add_source_button"> |
102 | - <property name="label" translatable="yes">Other...</property> |
103 | - <property name="visible">True</property> |
104 | - <property name="can_focus">True</property> |
105 | - <property name="receives_default">True</property> |
106 | - <signal name="clicked" handler="add_file_source_dialog"/> |
107 | - </object> |
108 | - <packing> |
109 | - <property name="expand">False</property> |
110 | - <property name="fill">False</property> |
111 | - <property name="pack_type">end</property> |
112 | - <property name="position">1</property> |
113 | - </packing> |
114 | - </child> |
115 | - </object> |
116 | - <packing> |
117 | - <property name="expand">False</property> |
118 | - <property name="fill">False</property> |
119 | - <property name="pack_type">end</property> |
120 | - <property name="position">2</property> |
121 | - </packing> |
122 | - </child> |
123 | - </object> |
124 | - <packing> |
125 | - <property name="position">1</property> |
126 | - </packing> |
127 | - </child> |
128 | - <child> |
129 | - <object class="GtkVBox" id="target_vbox"> |
130 | - <property name="visible">True</property> |
131 | - <property name="orientation">vertical</property> |
132 | - <property name="spacing">6</property> |
133 | - <child> |
134 | - <object class="GtkHBox" id="hbox5"> |
135 | - <property name="visible">True</property> |
136 | - <child> |
137 | - <object class="GtkLabel" id="label3"> |
138 | - <property name="visible">True</property> |
139 | - <property name="label" translatable="yes">Disk to use:</property> |
140 | - <property name="wrap">True</property> |
141 | - </object> |
142 | - <packing> |
143 | - <property name="expand">False</property> |
144 | - <property name="position">0</property> |
145 | - </packing> |
146 | - </child> |
147 | - </object> |
148 | - <packing> |
149 | - <property name="expand">False</property> |
150 | - <property name="position">0</property> |
151 | - </packing> |
152 | - </child> |
153 | - <child> |
154 | - <object class="GtkScrolledWindow" id="scrolledwindow2"> |
155 | - <property name="visible">True</property> |
156 | - <property name="can_focus">True</property> |
157 | - <property name="hscrollbar_policy">never</property> |
158 | - <property name="vscrollbar_policy">automatic</property> |
159 | - <property name="shadow_type">in</property> |
160 | - <child> |
161 | - <object class="GtkTreeView" id="dest_treeview"> |
162 | - <property name="height_request">50</property> |
163 | - <property name="visible">True</property> |
164 | - <property name="can_focus">True</property> |
165 | - <property name="headers_clickable">False</property> |
166 | - </object> |
167 | - </child> |
168 | - </object> |
169 | - <packing> |
170 | - <property name="position">1</property> |
171 | - </packing> |
172 | - </child> |
173 | - <child> |
174 | - <object class="GtkHBox" id="hbox7"> |
175 | - <property name="visible">True</property> |
176 | - <property name="spacing">6</property> |
177 | - <child> |
178 | - <object class="GtkHBox" id="hbox8"> |
179 | - <property name="visible">True</property> |
180 | - <child> |
181 | - <object class="GtkLabel" id="dest_status"> |
182 | - <property name="visible">True</property> |
183 | - </object> |
184 | - <packing> |
185 | - <property name="expand">False</property> |
186 | - <property name="fill">False</property> |
187 | - <property name="position">0</property> |
188 | - </packing> |
189 | - </child> |
190 | - </object> |
191 | - <packing> |
192 | - <property name="position">0</property> |
193 | - </packing> |
194 | - </child> |
195 | - <child> |
196 | - <object class="GtkButton" id="open_dest"> |
197 | - <property name="label">gtk-open</property> |
198 | - <property name="can_focus">True</property> |
199 | - <property name="receives_default">True</property> |
200 | - <property name="use_stock">True</property> |
201 | - <signal name="clicked" handler="open_dest_folder"/> |
202 | - </object> |
203 | - <packing> |
204 | - <property name="expand">False</property> |
205 | - <property name="fill">False</property> |
206 | - <property name="position">1</property> |
207 | - </packing> |
208 | - </child> |
209 | - <child> |
210 | - <object class="GtkButton" id="format_dest"> |
211 | - <property name="label" translatable="yes">Erase Disk</property> |
212 | - <property name="visible">True</property> |
213 | - <property name="can_focus">True</property> |
214 | - <property name="receives_default">True</property> |
215 | - <signal name="clicked" handler="format_dest_clicked"/> |
216 | - </object> |
217 | - <packing> |
218 | - <property name="expand">False</property> |
219 | - <property name="fill">False</property> |
220 | - <property name="position">2</property> |
221 | - </packing> |
222 | - </child> |
223 | - </object> |
224 | - <packing> |
225 | - <property name="expand">False</property> |
226 | - <property name="position">2</property> |
227 | - </packing> |
228 | - </child> |
229 | - </object> |
230 | - <packing> |
231 | - <property name="position">2</property> |
232 | - </packing> |
233 | - </child> |
234 | - <child> |
235 | - <object class="GtkVBox" id="persist_vbox"> |
236 | - <property name="visible">True</property> |
237 | - <property name="orientation">vertical</property> |
238 | - <property name="spacing">6</property> |
239 | - <child> |
240 | - <object class="GtkLabel" id="label4"> |
241 | + <child> |
242 | + <object class="GtkVBox" id="main_vbox"> |
243 | + <property name="visible">True</property> |
244 | + <property name="border_width">12</property> |
245 | + <property name="spacing">18</property> |
246 | + <child> |
247 | + <object class="GtkLabel" id="intro_label"> |
248 | <property name="visible">True</property> |
249 | <property name="xalign">0</property> |
250 | <property name="yalign">0</property> |
251 | - <property name="label" translatable="yes">When starting up from this disk, documents and settings will be:</property> |
252 | + <property name="label" translatable="yes">To try or install Ubuntu from a removable disk, it needs to be set up as a startup disk.</property> |
253 | <property name="wrap">True</property> |
254 | + <property name="selectable">True</property> |
255 | </object> |
256 | <packing> |
257 | + <property name="expand">False</property> |
258 | <property name="position">0</property> |
259 | </packing> |
260 | </child> |
261 | <child> |
262 | - <object class="GtkAlignment" id="alignment2"> |
263 | - <property name="visible">True</property> |
264 | - <property name="left_padding">6</property> |
265 | - <child> |
266 | - <object class="GtkVBox" id="vbox2"> |
267 | - <property name="visible">True</property> |
268 | - <property name="orientation">vertical</property> |
269 | - <property name="spacing">12</property> |
270 | - <child> |
271 | - <object class="GtkVBox" id="persist_enabled_vbox"> |
272 | - <property name="visible">True</property> |
273 | - <property name="orientation">vertical</property> |
274 | - <property name="spacing">3</property> |
275 | - <child> |
276 | - <object class="GtkRadioButton" id="persist_enabled"> |
277 | - <property name="label" translatable="yes">Stored in reserved extra space</property> |
278 | + <object class="GtkVBox" id="source_vbox"> |
279 | + <property name="visible">True</property> |
280 | + <property name="spacing">6</property> |
281 | + <child> |
282 | + <object class="GtkHBox" id="hbox4"> |
283 | + <property name="visible">True</property> |
284 | + <child> |
285 | + <object class="GtkLabel" id="label2"> |
286 | + <property name="visible">True</property> |
287 | + <property name="label" translatable="yes">Source disc image (.iso) or CD:</property> |
288 | + <property name="selectable">True</property> |
289 | + </object> |
290 | + <packing> |
291 | + <property name="expand">False</property> |
292 | + <property name="position">0</property> |
293 | + </packing> |
294 | + </child> |
295 | + </object> |
296 | + <packing> |
297 | + <property name="expand">False</property> |
298 | + <property name="position">0</property> |
299 | + </packing> |
300 | + </child> |
301 | + <child> |
302 | + <object class="GtkScrolledWindow" id="scrolledwindow1"> |
303 | + <property name="visible">True</property> |
304 | + <property name="can_focus">True</property> |
305 | + <property name="hscrollbar_policy">never</property> |
306 | + <property name="vscrollbar_policy">automatic</property> |
307 | + <property name="shadow_type">in</property> |
308 | + <child> |
309 | + <object class="GtkTreeView" id="source_treeview"> |
310 | + <property name="height_request">50</property> |
311 | + <property name="visible">True</property> |
312 | + <property name="can_focus">True</property> |
313 | + <property name="rubber_banding">True</property> |
314 | + </object> |
315 | + </child> |
316 | + </object> |
317 | + <packing> |
318 | + <property name="position">1</property> |
319 | + </packing> |
320 | + </child> |
321 | + <child> |
322 | + <object class="GtkHBox" id="hbox1"> |
323 | + <property name="visible">True</property> |
324 | + <child> |
325 | + <object class="GtkLabel" id="source_status"> |
326 | + <property name="visible">True</property> |
327 | + </object> |
328 | + <packing> |
329 | + <property name="expand">False</property> |
330 | + <property name="fill">False</property> |
331 | + <property name="position">1</property> |
332 | + </packing> |
333 | + </child> |
334 | + <child> |
335 | + <object class="GtkButton" id="add_source_button"> |
336 | + <property name="label" translatable="yes">Other...</property> |
337 | + <property name="visible">True</property> |
338 | + <property name="can_focus">True</property> |
339 | + <property name="receives_default">True</property> |
340 | + <signal name="clicked" handler="add_file_source_dialog"/> |
341 | + </object> |
342 | + <packing> |
343 | + <property name="expand">False</property> |
344 | + <property name="fill">False</property> |
345 | + <property name="pack_type">end</property> |
346 | + <property name="position">1</property> |
347 | + </packing> |
348 | + </child> |
349 | + </object> |
350 | + <packing> |
351 | + <property name="expand">False</property> |
352 | + <property name="fill">False</property> |
353 | + <property name="pack_type">end</property> |
354 | + <property name="position">2</property> |
355 | + </packing> |
356 | + </child> |
357 | + </object> |
358 | + <packing> |
359 | + <property name="position">1</property> |
360 | + </packing> |
361 | + </child> |
362 | + <child> |
363 | + <object class="GtkVBox" id="target_vbox"> |
364 | + <property name="visible">True</property> |
365 | + <property name="spacing">6</property> |
366 | + <child> |
367 | + <object class="GtkHBox" id="hbox5"> |
368 | + <property name="visible">True</property> |
369 | + <child> |
370 | + <object class="GtkLabel" id="label3"> |
371 | + <property name="visible">True</property> |
372 | + <property name="label" translatable="yes">Disk to use:</property> |
373 | + <property name="wrap">True</property> |
374 | + </object> |
375 | + <packing> |
376 | + <property name="expand">False</property> |
377 | + <property name="position">0</property> |
378 | + </packing> |
379 | + </child> |
380 | + </object> |
381 | + <packing> |
382 | + <property name="expand">False</property> |
383 | + <property name="position">0</property> |
384 | + </packing> |
385 | + </child> |
386 | + <child> |
387 | + <object class="GtkScrolledWindow" id="scrolledwindow2"> |
388 | + <property name="visible">True</property> |
389 | + <property name="can_focus">True</property> |
390 | + <property name="hscrollbar_policy">never</property> |
391 | + <property name="vscrollbar_policy">automatic</property> |
392 | + <property name="shadow_type">in</property> |
393 | + <child> |
394 | + <object class="GtkTreeView" id="dest_treeview"> |
395 | + <property name="height_request">50</property> |
396 | + <property name="visible">True</property> |
397 | + <property name="can_focus">True</property> |
398 | + </object> |
399 | + </child> |
400 | + </object> |
401 | + <packing> |
402 | + <property name="position">1</property> |
403 | + </packing> |
404 | + </child> |
405 | + <child> |
406 | + <object class="GtkHBox" id="hbox7"> |
407 | + <property name="visible">True</property> |
408 | + <property name="spacing">6</property> |
409 | + <child> |
410 | + <object class="GtkHBox" id="hbox8"> |
411 | + <property name="visible">True</property> |
412 | + <child> |
413 | + <object class="GtkLabel" id="dest_status"> |
414 | + <property name="visible">True</property> |
415 | + </object> |
416 | + <packing> |
417 | + <property name="expand">False</property> |
418 | + <property name="fill">False</property> |
419 | + <property name="position">0</property> |
420 | + </packing> |
421 | + </child> |
422 | + </object> |
423 | + <packing> |
424 | + <property name="position">0</property> |
425 | + </packing> |
426 | + </child> |
427 | + <child> |
428 | + <object class="GtkButton" id="open_dest"> |
429 | + <property name="label">gtk-open</property> |
430 | + <property name="can_focus">True</property> |
431 | + <property name="receives_default">True</property> |
432 | + <property name="use_stock">True</property> |
433 | + <signal name="clicked" handler="open_dest_folder"/> |
434 | + </object> |
435 | + <packing> |
436 | + <property name="expand">False</property> |
437 | + <property name="fill">False</property> |
438 | + <property name="position">1</property> |
439 | + </packing> |
440 | + </child> |
441 | + <child> |
442 | + <object class="GtkButton" id="format_dest"> |
443 | + <property name="label" translatable="yes">Erase Disk</property> |
444 | + <property name="visible">True</property> |
445 | + <property name="can_focus">True</property> |
446 | + <property name="receives_default">True</property> |
447 | + <signal name="clicked" handler="format_dest_clicked"/> |
448 | + </object> |
449 | + <packing> |
450 | + <property name="expand">False</property> |
451 | + <property name="fill">False</property> |
452 | + <property name="position">2</property> |
453 | + </packing> |
454 | + </child> |
455 | + </object> |
456 | + <packing> |
457 | + <property name="expand">False</property> |
458 | + <property name="position">2</property> |
459 | + </packing> |
460 | + </child> |
461 | + </object> |
462 | + <packing> |
463 | + <property name="position">2</property> |
464 | + </packing> |
465 | + </child> |
466 | + <child> |
467 | + <object class="GtkVBox" id="persist_vbox"> |
468 | + <property name="visible">True</property> |
469 | + <property name="spacing">6</property> |
470 | + <child> |
471 | + <object class="GtkLabel" id="label4"> |
472 | + <property name="visible">True</property> |
473 | + <property name="xalign">0</property> |
474 | + <property name="yalign">0</property> |
475 | + <property name="label" translatable="yes">When starting up from this disk, documents and settings will be:</property> |
476 | + <property name="wrap">True</property> |
477 | + </object> |
478 | + <packing> |
479 | + <property name="position">0</property> |
480 | + </packing> |
481 | + </child> |
482 | + <child> |
483 | + <object class="GtkAlignment" id="alignment2"> |
484 | + <property name="visible">True</property> |
485 | + <property name="left_padding">6</property> |
486 | + <child> |
487 | + <object class="GtkVBox" id="vbox2"> |
488 | + <property name="visible">True</property> |
489 | + <property name="spacing">12</property> |
490 | + <child> |
491 | + <object class="GtkVBox" id="persist_enabled_vbox"> |
492 | + <property name="visible">True</property> |
493 | + <property name="spacing">3</property> |
494 | + <child> |
495 | + <object class="GtkRadioButton" id="persist_enabled"> |
496 | + <property name="label" translatable="yes">Stored in reserved extra space</property> |
497 | + <property name="visible">True</property> |
498 | + <property name="can_focus">True</property> |
499 | + <property name="receives_default">False</property> |
500 | + <property name="active">True</property> |
501 | + <property name="draw_indicator">True</property> |
502 | + </object> |
503 | + <packing> |
504 | + <property name="expand">False</property> |
505 | + <property name="position">0</property> |
506 | + </packing> |
507 | + </child> |
508 | + <child> |
509 | + <object class="GtkAlignment" id="alignment3"> |
510 | + <property name="visible">True</property> |
511 | + <property name="left_padding">23</property> |
512 | + <child> |
513 | + <object class="GtkHBox" id="hbox2"> |
514 | + <property name="visible">True</property> |
515 | + <property name="spacing">6</property> |
516 | + <child> |
517 | + <object class="GtkLabel" id="label5"> |
518 | + <property name="visible">True</property> |
519 | + <property name="label" translatable="yes">How much:</property> |
520 | + </object> |
521 | + <packing> |
522 | + <property name="expand">False</property> |
523 | + <property name="position">1</property> |
524 | + </packing> |
525 | + </child> |
526 | + <child> |
527 | + <object class="GtkHScale" id="persist_value"> |
528 | + <property name="visible">True</property> |
529 | + <property name="can_focus">True</property> |
530 | + <property name="adjustment">adjustment1</property> |
531 | + <property name="restrict_to_fill_level">False</property> |
532 | + <property name="digits">0</property> |
533 | + <property name="value_pos">right</property> |
534 | + </object> |
535 | + <packing> |
536 | + <property name="pack_type">end</property> |
537 | + <property name="position">1</property> |
538 | + </packing> |
539 | + </child> |
540 | + </object> |
541 | + </child> |
542 | + </object> |
543 | + <packing> |
544 | + <property name="position">1</property> |
545 | + </packing> |
546 | + </child> |
547 | + </object> |
548 | + <packing> |
549 | + <property name="position">0</property> |
550 | + </packing> |
551 | + </child> |
552 | + <child> |
553 | + <object class="GtkRadioButton" id="persist_disabled"> |
554 | + <property name="label" translatable="yes">Discarded on shutdown, unless you save them elsewhere</property> |
555 | <property name="visible">True</property> |
556 | <property name="can_focus">True</property> |
557 | <property name="receives_default">False</property> |
558 | - <property name="active">True</property> |
559 | <property name="draw_indicator">True</property> |
560 | + <property name="group">persist_enabled</property> |
561 | </object> |
562 | <packing> |
563 | <property name="expand">False</property> |
564 | - <property name="position">0</property> |
565 | - </packing> |
566 | - </child> |
567 | - <child> |
568 | - <object class="GtkAlignment" id="alignment3"> |
569 | - <property name="visible">True</property> |
570 | - <property name="left_padding">23</property> |
571 | - <child> |
572 | - <object class="GtkHBox" id="hbox2"> |
573 | - <property name="visible">True</property> |
574 | - <property name="spacing">6</property> |
575 | - <child> |
576 | - <object class="GtkLabel" id="label5"> |
577 | - <property name="visible">True</property> |
578 | - <property name="label" translatable="yes">How much:</property> |
579 | - </object> |
580 | - <packing> |
581 | - <property name="expand">False</property> |
582 | - <property name="position">1</property> |
583 | - </packing> |
584 | - </child> |
585 | - <child> |
586 | - <object class="GtkHScale" id="persist_value"> |
587 | - <property name="visible">True</property> |
588 | - <property name="can_focus">True</property> |
589 | - <property name="adjustment">adjustment1</property> |
590 | - <property name="restrict_to_fill_level">False</property> |
591 | - <property name="digits">0</property> |
592 | - <property name="value_pos">right</property> |
593 | - </object> |
594 | - <packing> |
595 | - <property name="pack_type">end</property> |
596 | - <property name="position">1</property> |
597 | - </packing> |
598 | - </child> |
599 | - </object> |
600 | - </child> |
601 | - </object> |
602 | - <packing> |
603 | + <property name="pack_type">end</property> |
604 | <property name="position">1</property> |
605 | </packing> |
606 | </child> |
607 | </object> |
608 | - <packing> |
609 | - <property name="position">0</property> |
610 | - </packing> |
611 | - </child> |
612 | - <child> |
613 | - <object class="GtkRadioButton" id="persist_disabled"> |
614 | - <property name="label" translatable="yes">Discarded on shutdown, unless you save them elsewhere</property> |
615 | - <property name="visible">True</property> |
616 | - <property name="can_focus">True</property> |
617 | - <property name="receives_default">False</property> |
618 | - <property name="active">True</property> |
619 | - <property name="draw_indicator">True</property> |
620 | - <property name="group">persist_enabled</property> |
621 | - </object> |
622 | - <packing> |
623 | - <property name="expand">False</property> |
624 | - <property name="pack_type">end</property> |
625 | - <property name="position">1</property> |
626 | - </packing> |
627 | - </child> |
628 | - </object> |
629 | - </child> |
630 | - </object> |
631 | - <packing> |
632 | - <property name="expand">False</property> |
633 | - <property name="fill">False</property> |
634 | - <property name="position">1</property> |
635 | - </packing> |
636 | - </child> |
637 | - </object> |
638 | - <packing> |
639 | - <property name="expand">False</property> |
640 | - <property name="fill">False</property> |
641 | - <property name="position">3</property> |
642 | - </packing> |
643 | - </child> |
644 | - <child> |
645 | - <object class="GtkHButtonBox" id="hbuttonbox1"> |
646 | - <property name="visible">True</property> |
647 | - <property name="layout_style">end</property> |
648 | - <child> |
649 | - <object class="GtkButton" id="button_help"> |
650 | - <property name="label">gtk-help</property> |
651 | - <property name="visible">True</property> |
652 | - <property name="can_focus">True</property> |
653 | - <property name="receives_default">True</property> |
654 | - <property name="border_width">4</property> |
655 | - <property name="use_stock">True</property> |
656 | - </object> |
657 | - <packing> |
658 | - <property name="expand">False</property> |
659 | - <property name="fill">False</property> |
660 | - <property name="position">0</property> |
661 | - <property name="secondary">True</property> |
662 | - </packing> |
663 | - </child> |
664 | - <child> |
665 | - <object class="GtkButton" id="button_quit"> |
666 | - <property name="label">gtk-close</property> |
667 | - <property name="visible">True</property> |
668 | - <property name="can_focus">True</property> |
669 | - <property name="receives_default">True</property> |
670 | - <property name="border_width">4</property> |
671 | - <property name="use_stock">True</property> |
672 | - <signal name="clicked" handler="quit"/> |
673 | - </object> |
674 | - <packing> |
675 | - <property name="expand">False</property> |
676 | - <property name="fill">False</property> |
677 | - <property name="position">1</property> |
678 | - </packing> |
679 | - </child> |
680 | - <child> |
681 | - <object class="GtkButton" id="button_install"> |
682 | - <property name="label" translatable="yes">Make Startup Disk</property> |
683 | - <property name="visible">True</property> |
684 | - <property name="can_focus">True</property> |
685 | - <property name="can_default">True</property> |
686 | - <property name="has_default">True</property> |
687 | - <property name="receives_default">True</property> |
688 | - <property name="border_width">4</property> |
689 | - <signal name="clicked" handler="install"/> |
690 | - </object> |
691 | - <packing> |
692 | - <property name="expand">False</property> |
693 | - <property name="fill">False</property> |
694 | - <property name="position">2</property> |
695 | - </packing> |
696 | - </child> |
697 | - </object> |
698 | - <packing> |
699 | - <property name="expand">False</property> |
700 | - <property name="position">4</property> |
701 | + </child> |
702 | + </object> |
703 | + <packing> |
704 | + <property name="expand">False</property> |
705 | + <property name="fill">False</property> |
706 | + <property name="position">1</property> |
707 | + </packing> |
708 | + </child> |
709 | + </object> |
710 | + <packing> |
711 | + <property name="expand">False</property> |
712 | + <property name="fill">False</property> |
713 | + <property name="position">3</property> |
714 | + </packing> |
715 | + </child> |
716 | + <child> |
717 | + <object class="GtkHButtonBox" id="hbuttonbox1"> |
718 | + <property name="visible">True</property> |
719 | + <property name="layout_style">end</property> |
720 | + <child> |
721 | + <object class="GtkButton" id="button_help"> |
722 | + <property name="label">gtk-help</property> |
723 | + <property name="visible">True</property> |
724 | + <property name="can_focus">True</property> |
725 | + <property name="receives_default">True</property> |
726 | + <property name="border_width">4</property> |
727 | + <property name="use_stock">True</property> |
728 | + </object> |
729 | + <packing> |
730 | + <property name="expand">False</property> |
731 | + <property name="fill">False</property> |
732 | + <property name="position">0</property> |
733 | + <property name="secondary">True</property> |
734 | + </packing> |
735 | + </child> |
736 | + <child> |
737 | + <object class="GtkButton" id="button_quit"> |
738 | + <property name="label">gtk-close</property> |
739 | + <property name="visible">True</property> |
740 | + <property name="can_focus">True</property> |
741 | + <property name="receives_default">True</property> |
742 | + <property name="border_width">4</property> |
743 | + <property name="use_stock">True</property> |
744 | + <signal name="clicked" handler="quit"/> |
745 | + </object> |
746 | + <packing> |
747 | + <property name="expand">False</property> |
748 | + <property name="fill">False</property> |
749 | + <property name="position">1</property> |
750 | + </packing> |
751 | + </child> |
752 | + <child> |
753 | + <object class="GtkButton" id="button_install"> |
754 | + <property name="label" translatable="yes">Make Startup Disk</property> |
755 | + <property name="visible">True</property> |
756 | + <property name="sensitive">False</property> |
757 | + <property name="can_focus">True</property> |
758 | + <property name="can_default">True</property> |
759 | + <property name="has_default">True</property> |
760 | + <property name="receives_default">True</property> |
761 | + <property name="border_width">4</property> |
762 | + <signal name="clicked" handler="install"/> |
763 | + </object> |
764 | + <packing> |
765 | + <property name="expand">False</property> |
766 | + <property name="fill">False</property> |
767 | + <property name="position">2</property> |
768 | + </packing> |
769 | + </child> |
770 | + </object> |
771 | + <packing> |
772 | + <property name="expand">False</property> |
773 | + <property name="position">4</property> |
774 | + </packing> |
775 | + </child> |
776 | + </object> |
777 | + <packing> |
778 | + <property name="pack_type">end</property> |
779 | + <property name="position">0</property> |
780 | </packing> |
781 | </child> |
782 | </object> |
783 | @@ -423,7 +424,6 @@ |
784 | <child> |
785 | <object class="GtkVBox" id="vbox35"> |
786 | <property name="visible">True</property> |
787 | - <property name="orientation">vertical</property> |
788 | <property name="spacing">6</property> |
789 | <child> |
790 | <object class="GtkLabel" id="progress_title"> |
791 | @@ -506,7 +506,6 @@ |
792 | <child internal-child="vbox"> |
793 | <object class="GtkVBox" id="dialog-vbox10"> |
794 | <property name="visible">True</property> |
795 | - <property name="orientation">vertical</property> |
796 | <child> |
797 | <object class="GtkHBox" id="hbox27"> |
798 | <property name="visible">True</property> |
799 | @@ -614,7 +613,6 @@ |
800 | <child internal-child="vbox"> |
801 | <object class="GtkVBox" id="dialog-vbox3"> |
802 | <property name="visible">True</property> |
803 | - <property name="orientation">vertical</property> |
804 | <child> |
805 | <object class="GtkHBox" id="hbox9"> |
806 | <property name="visible">True</property> |
807 | @@ -705,7 +703,6 @@ |
808 | <child internal-child="vbox"> |
809 | <object class="GtkVBox" id="dialog-vbox5"> |
810 | <property name="visible">True</property> |
811 | - <property name="orientation">vertical</property> |
812 | <child> |
813 | <object class="GtkHBox" id="hbox10"> |
814 | <property name="visible">True</property> |
815 | |
816 | === modified file 'usbcreator/frontends/gtk/frontend.py' |
817 | --- usbcreator/frontends/gtk/frontend.py 2010-05-21 04:09:58 +0000 |
818 | +++ usbcreator/frontends/gtk/frontend.py 2010-06-12 04:08:24 +0000 |
819 | @@ -151,8 +151,21 @@ |
820 | |
821 | # Pre-populate the source view. |
822 | if img is not None: |
823 | + logging.debug('--iso: %s' % str(img)) |
824 | self.backend.add_image(img) |
825 | - self.source_vbox.hide() |
826 | + if not self.backend.sources: |
827 | + logging.error('Command Line option --iso: %s' % str(img)) |
828 | + infobar = gtk.InfoBar() |
829 | + infobar.set_border_width(6) |
830 | + infolabel = gtk.Label() |
831 | + content = infobar.get_content_area() |
832 | + content.pack_start(infolabel, expand=False) |
833 | + button = infobar.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK) |
834 | + self.infobar_vbox.pack_start(infobar) |
835 | + msg = _('Cannot use: ') |
836 | + infolabel.set_text(msg + img) |
837 | + self.infobar_vbox.show_all() |
838 | + infobar.connect('response', lambda x,y: x.hide()) |
839 | |
840 | download_dir = glib.get_user_special_dir(glib.USER_DIRECTORY_DOWNLOAD) |
841 | if download_dir and os.path.isdir(download_dir): |
842 | @@ -161,6 +174,9 @@ |
843 | if fname.endswith('.iso') or fname.endswith('.img'): |
844 | self.backend.add_image(os.path.join(download_dir, fname)) |
845 | |
846 | + # Sets first pre-populated image as current in the backend |
847 | + self.selection_changed_source(self.source_treeview.get_selection()) |
848 | + |
849 | if not persistent: |
850 | self.persist_disabled.set_active(True) |
851 | self.persist_vbox.hide() |
852 | @@ -441,15 +457,11 @@ |
853 | # Update install button state. |
854 | status = target['status'] |
855 | source = self.backend.get_current_source() |
856 | - if status == CAN_USE: |
857 | - self.button_install.set_sensitive(True) |
858 | - else: |
859 | - self.button_install.set_sensitive(False) |
860 | if not source: |
861 | + self.button_install.set_sensitive(False) |
862 | return |
863 | stype = self.backend.sources[source]['type'] |
864 | - if (self.button_install.get_property('sensitive') |
865 | - and stype == SOURCE_IMG): |
866 | + if status == CAN_USE and stype in (SOURCE_IMG, SOURCE_ISO): |
867 | self.button_install.set_sensitive(True) |
868 | else: |
869 | self.button_install.set_sensitive(False) |
Could we make the 'cannot use' message a dialog instead? If we set the source status label to this message it will persist, in all likelihood, for the duration of the program before the user presses install. This strikes me as confusing.
Otherwise, it looks good! Nice catches on those bugs.