changeset 26660:e9e253607e35

Fix some assertion failures.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sat, 18 Apr 2009 23:21:56 +0000
parents 4fca203e33be
children 9b6619a28f5d
files pidgin/gtkblist-theme.c pidgin/plugins/themeedit.c
diffstat 2 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist-theme.c	Sat Apr 18 18:13:04 2009 +0000
+++ b/pidgin/gtkblist-theme.c	Sat Apr 18 23:21:56 2009 +0000
@@ -127,7 +127,8 @@
 	PidginThemeFont *copy = g_new0(PidginThemeFont, 1);
 	copy->font  = g_strdup(pair->font);
 	strncpy(copy->color, pair->color, sizeof(copy->color) - 1);
-	copy->gdkcolor = gdk_color_copy(pair->gdkcolor);
+	if (pair->gdkcolor)
+		copy->gdkcolor = gdk_color_copy(pair->gdkcolor);
 	return copy;
 }
 
--- a/pidgin/plugins/themeedit.c	Sat Apr 18 18:13:04 2009 +0000
+++ b/pidgin/plugins/themeedit.c	Sat Apr 18 23:21:56 2009 +0000
@@ -130,12 +130,14 @@
 	} else {
 		PidginThemeFont *pair = NULL;
 		g_object_get(G_OBJECT(theme), prop, &pair, NULL);
-		color = pidgin_theme_font_get_color(pair);
+		if (pair)
+			color = pidgin_theme_font_get_color(pair);
 	}
 
 	dialog = gtk_color_selection_dialog_new(_("Select Color"));
-	gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel),
-			color);
+	if (color)
+		gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel),
+				color);
 	g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected),
 			prop);
 
@@ -232,7 +234,7 @@
 	};
 
 	dialog = pidgin_create_dialog(_("Pidgin Buddylist Theme Editor"), 0, "theme-editor", FALSE);
-	box = pidgin_dialog_get_vbox(GTK_DIALOG(dialog));
+	box = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(dialog), FALSE, PIDGIN_HIG_BOX_SPACE);
 
 	theme = pidgin_blist_get_theme();
 	if (!theme) {
@@ -266,6 +268,7 @@
 		}
 	}
 
+	gtk_dialog_set_has_separator(GTK_DIALOG(dialog), TRUE);
 	pidgin_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, G_CALLBACK(save_blist_theme), dialog);
 	gtk_widget_show_all(dialog);