Mercurial > pidgin
comparison gtk/gtknotify.c @ 14191:009db0b357b5
This is a hand-crafted commit to migrate across subversion revisions
16854:16861, due to some vagaries of the way the original renames were
done. Witness that monotone can do in one revision what svn had to
spread across several.
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Sat, 16 Dec 2006 04:59:55 +0000 |
parents | |
children | ab8a105eff62 |
comparison
equal
deleted
inserted
replaced
14190:366be2ce35a7 | 14191:009db0b357b5 |
---|---|
1 /** | |
2 * @file gtknotify.c GTK+ Notification API | |
3 * @ingroup gtkui | |
4 * | |
5 * gaim | |
6 * | |
7 * Gaim is the legal property of its developers, whose names are too numerous | |
8 * to list here. Please refer to the COPYRIGHT file distributed with this | |
9 * source distribution. | |
10 * | |
11 * This program is free software; you can redistribute it and/or modify | |
12 * it under the terms of the GNU General Public License as published by | |
13 * the Free Software Foundation; either version 2 of the License, or | |
14 * (at your option) any later version. | |
15 * | |
16 * This program is distributed in the hope that it will be useful, | |
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 * GNU General Public License for more details. | |
20 * | |
21 * You should have received a copy of the GNU General Public License | |
22 * along with this program; if not, write to the Free Software | |
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
24 */ | |
25 #include "internal.h" | |
26 #include "gtkgaim.h" | |
27 | |
28 #include <gdk/gdkkeysyms.h> | |
29 | |
30 #include "connection.h" | |
31 #include "debug.h" | |
32 #include "prefs.h" | |
33 #include "gaimstock.h" | |
34 #include "util.h" | |
35 | |
36 #include "gtkblist.h" | |
37 #include "gtkimhtml.h" | |
38 #include "gtknotify.h" | |
39 #include "gtkutils.h" | |
40 | |
41 typedef struct | |
42 { | |
43 GaimConnection *gc; | |
44 char *url; | |
45 GtkWidget *label; | |
46 GtkTreeIter iter; | |
47 } GaimNotifyMailData; | |
48 | |
49 typedef struct | |
50 { | |
51 GaimAccount *account; | |
52 GtkListStore *model; | |
53 GtkWidget *treeview; | |
54 GtkWidget *window; | |
55 gpointer user_data; | |
56 GaimNotifySearchResults *results; | |
57 | |
58 } GaimNotifySearchResultsData; | |
59 | |
60 typedef struct | |
61 { | |
62 GaimNotifySearchButton *button; | |
63 GaimNotifySearchResultsData *data; | |
64 | |
65 } GaimNotifySearchResultsButtonData; | |
66 | |
67 enum | |
68 { | |
69 GAIM_MAIL_ICON, | |
70 GAIM_MAIL_TO, | |
71 GAIM_MAIL_FROM, | |
72 GAIM_MAIL_SUBJECT, | |
73 GAIM_MAIL_DATA, | |
74 COLUMNS_GAIM_MAIL | |
75 }; | |
76 | |
77 typedef struct _GaimMailDialog GaimMailDialog; | |
78 | |
79 struct _GaimMailDialog | |
80 { | |
81 GtkWidget *dialog; | |
82 GtkWidget *treeview; | |
83 GtkTreeStore *treemodel; | |
84 GtkLabel *label; | |
85 GtkWidget *open_button; | |
86 }; | |
87 | |
88 static GaimMailDialog *mail_dialog = NULL; | |
89 | |
90 static void *gaim_gtk_notify_emails(GaimConnection *gc, size_t count, gboolean detailed, | |
91 const char **subjects, | |
92 const char **froms, const char **tos, | |
93 const char **urls); | |
94 | |
95 static void | |
96 message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget) | |
97 { | |
98 gaim_notify_close(GAIM_NOTIFY_MESSAGE, widget); | |
99 } | |
100 | |
101 static void | |
102 email_nondetailed_cb(GtkDialog *dialog, gint id, GaimNotifyMailData *data) | |
103 { | |
104 if (id == GTK_RESPONSE_OK) | |
105 gaim_notify_uri(NULL, data->url); | |
106 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); | |
107 gtk_widget_destroy(GTK_WIDGET(dialog)); | |
108 } | |
109 | |
110 static void | |
111 email_response_cb(GtkDialog *dlg, gint id, GaimMailDialog *dialog) | |
112 { | |
113 GaimNotifyMailData *data = NULL; | |
114 GtkTreeIter iter; | |
115 | |
116 if (id == GTK_RESPONSE_YES) | |
117 { | |
118 GtkTreeSelection *selection; | |
119 | |
120 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); | |
121 | |
122 if (gtk_tree_selection_get_selected(selection, NULL, &iter)) | |
123 { | |
124 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter, | |
125 GAIM_MAIL_DATA, &data, -1); | |
126 gaim_notify_uri(NULL, data->url); | |
127 | |
128 gtk_tree_store_remove(dialog->treemodel, &iter); | |
129 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); | |
130 | |
131 if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) | |
132 return; | |
133 } | |
134 else | |
135 return; | |
136 } | |
137 else | |
138 { | |
139 while (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(mail_dialog->treemodel), &iter)) | |
140 { | |
141 gtk_tree_model_get(GTK_TREE_MODEL(dialog->treemodel), &iter, | |
142 GAIM_MAIL_DATA, &data, -1); | |
143 | |
144 if (id == GTK_RESPONSE_ACCEPT) | |
145 gaim_notify_uri(NULL, data->url); | |
146 | |
147 gtk_tree_store_remove(dialog->treemodel, &iter); | |
148 gaim_notify_close(GAIM_NOTIFY_EMAILS, data); | |
149 } | |
150 } | |
151 gtk_widget_destroy(dialog->dialog); | |
152 g_free(dialog); | |
153 mail_dialog = NULL; | |
154 } | |
155 | |
156 static void | |
157 formatted_close_cb(GtkWidget *win, GdkEvent *event, void *user_data) | |
158 { | |
159 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); | |
160 } | |
161 | |
162 static void | |
163 searchresults_close_cb(GaimNotifySearchResultsData *data, GdkEvent *event, gpointer user_data) | |
164 { | |
165 gaim_notify_close(GAIM_NOTIFY_SEARCHRESULTS, data); | |
166 } | |
167 | |
168 static void | |
169 searchresults_callback_wrapper_cb(GtkWidget *widget, GaimNotifySearchResultsButtonData *bd) | |
170 { | |
171 GaimNotifySearchResultsData *data = bd->data; | |
172 | |
173 GtkTreeSelection *selection; | |
174 GtkTreeModel *model; | |
175 GtkTreeIter iter; | |
176 GaimNotifySearchButton *button; | |
177 GList *row = NULL; | |
178 gchar *str; | |
179 int i; | |
180 | |
181 g_return_if_fail(data != NULL); | |
182 | |
183 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data->treeview)); | |
184 | |
185 if (gtk_tree_selection_get_selected(selection, &model, &iter)) | |
186 { | |
187 for (i = 1; i < gtk_tree_model_get_n_columns(GTK_TREE_MODEL(model)); i++) { | |
188 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, i, &str, -1); | |
189 row = g_list_append(row, str); | |
190 } | |
191 } | |
192 | |
193 button = bd->button; | |
194 button->callback(gaim_account_get_connection(data->account), row, data->user_data); | |
195 g_list_foreach(row, (GFunc)g_free, NULL); | |
196 g_list_free(row); | |
197 } | |
198 | |
199 static void * | |
200 gaim_gtk_notify_message(GaimNotifyMsgType type, const char *title, | |
201 const char *primary, const char *secondary) | |
202 { | |
203 GtkWidget *dialog; | |
204 GtkWidget *hbox; | |
205 GtkWidget *label; | |
206 GtkWidget *img = NULL; | |
207 char label_text[2048]; | |
208 const char *icon_name = NULL; | |
209 char *primary_esc, *secondary_esc; | |
210 | |
211 switch (type) | |
212 { | |
213 case GAIM_NOTIFY_MSG_ERROR: | |
214 icon_name = GAIM_STOCK_DIALOG_ERROR; | |
215 break; | |
216 | |
217 case GAIM_NOTIFY_MSG_WARNING: | |
218 icon_name = GAIM_STOCK_DIALOG_WARNING; | |
219 break; | |
220 | |
221 case GAIM_NOTIFY_MSG_INFO: | |
222 icon_name = GAIM_STOCK_DIALOG_INFO; | |
223 break; | |
224 | |
225 default: | |
226 icon_name = NULL; | |
227 break; | |
228 } | |
229 | |
230 if (icon_name != NULL) | |
231 { | |
232 img = gtk_image_new_from_stock(icon_name, GTK_ICON_SIZE_DIALOG); | |
233 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
234 } | |
235 | |
236 dialog = gtk_dialog_new_with_buttons(title ? title : GAIM_ALERT_TITLE, | |
237 NULL, 0, GTK_STOCK_CLOSE, | |
238 GTK_RESPONSE_CLOSE, NULL); | |
239 | |
240 gtk_window_set_role(GTK_WINDOW(dialog), "notify_dialog"); | |
241 | |
242 g_signal_connect(G_OBJECT(dialog), "response", | |
243 G_CALLBACK(message_response_cb), dialog); | |
244 | |
245 gtk_container_set_border_width(GTK_CONTAINER(dialog), GAIM_HIG_BORDER); | |
246 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | |
247 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | |
248 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BORDER); | |
249 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BOX_SPACE); | |
250 | |
251 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BORDER); | |
252 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); | |
253 | |
254 if (img != NULL) | |
255 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
256 | |
257 primary_esc = g_markup_escape_text(primary, -1); | |
258 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
259 g_snprintf(label_text, sizeof(label_text), | |
260 "<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s", | |
261 primary_esc, (secondary ? secondary_esc : "")); | |
262 g_free(primary_esc); | |
263 g_free(secondary_esc); | |
264 | |
265 label = gtk_label_new(NULL); | |
266 | |
267 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
268 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
269 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
270 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); | |
271 | |
272 gtk_widget_show_all(dialog); | |
273 | |
274 return dialog; | |
275 } | |
276 | |
277 static void | |
278 selection_changed_cb(GtkTreeSelection *sel, GaimMailDialog *dialog) | |
279 { | |
280 GtkTreeIter iter; | |
281 GtkTreeModel *model; | |
282 GaimNotifyMailData *data; | |
283 gboolean active = TRUE; | |
284 | |
285 if (gtk_tree_selection_get_selected(sel, &model, &iter) == FALSE) | |
286 active = FALSE; | |
287 else | |
288 { | |
289 gtk_tree_model_get(model, &iter, GAIM_MAIL_DATA, &data, -1); | |
290 if (data->url == NULL) | |
291 active = FALSE; | |
292 } | |
293 | |
294 gtk_widget_set_sensitive(dialog->open_button, active); | |
295 } | |
296 | |
297 static void * | |
298 gaim_gtk_notify_email(GaimConnection *gc, const char *subject, const char *from, | |
299 const char *to, const char *url) | |
300 { | |
301 return gaim_gtk_notify_emails(gc, 1, (subject != NULL), | |
302 (subject == NULL ? NULL : &subject), | |
303 (from == NULL ? NULL : &from), | |
304 (to == NULL ? NULL : &to), | |
305 (url == NULL ? NULL : &url)); | |
306 } | |
307 | |
308 static void * | |
309 gaim_gtk_notify_emails(GaimConnection *gc, size_t count, gboolean detailed, | |
310 const char **subjects, const char **froms, | |
311 const char **tos, const char **urls) | |
312 { | |
313 GaimNotifyMailData *data = NULL; | |
314 GtkWidget *dialog = NULL; | |
315 GtkWidget *vbox = NULL; | |
316 GtkWidget *hbox; | |
317 GtkWidget *label; | |
318 GtkWidget *img; | |
319 char *detail_text; | |
320 char *label_text; | |
321 GtkTreeIter iter; | |
322 GaimAccount *account; | |
323 | |
324 account = gaim_connection_get_account(gc); | |
325 | |
326 if (mail_dialog == NULL || !detailed) | |
327 { | |
328 GtkCellRenderer *rend; | |
329 GtkTreeViewColumn *column; | |
330 GtkWidget *button = NULL; | |
331 | |
332 dialog = gtk_dialog_new_with_buttons(_("New Mail"), NULL, 0, | |
333 GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE, | |
334 NULL); | |
335 if (detailed) | |
336 gtk_window_set_role(GTK_WINDOW(dialog), "new_mail_detailed"); | |
337 else | |
338 gtk_window_set_role(GTK_WINDOW(dialog), "new_mail"); | |
339 | |
340 if (!detailed && urls) | |
341 { | |
342 gtk_dialog_add_button(GTK_DIALOG(dialog), | |
343 GAIM_STOCK_OPEN_MAIL, GTK_RESPONSE_OK); | |
344 } | |
345 else if (detailed && mail_dialog == NULL) | |
346 { | |
347 gtk_dialog_add_button(GTK_DIALOG(dialog), | |
348 _("Open All Messages"), GTK_RESPONSE_ACCEPT); | |
349 | |
350 button = gtk_dialog_add_button(GTK_DIALOG(dialog), | |
351 GAIM_STOCK_OPEN_MAIL, GTK_RESPONSE_YES); | |
352 } | |
353 | |
354 /* Setup the dialog */ | |
355 gtk_container_set_border_width(GTK_CONTAINER(dialog), GAIM_HIG_BOX_SPACE); | |
356 gtk_container_set_border_width(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BOX_SPACE); | |
357 gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE); | |
358 gtk_box_set_spacing(GTK_BOX(GTK_DIALOG(dialog)->vbox), GAIM_HIG_BORDER); | |
359 | |
360 /* Setup the main horizontal box */ | |
361 hbox = gtk_hbox_new(FALSE, GAIM_HIG_BORDER); | |
362 gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), hbox); | |
363 | |
364 /* Dialog icon */ | |
365 img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_INFO, | |
366 GTK_ICON_SIZE_DIALOG); | |
367 gtk_misc_set_alignment(GTK_MISC(img), 0, 0); | |
368 gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); | |
369 | |
370 /* Vertical box */ | |
371 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); | |
372 | |
373 gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0); | |
374 | |
375 if (mail_dialog == NULL && detailed) | |
376 { | |
377 GtkWidget *sw; | |
378 | |
379 /* Golden ratio it up! */ | |
380 gtk_widget_set_size_request(dialog, 475, 200); | |
381 | |
382 sw = gtk_scrolled_window_new(NULL, NULL); | |
383 gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(sw), GTK_SHADOW_IN); | |
384 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
385 | |
386 mail_dialog = g_new0(GaimMailDialog, 1); | |
387 mail_dialog->dialog = dialog; | |
388 mail_dialog->open_button = button; | |
389 | |
390 mail_dialog->treemodel = gtk_tree_store_new(COLUMNS_GAIM_MAIL, | |
391 GDK_TYPE_PIXBUF, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); | |
392 mail_dialog->treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(mail_dialog->treemodel)); | |
393 | |
394 g_signal_connect(G_OBJECT(dialog), "response", | |
395 G_CALLBACK(email_response_cb), mail_dialog); | |
396 g_signal_connect(G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(mail_dialog->treeview))), | |
397 "changed", G_CALLBACK(selection_changed_cb), mail_dialog); | |
398 | |
399 /* Account column */ | |
400 column = gtk_tree_view_column_new(); | |
401 gtk_tree_view_column_set_resizable(column, TRUE); | |
402 gtk_tree_view_column_set_title(column, _("Account")); | |
403 rend = gtk_cell_renderer_pixbuf_new(); | |
404 gtk_tree_view_column_pack_start(column, rend, FALSE); | |
405 gtk_tree_view_column_set_attributes(column, rend, "pixbuf", GAIM_MAIL_ICON, NULL); | |
406 rend = gtk_cell_renderer_text_new(); | |
407 gtk_tree_view_column_pack_start(column, rend, TRUE); | |
408 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_TO, NULL); | |
409 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); | |
410 | |
411 /* From column */ | |
412 column = gtk_tree_view_column_new(); | |
413 gtk_tree_view_column_set_resizable(column, TRUE); | |
414 gtk_tree_view_column_set_title(column, _("From")); | |
415 rend = gtk_cell_renderer_text_new(); | |
416 gtk_tree_view_column_pack_start(column, rend, TRUE); | |
417 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_FROM, NULL); | |
418 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); | |
419 | |
420 /* Subject column */ | |
421 column = gtk_tree_view_column_new(); | |
422 gtk_tree_view_column_set_resizable(column, TRUE); | |
423 gtk_tree_view_column_set_title(column, _("Subject")); | |
424 rend = gtk_cell_renderer_text_new(); | |
425 gtk_tree_view_column_pack_start(column, rend, TRUE); | |
426 gtk_tree_view_column_set_attributes(column, rend, "markup", GAIM_MAIL_SUBJECT, NULL); | |
427 gtk_tree_view_append_column(GTK_TREE_VIEW(mail_dialog->treeview), column); | |
428 | |
429 gtk_container_add(GTK_CONTAINER(sw), mail_dialog->treeview); | |
430 | |
431 label = gtk_label_new(NULL); | |
432 gtk_label_set_markup(GTK_LABEL(label), _("<span weight=\"bold\" size=\"larger\">You have mail!</span>")); | |
433 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
434 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
435 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
436 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
437 } | |
438 } | |
439 | |
440 if (detailed) | |
441 { | |
442 dialog = mail_dialog->dialog; | |
443 while (count--) | |
444 { | |
445 char *to_text = NULL; | |
446 char *from_text = NULL; | |
447 char *subject_text = NULL; | |
448 GdkPixbuf *pixbuf; | |
449 | |
450 if (tos != NULL) | |
451 to_text = g_markup_escape_text(*tos, -1); | |
452 if (froms != NULL) | |
453 from_text = g_markup_escape_text(*froms, -1); | |
454 if (subjects != NULL) | |
455 subject_text = g_markup_escape_text(*subjects, -1); | |
456 | |
457 data = g_new0(GaimNotifyMailData, 1); | |
458 if (urls != NULL) | |
459 data->url = g_strdup(*urls); | |
460 | |
461 pixbuf = gaim_gtk_create_prpl_icon(account, 0.5); | |
462 | |
463 gtk_tree_store_append(mail_dialog->treemodel, &iter, NULL); | |
464 gtk_tree_store_set(mail_dialog->treemodel, &iter, | |
465 GAIM_MAIL_ICON, pixbuf, | |
466 GAIM_MAIL_TO, to_text, | |
467 GAIM_MAIL_FROM, from_text, | |
468 GAIM_MAIL_SUBJECT, subject_text, | |
469 GAIM_MAIL_DATA, data, | |
470 -1); | |
471 if (pixbuf != NULL) | |
472 g_object_unref(pixbuf); | |
473 g_free(to_text); | |
474 g_free(from_text); | |
475 g_free(subject_text); | |
476 data->iter = iter; | |
477 | |
478 if (urls != NULL) | |
479 urls++; | |
480 if (froms != NULL) | |
481 froms++; | |
482 if (subjects != NULL) | |
483 subjects++; | |
484 if (tos != NULL) | |
485 tos++; | |
486 } | |
487 } | |
488 else | |
489 { | |
490 data = g_new0(GaimNotifyMailData, 1); | |
491 | |
492 if (urls != NULL) | |
493 data->url = g_strdup(*urls); | |
494 | |
495 g_signal_connect(G_OBJECT(dialog), "response", | |
496 G_CALLBACK(email_nondetailed_cb), data); | |
497 | |
498 detail_text = g_strdup_printf(ngettext("%s has %d new message.", | |
499 "%s has %d new messages.", | |
500 (int)count), | |
501 *tos, (int)count); | |
502 label_text = g_strdup_printf( | |
503 _("<span weight=\"bold\" size=\"larger\">You have mail!</span>" | |
504 "\n\n%s"), detail_text); | |
505 | |
506 label = gtk_label_new(NULL); | |
507 | |
508 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
509 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
510 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
511 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0); | |
512 | |
513 g_free(label_text); | |
514 g_free(detail_text); | |
515 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE); | |
516 } | |
517 gtk_widget_show_all(dialog); | |
518 | |
519 return data; | |
520 } | |
521 | |
522 static gboolean | |
523 formatted_input_cb(GtkWidget *win, GdkEventKey *event, gpointer data) | |
524 { | |
525 if (event->keyval == GDK_Escape) | |
526 { | |
527 gaim_notify_close(GAIM_NOTIFY_FORMATTED, win); | |
528 | |
529 return TRUE; | |
530 } | |
531 | |
532 return FALSE; | |
533 } | |
534 | |
535 static void * | |
536 gaim_gtk_notify_formatted(const char *title, const char *primary, | |
537 const char *secondary, const char *text) | |
538 { | |
539 GtkWidget *window; | |
540 GtkWidget *vbox; | |
541 GtkWidget *label; | |
542 GtkWidget *button; | |
543 GtkWidget *imhtml; | |
544 GtkWidget *frame; | |
545 int options = 0; | |
546 char label_text[2048]; | |
547 char *linked_text, *primary_esc, *secondary_esc; | |
548 | |
549 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
550 gtk_window_set_title(GTK_WINDOW(window), title); | |
551 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); | |
552 gtk_container_set_border_width(GTK_CONTAINER(window), GAIM_HIG_BORDER); | |
553 | |
554 g_signal_connect(G_OBJECT(window), "delete_event", | |
555 G_CALLBACK(formatted_close_cb), NULL); | |
556 | |
557 /* Setup the main vbox */ | |
558 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); | |
559 gtk_container_add(GTK_CONTAINER(window), vbox); | |
560 gtk_widget_show(vbox); | |
561 | |
562 /* Setup the descriptive label */ | |
563 primary_esc = g_markup_escape_text(primary, -1); | |
564 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
565 g_snprintf(label_text, sizeof(label_text), | |
566 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", | |
567 primary_esc, | |
568 (secondary ? "\n" : ""), | |
569 (secondary ? secondary_esc : "")); | |
570 g_free(primary_esc); | |
571 g_free(secondary_esc); | |
572 | |
573 label = gtk_label_new(NULL); | |
574 | |
575 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
576 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
577 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
578 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
579 gtk_widget_show(label); | |
580 | |
581 /* Add the imhtml */ | |
582 frame = gaim_gtk_create_imhtml(FALSE, &imhtml, NULL, NULL); | |
583 gtk_widget_set_name(imhtml, "gaim_gtknotify_imhtml"); | |
584 gtk_imhtml_set_format_functions(GTK_IMHTML(imhtml), | |
585 gtk_imhtml_get_format_functions(GTK_IMHTML(imhtml)) | GTK_IMHTML_IMAGE); | |
586 gtk_widget_set_size_request(imhtml, 300, 250); | |
587 gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); | |
588 gtk_widget_show(frame); | |
589 | |
590 /* Add the Close button. */ | |
591 button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | |
592 gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0); | |
593 gtk_widget_show(button); | |
594 | |
595 g_signal_connect_swapped(G_OBJECT(button), "clicked", | |
596 G_CALLBACK(formatted_close_cb), window); | |
597 g_signal_connect(G_OBJECT(window), "key_press_event", | |
598 G_CALLBACK(formatted_input_cb), NULL); | |
599 | |
600 /* Add the text to the gtkimhtml */ | |
601 if (!gaim_prefs_get_bool("/gaim/gtk/conversations/show_incoming_formatting")) | |
602 options |= GTK_IMHTML_NO_COLOURS | GTK_IMHTML_NO_FONTS | GTK_IMHTML_NO_SIZES; | |
603 | |
604 options |= GTK_IMHTML_NO_COMMENTS; | |
605 options |= GTK_IMHTML_NO_TITLE; | |
606 options |= GTK_IMHTML_NO_NEWLINE; | |
607 options |= GTK_IMHTML_NO_SCROLL; | |
608 | |
609 /* Make sure URLs are clickable */ | |
610 linked_text = gaim_markup_linkify(text); | |
611 gtk_imhtml_append_text(GTK_IMHTML(imhtml), linked_text, options); | |
612 g_free(linked_text); | |
613 | |
614 /* Show the window */ | |
615 gtk_widget_show(window); | |
616 | |
617 return window; | |
618 } | |
619 | |
620 static void | |
621 gaim_gtk_notify_searchresults_new_rows(GaimConnection *gc, GaimNotifySearchResults *results, | |
622 void *data_) | |
623 { | |
624 GaimNotifySearchResultsData *data = data_; | |
625 GtkListStore *model = data->model; | |
626 GtkTreeIter iter; | |
627 GdkPixbuf *pixbuf; | |
628 guint col_num; | |
629 guint i; | |
630 guint j; | |
631 | |
632 gtk_list_store_clear(data->model); | |
633 | |
634 pixbuf = gaim_gtk_create_prpl_icon(gaim_connection_get_account(gc), 0.5); | |
635 | |
636 /* +1 is for the automagically created Status column. */ | |
637 col_num = gaim_notify_searchresults_get_columns_count(results) + 1; | |
638 | |
639 for (i = 0; i < gaim_notify_searchresults_get_rows_count(results); i++) { | |
640 GList *row = gaim_notify_searchresults_row_get(results, i); | |
641 | |
642 gtk_list_store_append(model, &iter); | |
643 gtk_list_store_set(model, &iter, 0, pixbuf, -1); | |
644 | |
645 for (j = 1; j < col_num; j++) { | |
646 GValue v; | |
647 char *escaped = g_markup_escape_text(g_list_nth_data(row, j - 1), -1); | |
648 | |
649 v.g_type = 0; | |
650 g_value_init(&v, G_TYPE_STRING); | |
651 g_value_set_string(&v, escaped); | |
652 gtk_list_store_set_value(model, &iter, j, &v); | |
653 g_free(escaped); | |
654 } | |
655 } | |
656 | |
657 if (pixbuf != NULL) | |
658 g_object_unref(pixbuf); | |
659 } | |
660 | |
661 static void * | |
662 gaim_gtk_notify_searchresults(GaimConnection *gc, const char *title, | |
663 const char *primary, const char *secondary, | |
664 GaimNotifySearchResults *results, gpointer user_data) | |
665 { | |
666 GtkWidget *window; | |
667 GtkWidget *treeview; | |
668 GtkWidget *close_button; | |
669 GType *col_types; | |
670 GtkListStore *model; | |
671 GtkCellRenderer *renderer; | |
672 guint col_num; | |
673 guint i; | |
674 | |
675 GtkWidget *vbox; | |
676 GtkWidget *button_area; | |
677 GtkWidget *label; | |
678 GtkWidget *sw; | |
679 GaimNotifySearchResultsData *data; | |
680 char *label_text; | |
681 char *primary_esc, *secondary_esc; | |
682 | |
683 g_return_val_if_fail(gc != NULL, NULL); | |
684 g_return_val_if_fail(results != NULL, NULL); | |
685 | |
686 data = g_malloc(sizeof(GaimNotifySearchResultsData)); | |
687 data->user_data = user_data; | |
688 data->results = results; | |
689 | |
690 /* Create the window */ | |
691 window = gtk_window_new(GTK_WINDOW_TOPLEVEL); | |
692 gtk_window_set_title(GTK_WINDOW(window), (title ? title :_("Search Results"))); | |
693 gtk_window_set_type_hint(GTK_WINDOW(window), GDK_WINDOW_TYPE_HINT_DIALOG); | |
694 gtk_container_set_border_width(GTK_CONTAINER(window), GAIM_HIG_BORDER); | |
695 | |
696 g_signal_connect_swapped(G_OBJECT(window), "delete_event", | |
697 G_CALLBACK(searchresults_close_cb), data); | |
698 | |
699 /* Setup the main vbox */ | |
700 vbox = gtk_vbox_new(FALSE, GAIM_HIG_BORDER); | |
701 gtk_container_add(GTK_CONTAINER(window), vbox); | |
702 gtk_widget_show(vbox); | |
703 | |
704 /* Setup the descriptive label */ | |
705 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL; | |
706 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL; | |
707 label_text = g_strdup_printf( | |
708 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s", | |
709 (primary ? primary_esc : ""), | |
710 (primary && secondary ? "\n" : ""), | |
711 (secondary ? secondary_esc : "")); | |
712 g_free(primary_esc); | |
713 g_free(secondary_esc); | |
714 label = gtk_label_new(NULL); | |
715 gtk_label_set_markup(GTK_LABEL(label), label_text); | |
716 gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
717 gtk_misc_set_alignment(GTK_MISC(label), 0, 0); | |
718 gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0); | |
719 gtk_widget_show(label); | |
720 g_free(label_text); | |
721 | |
722 /* +1 is for the automagically created Status column. */ | |
723 col_num = gaim_notify_searchresults_get_columns_count(results) + 1; | |
724 | |
725 /* Setup the list model */ | |
726 col_types = g_new0(GType, col_num); | |
727 | |
728 /* There always is this first column. */ | |
729 col_types[0] = GDK_TYPE_PIXBUF; | |
730 for (i = 1; i < col_num; i++) { | |
731 col_types[i] = G_TYPE_STRING; | |
732 } | |
733 model = gtk_list_store_newv(col_num, col_types); | |
734 | |
735 /* Setup the scrolled window containing the treeview */ | |
736 sw = gtk_scrolled_window_new(NULL, NULL); | |
737 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), | |
738 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); | |
739 gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), | |
740 GTK_SHADOW_IN); | |
741 gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); | |
742 gtk_widget_show(sw); | |
743 | |
744 /* Setup the treeview */ | |
745 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model)); | |
746 gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); | |
747 gtk_widget_set_size_request(treeview, 500, 400); | |
748 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)), | |
749 GTK_SELECTION_SINGLE); | |
750 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE); | |
751 gtk_container_add(GTK_CONTAINER(sw), treeview); | |
752 gtk_widget_show(treeview); | |
753 | |
754 renderer = gtk_cell_renderer_pixbuf_new(); | |
755 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), | |
756 -1, "", renderer, "pixbuf", 0, NULL); | |
757 | |
758 for (i = 1; i < col_num; i++) { | |
759 renderer = gtk_cell_renderer_text_new(); | |
760 | |
761 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1, | |
762 gaim_notify_searchresults_column_get_title(results, i-1), | |
763 renderer, "text", i, NULL); | |
764 } | |
765 | |
766 /* Setup the button area */ | |
767 button_area = gtk_hbutton_box_new(); | |
768 gtk_box_pack_start(GTK_BOX(vbox), button_area, FALSE, FALSE, 0); | |
769 gtk_button_box_set_layout(GTK_BUTTON_BOX(button_area), GTK_BUTTONBOX_END); | |
770 gtk_box_set_spacing(GTK_BOX(button_area), GAIM_HIG_BORDER); | |
771 gtk_widget_show(button_area); | |
772 | |
773 for (i = 0; i < g_list_length(results->buttons); i++) { | |
774 GaimNotifySearchButton *b = g_list_nth_data(results->buttons, i); | |
775 GtkWidget *button = NULL; | |
776 switch (b->type) { | |
777 case GAIM_NOTIFY_BUTTON_LABELED: | |
778 if(b->label) { | |
779 button = gtk_button_new_with_label(b->label); | |
780 } else { | |
781 gaim_debug_warning("gtknotify", "Missing button label"); | |
782 } | |
783 break; | |
784 case GAIM_NOTIFY_BUTTON_CONTINUE: | |
785 button = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD); | |
786 break; | |
787 case GAIM_NOTIFY_BUTTON_ADD: | |
788 button = gtk_button_new_from_stock(GTK_STOCK_ADD); | |
789 break; | |
790 case GAIM_NOTIFY_BUTTON_INFO: | |
791 button = gtk_button_new_from_stock(GAIM_STOCK_INFO); | |
792 break; | |
793 case GAIM_NOTIFY_BUTTON_IM: | |
794 button = gtk_button_new_from_stock(GAIM_STOCK_IM); | |
795 break; | |
796 case GAIM_NOTIFY_BUTTON_JOIN: | |
797 button = gtk_button_new_from_stock(GAIM_STOCK_CHAT); | |
798 break; | |
799 case GAIM_NOTIFY_BUTTON_INVITE: | |
800 button = gtk_button_new_from_stock(GAIM_STOCK_INVITE); | |
801 break; | |
802 default: | |
803 gaim_debug_warning("gtknotify", "Incorrect button type: %d\n", b->type); | |
804 } | |
805 if (button != NULL) { | |
806 GaimNotifySearchResultsButtonData *bd; | |
807 | |
808 gtk_box_pack_start(GTK_BOX(button_area), button, FALSE, FALSE, 0); | |
809 gtk_widget_show(button); | |
810 | |
811 bd = g_new0(GaimNotifySearchResultsButtonData, 1); | |
812 bd->button = b; | |
813 bd->data = data; | |
814 | |
815 g_signal_connect(G_OBJECT(button), "clicked", | |
816 G_CALLBACK(searchresults_callback_wrapper_cb), bd); | |
817 g_signal_connect_swapped(G_OBJECT(button), "destroy", G_CALLBACK(g_free), bd); | |
818 } | |
819 } | |
820 | |
821 /* Add the Close button */ | |
822 close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE); | |
823 gtk_box_pack_start(GTK_BOX(button_area), close_button, FALSE, FALSE, 0); | |
824 gtk_widget_show(close_button); | |
825 | |
826 g_signal_connect_swapped(G_OBJECT(close_button), "clicked", | |
827 G_CALLBACK(searchresults_close_cb), data); | |
828 | |
829 data->account = gc->account; | |
830 data->model = model; | |
831 data->treeview = treeview; | |
832 data->window = window; | |
833 | |
834 /* Insert rows. */ | |
835 gaim_gtk_notify_searchresults_new_rows(gc, results, data); | |
836 | |
837 /* Show the window */ | |
838 gtk_widget_show(window); | |
839 return data; | |
840 } | |
841 | |
842 static void * | |
843 gaim_gtk_notify_userinfo(GaimConnection *gc, const char *who, | |
844 const char *text) | |
845 { | |
846 char *primary; | |
847 void *ui_handle; | |
848 | |
849 primary = g_strdup_printf(_("Info for %s"), who); | |
850 ui_handle = gaim_gtk_notify_formatted(_("Buddy Information"), primary, NULL, text); | |
851 g_free(primary); | |
852 return ui_handle; | |
853 } | |
854 | |
855 static void | |
856 gaim_gtk_close_notify(GaimNotifyType type, void *ui_handle) | |
857 { | |
858 if (type == GAIM_NOTIFY_EMAIL || type == GAIM_NOTIFY_EMAILS) | |
859 { | |
860 GaimNotifyMailData *data = (GaimNotifyMailData *)ui_handle; | |
861 | |
862 g_free(data->url); | |
863 g_free(data); | |
864 } | |
865 else if (type == GAIM_NOTIFY_SEARCHRESULTS) | |
866 { | |
867 GaimNotifySearchResultsData *data = (GaimNotifySearchResultsData *)ui_handle; | |
868 | |
869 gtk_widget_destroy(data->window); | |
870 gaim_notify_searchresults_free(data->results); | |
871 | |
872 g_free(data); | |
873 } | |
874 else if (ui_handle != NULL) | |
875 gtk_widget_destroy(GTK_WIDGET(ui_handle)); | |
876 } | |
877 | |
878 #ifndef _WIN32 | |
879 static gint | |
880 uri_command(const char *command, gboolean sync) | |
881 { | |
882 gchar *tmp; | |
883 GError *error = NULL; | |
884 gint ret = 0; | |
885 | |
886 gaim_debug_misc("gtknotify", "Executing %s\n", command); | |
887 | |
888 if (!gaim_program_is_valid(command)) | |
889 { | |
890 tmp = g_strdup_printf(_("The browser command \"%s\" is invalid."), | |
891 command ? command : "(none)"); | |
892 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); | |
893 g_free(tmp); | |
894 | |
895 } | |
896 else if (sync) | |
897 { | |
898 gint status; | |
899 | |
900 if (!g_spawn_command_line_sync(command, NULL, NULL, &status, &error)) | |
901 { | |
902 tmp = g_strdup_printf(_("Error launching \"%s\": %s"), | |
903 command, error->message); | |
904 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); | |
905 g_free(tmp); | |
906 g_error_free(error); | |
907 } | |
908 else | |
909 ret = status; | |
910 } | |
911 else | |
912 { | |
913 if (!g_spawn_command_line_async(command, &error)) | |
914 { | |
915 tmp = g_strdup_printf(_("Error launching \"%s\": %s"), | |
916 command, error->message); | |
917 gaim_notify_error(NULL, NULL, _("Unable to open URL"), tmp); | |
918 g_free(tmp); | |
919 g_error_free(error); | |
920 } | |
921 } | |
922 | |
923 return ret; | |
924 } | |
925 #endif /* _WIN32 */ | |
926 | |
927 static void * | |
928 gaim_gtk_notify_uri(const char *uri) | |
929 { | |
930 #ifndef _WIN32 | |
931 char *escaped = g_shell_quote(uri); | |
932 char *command = NULL; | |
933 char *remote_command = NULL; | |
934 const char *web_browser; | |
935 int place; | |
936 | |
937 web_browser = gaim_prefs_get_string("/gaim/gtk/browsers/browser"); | |
938 place = gaim_prefs_get_int("/gaim/gtk/browsers/place"); | |
939 | |
940 /* if they are running gnome, use the gnome web browser */ | |
941 if (gaim_running_gnome() == TRUE) | |
942 { | |
943 command = g_strdup_printf("gnome-open %s", escaped); | |
944 } | |
945 else if (!strcmp(web_browser, "epiphany") || | |
946 !strcmp(web_browser, "galeon")) | |
947 { | |
948 if (place == GAIM_BROWSER_NEW_WINDOW) | |
949 command = g_strdup_printf("%s -w %s", web_browser, escaped); | |
950 else if (place == GAIM_BROWSER_NEW_TAB) | |
951 command = g_strdup_printf("%s -n %s", web_browser, escaped); | |
952 else | |
953 command = g_strdup_printf("%s %s", web_browser, escaped); | |
954 } | |
955 else if (!strcmp(web_browser, "gnome-open")) | |
956 { | |
957 command = g_strdup_printf("gnome-open %s", escaped); | |
958 } | |
959 else if (!strcmp(web_browser, "kfmclient")) | |
960 { | |
961 command = g_strdup_printf("kfmclient openURL %s", escaped); | |
962 /* | |
963 * Does Konqueror have options to open in new tab | |
964 * and/or current window? | |
965 */ | |
966 } | |
967 else if (!strcmp(web_browser, "mozilla") || | |
968 !strcmp(web_browser, "mozilla-firebird") || | |
969 !strcmp(web_browser, "firefox")) | |
970 { | |
971 char *args = ""; | |
972 | |
973 command = g_strdup_printf("%s %s", web_browser, escaped); | |
974 | |
975 /* | |
976 * Firefox 0.9 and higher require a "-a firefox" option when | |
977 * using -remote commands. This breaks older versions of | |
978 * mozilla. So we include this other handly little string | |
979 * when calling firefox. If the API for remote calls changes | |
980 * any more in firefox then firefox should probably be split | |
981 * apart from mozilla-firebird and mozilla... but this is good | |
982 * for now. | |
983 */ | |
984 if (!strcmp(web_browser, "firefox")) | |
985 args = "-a firefox"; | |
986 | |
987 if (place == GAIM_BROWSER_NEW_WINDOW) | |
988 remote_command = g_strdup_printf("%s %s -remote " | |
989 "openURL(%s,new-window)", | |
990 web_browser, args, escaped); | |
991 else if (place == GAIM_BROWSER_NEW_TAB) | |
992 remote_command = g_strdup_printf("%s %s -remote " | |
993 "openURL(%s,new-tab)", | |
994 web_browser, args, escaped); | |
995 else if (place == GAIM_BROWSER_CURRENT) | |
996 remote_command = g_strdup_printf("%s %s -remote " | |
997 "openURL(%s)", | |
998 web_browser, args, escaped); | |
999 } | |
1000 else if (!strcmp(web_browser, "netscape")) | |
1001 { | |
1002 command = g_strdup_printf("netscape %s", escaped); | |
1003 | |
1004 if (place == GAIM_BROWSER_NEW_WINDOW) | |
1005 { | |
1006 remote_command = g_strdup_printf("netscape -remote " | |
1007 "openURL(%s,new-window)", | |
1008 escaped); | |
1009 } | |
1010 else if (place == GAIM_BROWSER_CURRENT) | |
1011 { | |
1012 remote_command = g_strdup_printf("netscape -remote " | |
1013 "openURL(%s)", escaped); | |
1014 } | |
1015 } | |
1016 else if (!strcmp(web_browser, "opera")) | |
1017 { | |
1018 if (place == GAIM_BROWSER_NEW_WINDOW) | |
1019 command = g_strdup_printf("opera -newwindow %s", escaped); | |
1020 else if (place == GAIM_BROWSER_NEW_TAB) | |
1021 command = g_strdup_printf("opera -newpage %s", escaped); | |
1022 else if (place == GAIM_BROWSER_CURRENT) | |
1023 { | |
1024 remote_command = g_strdup_printf("opera -remote " | |
1025 "openURL(%s)", escaped); | |
1026 command = g_strdup_printf("opera %s", escaped); | |
1027 } | |
1028 else | |
1029 command = g_strdup_printf("opera %s", escaped); | |
1030 | |
1031 } | |
1032 else if (!strcmp(web_browser, "custom")) | |
1033 { | |
1034 const char *web_command; | |
1035 | |
1036 web_command = gaim_prefs_get_string("/gaim/gtk/browsers/command"); | |
1037 | |
1038 if (web_command == NULL || *web_command == '\0') | |
1039 { | |
1040 gaim_notify_error(NULL, NULL, _("Unable to open URL"), | |
1041 _("The 'Manual' browser command has been " | |
1042 "chosen, but no command has been set.")); | |
1043 return NULL; | |
1044 } | |
1045 | |
1046 if (strstr(web_command, "%s")) | |
1047 command = gaim_strreplace(web_command, "%s", escaped); | |
1048 else | |
1049 { | |
1050 /* | |
1051 * There is no "%s" in the browser command. Assume the user | |
1052 * wanted the URL tacked on to the end of the command. | |
1053 */ | |
1054 command = g_strdup_printf("%s %s", web_command, escaped); | |
1055 } | |
1056 } | |
1057 | |
1058 g_free(escaped); | |
1059 | |
1060 if (remote_command != NULL) | |
1061 { | |
1062 /* try the remote command first */ | |
1063 if (uri_command(remote_command, TRUE) != 0) | |
1064 uri_command(command, FALSE); | |
1065 | |
1066 g_free(remote_command); | |
1067 | |
1068 } | |
1069 else | |
1070 uri_command(command, FALSE); | |
1071 | |
1072 g_free(command); | |
1073 | |
1074 #else /* !_WIN32 */ | |
1075 wgaim_notify_uri(uri); | |
1076 #endif /* !_WIN32 */ | |
1077 | |
1078 return NULL; | |
1079 } | |
1080 | |
1081 static GaimNotifyUiOps ops = | |
1082 { | |
1083 gaim_gtk_notify_message, | |
1084 gaim_gtk_notify_email, | |
1085 gaim_gtk_notify_emails, | |
1086 gaim_gtk_notify_formatted, | |
1087 gaim_gtk_notify_searchresults, | |
1088 gaim_gtk_notify_searchresults_new_rows, | |
1089 gaim_gtk_notify_userinfo, | |
1090 gaim_gtk_notify_uri, | |
1091 gaim_gtk_close_notify | |
1092 }; | |
1093 | |
1094 GaimNotifyUiOps * | |
1095 gaim_gtk_notify_get_ui_ops(void) | |
1096 { | |
1097 return &ops; | |
1098 } |