comparison pidgin/gtkaccount.c @ 24848:2ce759d9176a

Make sure the prpl has a get_account_text_table function before trying to call it. Fixes #7918.
author John Bailey <rekkanoryo@rekkanoryo.org>
date Mon, 29 Dec 2008 05:37:18 +0000
parents 024818afb013
children fe5179d40a51
comparison
equal deleted inserted replaced
24846:689cfb82242e 24848:2ce759d9176a
284 284
285 static gboolean 285 static gboolean
286 screenname_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) 286 screenname_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog)
287 { 287 {
288 GdkColor color = {0, 34952, 35466, 34181}; 288 GdkColor color = {0, 34952, 35466, 34181};
289 GHashTable *table; 289 GHashTable *table = NULL;
290 const char *label; 290 const char *label = NULL;
291 291
292 table = dialog->prpl_info->get_account_text_table(NULL); 292 if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) {
293 label = g_hash_table_lookup(table, "login_label"); 293 table = dialog->prpl_info->get_account_text_table(NULL);
294 294 label = g_hash_table_lookup(table, "login_label");
295 if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { 295
296 /* We have to avoid hitting the screenname_changed_cb function 296 if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') {
297 * because it enables buttons we don't want enabled yet ;) 297 /* We have to avoid hitting the screenname_changed_cb function
298 */ 298 * because it enables buttons we don't want enabled yet ;)
299 g_signal_handlers_block_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); 299 */
300 gtk_entry_set_text(GTK_ENTRY(widget), label); 300 g_signal_handlers_block_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog);
301 /* Make sure we can hit it again */ 301 gtk_entry_set_text(GTK_ENTRY(widget), label);
302 g_signal_handlers_unblock_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog); 302 /* Make sure we can hit it again */
303 gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color); 303 g_signal_handlers_unblock_by_func(widget, G_CALLBACK(screenname_changed_cb), dialog);
304 } 304 gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color);
305 305 }
306 g_hash_table_destroy(table); 306
307 g_hash_table_destroy(table);
308 }
307 309
308 return FALSE; 310 return FALSE;
309 } 311 }
310 312
311 static void 313 static void