[brasero] Don't show autodetect in image type chooser when it's representing the output of the image the user



commit affa81cc39a95435e1c237e66f7287a5cb45516b
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Fri Jul 3 09:37:19 2009 +0200

    Don't show autodetect in image type chooser when it's representing the output of the image the user wants to create

 libbrasero-burn/brasero-image-properties.c   |    8 +++-----
 libbrasero-burn/brasero-image-type-chooser.c |   15 +++++++++------
 libbrasero-burn/brasero-image-type-chooser.h |    3 ++-
 libbrasero-burn/brasero-session-cfg.c        |   11 -----------
 libbrasero-burn/brasero-session-cfg.h        |    3 ---
 libbrasero-burn/brasero-src-image.c          |    2 +-
 6 files changed, 15 insertions(+), 27 deletions(-)
---
diff --git a/libbrasero-burn/brasero-image-properties.c b/libbrasero-burn/brasero-image-properties.c
index 6be4d43..02b9990 100644
--- a/libbrasero-burn/brasero-image-properties.c
+++ b/libbrasero-burn/brasero-image-properties.c
@@ -208,7 +208,8 @@ brasero_image_properties_set_formats (BraseroImageProperties *self,
 	}
 
 	num = brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format),
-						      formats);
+						      formats,
+	                                              FALSE);
 	brasero_image_type_chooser_set_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format),
 					       format);
 
@@ -328,10 +329,7 @@ brasero_image_properties_update (BraseroImageProperties *self)
 	brasero_image_properties_set_path (self, path);
 	g_free (path);
 
-	if (!brasero_session_cfg_has_default_output_format (priv->session))
-		format = brasero_burn_session_get_output_format (BRASERO_BURN_SESSION (priv->session));
-	else
-		format = BRASERO_IMAGE_FORMAT_ANY;
+	format = brasero_burn_session_get_output_format (BRASERO_BURN_SESSION (priv->session));
 
 	num = brasero_burn_session_get_possible_output_formats (BRASERO_BURN_SESSION (priv->session), &formats);
 	brasero_image_properties_set_formats (self,
diff --git a/libbrasero-burn/brasero-image-type-chooser.c b/libbrasero-burn/brasero-image-type-chooser.c
index d309f28..85e6ddf 100644
--- a/libbrasero-burn/brasero-image-type-chooser.c
+++ b/libbrasero-burn/brasero-image-type-chooser.c
@@ -69,7 +69,8 @@ static GtkHBoxClass *parent_class = NULL;
 
 guint
 brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
-				        BraseroImageFormat formats)
+				        BraseroImageFormat formats,
+                                        gboolean show_autodetect)
 {
 	guint format_num;
 	GtkTreeIter iter;
@@ -87,11 +88,13 @@ brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
 	gtk_list_store_clear (GTK_LIST_STORE (store));
 
 	/* now we get the targets available and display them */
-	gtk_list_store_prepend (GTK_LIST_STORE (store), &iter);
-	gtk_list_store_set (GTK_LIST_STORE (store), &iter,
-			    FORMAT_TEXT, _("Autodetect"),
-			    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_NONE,
-			    -1);
+	if (show_autodetect) {
+		gtk_list_store_prepend (GTK_LIST_STORE (store), &iter);
+		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
+				    FORMAT_TEXT, _("Autodetect"),
+				    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_NONE,
+				    -1);
+	}
 
 	if (formats & BRASERO_IMAGE_FORMAT_BIN) {
 		format_num ++;
diff --git a/libbrasero-burn/brasero-image-type-chooser.h b/libbrasero-burn/brasero-image-type-chooser.h
index 1b64890..0146b21 100644
--- a/libbrasero-burn/brasero-image-type-chooser.h
+++ b/libbrasero-burn/brasero-image-type-chooser.h
@@ -62,7 +62,8 @@ GtkWidget *brasero_image_type_chooser_new ();
 
 guint
 brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
-				        BraseroImageFormat formats);
+				        BraseroImageFormat formats,
+                                        gboolean show_autodetect);
 void
 brasero_image_type_chooser_set_format (BraseroImageTypeChooser *self,
 				       BraseroImageFormat format);
diff --git a/libbrasero-burn/brasero-session-cfg.c b/libbrasero-burn/brasero-session-cfg.c
index 089b7be..05024a9 100644
--- a/libbrasero-burn/brasero-session-cfg.c
+++ b/libbrasero-burn/brasero-session-cfg.c
@@ -103,17 +103,6 @@ brasero_session_cfg_has_default_output_path (BraseroSessionCfg *session)
 	return (result == BRASERO_BURN_OK);
 }
 
-gboolean
-brasero_session_cfg_has_default_output_format (BraseroSessionCfg *session)
-{
-	BraseroBurnSessionClass *klass;
-	BraseroImageFormat format;
-
-	klass = BRASERO_BURN_SESSION_CLASS (brasero_session_cfg_parent_class);
-	format = klass->get_output_format (BRASERO_BURN_SESSION (session));
-	return (format == BRASERO_IMAGE_FORMAT_NONE);
-}
-
 static gboolean
 brasero_session_cfg_wrong_extension_signal (BraseroSessionCfg *session)
 {
diff --git a/libbrasero-burn/brasero-session-cfg.h b/libbrasero-burn/brasero-session-cfg.h
index f518c6e..571eb96 100644
--- a/libbrasero-burn/brasero-session-cfg.h
+++ b/libbrasero-burn/brasero-session-cfg.h
@@ -109,9 +109,6 @@ brasero_session_cfg_is_compulsory (BraseroSessionCfg *cfg,
 				   BraseroBurnFlag flags);
 
 gboolean
-brasero_session_cfg_has_default_output_format (BraseroSessionCfg *cfg);
-
-gboolean
 brasero_session_cfg_has_default_output_path (BraseroSessionCfg *cfg);
 
 void
diff --git a/libbrasero-burn/brasero-src-image.c b/libbrasero-burn/brasero-src-image.c
index 36f1c89..4c5f90d 100644
--- a/libbrasero-burn/brasero-src-image.c
+++ b/libbrasero-burn/brasero-src-image.c
@@ -378,7 +378,7 @@ brasero_src_image_set_formats (BraseroSrcImage *dialog)
 
 	brasero_track_type_free (input);
 
-	brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), formats);
+	brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), formats,  TRUE);
 
 	format = brasero_track_image_cfg_get_forced_format (priv->track);
 	brasero_image_type_chooser_set_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format), format);



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