| 728 { |
728 { |
| 729 PidginNotifySearchResultsData *data = data_; |
729 PidginNotifySearchResultsData *data = data_; |
| 730 GtkListStore *model = data->model; |
730 GtkListStore *model = data->model; |
| 731 GtkTreeIter iter; |
731 GtkTreeIter iter; |
| 732 GdkPixbuf *pixbuf; |
732 GdkPixbuf *pixbuf; |
| 733 guint col_num; |
|
| 734 GList *row, *column; |
733 GList *row, *column; |
| 735 guint n; |
734 guint n; |
| 736 |
735 |
| 737 gtk_list_store_clear(data->model); |
736 gtk_list_store_clear(data->model); |
| 738 |
737 |
| 739 pixbuf = pidgin_create_prpl_icon(purple_connection_get_account(gc), 0.5); |
738 pixbuf = pidgin_create_prpl_icon(purple_connection_get_account(gc), 0.5); |
| 740 |
|
| 741 /* +1 is for the automagically created Status column. */ |
|
| 742 col_num = g_list_length(results->columns) + 1; |
|
| 743 |
739 |
| 744 for (row = results->rows; row != NULL; row = row->next) { |
740 for (row = results->rows; row != NULL; row = row->next) { |
| 745 |
741 |
| 746 gtk_list_store_append(model, &iter); |
742 gtk_list_store_append(model, &iter); |
| 747 gtk_list_store_set(model, &iter, 0, pixbuf, -1); |
743 gtk_list_store_set(model, &iter, 0, pixbuf, -1); |
| 867 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, |
864 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, |
| 868 column->title, renderer, "text", i, NULL); |
865 column->title, renderer, "text", i, NULL); |
| 869 i++; |
866 i++; |
| 870 } |
867 } |
| 871 |
868 |
| 872 for (i = 0; i < g_list_length(results->buttons); i++) { |
869 for (l = results->buttons; l; l = l->next) { |
| 873 PurpleNotifySearchButton *b = g_list_nth_data(results->buttons, i); |
870 PurpleNotifySearchButton *b = l->data; |
| 874 GtkWidget *button = NULL; |
871 GtkWidget *button = NULL; |
| 875 switch (b->type) { |
872 switch (b->type) { |
| 876 case PURPLE_NOTIFY_BUTTON_LABELED: |
873 case PURPLE_NOTIFY_BUTTON_LABELED: |
| 877 if(b->label) { |
874 if(b->label) { |
| 878 button = gtk_button_new_with_label(b->label); |
875 button = gtk_button_new_with_label(b->label); |