Merge lp:~psusi/ubuntu/saucy/brasero/fix-drive-selector into lp:ubuntu/saucy/brasero

Proposed by Phillip Susi
Status: Needs review
Proposed branch: lp:~psusi/ubuntu/saucy/brasero/fix-drive-selector
Merge into: lp:ubuntu/saucy/brasero
Diff against target: 793 lines (+731/-2)
6 files modified
.pc/05_populate-tree-model-after-construction.patch/libbrasero-media/brasero-drive-selection.c (+671/-0)
.pc/applied-patches (+1/-0)
debian/changelog (+8/-0)
debian/patches/05_populate-tree-model-after-construction.patch (+42/-0)
debian/patches/series (+1/-0)
libbrasero-media/brasero-drive-selection.c (+8/-2)
To merge this branch: bzr merge lp:~psusi/ubuntu/saucy/brasero/fix-drive-selector
Reviewer Review Type Date Requested Status
Timo Aaltonen Approve
Review via email: mp+190014@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Timo Aaltonen (tjaalton) :
review: Approve

Unmerged revisions

111. By Phillip Susi

debian/patches/05_populate-tree-model-after-construction.patch:
backport upstream commit to fix drive selection not showing
up correctly (LP: #1237169).

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added directory '.pc/05_populate-tree-model-after-construction.patch'
=== added directory '.pc/05_populate-tree-model-after-construction.patch/libbrasero-media'
=== added file '.pc/05_populate-tree-model-after-construction.patch/libbrasero-media/brasero-drive-selection.c'
--- .pc/05_populate-tree-model-after-construction.patch/libbrasero-media/brasero-drive-selection.c 1970-01-01 00:00:00 +0000
+++ .pc/05_populate-tree-model-after-construction.patch/libbrasero-media/brasero-drive-selection.c 2013-10-09 02:24:44 +0000
@@ -0,0 +1,671 @@
1/* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 8; tab-width: 8 -*- */
2/*
3 * Libbrasero-media
4 * Copyright (C) Philippe Rouquier 2005-2009 <bonfire-app@wanadoo.fr>
5 *
6 * Libbrasero-media is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * The Libbrasero-media authors hereby grant permission for non-GPL compatible
12 * GStreamer plugins to be used and distributed together with GStreamer
13 * and Libbrasero-media. This permission is above and beyond the permissions granted
14 * by the GPL license by which Libbrasero-media is covered. If you modify this code
15 * you may extend this exception to your version of the code, but you are not
16 * obligated to do so. If you do not wish to do so, delete this exception
17 * statement from your version.
18 *
19 * Libbrasero-media is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU Library General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program; if not, write to:
26 * The Free Software Foundation, Inc.,
27 * 51 Franklin Street, Fifth Floor
28 * Boston, MA 02110-1301, USA.
29 */
30
31#ifdef HAVE_CONFIG_H
32# include <config.h>
33#endif
34
35#include <glib.h>
36#include <glib-object.h>
37#include <glib/gi18n-lib.h>
38
39#include <gtk/gtk.h>
40
41#include "brasero-drive-selection.h"
42#include "brasero-medium-monitor.h"
43#include "brasero-drive.h"
44#include "brasero-units.h"
45
46typedef struct _BraseroDriveSelectionPrivate BraseroDriveSelectionPrivate;
47struct _BraseroDriveSelectionPrivate
48{
49 BraseroDrive *active;
50
51 BraseroDriveType type;
52 gulong added_sig;
53 gulong removed_sig;
54};
55
56#define BRASERO_DRIVE_SELECTION_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), BRASERO_TYPE_DRIVE_SELECTION, BraseroDriveSelectionPrivate))
57
58typedef enum {
59 CHANGED_SIGNAL,
60 LAST_SIGNAL
61} BraseroDriveSelectionSignalType;
62
63/* GtkBuildable */
64static GtkBuildableIface *parent_buildable_iface;
65
66static guint brasero_drive_selection_signals [LAST_SIGNAL] = { 0 };
67
68enum {
69 PROP_0,
70 PROP_DRIVE,
71 PROP_DRIVE_TYPE
72};
73
74enum {
75 DRIVE_COL,
76 NAME_COL,
77 ICON_COL,
78 NUM_COL
79};
80
81
82static void
83brasero_drive_selection_buildable_init (GtkBuildableIface *iface)
84{
85 parent_buildable_iface = g_type_interface_peek_parent (iface);
86}
87
88G_DEFINE_TYPE_WITH_CODE (BraseroDriveSelection, brasero_drive_selection, GTK_TYPE_COMBO_BOX, G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, brasero_drive_selection_buildable_init));
89
90static void
91brasero_drive_selection_set_current_drive (BraseroDriveSelection *self,
92 GtkTreeIter *iter)
93{
94 BraseroDriveSelectionPrivate *priv;
95 BraseroDrive *drive;
96 GtkTreeModel *model;
97
98 priv = BRASERO_DRIVE_SELECTION_PRIVATE (self);
99
100 model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
101 gtk_tree_model_get (model, iter,
102 DRIVE_COL, &drive,
103 -1);
104
105 if (drive)
106 gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
107 else
108 gtk_widget_set_sensitive (GTK_WIDGET (self), FALSE);
109
110 if (priv->active == drive)
111 return;
112
113 if (priv->active)
114 g_object_unref (priv->active);
115
116 priv->active = drive;
117
118 if (priv->active)
119 g_object_ref (priv->active);
120
121 g_signal_emit (self,
122 brasero_drive_selection_signals [CHANGED_SIGNAL],
123 0,
124 priv->active);
125}
126
127static void
128brasero_drive_selection_changed (GtkComboBox *combo)
129{
130 GtkTreeIter iter;
131
132 if (!gtk_combo_box_get_active_iter (combo, &iter))
133 return;
134
135 brasero_drive_selection_set_current_drive (BRASERO_DRIVE_SELECTION (combo), &iter);
136}
137
138/**
139 * brasero_drive_selection_set_active:
140 * @selector: a #BraseroDriveSelection
141 * @drive: a #BraseroDrive to set as the active one in the selector
142 *
143 * Sets the active drive. Emits the ::drive-changed signal.
144 *
145 * Return value: a #gboolean. TRUE if it succeeded, FALSE otherwise.
146 **/
147gboolean
148brasero_drive_selection_set_active (BraseroDriveSelection *selector,
149 BraseroDrive *drive)
150{
151 BraseroDriveSelectionPrivate *priv;
152 gboolean result = FALSE;
153 GtkTreeModel *model;
154 GtkTreeIter iter;
155
156 g_return_val_if_fail (selector != NULL, FALSE);
157 g_return_val_if_fail (BRASERO_IS_DRIVE_SELECTION (selector), FALSE);
158
159 priv = BRASERO_DRIVE_SELECTION_PRIVATE (selector);
160
161 if (priv->active == drive)
162 return TRUE;
163
164 model = gtk_combo_box_get_model (GTK_COMBO_BOX (selector));
165 if (!gtk_tree_model_get_iter_first (model, &iter))
166 return FALSE;
167
168 do {
169 BraseroDrive *iter_drive;
170
171 gtk_tree_model_get (model, &iter,
172 DRIVE_COL, &iter_drive,
173 -1);
174
175 if (drive == iter_drive) {
176 if (iter_drive)
177 g_object_unref (iter_drive);
178
179 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (selector), &iter);
180 brasero_drive_selection_set_current_drive (selector, &iter);
181 result = TRUE;
182 break;
183 }
184
185 g_object_unref (iter_drive);
186 } while (gtk_tree_model_iter_next (model, &iter));
187
188 return result;
189}
190
191/**
192 * brasero_drive_selection_get_active:
193 * @selector: a #BraseroDriveSelection
194 *
195 * Gets the active drive.
196 *
197 * Return value: a #BraseroDrive or NULL. Unref when it is not needed anymore.
198 **/
199BraseroDrive *
200brasero_drive_selection_get_active (BraseroDriveSelection *selector)
201{
202 BraseroDriveSelectionPrivate *priv;
203
204 g_return_val_if_fail (selector != NULL, NULL);
205 g_return_val_if_fail (BRASERO_IS_DRIVE_SELECTION (selector), NULL);
206
207 priv = BRASERO_DRIVE_SELECTION_PRIVATE (selector);
208 if (!priv->active)
209 return NULL;
210
211 return g_object_ref (priv->active);
212}
213
214static void
215brasero_drive_selection_update_no_disc_entry (BraseroDriveSelection *self,
216 GtkTreeModel *model,
217 GtkTreeIter *iter)
218{
219 GIcon *icon;
220
221 icon = g_themed_icon_new_with_default_fallbacks ("drive-optical");
222
223 /* FIXME: that needs a string */
224 gtk_list_store_set (GTK_LIST_STORE (model), iter,
225 NAME_COL, NULL,
226 ICON_COL, NULL,
227 -1);
228
229 g_object_unref (icon);
230
231 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (self), iter);
232 brasero_drive_selection_set_current_drive (self, iter);
233}
234
235static void
236brasero_drive_selection_add_no_disc_entry (BraseroDriveSelection *self)
237{
238 GtkTreeIter iter;
239 GtkTreeModel *model;
240
241 /* Nothing's available. Say it. Two cases here, either we're
242 * still probing drives or there isn't actually any available
243 * drive. */
244 model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
245 gtk_list_store_append (GTK_LIST_STORE (model), &iter);
246 brasero_drive_selection_update_no_disc_entry (self, model, &iter);
247}
248
249/**
250 * brasero_drive_selection_show_type:
251 * @selector: a #BraseroDriveSelection
252 * @type: a #BraseroDriveType
253 *
254 * Filters and displays drive corresponding to @type.
255 *
256 **/
257void
258brasero_drive_selection_show_type (BraseroDriveSelection *selector,
259 BraseroDriveType type)
260{
261 BraseroDriveSelectionPrivate *priv;
262 BraseroMediumMonitor *monitor;
263 GtkTreeModel *model;
264 GtkTreeIter iter;
265 GSList *list;
266 GSList *item;
267
268 g_return_if_fail (selector != NULL);
269 g_return_if_fail (BRASERO_IS_DRIVE_SELECTION (selector));
270
271 priv = BRASERO_DRIVE_SELECTION_PRIVATE (selector);
272
273 priv->type = type;
274
275 monitor = brasero_medium_monitor_get_default ();
276 list = brasero_medium_monitor_get_drives (monitor, type);
277 g_object_unref (monitor);
278
279 model = gtk_combo_box_get_model (GTK_COMBO_BOX (selector));
280 if (gtk_tree_model_get_iter_first (model, &iter)) {
281 /* First filter */
282 do {
283 GSList *node;
284 BraseroDrive *drive;
285
286 gtk_tree_model_get (model, &iter,
287 DRIVE_COL, &drive,
288 -1);
289
290 if (!drive) {
291 /* That's the dummy line saying there isn't any
292 * available drive for whatever action it is */
293 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
294 break;
295 }
296
297 node = g_slist_find (list, drive);
298 g_object_unref (drive);
299
300 if (!node) {
301 if (gtk_list_store_remove (GTK_LIST_STORE (model), &iter))
302 continue;
303
304 /* no more iter in the tree get out */
305 break;
306 }
307
308 g_object_unref (node->data);
309 list = g_slist_delete_link (list, node);
310 } while (gtk_tree_model_iter_next (model, &iter));
311 }
312
313 if (list) {
314 /* add remaining drive */
315 for (item = list; item; item = item->next) {
316 gchar *drive_name;
317 BraseroDrive *drive;
318 GIcon *drive_icon = NULL;
319
320 drive = item->data;
321
322 drive_name = brasero_drive_get_display_name (drive);
323
324 if (!brasero_drive_is_fake (drive)) {
325 GDrive *gdrive;
326
327 gdrive = brasero_drive_get_gdrive (drive);
328 if (gdrive) {
329 drive_icon = g_drive_get_icon (gdrive);
330 g_object_unref (gdrive);
331 }
332 else
333 drive_icon = g_themed_icon_new_with_default_fallbacks ("drive-optical");
334 }
335 else
336 drive_icon = g_themed_icon_new_with_default_fallbacks ("iso-image-new");
337
338 gtk_list_store_append (GTK_LIST_STORE (model), &iter);
339 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
340 DRIVE_COL, drive,
341 NAME_COL, drive_name?drive_name:_("Unnamed CD/DVD Drive"),
342 ICON_COL, drive_icon,
343 -1);
344 g_free (drive_name);
345 g_object_unref (drive_icon);
346 }
347 g_slist_foreach (list, (GFunc) g_object_unref, NULL);
348 g_slist_free (list);
349 }
350
351 if (!gtk_tree_model_get_iter_first (model, &iter)) {
352 brasero_drive_selection_add_no_disc_entry (selector);
353 return;
354 }
355
356 gtk_widget_set_sensitive (GTK_WIDGET (selector), TRUE);
357 if (gtk_combo_box_get_active (GTK_COMBO_BOX (selector)) == -1) {
358 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (selector), &iter);
359 brasero_drive_selection_set_current_drive (selector, &iter);
360 }
361}
362
363static void
364brasero_drive_selection_drive_added_cb (BraseroMediumMonitor *monitor,
365 BraseroDrive *drive,
366 BraseroDriveSelection *self)
367{
368 BraseroDriveSelectionPrivate *priv;
369 gchar *drive_name = NULL;
370 gboolean add = FALSE;
371 GtkTreeModel *model;
372 GIcon *drive_icon;
373 GtkTreeIter iter;
374
375 priv = BRASERO_DRIVE_SELECTION_PRIVATE (self);
376
377 if ((priv->type & BRASERO_DRIVE_TYPE_WRITER)
378 && (brasero_drive_can_write (drive)))
379 add = TRUE;
380 else if (priv->type & BRASERO_DRIVE_TYPE_READER)
381 add = TRUE;
382
383 model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
384
385 if (!add) {
386 /* Try to get the first iter (it shouldn't fail) */
387 if (!gtk_tree_model_get_iter_first (model, &iter)) {
388 brasero_drive_selection_add_no_disc_entry (self);
389 return;
390 }
391
392 /* See if that's a real drive or not; if so, return. */
393 drive = NULL;
394 gtk_tree_model_get (model, &iter,
395 DRIVE_COL, &drive,
396 -1);
397 if (drive)
398 return;
399
400 brasero_drive_selection_update_no_disc_entry (self, model, &iter);
401 return;
402 }
403
404 /* remove warning message */
405 if (gtk_tree_model_get_iter_first (model, &iter)) {
406 BraseroDrive *tmp;
407
408 gtk_tree_model_get (model, &iter,
409 DRIVE_COL, &tmp,
410 -1);
411 if (!tmp)
412 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
413 else
414 g_object_unref (tmp);
415 }
416
417 if (!brasero_drive_is_fake (drive)) {
418 GDrive *gdrive;
419
420 gdrive = brasero_drive_get_gdrive (drive);
421 if (gdrive) {
422 drive_icon = g_drive_get_icon (gdrive);
423 g_object_unref (gdrive);
424 }
425 else
426 drive_icon = g_themed_icon_new_with_default_fallbacks ("drive-optical");
427 }
428 else
429 drive_icon = g_themed_icon_new_with_default_fallbacks ("iso-image-new");
430
431 drive_name = brasero_drive_get_display_name (drive);
432
433 gtk_list_store_append (GTK_LIST_STORE (model), &iter);
434 gtk_list_store_set (GTK_LIST_STORE (model), &iter,
435 DRIVE_COL, drive,
436 NAME_COL, drive_name?drive_name:_("Unnamed CD/DVD Drive"),
437 ICON_COL, drive_icon,
438 -1);
439 g_free (drive_name);
440 g_object_unref (drive_icon);
441
442 gtk_widget_set_sensitive (GTK_WIDGET (self), TRUE);
443 if (gtk_combo_box_get_active (GTK_COMBO_BOX (self)) == -1) {
444 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (self), &iter);
445 brasero_drive_selection_set_current_drive (self, &iter);
446 }
447}
448
449static void
450brasero_drive_selection_drive_removed_cb (BraseroMediumMonitor *monitor,
451 BraseroDrive *drive,
452 BraseroDriveSelection *self)
453{
454 GtkTreeModel *model;
455 GtkTreeIter iter;
456
457 model = gtk_combo_box_get_model (GTK_COMBO_BOX (self));
458 if (!gtk_tree_model_get_iter_first (model, &iter))
459 return;
460
461 do {
462 BraseroDrive *iter_drive;
463
464 gtk_tree_model_get (model, &iter,
465 DRIVE_COL, &iter_drive,
466 -1);
467
468 if (drive == iter_drive) {
469 g_object_unref (iter_drive);
470 gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
471 break;
472 }
473
474 /* Could be NULL if a message "there is no drive ..." is on */
475 if (iter_drive)
476 g_object_unref (iter_drive);
477
478 } while (gtk_tree_model_iter_next (model, &iter));
479
480 if (!gtk_tree_model_get_iter_first (model, &iter)) {
481 brasero_drive_selection_add_no_disc_entry (self);
482 return;
483 }
484
485 if (gtk_combo_box_get_active (GTK_COMBO_BOX (self)) == -1) {
486 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (self), &iter);
487 brasero_drive_selection_set_current_drive (self, &iter);
488 }
489}
490
491static void
492brasero_drive_selection_init (BraseroDriveSelection *object)
493{
494 GtkListStore *model;
495 GtkCellRenderer *renderer;
496 BraseroMediumMonitor *monitor;
497 BraseroDriveSelectionPrivate *priv;
498
499 priv = BRASERO_DRIVE_SELECTION_PRIVATE (object);
500
501 monitor = brasero_medium_monitor_get_default ();
502 priv->added_sig = g_signal_connect (monitor,
503 "drive-added",
504 G_CALLBACK (brasero_drive_selection_drive_added_cb),
505 object);
506 priv->removed_sig = g_signal_connect (monitor,
507 "drive-removed",
508 G_CALLBACK (brasero_drive_selection_drive_removed_cb),
509 object);
510
511 g_object_unref (monitor);
512
513 /* get the list and fill the model */
514 model = gtk_list_store_new (NUM_COL,
515 G_TYPE_OBJECT,
516 G_TYPE_STRING,
517 G_TYPE_ICON);
518
519 gtk_combo_box_set_model (GTK_COMBO_BOX (object), GTK_TREE_MODEL (model));
520 g_object_unref (model);
521
522 renderer = gtk_cell_renderer_pixbuf_new ();
523 g_object_set (renderer, "follow-state", TRUE, NULL);
524 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (object), renderer, FALSE);
525 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), renderer,
526 "gicon", ICON_COL,
527 NULL);
528
529 renderer = gtk_cell_renderer_text_new ();
530 g_object_set (renderer, "xpad", 8, NULL);
531 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (object), renderer, TRUE);
532 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), renderer,
533 "markup", NAME_COL,
534 NULL);
535
536 brasero_drive_selection_show_type (BRASERO_DRIVE_SELECTION (object),
537 BRASERO_DRIVE_TYPE_ALL_BUT_FILE);
538
539}
540
541static void
542brasero_drive_selection_finalize (GObject *object)
543{
544 BraseroDriveSelectionPrivate *priv;
545 BraseroMediumMonitor *monitor;
546
547 priv = BRASERO_DRIVE_SELECTION_PRIVATE (object);
548
549 monitor = brasero_medium_monitor_get_default ();
550
551 g_signal_handler_disconnect (monitor, priv->added_sig);
552 g_signal_handler_disconnect (monitor, priv->removed_sig);
553 priv->removed_sig = 0;
554 priv->added_sig = 0;
555
556 g_object_unref (monitor);
557
558 G_OBJECT_CLASS (brasero_drive_selection_parent_class)->finalize (object);
559 }
560
561static void
562brasero_drive_selection_set_property (GObject *object,
563 guint prop_id,
564 const GValue *value,
565 GParamSpec *pspec)
566{
567 g_return_if_fail (BRASERO_IS_DRIVE_SELECTION (object));
568
569 switch (prop_id)
570 {
571 case PROP_DRIVE_TYPE:
572 brasero_drive_selection_show_type (BRASERO_DRIVE_SELECTION (object),
573 g_value_get_uint (value));
574 break;
575 case PROP_DRIVE:
576 brasero_drive_selection_set_active (BRASERO_DRIVE_SELECTION (object),
577 BRASERO_DRIVE (g_value_get_object (value)));
578 break;
579 default:
580 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
581 break;
582 }
583 }
584
585static void
586brasero_drive_selection_get_property (GObject *object,
587 guint prop_id,
588 GValue *value,
589 GParamSpec *pspec)
590{
591 BraseroDriveSelectionPrivate *priv;
592
593 g_return_if_fail (BRASERO_IS_DRIVE_SELECTION (object));
594
595 priv = BRASERO_DRIVE_SELECTION_PRIVATE (object);
596
597 switch (prop_id)
598 {
599 case PROP_DRIVE_TYPE:
600 g_value_set_uint (value, priv->type);
601 break;
602 case PROP_DRIVE:
603 g_value_set_object (value, brasero_drive_selection_get_active (BRASERO_DRIVE_SELECTION (object)));
604 break;
605 default:
606 G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
607 break;
608 }
609}
610
611static void
612brasero_drive_selection_class_init (BraseroDriveSelectionClass *klass)
613{
614 GObjectClass* object_class = G_OBJECT_CLASS (klass);
615 GtkComboBoxClass *combo_class = GTK_COMBO_BOX_CLASS (klass);
616
617 g_type_class_add_private (klass, sizeof (BraseroDriveSelectionPrivate));
618
619 object_class->finalize = brasero_drive_selection_finalize;
620 object_class->set_property = brasero_drive_selection_set_property;
621 object_class->get_property = brasero_drive_selection_get_property;
622
623 combo_class->changed = brasero_drive_selection_changed;
624
625 g_object_class_install_property (object_class, PROP_DRIVE,
626 g_param_spec_object ("Drive",
627 "Selected drive",
628 "The currently selected drive",
629 BRASERO_TYPE_DRIVE, G_PARAM_READWRITE));
630
631 g_object_class_install_property (object_class, PROP_DRIVE_TYPE,
632 g_param_spec_uint ("drive-type",
633 "The type of drives",
634 "The type of drives displayed",
635 0, BRASERO_DRIVE_TYPE_ALL,
636 BRASERO_DRIVE_TYPE_ALL_BUT_FILE,
637 G_PARAM_READWRITE));
638 /**
639 * BraseroDriveSelection::drive-changed:
640 * @selector: the object which received the signal
641 * @drive: the drive which is now selected
642 *
643 * This signal gets emitted when the selected medium has changed
644 *
645 */
646 brasero_drive_selection_signals [CHANGED_SIGNAL] =
647 g_signal_new ("drive_changed",
648 BRASERO_TYPE_DRIVE_SELECTION,
649 G_SIGNAL_RUN_FIRST|G_SIGNAL_ACTION|G_SIGNAL_NO_RECURSE,
650 G_STRUCT_OFFSET (BraseroDriveSelectionClass, drive_changed),
651 NULL,
652 NULL,
653 g_cclosure_marshal_VOID__OBJECT,
654 G_TYPE_NONE,
655 1,
656 BRASERO_TYPE_DRIVE);
657}
658
659/**
660 * brasero_drive_selection_new:
661 *
662 * Creates a new #BraseroDriveSelection object
663 *
664 * Return value: a #GtkWidget. Unref when it is not needed anymore.
665 **/
666
667GtkWidget *
668brasero_drive_selection_new (void)
669{
670 return g_object_new (BRASERO_TYPE_DRIVE_SELECTION, NULL);
671}
0672
=== modified file '.pc/applied-patches'
--- .pc/applied-patches 2013-06-05 21:22:12 +0000
+++ .pc/applied-patches 2013-10-09 02:24:44 +0000
@@ -1,5 +1,6 @@
101_grafted_folders.patch101_grafted_folders.patch
203_cue-invalid-frame-75.patch203_cue-invalid-frame-75.patch
304_tracker-0.16.patch304_tracker-0.16.patch
405_populate-tree-model-after-construction.patch
4012_appindicator.patch5012_appindicator.patch
5013_unity_launcher_progress.patch6013_unity_launcher_progress.patch
67
=== modified file 'debian/changelog'
--- debian/changelog 2013-06-05 21:44:05 +0000
+++ debian/changelog 2013-10-09 02:24:44 +0000
@@ -1,3 +1,11 @@
1brasero (3.8.0-1ubuntu3) UNRELEASED; urgency=low
2
3 * debian/patches/05_populate-tree-model-after-construction.patch:
4 backport upstream commit to fix drive selection not showing
5 up correctly (LP: #1237169).
6
7 -- Phillip Susi <psusi@ubuntu.com> Tue, 08 Oct 2013 21:51:54 -0400
8
1brasero (3.8.0-1ubuntu2) saucy; urgency=low9brasero (3.8.0-1ubuntu2) saucy; urgency=low
210
3 * Fix configure flags from last upload 11 * Fix configure flags from last upload
412
=== added file 'debian/patches/05_populate-tree-model-after-construction.patch'
--- debian/patches/05_populate-tree-model-after-construction.patch 1970-01-01 00:00:00 +0000
+++ debian/patches/05_populate-tree-model-after-construction.patch 2013-10-09 02:24:44 +0000
@@ -0,0 +1,42 @@
1From 4cdec3b2aa5e726714d34fff003480403ae6ae77 Mon Sep 17 00:00:00 2001
2From: Jonh Wendell <jonh.wendell@intel.com>
3Date: Wed, 19 Jun 2013 15:19:29 +0000
4Subject: brasero-drive-selection: populate the tree model after construction
5
6Having it in the init was leading to an issue in the draw.
7Postpone it to constructed phase fixes it.
8---
9diff --git a/libbrasero-media/brasero-drive-selection.c b/libbrasero-media/brasero-drive-selection.c
10index 0e4bad6..7aa8275 100644
11--- a/libbrasero-media/brasero-drive-selection.c
12+++ b/libbrasero-media/brasero-drive-selection.c
13@@ -532,12 +532,17 @@ brasero_drive_selection_init (BraseroDriveSelection *object)
14 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), renderer,
15 "markup", NAME_COL,
16 NULL);
17+}
18+
19+static void
20+brasero_drive_selection_constructed (GObject *object)
21+{
22+ G_OBJECT_CLASS (brasero_drive_selection_parent_class)->constructed (object);
23
24 brasero_drive_selection_show_type (BRASERO_DRIVE_SELECTION (object),
25 BRASERO_DRIVE_TYPE_ALL_BUT_FILE);
26-
27 }
28-
29+
30 static void
31 brasero_drive_selection_finalize (GObject *object)
32 {
33@@ -619,6 +624,7 @@ brasero_drive_selection_class_init (BraseroDriveSelectionClass *klass)
34 object_class->finalize = brasero_drive_selection_finalize;
35 object_class->set_property = brasero_drive_selection_set_property;
36 object_class->get_property = brasero_drive_selection_get_property;
37+ object_class->constructed = brasero_drive_selection_constructed;
38
39 combo_class->changed = brasero_drive_selection_changed;
40
41--
42cgit v0.9.2
043
=== modified file 'debian/patches/series'
--- debian/patches/series 2013-06-05 21:22:12 +0000
+++ debian/patches/series 2013-10-09 02:24:44 +0000
@@ -1,5 +1,6 @@
101_grafted_folders.patch101_grafted_folders.patch
203_cue-invalid-frame-75.patch203_cue-invalid-frame-75.patch
304_tracker-0.16.patch304_tracker-0.16.patch
405_populate-tree-model-after-construction.patch
4012_appindicator.patch5012_appindicator.patch
5013_unity_launcher_progress.patch6013_unity_launcher_progress.patch
67
=== modified file 'libbrasero-media/brasero-drive-selection.c'
--- libbrasero-media/brasero-drive-selection.c 2011-05-18 17:53:39 +0000
+++ libbrasero-media/brasero-drive-selection.c 2013-10-09 02:24:44 +0000
@@ -532,12 +532,17 @@
532 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), renderer,532 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (object), renderer,
533 "markup", NAME_COL,533 "markup", NAME_COL,
534 NULL);534 NULL);
535}
536
537static void
538brasero_drive_selection_constructed (GObject *object)
539{
540 G_OBJECT_CLASS (brasero_drive_selection_parent_class)->constructed (object);
535541
536 brasero_drive_selection_show_type (BRASERO_DRIVE_SELECTION (object),542 brasero_drive_selection_show_type (BRASERO_DRIVE_SELECTION (object),
537 BRASERO_DRIVE_TYPE_ALL_BUT_FILE);543 BRASERO_DRIVE_TYPE_ALL_BUT_FILE);
538
539}544}
540 545
541static void546static void
542brasero_drive_selection_finalize (GObject *object)547brasero_drive_selection_finalize (GObject *object)
543{548{
@@ -619,6 +624,7 @@
619 object_class->finalize = brasero_drive_selection_finalize;624 object_class->finalize = brasero_drive_selection_finalize;
620 object_class->set_property = brasero_drive_selection_set_property;625 object_class->set_property = brasero_drive_selection_set_property;
621 object_class->get_property = brasero_drive_selection_get_property;626 object_class->get_property = brasero_drive_selection_get_property;
627 object_class->constructed = brasero_drive_selection_constructed;
622 628
623 combo_class->changed = brasero_drive_selection_changed;629 combo_class->changed = brasero_drive_selection_changed;
624630

Subscribers

People subscribed via source and target branches

to all changes: