[brasero: 1/6] Fix bgo #573807 – Image selection filters are badly named



commit ea8a5b619af8782e82b7331fb505b12b44c07167
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date:   Mon May 11 12:22:42 2009 +0200

    Fix bgo #573807 â?? Image selection filters are badly named
    Change some names for the images and don't show the combo box if there is just one available choice
---
 libbrasero-burn/brasero-image-properties.c   |   10 +++++++---
 libbrasero-burn/brasero-image-type-chooser.c |   19 +++++++++++++------
 libbrasero-burn/brasero-image-type-chooser.h |    2 +-
 3 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/libbrasero-burn/brasero-image-properties.c b/libbrasero-burn/brasero-image-properties.c
index ed7e9ac..a314482 100644
--- a/libbrasero-burn/brasero-image-properties.c
+++ b/libbrasero-burn/brasero-image-properties.c
@@ -180,6 +180,7 @@ brasero_image_properties_set_formats (BraseroImageProperties *self,
 				      BraseroImageFormat format)
 {
 	BraseroImagePropertiesPrivate *priv;
+	guint num;
 
 	priv = BRASERO_IMAGE_PROPERTIES_PRIVATE (self);
 
@@ -222,12 +223,15 @@ brasero_image_properties_set_formats (BraseroImageProperties *self,
 				  self);
 	}
 
-	brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format),
-					        formats);
+	num = brasero_image_type_chooser_set_formats (BRASERO_IMAGE_TYPE_CHOOSER (priv->format),
+						      formats);
 	brasero_image_type_chooser_set_format (BRASERO_IMAGE_TYPE_CHOOSER (priv->format),
 					       format);
 
-	gtk_widget_show (priv->format);
+	if (num > 1)
+		gtk_widget_show (priv->format);
+	else
+		gtk_widget_hide (priv->format);
 }
 
 static void
diff --git a/libbrasero-burn/brasero-image-type-chooser.c b/libbrasero-burn/brasero-image-type-chooser.c
index 7da7855..65719ea 100644
--- a/libbrasero-burn/brasero-image-type-chooser.c
+++ b/libbrasero-burn/brasero-image-type-chooser.c
@@ -67,10 +67,11 @@ struct _BraseroImageTypeChooserPrivate {
 
 static GtkHBoxClass *parent_class = NULL;
 
-void
+guint
 brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
 				        BraseroImageFormat formats)
 {
+	guint format_num;
 	GtkTreeIter iter;
 	GtkTreeModel *store;
 	BraseroImageTypeChooserPrivate *priv;
@@ -79,6 +80,8 @@ brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
 
 	priv->updating = TRUE;
 
+	format_num = 0;
+
 	/* clean */
 	store = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->combo));
 	gtk_list_store_clear (GTK_LIST_STORE (store));
@@ -86,38 +89,42 @@ brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
 	/* 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, _("Let brasero choose (safest)"),
+			    FORMAT_TEXT, _("Autodetect"),
 			    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_NONE,
 			    -1);
 
 	if (formats & BRASERO_IMAGE_FORMAT_BIN) {
+		format_num ++;
 		gtk_list_store_append (GTK_LIST_STORE (store), &iter);
 		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
-				    FORMAT_TEXT, _("*.iso image"),
+				    FORMAT_TEXT, _("ISO9660 images"),
 				    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_BIN,
 				    -1);
 	}
 
 	if (formats & BRASERO_IMAGE_FORMAT_CLONE) {
+		format_num ++;
 		gtk_list_store_append (GTK_LIST_STORE (store), &iter);
 		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
-				    FORMAT_TEXT, _("*.raw image"),
+				    FORMAT_TEXT, _("Readcd/Readom images"),
 				    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_CLONE,
 				    -1);
 	}
 
 	if (formats & BRASERO_IMAGE_FORMAT_CUE) {
+		format_num ++;
 		gtk_list_store_append (GTK_LIST_STORE (store), &iter);
 		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
-				    FORMAT_TEXT, _("*.cue image"),
+				    FORMAT_TEXT, _("Cue images"),
 				    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_CUE,
 				    -1);
 	}
 
 	if (formats & BRASERO_IMAGE_FORMAT_CDRDAO) {
+		format_num ++;
 		gtk_list_store_append (GTK_LIST_STORE (store), &iter);
 		gtk_list_store_set (GTK_LIST_STORE (store), &iter,
-				    FORMAT_TEXT, _("*.toc image (cdrdao)"),
+				    FORMAT_TEXT, _("Cdrdao images"),
 				    FORMAT_TYPE, BRASERO_IMAGE_FORMAT_CDRDAO,
 				    -1);
 	}
diff --git a/libbrasero-burn/brasero-image-type-chooser.h b/libbrasero-burn/brasero-image-type-chooser.h
index cf56ebe..1b64890 100644
--- a/libbrasero-burn/brasero-image-type-chooser.h
+++ b/libbrasero-burn/brasero-image-type-chooser.h
@@ -60,7 +60,7 @@ struct _BraseroImageTypeChooserClass {
 GType brasero_image_type_chooser_get_type ();
 GtkWidget *brasero_image_type_chooser_new ();
 
-void
+guint
 brasero_image_type_chooser_set_formats (BraseroImageTypeChooser *self,
 				        BraseroImageFormat formats);
 void



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