comparison src/gtknotify.c @ 13640:d12bbe6da705

[gaim-migrate @ 16038] * Changed signatures of some of the search results notify API functions. * GG PRPL: Support parallel public directory searches. committer: Tailor Script <tailor@pidgin.im>
author Bartoz Oler <bartosz@pidgin.im>
date Sun, 16 Apr 2006 10:10:55 +0000
parents c69a837e990c
children 8b7d6fce88d5
comparison
equal deleted inserted replaced
13639:43c7e892d8bf 13640:d12bbe6da705
50 { 50 {
51 GaimAccount *account; 51 GaimAccount *account;
52 GtkListStore *model; 52 GtkListStore *model;
53 GtkWidget *treeview; 53 GtkWidget *treeview;
54 GtkWidget *window; 54 GtkWidget *window;
55 gpointer user_data;
56
55 } GaimNotifySearchResultsData; 57 } GaimNotifySearchResultsData;
56 58
57 typedef struct 59 typedef struct
58 { 60 {
59 GaimNotifySearchButton *button; 61 GaimNotifySearchButton *button;
155 { 157 {
156 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); 158 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win);
157 } 159 }
158 160
159 static void 161 static void
160 searchresults_close_cb(GaimNotifySearchResultsData *data, GdkEvent *event, void *user_data) 162 searchresults_close_cb(GaimNotifySearchResultsData *data, GdkEvent *event, gpointer user_data)
161 { 163 {
162 gaim_notify_close(GAIM_NOTIFY_SEARCHRESULTS, data); 164 gaim_notify_close(GAIM_NOTIFY_SEARCHRESULTS, data);
163 } 165 }
164 166
165 static void 167 static void
186 row = g_list_append(row, str); 188 row = g_list_append(row, str);
187 } 189 }
188 } 190 }
189 191
190 button = bd->button; 192 button = bd->button;
191 button->callback(gaim_account_get_connection(data->account), row); 193 button->callback(gaim_account_get_connection(data->account), row, data->user_data);
192 } 194 }
193 195
194 static void * 196 static void *
195 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title, 197 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title,
196 const char *primary, const char *secondary) 198 const char *primary, const char *secondary)
612 return window; 614 return window;
613 } 615 }
614 616
615 static void 617 static void
616 gaim_gtk_notify_searchresults_new_rows(GaimConnection *gc, GaimNotifySearchResults *results, 618 gaim_gtk_notify_searchresults_new_rows(GaimConnection *gc, GaimNotifySearchResults *results,
617 void *data_, gpointer user_data) 619 void *data_)
618 { 620 {
619 GaimNotifySearchResultsData *data = data_; 621 GaimNotifySearchResultsData *data = data_;
620 GtkListStore *model = data->model; 622 GtkListStore *model = data->model;
621 GtkTreeIter iter; 623 GtkTreeIter iter;
622 GdkPixbuf *pixbuf; 624 GdkPixbuf *pixbuf;
654 } 656 }
655 657
656 static void * 658 static void *
657 gaim_gtk_notify_searchresults(GaimConnection *gc, const char *title, 659 gaim_gtk_notify_searchresults(GaimConnection *gc, const char *title,
658 const char *primary, const char *secondary, 660 const char *primary, const char *secondary,
659 GaimNotifySearchResults *results) 661 GaimNotifySearchResults *results, gpointer user_data)
660 { 662 {
661 GtkWidget *window; 663 GtkWidget *window;
662 GtkWidget *treeview; 664 GtkWidget *treeview;
663 GtkWidget *close_button; 665 GtkWidget *close_button;
664 GType *col_types; 666 GType *col_types;
677 679
678 g_return_val_if_fail(gc != NULL, NULL); 680 g_return_val_if_fail(gc != NULL, NULL);
679 g_return_val_if_fail(results != NULL, NULL); 681 g_return_val_if_fail(results != NULL, NULL);
680 682
681 data = g_malloc(sizeof(GaimNotifySearchResultsData)); 683 data = g_malloc(sizeof(GaimNotifySearchResultsData));
684 data->user_data = user_data;
682 685
683 /* Create the window */ 686 /* Create the window */
684 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 687 window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
685 gtk_window_set_title(GTK_WINDOW(window), (title ? title :_("Search Results"))); 688 gtk_window_set_title(GTK_WINDOW(window), (title ? title :_("Search Results")));
686 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); 689 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG);
822 data->model = model; 825 data->model = model;
823 data->treeview = treeview; 826 data->treeview = treeview;
824 data->window = window; 827 data->window = window;
825 828
826 /* Insert rows. */ 829 /* Insert rows. */
827 gaim_gtk_notify_searchresults_new_rows(gc, results, data, NULL); 830 gaim_gtk_notify_searchresults_new_rows(gc, results, data);
828 831
829 /* Show the window */ 832 /* Show the window */
830 gtk_widget_show(window); 833 gtk_widget_show(window);
831 return data; 834 return data;
832 } 835 }