brasero r792 - in trunk: . src



Author: philippr
Date: Sun May  4 14:28:11 2008
New Revision: 792
URL: http://svn.gnome.org/viewvc/brasero?rev=792&view=rev

Log:
	Fix #531273 â Edit information dialog for music CDs looses start point info

	* src/brasero-audio-disc.c (brasero_audio_disc_add_slices):
	* src/brasero-song-properties.c (brasero_song_props_update_length),
	(brasero_song_props_end_changed_cb),
	(brasero_song_props_start_changed_cb),
	(brasero_song_props_set_properties):
	* src/brasero-time-button.c (brasero_time_button_set_max):


Modified:
   trunk/ChangeLog
   trunk/src/brasero-audio-disc.c
   trunk/src/brasero-song-properties.c
   trunk/src/brasero-time-button.c

Modified: trunk/src/brasero-audio-disc.c
==============================================================================
--- trunk/src/brasero-audio-disc.c	(original)
+++ trunk/src/brasero-audio-disc.c	Sun May  4 14:28:11 2008
@@ -2695,6 +2695,7 @@
 				    SIZE_COL, string,
 				    LENGTH_COL, length,
 				    -1);
+
 		g_free (string);
 	}
 

Modified: trunk/src/brasero-song-properties.c
==============================================================================
--- trunk/src/brasero-song-properties.c	(original)
+++ trunk/src/brasero-song-properties.c	Sun May  4 14:28:11 2008
@@ -63,8 +63,7 @@
 static GObjectClass *parent_class = NULL;
 
 static void
-brasero_song_props_end_changed_cb (BraseroTimeButton *button,
-				   BraseroSongProps *self)
+brasero_song_props_update_length (BraseroSongProps *self)
 {
 	gchar *length_str;
 	gint64 start;
@@ -75,32 +74,27 @@
 	start = brasero_time_button_get_value (BRASERO_TIME_BUTTON (self->priv->start));
 	gap = gtk_spin_button_get_value (GTK_SPIN_BUTTON (self->priv->gap)) * GST_SECOND;
 
-	brasero_time_button_set_value (BRASERO_TIME_BUTTON (self->priv->start),
-				       start);
-	brasero_time_button_set_max (BRASERO_TIME_BUTTON (self->priv->start),
-				     end - 1);
-
 	length_str = brasero_utils_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (start, end + gap), TRUE, FALSE);
 	gtk_label_set_markup (GTK_LABEL (self->priv->length), length_str);
 	g_free (length_str);
 }
 
 static void
-brasero_song_props_start_changed_cb (BraseroTimeButton *button,
-				     BraseroSongProps *self)
+brasero_song_props_end_changed_cb (BraseroTimeButton *button,
+				   BraseroSongProps *self)
 {
-	gchar *length_str;
-	gint64 start;
 	gint64 end;
-	gint64 gap;
 
 	end = brasero_time_button_get_value (BRASERO_TIME_BUTTON (self->priv->end));
-	start = brasero_time_button_get_value (BRASERO_TIME_BUTTON (self->priv->start));
-	gap = gtk_spin_button_get_value (GTK_SPIN_BUTTON (self->priv->gap)) * GST_SECOND;
+	brasero_time_button_set_max (BRASERO_TIME_BUTTON (self->priv->start), end - 1);
+	brasero_song_props_update_length (self);
+}
 
-	length_str = brasero_utils_get_time_string (BRASERO_AUDIO_TRACK_LENGTH (start, end + gap), TRUE, FALSE);
-	gtk_label_set_markup (GTK_LABEL (self->priv->length), length_str);
-	g_free (length_str);
+static void
+brasero_song_props_start_changed_cb (BraseroTimeButton *button,
+				     BraseroSongProps *self)
+{
+	brasero_song_props_update_length (self);
 }
 
 static void
@@ -315,8 +309,17 @@
 
 	brasero_time_button_set_max (BRASERO_TIME_BUTTON (self->priv->start), end - 1);
 	brasero_time_button_set_value (BRASERO_TIME_BUTTON (self->priv->start), start);
+
+	g_signal_handlers_block_by_func (self->priv->end,
+					 brasero_song_props_end_changed_cb,
+					 self);
 	brasero_time_button_set_max (BRASERO_TIME_BUTTON (self->priv->end), length);
 	brasero_time_button_set_value (BRASERO_TIME_BUTTON (self->priv->end), end);
+	g_signal_handlers_unblock_by_func (self->priv->end,
+					   brasero_song_props_end_changed_cb,
+					   self);
+
+	brasero_song_props_update_length (self);
 }
 
 static void

Modified: trunk/src/brasero-time-button.c
==============================================================================
--- trunk/src/brasero-time-button.c	(original)
+++ trunk/src/brasero-time-button.c	Sun May  4 14:28:11 2008
@@ -199,7 +199,6 @@
 		gtk_widget_set_sensitive (priv->hrs, FALSE);
 
 	gtk_spin_button_set_range (GTK_SPIN_BUTTON (priv->min), 0.0, priv->max_min);
-
 	if (priv->max_min) {
 		gtk_widget_set_sensitive (priv->min, TRUE);
 		gtk_widget_set_sensitive (priv->sec, TRUE);



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