marlin r1313 - in trunk: marlin src/dialogs



Author: iain
Date: Thu Oct 16 01:05:29 2008
New Revision: 1313
URL: http://svn.gnome.org/viewvc/marlin?rev=1313&view=rev

Log:
Make Crossfade dialog not crash


Modified:
   trunk/marlin/ChangeLog
   trunk/marlin/marlin-cross-fader.c
   trunk/marlin/marlin-grid.c
   trunk/src/dialogs/marlin-crossfade-dialog.c

Modified: trunk/marlin/marlin-cross-fader.c
==============================================================================
--- trunk/marlin/marlin-cross-fader.c	(original)
+++ trunk/marlin/marlin-cross-fader.c	Thu Oct 16 01:05:29 2008
@@ -65,7 +65,7 @@
 };
 
 #define GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), MARLIN_CROSS_FADER_TYPE, MarlinCrossFaderPrivate))
-G_DEFINE_TYPE (MarlinCrossFader, marlin_cross_fader, GTK_TYPE_WIDGET);
+G_DEFINE_TYPE (MarlinCrossFader, marlin_cross_fader, MARLIN_GRID_TYPE);
 
 static void
 finalize (GObject *object)

Modified: trunk/marlin/marlin-grid.c
==============================================================================
--- trunk/marlin/marlin-grid.c	(original)
+++ trunk/marlin/marlin-grid.c	Thu Oct 16 01:05:29 2008
@@ -74,7 +74,7 @@
 	gboolean in_grab;
 };
 
-G_DEFINE_TYPE (MarlinGrid, marlin_grid, G_TYPE_OBJECT);
+G_DEFINE_TYPE (MarlinGrid, marlin_grid, GTK_TYPE_DRAWING_AREA);
 
 static void
 finalize (GObject *object)
@@ -122,7 +122,7 @@
 size_allocate (GtkWidget     *widget,
 	       GtkAllocation *allocation)
 {
-	MarlinGrid *grid = (MarlinGrid *) grid;
+	MarlinGrid *grid = (MarlinGrid *) widget;
 	MarlinGridPrivate *priv = grid->priv;
 	guint64 length;
 
@@ -133,7 +133,7 @@
 	}
 
 	length = priv->finish - priv->start;
-	priv->frames_per_pixel = ceil (((double)length) / (allocation->width - 38));
+	priv->frames_per_pixel = (int) ceil (((double)length) / (allocation->width - 38));
 
 	GTK_WIDGET_CLASS (marlin_grid_parent_class)->size_allocate (widget, allocation);
 }
@@ -361,7 +361,7 @@
 	length = priv->finish - priv->start;
 	priv->box_x = 35;
 	priv->box_y = 5;
-	priv->box_width = length / priv->frames_per_pixel + 1;
+	priv->box_width = length / (priv->frames_per_pixel + 1);
 	priv->box_height = widget->allocation.height - (20 + priv->box_y);
 
 	draw_labels (grid, cr);
@@ -412,7 +412,7 @@
 	rect.y = priv->box_y + LEVEL_TO_PIXEL (point->level) - HALF_POINT_WIDTH;
 	rect.width = POINT_WIDTH;
 	rect.height = POINT_WIDTH;
-	
+
 	gdk_window_invalidate_rect (widget->window, &rect, FALSE);
 }
 
@@ -647,7 +647,7 @@
 	if (priv->curves->len > 1) {
 		for (i = 0; i < priv->curves->len; i++) {
 			MarlinGridCurve *c = priv->curves->pdata[i];
-			
+
 			priv->start = MIN (priv->start, c->range.start);
 			priv->finish = MAX (priv->finish, c->range.finish);
 		}
@@ -674,7 +674,7 @@
 	curve->range.start = range->start;
 	curve->range.finish = range->finish;
 	curve->points = marlin_list_new (NULL);
-	
+
 	return curve;
 }
 

Modified: trunk/src/dialogs/marlin-crossfade-dialog.c
==============================================================================
--- trunk/src/dialogs/marlin-crossfade-dialog.c	(original)
+++ trunk/src/dialogs/marlin-crossfade-dialog.c	Thu Oct 16 01:05:29 2008
@@ -325,6 +325,7 @@
 	gtk_widget_show (xfd->both);
 	gtk_box_pack_start (GTK_BOX (r_vbox), xfd->both, FALSE, FALSE, 0);
 #endif
+
 	load_settings (xfd);
 
 	gtk_dialog_add_button (GTK_DIALOG (dialog),
@@ -340,7 +341,7 @@
 
 	g_signal_connect (dialog, "response",
 			  G_CALLBACK (xfade_response_cb), xfd);
-	
+
 	gtk_widget_show (dialog);
 
 	return dialog;



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