Mercurial > pidgin
comparison finch/gntnotify.c @ 32819:2c6510167895 default tip
propagate from branch 'im.pidgin.pidgin.2.x.y' (head 3315c5dfbd0ad16511bdcf865e5b07c02d07df24)
to branch 'im.pidgin.pidgin' (head cbd1eda6bcbf0565ae7766396bb8f6f419cb6a9a)
author | Elliott Sales de Andrade <qulogic@pidgin.im> |
---|---|
date | Sat, 02 Jun 2012 02:30:49 +0000 |
parents | 85d75e81e12f |
children |
comparison
equal
deleted
inserted
replaced
32818:01ff09d4a463 | 32819:2c6510167895 |
---|---|
288 GList *l; | 288 GList *l; |
289 GString *text; | 289 GString *text; |
290 | 290 |
291 text = g_string_new("<span>"); | 291 text = g_string_new("<span>"); |
292 | 292 |
293 for (l = purple_notify_user_info_get_entries(user_info); l != NULL; | 293 for (l = purple_notify_user_info_get_entries(user_info)->head; l != NULL; |
294 l = l->next) { | 294 l = l->next) { |
295 PurpleNotifyUserInfoEntry *user_info_entry = l->data; | 295 PurpleNotifyUserInfoEntry *user_info_entry = l->data; |
296 PurpleNotifyUserInfoEntryType type = purple_notify_user_info_entry_get_type(user_info_entry); | 296 PurpleNotifyUserInfoEntryType type = purple_notify_user_info_entry_get_type(user_info_entry); |
297 const char *label = purple_notify_user_info_entry_get_label(user_info_entry); | 297 const char *label = purple_notify_user_info_entry_get_label(user_info_entry); |
298 const char *value = purple_notify_user_info_entry_get_value(user_info_entry); | 298 const char *value = purple_notify_user_info_entry_get_value(user_info_entry); |
384 finch_notify_sr_new_rows(PurpleConnection *gc, | 384 finch_notify_sr_new_rows(PurpleConnection *gc, |
385 PurpleNotifySearchResults *results, void *data) | 385 PurpleNotifySearchResults *results, void *data) |
386 { | 386 { |
387 GntTree *tree = GNT_TREE(data); | 387 GntTree *tree = GNT_TREE(data); |
388 GList *o; | 388 GList *o; |
389 GntTreeRow *prev = NULL; | |
389 | 390 |
390 /* XXX: Do I need to empty the tree here? */ | 391 /* XXX: Do I need to empty the tree here? */ |
391 | 392 |
392 for (o = results->rows; o; o = o->next) | 393 for (o = results->rows; o; o = o->next) |
393 { | 394 { |
394 gnt_tree_add_row_after(GNT_TREE(tree), o->data, | 395 gnt_tree_add_row_after(GNT_TREE(tree), o->data, |
395 gnt_tree_create_row_from_list(GNT_TREE(tree), o->data), | 396 gnt_tree_create_row_from_list(GNT_TREE(tree), o->data), |
396 NULL, NULL); | 397 NULL, prev); |
397 } | 398 prev = o->data; |
399 } | |
400 } | |
401 | |
402 static void | |
403 notify_sr_destroy_cb(GntWidget *window, void *data) | |
404 { | |
405 purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, window); | |
398 } | 406 } |
399 | 407 |
400 static void * | 408 static void * |
401 finch_notify_searchresults(PurpleConnection *gc, const char *title, | 409 finch_notify_searchresults(PurpleConnection *gc, const char *title, |
402 const char *primary, const char *secondary, | 410 const char *primary, const char *secondary, |
427 | 435 |
428 i = 0; | 436 i = 0; |
429 for (iter = results->columns; iter; iter = iter->next) | 437 for (iter = results->columns; iter; iter = iter->next) |
430 { | 438 { |
431 PurpleNotifySearchColumn *column = iter->data; | 439 PurpleNotifySearchColumn *column = iter->data; |
432 gnt_tree_set_column_title(GNT_TREE(tree), i, column->title); | 440 gnt_tree_set_column_title(GNT_TREE(tree), i, purple_notify_searchresult_column_get_title(column)); |
441 | |
442 if (!purple_notify_searchresult_column_is_visible(column)) | |
443 gnt_tree_set_column_visible(GNT_TREE(tree), i, FALSE); | |
433 i++; | 444 i++; |
434 } | 445 } |
435 | 446 |
436 box = gnt_hbox_new(TRUE); | 447 box = gnt_hbox_new(TRUE); |
437 | 448 |
476 | 487 |
477 gnt_box_add_widget(GNT_BOX(box), button); | 488 gnt_box_add_widget(GNT_BOX(box), button); |
478 } | 489 } |
479 | 490 |
480 gnt_box_add_widget(GNT_BOX(window), box); | 491 gnt_box_add_widget(GNT_BOX(window), box); |
492 g_signal_connect(G_OBJECT(tree), "destroy", | |
493 G_CALLBACK(notify_sr_destroy_cb), NULL); | |
481 | 494 |
482 finch_notify_sr_new_rows(gc, results, tree); | 495 finch_notify_sr_new_rows(gc, results, tree); |
483 | 496 |
484 gnt_widget_show(window); | 497 gnt_widget_show(window); |
485 g_object_set_data(G_OBJECT(window), "notify-results", results); | 498 g_object_set_data(G_OBJECT(window), "notify-results", results); |