plugins/gevolution/add_buddy_dialog.c

changeset 13091
b5ed878998dd
parent 11807
24a6c489e7f2
child 13705
100ce0da2e0a
equal deleted inserted replaced
13090:aee4ed853ff3 13091:b5ed878998dd
161 GList *list, const char *id) 161 GList *list, const char *id)
162 { 162 {
163 GaimAccount *account = NULL; 163 GaimAccount *account = NULL;
164 GList *l; 164 GList *l;
165 GtkTreeIter iter; 165 GtkTreeIter iter;
166 GdkPixbuf *pixbuf, *icon = NULL; 166 GdkPixbuf *pixbuf;
167 167
168 if (list == NULL) 168 if (list == NULL)
169 return; 169 return;
170 170
171 for (l = gaim_connections_get_all(); l != NULL; l = l->next) 171 for (l = gaim_connections_get_all(); l != NULL; l = l->next)
181 } 181 }
182 182
183 if (account == NULL) 183 if (account == NULL)
184 return; 184 return;
185 185
186 pixbuf = gaim_gtk_create_prpl_icon(account); 186 pixbuf = gaim_gtk_create_prpl_icon(account, 0.5);
187
188 if (pixbuf != NULL)
189 icon = gdk_pixbuf_scale_simple(pixbuf, 16, 16,
190 GDK_INTERP_BILINEAR);
191 187
192 for (l = list; l != NULL; l = l->next) 188 for (l = list; l != NULL; l = l->next)
193 { 189 {
194 char *account_name = (char *)l->data; 190 char *account_name = (char *)l->data;
195 191
201 197
202 gtk_list_store_append(dialog->model, &iter); 198 gtk_list_store_append(dialog->model, &iter);
203 199
204 gtk_list_store_set(dialog->model, &iter, 200 gtk_list_store_set(dialog->model, &iter,
205 COLUMN_NAME, name, 201 COLUMN_NAME, name,
206 COLUMN_PRPL_ICON, icon, 202 COLUMN_PRPL_ICON, pixbuf,
207 COLUMN_USERNAME, account_name, 203 COLUMN_USERNAME, account_name,
208 COLUMN_DATA, contact, 204 COLUMN_DATA, contact,
209 -1); 205 -1);
210 206
211 if (!strcmp(gaim_account_get_protocol_id(account), 207 if (!strcmp(gaim_account_get_protocol_id(account),
221 217
222 gtk_tree_selection_select_iter(selection, &iter); 218 gtk_tree_selection_select_iter(selection, &iter);
223 } 219 }
224 } 220 }
225 221
226 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); 222 if (pixbuf != NULL)
227 if (icon != NULL) g_object_unref(G_OBJECT(icon)); 223 g_object_unref(G_OBJECT(pixbuf));
228 224
229 g_list_foreach(list, (GFunc)g_free, NULL); 225 g_list_foreach(list, (GFunc)g_free, NULL);
230 g_list_free(list); 226 g_list_free(list);
231 } 227 }
232 228
609 void 605 void
610 gevo_add_buddy_dialog_add_person(GevoAddBuddyDialog *dialog, 606 gevo_add_buddy_dialog_add_person(GevoAddBuddyDialog *dialog,
611 EContact *contact, const char *name, 607 EContact *contact, const char *name,
612 GaimAccount *account, const char *screenname) 608 GaimAccount *account, const char *screenname)
613 { 609 {
614 GdkPixbuf *pixbuf, *icon = NULL; 610 GdkPixbuf *pixbuf;
615 GtkTreeIter iter; 611 GtkTreeIter iter;
616 612
617 pixbuf = gaim_gtk_create_prpl_icon(account); 613 pixbuf = gaim_gtk_create_prpl_icon(account, 0.5);
618
619 if (pixbuf != NULL)
620 icon = gdk_pixbuf_scale_simple(pixbuf, 16, 16, GDK_INTERP_BILINEAR);
621 614
622 gtk_list_store_append(dialog->model, &iter); 615 gtk_list_store_append(dialog->model, &iter);
623 616
624 gtk_list_store_set(dialog->model, &iter, 617 gtk_list_store_set(dialog->model, &iter,
625 COLUMN_NAME, name, 618 COLUMN_NAME, name,
626 COLUMN_PRPL_ICON, icon, 619 COLUMN_PRPL_ICON, pixbuf,
627 COLUMN_DATA, contact, 620 COLUMN_DATA, contact,
628 COLUMN_USERNAME, screenname, 621 COLUMN_USERNAME, screenname,
629 -1); 622 -1);
630 623
631 if (contact != NULL) 624 if (contact != NULL)
632 dialog->contacts = g_list_append(dialog->contacts, contact); 625 dialog->contacts = g_list_append(dialog->contacts, contact);
633 626
634 if (pixbuf != NULL) g_object_unref(G_OBJECT(pixbuf)); 627 if (pixbuf != NULL)
635 if (icon != NULL) g_object_unref(G_OBJECT(icon)); 628 g_object_unref(G_OBJECT(pixbuf));
636 } 629 }

mercurial