[brasero] Fix #573805 – "Increase compatibility with Windows systems"?



commit b9a6d456b7594a833f2970262677f947a74cb528
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Fri Jun 26 09:40:55 2009 +0200

    Fix #573805 â?? "Increase compatibility with Windows systems"?
    Remove the checkbox from burn options dialog that dealt with Windows compatibility and replace it with a dialog that pops up when a non compliant name is detected

 libbrasero-burn/Makefile.am             |    2 -
 libbrasero-burn/brasero-burn-options.c  |    3 +-
 libbrasero-burn/brasero-data-options.c  |  391 -------------------------------
 libbrasero-burn/brasero-data-options.h  |   69 ------
 libbrasero-burn/brasero-status-dialog.c |  142 +++++++++++
 nautilus/nautilus-burn-extension.c      |   14 +-
 po/POTFILES.in                          |    1 -
 7 files changed, 144 insertions(+), 478 deletions(-)
---
diff --git a/libbrasero-burn/Makefile.am b/libbrasero-burn/Makefile.am
index 516e421..a19a96b 100644
--- a/libbrasero-burn/Makefile.am
+++ b/libbrasero-burn/Makefile.am
@@ -186,8 +186,6 @@ libbrasero_burn_la_SOURCES = 		\
 	brasero-track-stream-cfg.c                 \
 	brasero-track-stream-cfg.h                 \
 	brasero-tool-dialog-private.h                 \
-	brasero-data-options.c                 \
-	brasero-data-options.h                 \
 	brasero-video-options.h                 \
 	brasero-video-options.c                 \
 	brasero-session-span.h                 \
diff --git a/libbrasero-burn/brasero-burn-options.c b/libbrasero-burn/brasero-burn-options.c
index 47d2b04..54dbaa4 100644
--- a/libbrasero-burn/brasero-burn-options.c
+++ b/libbrasero-burn/brasero-burn-options.c
@@ -47,7 +47,6 @@
 #include "brasero-session.h"
 #include "brasero-session-helper.h"
 #include "brasero-burn-options.h"
-#include "brasero-data-options.h"
 #include "brasero-video-options.h"
 #include "brasero-src-image.h"
 #include "brasero-src-selection.h"
@@ -256,7 +255,6 @@ brasero_burn_options_not_ready_dialog_show_cb (gpointer data)
 
 	priv = BRASERO_BURN_OPTIONS_PRIVATE (data);
 	priv->not_ready_id = 0;
-	gtk_widget_show (priv->status_dialog);
 	return FALSE;
 }
 
@@ -292,6 +290,7 @@ brasero_burn_options_update_valid (BraseroBurnOptions *self)
 					  "response", 
 					  G_CALLBACK (brasero_burn_options_not_ready_dialog_cancel_cb),
 					  self);
+	gtk_widget_show (priv->status_dialog);
 			priv->not_ready_id = g_timeout_add_seconds (1,
 								    brasero_burn_options_not_ready_dialog_show_cb,
 								    self);
diff --git a/libbrasero-burn/brasero-status-dialog.c b/libbrasero-burn/brasero-status-dialog.c
index cf76ef1..792f786 100644
--- a/libbrasero-burn/brasero-status-dialog.c
+++ b/libbrasero-burn/brasero-status-dialog.c
@@ -42,6 +42,8 @@
 
 #include "brasero-units.h"
 
+#include "brasero-track-data-cfg.h"
+
 #include "brasero-enums.h"
 #include "brasero-session.h"
 #include "brasero-status-dialog.h"
@@ -150,11 +152,125 @@ brasero_status_dialog_wait_for_ready_state (BraseroStatusDialog *dialog)
 	return TRUE;
 }
 
+static gboolean
+brasero_status_dialog_deep_directory_cb (BraseroTrackDataCfg *project,
+					 const gchar *name,
+					 BraseroStatusDialog *dialog)
+{
+	gint answer;
+	gchar *string;
+	GtkWidget *message;
+
+	gtk_widget_hide (GTK_WIDGET (dialog));
+
+	string = g_strdup_printf (_("Do you really want to add \"%s\" to the selection?"), name);
+	message = gtk_message_dialog_new (GTK_WINDOW (dialog),
+					  GTK_DIALOG_DESTROY_WITH_PARENT|
+					  GTK_DIALOG_MODAL,
+					  GTK_MESSAGE_WARNING,
+					  GTK_BUTTONS_NONE,
+					  string);
+	g_free (string);
+
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
+						  _("The children of this directory will have 7 parent directories."
+						    "\nBrasero can create an image of such a file hierarchy and burn it; but the disc may not be readable on all operating systems."
+						    "\nNOTE: Such a file hierarchy is known to work on linux."));
+
+	gtk_dialog_add_button (GTK_DIALOG (message), GTK_STOCK_CANCEL, GTK_RESPONSE_NO);
+	gtk_dialog_add_button (GTK_DIALOG (message), _("_Add File"), GTK_RESPONSE_YES);
+
+	answer = gtk_dialog_run (GTK_DIALOG (message));
+	gtk_widget_destroy (message);
+
+	gtk_widget_show (GTK_WIDGET (dialog));
+
+	return (answer != GTK_RESPONSE_YES);
+}
+
+static gboolean
+brasero_status_dialog_2G_file_cb (BraseroTrackDataCfg *track,
+				  const gchar *name,
+				  BraseroStatusDialog *dialog)
+{
+	gint answer;
+	gchar *string;
+	GtkWidget *message;
+
+	gtk_widget_hide (GTK_WIDGET (dialog));
+
+	string = g_strdup_printf (_("Do you really want to add \"%s\" to the selection and use the third version of ISO9660 standard to support it?"), name);
+	message = gtk_message_dialog_new (GTK_WINDOW (dialog),
+					  GTK_DIALOG_DESTROY_WITH_PARENT|
+					  GTK_DIALOG_MODAL,
+					  GTK_MESSAGE_WARNING,
+					  GTK_BUTTONS_NONE,
+					  string);
+	g_free (string);
+
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message),
+						  _("The size of the file is over 2 GiB. Files larger than 2 GiB are not supported by ISO9660 standard in its first and second versions (the most widespread ones)."
+						    "\nIt is recommended to use the third version of ISO9660 standard which is supported by most of the operating systems including Linux and all versions of Windows ©."
+						    "\nHowever MacOS X cannot read images created with version 3 of ISO9660 standard."));
+
+	gtk_dialog_add_button (GTK_DIALOG (message), GTK_STOCK_CANCEL, GTK_RESPONSE_NO);
+	gtk_dialog_add_button (GTK_DIALOG (message), _("_Add File"), GTK_RESPONSE_YES);
+
+	answer = gtk_dialog_run (GTK_DIALOG (message));
+	gtk_widget_destroy (message);
+
+	gtk_widget_show (GTK_WIDGET (dialog));
+
+	return (answer != GTK_RESPONSE_YES);
+}
+
+static void
+brasero_status_dialog_joliet_rename_cb (BraseroTrackData *track,
+					BraseroStatusDialog *dialog)
+{
+	GtkResponseType answer;
+	GtkWidget *message;
+	gchar *secondary;
+
+	gtk_widget_hide (GTK_WIDGET (dialog));
+
+	message = gtk_message_dialog_new (GTK_WINDOW (dialog),
+					  GTK_DIALOG_DESTROY_WITH_PARENT|
+					  GTK_DIALOG_MODAL,
+					  GTK_MESSAGE_WARNING,
+					  GTK_BUTTONS_NONE,
+					  _("Should files be renamed to be fully Windows-compatible?"));
+
+	secondary = g_strdup_printf ("%s\n%s",
+				     _("Some files don't have a suitable name for a fully Windows-compatible CD."),
+				     _("Those names should be changed and truncated to 64 characters."));
+	gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (message), "%s", secondary);
+	g_free (secondary);
+
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Disable Full Windows Compatibility"),
+			       GTK_RESPONSE_CANCEL);
+	gtk_dialog_add_button (GTK_DIALOG (message),
+			       _("_Rename for Full Windows Compatibility"),
+			       GTK_RESPONSE_YES);
+
+	answer = gtk_dialog_run (GTK_DIALOG (message));
+	gtk_widget_destroy (message);
+
+	if (answer != GTK_RESPONSE_YES)
+		brasero_track_data_rm_fs (track, BRASERO_IMAGE_FS_JOLIET);
+	else
+		brasero_track_data_add_fs (track, BRASERO_IMAGE_FS_JOLIET);
+
+	gtk_widget_show (GTK_WIDGET (dialog));
+}
+
 static void
 brasero_status_dialog_wait_for_session (BraseroStatusDialog *dialog)
 {
 	BraseroStatus *status;
 	BraseroBurnResult result;
+	BraseroTrackType *track_type;
 	BraseroStatusDialogPrivate *priv;
 
 	priv = BRASERO_STATUS_DIALOG_PRIVATE (dialog);
@@ -169,6 +285,32 @@ brasero_status_dialog_wait_for_session (BraseroStatusDialog *dialog)
 
 	gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_CENTER_ON_PARENT);
 
+	track_type = brasero_track_type_new ();
+	brasero_burn_session_get_input_type (priv->session, track_type);
+	if (brasero_track_type_get_has_data (track_type)) {
+		GSList *tracks;
+		BraseroTrack *track;
+
+		tracks = brasero_burn_session_get_tracks (priv->session);
+		track = tracks->data;
+
+		if (BRASERO_IS_TRACK_DATA_CFG (track)) {
+			g_signal_connect (track,
+					  "joliet-rename",
+					  G_CALLBACK (brasero_status_dialog_joliet_rename_cb),
+					  dialog);
+			g_signal_connect (track,
+					  "2G-file",
+					  G_CALLBACK (brasero_status_dialog_2G_file_cb),
+					  dialog);
+			g_signal_connect (track,
+					  "deep-directory",
+					  G_CALLBACK (brasero_status_dialog_deep_directory_cb),
+					  dialog);
+		}
+	}
+	brasero_track_type_free (track_type);
+
 	brasero_status_dialog_update (dialog, status);
 	brasero_status_free (status);
 	priv->id = g_timeout_add (200,
diff --git a/nautilus/nautilus-burn-extension.c b/nautilus/nautilus-burn-extension.c
index d47a464..cf91302 100644
--- a/nautilus/nautilus-burn-extension.c
+++ b/nautilus/nautilus-burn-extension.c
@@ -202,7 +202,6 @@ write_activate (GtkWindow *toplevel)
 	BraseroSessionCfg	*session;
 	GtkWidget 		*name_options;
 	GtkWidget		*options;
-	GtkWidget		*box;
 	gchar			*string;
 
 	if (nautilus_disc_burn_is_empty (toplevel))
@@ -217,10 +216,6 @@ write_activate (GtkWindow *toplevel)
 					NULL);
 	g_object_unref (track);
 
-	/* Add option widget */
-	box = gtk_vbox_new (FALSE, 6);
-	gtk_widget_show (box);
-
 	/* add name widget here to set the label of the volume */
 	name_options = brasero_project_name_new (NULL);
 	brasero_project_name_set_session (BRASERO_PROJECT_NAME (name_options),
@@ -233,15 +228,8 @@ write_activate (GtkWindow *toplevel)
 	g_free (string);
 	gtk_widget_show_all (options);
 
-	gtk_box_pack_start (GTK_BOX (box), options, FALSE, TRUE, 0);
-
-	/* create the options box */
-	options = brasero_data_options_new (BRASERO_BURN_SESSION (session));
-	gtk_widget_show (options);
-	gtk_box_pack_start (GTK_BOX (box), options, FALSE, TRUE, 0);
-
 	/* NOTE: set the disc we're handling */
-	launch_brasero_on_window_session (session, box, toplevel);
+	launch_brasero_on_window_session (session, options, toplevel);
 
 	/* cleanup */
 	g_object_unref (session);
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 4dd898a..0b595cd 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1,7 +1,6 @@
 # List of source files containing translatable strings.
 [encoding: UTF-8]
 
-libbrasero-burn/brasero-data-options.c
 libbrasero-burn/brasero-video-options.c
 libbrasero-burn/burn-debug.c
 libbrasero-burn/brasero-track-stream-cfg.c



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