brasero r1352 - in trunk: . src



Author: philippr
Date: Sun Oct  5 14:44:53 2008
New Revision: 1352
URL: http://svn.gnome.org/viewvc/brasero?rev=1352&view=rev

Log:
	Fix for #554201 â Project size graph in status bar

	* src/brasero-data-disc.c (brasero_data_disc_get_loaded_medium):
	* src/brasero-data-disc.h:
	* src/brasero-project-type-chooser.c
	(brasero_project_type_chooser_build_recent),
	(brasero_project_type_chooser_init):
	* src/brasero-project.c (brasero_project_update_project_size),
	(brasero_project_flags_changed_cb), (brasero_project_switch):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-data-disc.c
   trunk/src/brasero-data-disc.h
   trunk/src/brasero-project-type-chooser.c
   trunk/src/brasero-project.c

Modified: trunk/src/brasero-data-disc.c
==============================================================================
--- trunk/src/brasero-data-disc.c	(original)
+++ trunk/src/brasero-data-disc.c	Sun Oct  5 14:44:53 2008
@@ -197,6 +197,14 @@
 #define BRASERO_DATA_DISC_MEDIUM	"brasero-data-disc-medium"
 #define BRASERO_DATA_DISC_MERGE_ID	"brasero-data-disc-merge-id"
 
+BraseroMedium *
+brasero_data_disc_get_loaded_medium (BraseroDataDisc *self)
+{
+	BraseroDataDiscPrivate *priv;
+	priv = BRASERO_DATA_DISC_PRIVATE (self);
+	return brasero_data_session_get_loaded_medium (BRASERO_DATA_SESSION (priv->project));
+}
+
 /**
  * Actions callbacks
  */

Modified: trunk/src/brasero-data-disc.h
==============================================================================
--- trunk/src/brasero-data-disc.h	(original)
+++ trunk/src/brasero-data-disc.h	Sun Oct  5 14:44:53 2008
@@ -28,6 +28,8 @@
 #include <gtk/gtkvbox.h>
 #include <gtk/gtksizegroup.h>
 
+#include "burn-medium.h"
+
 G_BEGIN_DECLS
 
 #define BRASERO_TYPE_DATA_DISC             (brasero_data_disc_get_type ())
@@ -58,6 +60,10 @@
 void
 brasero_data_disc_set_right_button_group (BraseroDataDisc *disc,
 					  GtkSizeGroup *size_group);
+
+BraseroMedium *
+brasero_data_disc_get_loaded_medium (BraseroDataDisc *disc);
+
 G_END_DECLS
 
 #endif /* _BRASERO_DATA_DISC_H_ */

Modified: trunk/src/brasero-project-type-chooser.c
==============================================================================
--- trunk/src/brasero-project-type-chooser.c	(original)
+++ trunk/src/brasero-project-type-chooser.c	Sun Oct  5 14:44:53 2008
@@ -311,7 +311,7 @@
 		g_free (string);
 
 		gtk_widget_show (label);
-		gtk_box_pack_start (GTK_BOX (self->priv->recent_box), label, FALSE, FALSE, 6);
+		gtk_box_pack_start (GTK_BOX (self->priv->recent_box), label, FALSE, FALSE, 0);
 	}
 
 	g_list_free (list);
@@ -424,7 +424,7 @@
 	vbox = gtk_vbox_new (TRUE, 0);
 	gtk_widget_show (vbox);
 	gtk_box_pack_start (GTK_BOX (recent_box), vbox, FALSE, TRUE, 0);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 6);
+	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
 	obj->priv->recent_box = vbox;
 
 	recent = gtk_recent_manager_get_default ();

Modified: trunk/src/brasero-project.c
==============================================================================
--- trunk/src/brasero-project.c	(original)
+++ trunk/src/brasero-project.c	Sun Oct  5 14:44:53 2008
@@ -194,6 +194,8 @@
 	guint has_focus:1;
 	guint oversized:1;
 	guint selected_uris:1;
+
+	guint merging:1;
 };
 
 static GtkActionEntry entries [] = {
@@ -577,7 +579,26 @@
 						   !BRASERO_IS_DATA_DISC (project->priv->current),
 						   TRUE,
 						   FALSE);
-	size = g_strdup_printf (_("Project estimated size: %s"), string);
+	if (project->priv->merging) {
+		gchar *medium_string;
+		BraseroMedium *medium;
+		gint64 free_space = 0;
+
+		medium = brasero_data_disc_get_loaded_medium (BRASERO_DATA_DISC (project->priv->current));
+		brasero_medium_get_free_space (medium,
+					       &free_space,
+					       NULL);
+		/* Translators: first %s is the size of the project and the 
+		 * second %s is the remaining free space on the disc that is
+		 * used for multisession */
+		medium_string = g_format_size_for_display (free_space);
+		size = g_strdup_printf (_("Project estimated size: %s/%s"),
+					string,
+					medium_string);
+		g_free (medium_string);
+	}
+	else
+		size = g_strdup_printf (_("Project estimated size: %s"), string);
 	g_free (string);
 
 	gtk_statusbar_push (GTK_STATUSBAR (status), project->priv->status_ctx, size);
@@ -597,7 +618,11 @@
 brasero_project_flags_changed_cb (BraseroDisc *disc,
 				  BraseroBurnFlag flags,
 				  BraseroProject *project)
-{ }
+{
+	/* we just need to know if MERGE flag is on */
+	project->priv->merging = (flags & BRASERO_BURN_FLAG_MERGE) != 0;
+	brasero_project_update_project_size (project, project->priv->sectors);
+}
 
 /***************************** URIContainer ************************************/
 static void
@@ -898,6 +923,7 @@
 
 	project->priv->empty = 1;
     	project->priv->burnt = 0;
+	project->priv->merging = 0;
 	project->priv->modified = 0;
 
 	if (project->priv->current)



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