comparison pidgin/plugins/themeedit.c @ 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
comparison
equal deleted inserted replaced
26659:4fca203e33be 26660:e9e253607e35
128 if (prop_type_is_color(theme, prop)) { 128 if (prop_type_is_color(theme, prop)) {
129 g_object_get(G_OBJECT(theme), prop, &color, NULL); 129 g_object_get(G_OBJECT(theme), prop, &color, NULL);
130 } else { 130 } else {
131 PidginThemeFont *pair = NULL; 131 PidginThemeFont *pair = NULL;
132 g_object_get(G_OBJECT(theme), prop, &pair, NULL); 132 g_object_get(G_OBJECT(theme), prop, &pair, NULL);
133 color = pidgin_theme_font_get_color(pair); 133 if (pair)
134 color = pidgin_theme_font_get_color(pair);
134 } 135 }
135 136
136 dialog = gtk_color_selection_dialog_new(_("Select Color")); 137 dialog = gtk_color_selection_dialog_new(_("Select Color"));
137 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel), 138 if (color)
138 color); 139 gtk_color_selection_set_current_color(GTK_COLOR_SELECTION(GTK_COLOR_SELECTION_DIALOG(dialog)->colorsel),
140 color);
139 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected), 141 g_signal_connect(G_OBJECT(dialog), "response", G_CALLBACK(theme_color_selected),
140 prop); 142 prop);
141 143
142 gtk_widget_show_all(dialog); 144 gtk_widget_show_all(dialog);
143 } 145 }
230 }, 232 },
231 { NULL, { } } 233 { NULL, { } }
232 }; 234 };
233 235
234 dialog = pidgin_create_dialog(_("Pidgin Buddylist Theme Editor"), 0, "theme-editor", FALSE); 236 dialog = pidgin_create_dialog(_("Pidgin Buddylist Theme Editor"), 0, "theme-editor", FALSE);
235 box = pidgin_dialog_get_vbox(GTK_DIALOG(dialog)); 237 box = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(dialog), FALSE, PIDGIN_HIG_BOX_SPACE);
236 238
237 theme = pidgin_blist_get_theme(); 239 theme = pidgin_blist_get_theme();
238 if (!theme) { 240 if (!theme) {
239 theme = g_object_new(PIDGIN_TYPE_BLIST_THEME, "type", "blist", 241 theme = g_object_new(PIDGIN_TYPE_BLIST_THEME, "type", "blist",
240 "author", getlogin(), 242 "author", getlogin(),
264 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); 266 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
265 } 267 }
266 } 268 }
267 } 269 }
268 270
271 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), TRUE);
269 pidgin_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, G_CALLBACK(save_blist_theme), dialog); 272 pidgin_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, G_CALLBACK(save_blist_theme), dialog);
270 gtk_widget_show_all(dialog); 273 gtk_widget_show_all(dialog);
271 274
272 g_object_unref(group); 275 g_object_unref(group);
273 } 276 }