brasero r682 - in trunk: . src



Author: philippr
Date: Sat Mar 15 09:57:00 2008
New Revision: 682
URL: http://svn.gnome.org/viewvc/brasero?rev=682&view=rev

Log:
	Fixed a few bugs (problem with data project loading, some warnings, properties button not shown)
	Removed video option and enable UDF and VIDEO burning automatically whenever there is a DVD in drive and all necessary files

	* src/brasero-data-project.c: (brasero_data_project_add_node_real):
	* src/brasero-dest-selection.c:
	(brasero_dest_selection_save_drive_properties),
	(brasero_dest_selection_set_drive_properties),
	(brasero_dest_selection_init):
	* src/brasero-disc-option-dialog.c:
	(brasero_disc_option_dialog_load_multi_state),
	(brasero_disc_option_dialog_get_default_label),
	(brasero_disc_option_dialog_update_multi),
	(brasero_disc_option_dialog_caps_changed),
	(brasero_disc_option_dialog_output_changed),
	(brasero_disc_option_dialog_set_multi),
	(brasero_disc_option_dialog_multi_widget),
	(brasero_disc_option_dialog_add_data_options):
	* src/burn-drive.c: (brasero_drive_is_door_open),
	(brasero_drive_lock), (brasero_drive_unlock),
	(brasero_drive_get_display_name):
	* src/burn-session.c: (brasero_burn_session_dest_media_removed):
	* src/burn-volume-obj.c: (brasero_volume_new):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-project.c
   trunk/src/brasero-dest-selection.c
   trunk/src/brasero-disc-option-dialog.c
   trunk/src/burn-drive.c
   trunk/src/burn-session.c
   trunk/src/burn-volume-obj.c

Modified: trunk/src/brasero-data-project.c
==============================================================================
--- trunk/src/brasero-data-project.c	(original)
+++ trunk/src/brasero-data-project.c	Sat Mar 15 09:57:00 2008
@@ -1401,11 +1401,6 @@
 		graft = brasero_data_project_uri_ensure_graft (self, uri);
 		brasero_file_node_graft (node, graft);
 	}
-	else if (node->is_grafted) {
-		/* we were asked to graft this node; do it */
-		graft = brasero_data_project_uri_ensure_graft (self, uri);
-		brasero_file_node_graft (node, graft);
-	}
 	else {
 		gchar *parent_uri;
 
@@ -1431,6 +1426,11 @@
 			 * updated when setting info on node. */
 			g_free (parent_uri);
 		}
+		else {
+			/* its father is probably an fake empty directory */
+			graft = brasero_data_project_uri_add_graft (self, uri);
+			brasero_file_node_graft (node, graft);
+		}
 	}
 
 	/* check joliet compatibility; do it after node was created. */

Modified: trunk/src/brasero-dest-selection.c
==============================================================================
--- trunk/src/brasero-dest-selection.c	(original)
+++ trunk/src/brasero-dest-selection.c	Sat Mar 15 09:57:00 2008
@@ -117,10 +117,20 @@
 		speed = BRASERO_RATE_TO_SPEED_CD (rate);
 
 	key = brasero_burn_session_get_config_key (priv->session, "speed");
+	if (!key) {
+		g_object_unref (client);
+		return;
+	}
+
 	gconf_client_set_int (client, key, speed, NULL);
 	g_free (key);
 
 	key = brasero_burn_session_get_config_key (priv->session, "flags");
+	if (!key) {
+		g_object_unref (client);
+		return;
+	}
+
 	flags = gconf_client_get_int (client, key, NULL);
 	flags &= ~BRASERO_DRIVE_PROPERTIES_FLAGS;
 	flags |= (brasero_burn_session_get_flags (priv->session) & BRASERO_DRIVE_PROPERTIES_FLAGS);
@@ -855,6 +865,11 @@
 	client = gconf_client_get_default ();
 
 	key = brasero_burn_session_get_config_key (priv->session, "speed");
+	if (!key) {
+		g_object_unref (client);
+		return;
+	}
+
 	value = gconf_client_get_without_default (client, key, NULL);
 	g_free (key);
 
@@ -876,6 +891,11 @@
 	 * Indeed two flags could be mutually exclusive and then adding both at
 	 * the same would make the session unusable (MULTI and BLANK_BEFORE_WRITE) */
 	key = brasero_burn_session_get_config_key (priv->session, "flags");
+	if (!key) {
+		g_object_unref (client);
+		return;
+	}
+
 	value = gconf_client_get_without_default (client, key, NULL);
 	g_free (key);
 
@@ -1307,6 +1327,7 @@
 					   object);
 
 	priv->button = gtk_button_new_from_stock (GTK_STOCK_PROPERTIES);
+	gtk_widget_show (priv->button);
 	gtk_widget_set_tooltip_text (priv->button, _("Configure some options for the recording"));
 	g_signal_connect (G_OBJECT (priv->button),
 			  "clicked",

Modified: trunk/src/brasero-disc-option-dialog.c
==============================================================================
--- trunk/src/brasero-disc-option-dialog.c	(original)
+++ trunk/src/brasero-disc-option-dialog.c	Sat Mar 15 09:57:00 2008
@@ -62,7 +62,6 @@
 	guint caps_sig;
 	guint output_sig;
 
-	GtkWidget *video_toggle;
 	GtkWidget *joliet_toggle;
 	GtkWidget *multi_toggle;
 
@@ -118,8 +117,10 @@
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
 	/* That's only provided multi is not compulsory or unsupported */
-
 	key = brasero_burn_session_get_config_key (priv->session, "multi");
+	if (!key)
+		return;
+
 	client = gconf_client_get_default ();
 	multi_on = gconf_client_get_int (client, key, NULL);
 	g_object_unref (client);
@@ -146,7 +147,6 @@
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
 	brasero_burn_session_get_input_type (priv->session, &source);
-
 	drive = brasero_drive_selection_get_drive (BRASERO_DRIVE_SELECTION (priv->selection));
 
 	t = time (NULL);
@@ -165,7 +165,9 @@
 	else if (source.type == BRASERO_TRACK_TYPE_AUDIO)
 		title_str = g_strdup_printf (_("Audio disc (%s)"), buffer);
 
-	g_object_unref (drive);
+	if (drive)
+		g_object_unref (drive);
+
 	return title_str;
 }
 
@@ -254,70 +256,10 @@
 	return TRUE;
 }
 
-static gboolean
-brasero_disc_option_dialog_update_video (BraseroDiscOptionDialog *dialog)
-{
-	BraseroDiscOptionDialogPrivate *priv;
-	BraseroBurnResult result;
-	BraseroTrackType source;
-
-	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
-	if (!priv->video_toggle)
-		return FALSE;
-
-	/* the library must have the proper support and multi mustn't be on */
-	if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->multi_toggle)))
-		goto turn_off;
-
-	brasero_burn_session_get_input_type (priv->session, &source);
-	source.subtype.fs_type |= BRASERO_IMAGE_FS_VIDEO;
-	result = brasero_burn_caps_is_input_supported (priv->caps,
-						       priv->session,
-						       &source);
-
-	if (result != BRASERO_BURN_OK)
-		goto turn_off;
-
-	if (GTK_WIDGET_IS_SENSITIVE (priv->video_toggle))
-		return FALSE;
-
-	gtk_widget_set_sensitive (priv->video_toggle, TRUE);
-
-	if (!priv->video_saved)
-		return TRUE;
-
-	brasero_burn_session_set_input_type (priv->session, &source);
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->video_toggle), TRUE);
-
-	/* multi and video shouldn't be on at the same time
-	 * NOTE: in this case multi_toggle cannot be on since we checked
-	 * its state earlier on */
-	priv->multi_saved = FALSE;
-	gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
-
-	return TRUE;
-
-turn_off:
-
-	if (!GTK_WIDGET_IS_SENSITIVE (priv->video_toggle))
-		return FALSE;
-
-	priv->video_saved = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->video_toggle));
-	if (priv->video_saved) {
-		source.subtype.fs_type &= ~BRASERO_IMAGE_FS_VIDEO;
-		brasero_burn_session_set_input_type (priv->session, &source);
-
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->video_toggle), FALSE);
-	}
-
-	gtk_widget_set_sensitive (priv->video_toggle, FALSE);
-	return TRUE;
-}
-
 static void
 brasero_disc_option_dialog_update_multi (BraseroDiscOptionDialog *dialog)
 {
+	BraseroTrackType input;
 	BraseroDiscOptionDialogPrivate *priv;
 	BraseroBurnFlag supported = BRASERO_BURN_FLAG_NONE;
 	BraseroBurnFlag compulsory = BRASERO_BURN_FLAG_NONE;
@@ -327,6 +269,14 @@
 	if (!priv->multi_toggle)
 		return;
 
+	brasero_burn_session_get_input_type (priv->session, &input);
+	if (input.type == BRASERO_TRACK_TYPE_DATA
+	&& (input.subtype.fs_type & BRASERO_IMAGE_FS_VIDEO)
+	&& (brasero_burn_session_get_dest_media (priv->session) & BRASERO_MEDIUM_DVD)) {
+		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
+		goto end;
+	}
+
 	/* Wipe out some flags before trying to see if MULTI is supported:
 	 * DAO/BLANK_BEFORE_WRITE don't really get along well with MULTI */
 	brasero_burn_session_remove_flag (priv->session,
@@ -358,20 +308,6 @@
 		goto end;
 	}
 
-	/* to improve video DVD compatibility we don't allow to leave a disc
-	 * open and have a video DVD created */
-	if (priv->video_toggle
-	&&  gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->video_toggle))) {
-		if (GTK_WIDGET_IS_SENSITIVE (priv->multi_toggle))
-			priv->multi_saved = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->multi_toggle));
-
-		brasero_burn_session_remove_flag (priv->session, BRASERO_BURN_FLAG_MULTI);
-
-		gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->multi_toggle), FALSE);
-		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
-		goto end;
-	}
-
 	/* only load preferences if it is supported and not compulsory */
 	gtk_widget_set_sensitive (priv->multi_toggle, TRUE);
 	brasero_disc_option_dialog_load_multi_state (dialog);
@@ -417,8 +353,6 @@
 	brasero_disc_option_dialog_update_multi (dialog);
 	/* update the joliet button */
 	brasero_disc_option_dialog_update_joliet (dialog);
-	/* update the video button */
-	brasero_disc_option_dialog_update_video (dialog);
 }
 
 static void
@@ -434,8 +368,6 @@
 	brasero_disc_option_dialog_update_multi (dialog);
 	/* update the joliet button */
 	brasero_disc_option_dialog_update_joliet (dialog);
-	/* update the video button */
-	brasero_disc_option_dialog_update_video (dialog);
 
 	/* see if we need to update the label */
 	if (!priv->label_modified)
@@ -448,36 +380,6 @@
  */
 
 static void
-brasero_disc_option_dialog_set_video (BraseroDiscOptionDialog *dialog)
-{
-	BraseroDiscOptionDialogPrivate *priv;
-	BraseroTrackType source;
-
-	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
-	if (!priv->video_toggle)
-		return;
-
-	/* NOTE: we don't check for the sensitive property since when
-	 * something is compulsory the button is active but insensitive
-	 */
-	brasero_burn_session_get_input_type (priv->session, &source);
-	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->video_toggle))) {
-		source.subtype.fs_type &= ~BRASERO_IMAGE_FS_VIDEO;
-
-		brasero_disc_option_dialog_update_multi (dialog);
-	}
-	else {
-		source.subtype.fs_type |= BRASERO_IMAGE_FS_VIDEO;
-
-		priv->multi_saved = FALSE;
-		gtk_widget_set_sensitive (priv->multi_toggle, FALSE);
-	}
-
-	brasero_burn_session_set_input_type (priv->session, &source);
-}
-
-static void
 brasero_disc_option_dialog_set_joliet (BraseroDiscOptionDialog *dialog)
 {
 	BraseroDiscOptionDialogPrivate *priv;
@@ -510,24 +412,12 @@
 
 	if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->multi_toggle))) {
 		brasero_burn_session_remove_flag (priv->session, BRASERO_BURN_FLAG_MULTI);
-		brasero_disc_option_dialog_update_video (dialog);
 		brasero_disc_option_dialog_save_multi_state (dialog);
 		return;
 	}
 
 	brasero_burn_session_add_flag (priv->session, BRASERO_BURN_FLAG_MULTI);
 	brasero_disc_option_dialog_save_multi_state (dialog);
-
-	if (!priv->video_toggle)
-		return;
-
-	/* to improve video DVD compatibility we don't allow to leave a disc
-	 * open and have a video DVD created.
-	 * NOTE: video and multi buttons are antithetic so if the user pressed
-	 * this one that means that video wasn't active so no need to set video
-	 * to FALSE*/
-	priv->video_saved = FALSE;
-	gtk_widget_set_sensitive (priv->video_toggle, FALSE);
 }
 
 static void
@@ -538,13 +428,6 @@
 }
 
 static void
-brasero_disc_option_dialog_video_toggled (GtkToggleButton *video_toggle,
-					  BraseroDiscOptionDialog *dialog)
-{
-	brasero_disc_option_dialog_set_video (dialog);
-}
-
-static void
 brasero_disc_option_dialog_joliet_toggled_cb (GtkToggleButton *toggle,
 					      BraseroDiscOptionDialog *dialog)
 {
@@ -637,35 +520,6 @@
 }
 
 static gboolean
-brasero_disc_option_dialog_video_widget (BraseroDiscOptionDialog *dialog)
-{
-	BraseroDiscOptionDialogPrivate *priv;
-	BraseroTrackType type;
-
-	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
-
-	/* Two conditions to create this widget:
-	 * the track must have the necessary files
-	 * the library must have the proper plugin */
-	brasero_burn_session_get_input_type (priv->session, &type);
-	if (!(type.type & BRASERO_IMAGE_FS_VIDEO))
-		return FALSE;
-
-	priv->video_toggle = gtk_check_button_new_with_mnemonic (_("Create a vid_eo DVD"));
-	g_signal_connect (priv->video_toggle,
-			  "toggled",
-			  G_CALLBACK (brasero_disc_option_dialog_video_toggled),
-			  dialog);
-	gtk_widget_set_tooltip_text (priv->video_toggle,
-			      _("Create a video DVD that can be played by all DVD readers"));
-
-	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (priv->video_toggle), TRUE);
-	brasero_disc_option_dialog_update_video (dialog);
-
-	return TRUE;
-}
-
-static gboolean
 brasero_disc_option_dialog_joliet_widget (BraseroDiscOptionDialog *dialog)
 {
 	BraseroDiscOptionDialogPrivate *priv;
@@ -702,6 +556,7 @@
 
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 	priv->multi_toggle = gtk_check_button_new_with_mnemonic (_("Leave the disc _open to add other files later"));
+
 	g_signal_connect (priv->multi_toggle,
 			  "toggled",
 			  G_CALLBACK (brasero_disc_option_dialog_multi_toggled),
@@ -718,12 +573,10 @@
 {
 	BraseroDiscOptionDialogPrivate *priv;
 	GtkWidget *widget = NULL;
-	BraseroTrackType source;
 	GtkWidget *options;
 
 	priv = BRASERO_DISC_OPTION_DIALOG_PRIVATE (dialog);
 
-	brasero_burn_session_get_input_type (priv->session, &source);
 
 	/* create the options */
 	widget = gtk_vbox_new (FALSE, 0);
@@ -739,13 +592,9 @@
 	/* general options */
 	brasero_disc_option_dialog_joliet_widget (dialog);
 
-	/* video toggle */
-	brasero_disc_option_dialog_video_widget (dialog);
-
 	options = brasero_utils_pack_properties (_("<b>Disc options</b>"),
 						 priv->multi_toggle,
 						 priv->joliet_toggle,
-						 priv->video_toggle,
 						 NULL);
 	gtk_box_pack_start (GTK_BOX (widget), options, FALSE, FALSE, 0);
 

Modified: trunk/src/burn-drive.c
==============================================================================
--- trunk/src/burn-drive.c	(original)
+++ trunk/src/burn-drive.c	Sat Mar 15 09:57:00 2008
@@ -173,6 +173,9 @@
 
 	priv = BRASERO_DRIVE_PRIVATE (self);
 
+	if (!priv->udi)
+		return FALSE;
+
 	handle = brasero_device_handle_open (priv->path, NULL);
 	if (!handle)
 		return FALSE;
@@ -199,6 +202,9 @@
 
 	priv = BRASERO_DRIVE_PRIVATE (self);
 
+	if (!priv->udi)
+		return FALSE;
+
 	ctx = brasero_drive_get_hal_context ();
 
 	dbus_error_init (&error);
@@ -230,6 +236,9 @@
 
 	priv = BRASERO_DRIVE_PRIVATE (self);
 
+	if (!priv->udi)
+		return FALSE;
+
 	ctx = brasero_drive_get_hal_context ();
 
 	dbus_error_init (&error);
@@ -251,6 +260,9 @@
 
 	priv = BRASERO_DRIVE_PRIVATE (self);
 
+	if (!priv->udi)
+		return g_strdup (_("File Image"));;
+
 	ctx = brasero_drive_get_hal_context ();
 	return libhal_device_get_property_string (ctx,
 						  priv->udi,

Modified: trunk/src/burn-session.c
==============================================================================
--- trunk/src/burn-session.c	(original)
+++ trunk/src/burn-session.c	Sat Mar 15 09:57:00 2008
@@ -368,6 +368,7 @@
 					 BraseroMedium *medium,
 					 BraseroBurnSession *self)
 {
+	
 	g_signal_emit (self,
 		       brasero_burn_session_signals [OUTPUT_CHANGED_SIGNAL],
 		       0);

Modified: trunk/src/burn-volume-obj.c
==============================================================================
--- trunk/src/burn-volume-obj.c	(original)
+++ trunk/src/burn-volume-obj.c	Sat Mar 15 09:57:00 2008
@@ -651,8 +651,5 @@
 			       "udi", udi,
 			       NULL);
 
-	if (volume)
-		brasero_volume_get_gvolume (volume);
-
 	return volume;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]