Fri, 29 May 2009 05:11:14 +0000
Fix Finch not to announce "your gmail account has 0 new messages."
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
1 | /** |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
2 | * @file gntnotify.c GNT Notify API |
|
16255
fa61ee19f526
Rename the Doxygen group from gntui to finch and define the finch group
Richard Laager <rlaager@pidgin.im>
parents:
15931
diff
changeset
|
3 | * @ingroup finch |
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* finch |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
8 | * Finch is the legal property of its developers, whose names are too numerous |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
10 | * source distribution. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
11 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
12 | * This program is free software; you can redistribute it and/or modify |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
13 | * it under the terms of the GNU General Public License as published by |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
14 | * the Free Software Foundation; either version 2 of the License, or |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
15 | * (at your option) any later version. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
16 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
17 | * This program is distributed in the hope that it will be useful, |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
20 | * GNU General Public License for more details. |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
21 | * |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
22 | * You should have received a copy of the GNU General Public License |
|
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
23 | * along with this program; if not, write to the Free Software |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
18402
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
|
14620
90d599495d65
[gaim-migrate @ 17281]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14368
diff
changeset
|
25 | */ |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
26 | #include <gnt.h> |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
27 | #include <gntbox.h> |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
28 | #include <gntbutton.h> |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
29 | #include <gntlabel.h> |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
30 | #include <gnttree.h> |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
31 | #include <gntutils.h> |
|
22991
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
32 | #include <gntwindow.h> |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
33 | |
|
18273
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17846
diff
changeset
|
34 | #include "finch.h" |
|
e61c53184c52
#include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17846
diff
changeset
|
35 | |
|
26477
245d9650bb2b
Remove some extra edits that snuck into Finch.
Michael Ruprecht <maiku@pidgin.im>
parents:
26138
diff
changeset
|
36 | #include <util.h> |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
37 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
38 | #include "gntnotify.h" |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
39 | #include "debug.h" |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
40 | |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
41 | static struct |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
42 | { |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
43 | GntWidget *window; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
44 | GntWidget *tree; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
45 | } emaildialog; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
46 | |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
47 | static void |
| 15884 | 48 | notify_msg_window_destroy_cb(GntWidget *window, PurpleNotifyMsgType type) |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
49 | { |
| 15884 | 50 | purple_notify_close(type, window); |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
51 | } |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
52 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
53 | static void * |
| 15884 | 54 | finch_notify_message(PurpleNotifyMsgType type, const char *title, |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
55 | const char *primary, const char *secondary) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
56 | { |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
57 | GntWidget *window, *button; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
58 | GntTextFormatFlags pf = 0, sf = 0; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
59 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
60 | switch (type) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
61 | { |
| 15884 | 62 | case PURPLE_NOTIFY_MSG_ERROR: |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
63 | sf |= GNT_TEXT_FLAG_BOLD; |
| 15884 | 64 | case PURPLE_NOTIFY_MSG_WARNING: |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
65 | pf |= GNT_TEXT_FLAG_UNDERLINE; |
| 15884 | 66 | case PURPLE_NOTIFY_MSG_INFO: |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
67 | pf |= GNT_TEXT_FLAG_BOLD; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
68 | break; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
69 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
70 | |
|
22991
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
71 | window = gnt_window_box_new(FALSE, TRUE); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
72 | gnt_box_set_title(GNT_BOX(window), title); |
|
14015
e543d2109729
[gaim-migrate @ 16501]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
73 | gnt_box_set_fill(GNT_BOX(window), FALSE); |
|
e543d2109729
[gaim-migrate @ 16501]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14014
diff
changeset
|
74 | gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); |
|
17846
e8ee63f71029
Remove the confusing 'OK' button from the auth dialog.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17845
diff
changeset
|
75 | gnt_box_set_pad(GNT_BOX(window), 0); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
76 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
77 | if (primary) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
78 | gnt_box_add_widget(GNT_BOX(window), |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
79 | gnt_label_new_with_format(primary, pf)); |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
80 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
81 | button = gnt_button_new(_("OK")); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
82 | |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
83 | if (secondary) { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
84 | GntWidget *msg; |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
85 | if (type == PURPLE_NOTIFY_FORMATTED) { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
86 | int width = -1, height = -1; |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
87 | char *plain = (char*)secondary; |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
88 | msg = gnt_text_view_new(); |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
89 | gnt_text_view_set_flag(GNT_TEXT_VIEW(msg), GNT_TEXT_VIEW_TOP_ALIGN | GNT_TEXT_VIEW_NO_SCROLL); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
90 | switch (type) { |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
91 | case PURPLE_NOTIFY_FORMATTED: |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
92 | plain = purple_markup_strip_html(secondary); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
93 | if (gnt_util_parse_xhtml_to_textview(secondary, GNT_TEXT_VIEW(msg))) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
94 | break; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
95 | /* Fallthrough */ |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
96 | default: |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
97 | gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(msg), plain, sf); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
98 | } |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
99 | gnt_text_view_attach_scroll_widget(GNT_TEXT_VIEW(msg), button); |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
100 | gnt_util_get_text_bound(plain, &width, &height); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
101 | gnt_widget_set_size(msg, width + 3, height + 1); |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
102 | if (plain != secondary) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
103 | g_free(plain); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
104 | } else { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
105 | msg = gnt_label_new_with_format(secondary, sf); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
106 | } |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
107 | gnt_box_add_widget(GNT_BOX(window), msg); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
108 | g_object_set_data(G_OBJECT(window), "info-widget", msg); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
109 | } |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
110 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
111 | gnt_box_add_widget(GNT_BOX(window), button); |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
112 | g_signal_connect_swapped(G_OBJECT(button), "activate", |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
113 | G_CALLBACK(gnt_widget_destroy), window); |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
114 | g_signal_connect(G_OBJECT(window), "destroy", |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
115 | G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type)); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
116 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
117 | gnt_widget_show(window); |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
118 | return window; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
119 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
120 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
121 | /* handle is, in all/most occasions, a GntWidget * */ |
| 15884 | 122 | static void finch_close_notify(PurpleNotifyType type, void *handle) |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
123 | { |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
124 | GntWidget *widget = handle; |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
125 | |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
126 | if (!widget) |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
127 | return; |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
128 | |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
129 | while (widget->parent) |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
130 | widget = widget->parent; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
131 | |
| 15884 | 132 | if (type == PURPLE_NOTIFY_SEARCHRESULTS) |
| 133 | purple_notify_searchresults_free(g_object_get_data(handle, "notify-results")); | |
|
14368
141224b7e90e
[gaim-migrate @ 16996]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14260
diff
changeset
|
134 | #if 1 |
|
141224b7e90e
[gaim-migrate @ 16996]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14260
diff
changeset
|
135 | /* This did not seem to be necessary */ |
|
14050
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
136 | g_signal_handlers_disconnect_by_func(G_OBJECT(widget), |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
137 | G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type)); |
|
800c76ca93f7
[gaim-migrate @ 16561]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14041
diff
changeset
|
138 | #endif |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
139 | gnt_widget_destroy(widget); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
140 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
141 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15252
diff
changeset
|
142 | static void *finch_notify_formatted(const char *title, const char *primary, |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
143 | const char *secondary, const char *text) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
144 | { |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
145 | char *xhtml = NULL; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
146 | char *t = g_strdup_printf("<span>%s%s%s</span>", |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
147 | secondary ? secondary : "", |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
148 | secondary ? "\n" : "", |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
149 | text ? text : ""); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
150 | void *ret; |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
151 | |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
152 | purple_markup_html_to_xhtml(t, &xhtml, NULL); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
153 | ret = finch_notify_message(PURPLE_NOTIFY_FORMATTED, title, primary, xhtml); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
154 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
155 | g_free(t); |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
156 | g_free(xhtml); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
157 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
158 | return ret; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
159 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
160 | |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
161 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
20984
diff
changeset
|
162 | reset_email_dialog(void) |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
163 | { |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
164 | emaildialog.window = NULL; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
165 | emaildialog.tree = NULL; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
166 | } |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
167 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
168 | static void |
|
22104
56970903b8e9
Probe for -Wstrict-prototypes to get some more warnings. I then cleaned up
Richard Laager <rlaager@pidgin.im>
parents:
20984
diff
changeset
|
169 | setup_email_dialog(void) |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
170 | { |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
171 | GntWidget *box, *tree, *button; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
172 | if (emaildialog.window) |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
173 | return; |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
174 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
175 | emaildialog.window = box = gnt_vbox_new(FALSE); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
176 | gnt_box_set_toplevel(GNT_BOX(box), TRUE); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
177 | gnt_box_set_title(GNT_BOX(box), _("Emails")); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
178 | gnt_box_set_fill(GNT_BOX(box), FALSE); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
179 | gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_MID); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
180 | gnt_box_set_pad(GNT_BOX(box), 0); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
181 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
182 | gnt_box_add_widget(GNT_BOX(box), |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
183 | gnt_label_new_with_format(_("You have mail!"), GNT_TEXT_FLAG_BOLD)); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
184 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
185 | emaildialog.tree = tree = gnt_tree_new_with_columns(3); |
| 17357 | 186 | gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("Sender"), _("Subject")); |
|
14033
127990de806d
[gaim-migrate @ 16529]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14026
diff
changeset
|
187 | gnt_tree_set_show_title(GNT_TREE(tree), TRUE); |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
188 | gnt_tree_set_col_width(GNT_TREE(tree), 0, 15); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
189 | gnt_tree_set_col_width(GNT_TREE(tree), 1, 25); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
190 | gnt_tree_set_col_width(GNT_TREE(tree), 2, 25); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
191 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
192 | gnt_box_add_widget(GNT_BOX(box), tree); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
193 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
194 | button = gnt_button_new(_("Close")); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
195 | gnt_box_add_widget(GNT_BOX(box), button); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
196 | |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
197 | g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), box); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
198 | g_signal_connect(G_OBJECT(box), "destroy", G_CALLBACK(reset_email_dialog), NULL); |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
199 | } |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
200 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
201 | static void * |
| 15884 | 202 | finch_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed, |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
203 | const char **subjects, const char **froms, const char **tos, |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
204 | const char **urls) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
205 | { |
| 15884 | 206 | PurpleAccount *account = purple_connection_get_account(gc); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
207 | GString *message = g_string_new(NULL); |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
208 | void *ret; |
|
20984
d8539239d231
Fix the searchresult thingy nosnilmot fixed in pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20875
diff
changeset
|
209 | static int key = 0; |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
210 | |
|
27190
6018f258116c
Fix Finch not to announce "your gmail account has 0 new messages."
Paul Aurich <darkrain42@pidgin.im>
parents:
26852
diff
changeset
|
211 | if (count == 0) |
|
6018f258116c
Fix Finch not to announce "your gmail account has 0 new messages."
Paul Aurich <darkrain42@pidgin.im>
parents:
26852
diff
changeset
|
212 | return NULL; |
|
6018f258116c
Fix Finch not to announce "your gmail account has 0 new messages."
Paul Aurich <darkrain42@pidgin.im>
parents:
26852
diff
changeset
|
213 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
214 | if (!detailed) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
215 | { |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
216 | g_string_append_printf(message, |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
217 | ngettext("%s (%s) has %d new message.", |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
218 | "%s (%s) has %d new messages.", |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
219 | (int)count), |
| 15884 | 220 | tos ? *tos : purple_account_get_username(account), |
| 221 | purple_account_get_protocol_name(account), (int)count); | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
222 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
223 | else |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
224 | { |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14050
diff
changeset
|
225 | char *to; |
|
23319
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
226 | gboolean newwin = (emaildialog.window == NULL); |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14050
diff
changeset
|
227 | |
|
23319
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
228 | if (newwin) |
|
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
229 | setup_email_dialog(); |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
230 | |
| 15884 | 231 | to = g_strdup_printf("%s (%s)", tos ? *tos : purple_account_get_username(account), |
| 232 | purple_account_get_protocol_name(account)); | |
|
20984
d8539239d231
Fix the searchresult thingy nosnilmot fixed in pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20875
diff
changeset
|
233 | gnt_tree_add_row_after(GNT_TREE(emaildialog.tree), GINT_TO_POINTER(++key), |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14050
diff
changeset
|
234 | gnt_tree_create_row(GNT_TREE(emaildialog.tree), to, |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
235 | froms ? *froms : "[Unknown sender]", |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
236 | *subjects), |
|
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
237 | NULL, NULL); |
|
14167
ca6027c33d2c
[gaim-migrate @ 16739]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14050
diff
changeset
|
238 | g_free(to); |
|
23319
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
239 | if (newwin) |
|
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
240 | gnt_widget_show(emaildialog.window); |
|
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
241 | else |
|
987080575fde
Highlight the mail window for new mails.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22991
diff
changeset
|
242 | gnt_window_present(emaildialog.window); |
|
14026
ad91ce0effe2
[gaim-migrate @ 16520]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14015
diff
changeset
|
243 | return NULL; |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
244 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
245 | |
| 15884 | 246 | ret = finch_notify_message(PURPLE_NOTIFY_EMAIL, _("New Mail"), _("You have mail!"), message->str); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
247 | g_string_free(message, TRUE); |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
248 | return ret; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
249 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
250 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
251 | static void * |
| 15884 | 252 | finch_notify_email(PurpleConnection *gc, const char *subject, const char *from, |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
253 | const char *to, const char *url) |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
254 | { |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15252
diff
changeset
|
255 | return finch_notify_emails(gc, 1, subject != NULL, |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
256 | subject ? &subject : NULL, |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
257 | from ? &from : NULL, |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
258 | to ? &to : NULL, |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
259 | url ? &url : NULL); |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
260 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
261 | |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
262 | /** User information. **/ |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
263 | static GHashTable *userinfo; |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
264 | |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
265 | static char * |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
266 | userinfo_hash(PurpleAccount *account, const char *who) |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
267 | { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
268 | char key[256]; |
|
26852
8fbd1e0d5b7e
Use safe function.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
26477
diff
changeset
|
269 | g_snprintf(key, sizeof(key), "%s - %s", purple_account_get_username(account), purple_normalize(account, who)); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
270 | return g_utf8_strup(key, -1); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
271 | } |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
272 | |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
273 | static void |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
274 | remove_userinfo(GntWidget *widget, gpointer key) |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
275 | { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
276 | g_hash_table_remove(userinfo, key); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
277 | } |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
278 | |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
279 | static char * |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
280 | purple_notify_user_info_get_xhtml(PurpleNotifyUserInfo *user_info) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
281 | { |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
282 | GList *l; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
283 | GString *text; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
284 | |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
285 | text = g_string_new("<span>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
286 | |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
287 | for (l = purple_notify_user_info_get_entries(user_info); l != NULL; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
288 | l = l->next) { |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
289 | PurpleNotifyUserInfoEntry *user_info_entry = l->data; |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
290 | PurpleNotifyUserInfoEntryType type = purple_notify_user_info_entry_get_type(user_info_entry); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
291 | const char *label = purple_notify_user_info_entry_get_label(user_info_entry); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
292 | const char *value = purple_notify_user_info_entry_get_value(user_info_entry); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
293 | |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
294 | /* Handle the label/value pair itself */ |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
295 | if (type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
296 | g_string_append(text, "<u>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
297 | if (label) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
298 | g_string_append_printf(text, "<b>%s</b>", label); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
299 | g_string_append(text, "<span>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
300 | if (label && value) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
301 | g_string_append(text, ": "); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
302 | if (value) { |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
303 | char *strip = purple_markup_strip_html(value); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
304 | g_string_append(text, strip); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
305 | g_free(strip); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
306 | } |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
307 | g_string_append(text, "</span>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
308 | if (type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_HEADER) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
309 | g_string_append(text, "</u>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
310 | else if (type == PURPLE_NOTIFY_USER_INFO_ENTRY_SECTION_BREAK) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
311 | g_string_append(text, "<HR/>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
312 | g_string_append(text, "<BR/>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
313 | } |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
314 | g_string_append(text, "</span>"); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
315 | |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
316 | return g_string_free(text, FALSE); |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
317 | } |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
318 | |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
319 | static void * |
| 15884 | 320 | finch_notify_userinfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info) |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
321 | { |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
322 | char *primary; |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
14620
diff
changeset
|
323 | char *info; |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
324 | void *ui_handle; |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
325 | char *key = userinfo_hash(purple_connection_get_account(gc), who); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
326 | |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
327 | info = purple_notify_user_info_get_xhtml(user_info); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
328 | |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
329 | ui_handle = g_hash_table_lookup(userinfo, key); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
330 | if (ui_handle != NULL) { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
331 | GntTextView *msg = GNT_TEXT_VIEW(g_object_get_data(G_OBJECT(ui_handle), "info-widget")); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
332 | char *strip = purple_markup_strip_html(info); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
333 | int tvw, tvh, width, height, ntvw, ntvh; |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
334 | |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17357
diff
changeset
|
335 | while (GNT_WIDGET(ui_handle)->parent) |
|
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17357
diff
changeset
|
336 | ui_handle = GNT_WIDGET(ui_handle)->parent; |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
337 | gnt_widget_get_size(GNT_WIDGET(ui_handle), &width, &height); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
338 | gnt_widget_get_size(GNT_WIDGET(msg), &tvw, &tvh); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
339 | |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
340 | gnt_text_view_clear(msg); |
|
24225
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
341 | if (!gnt_util_parse_xhtml_to_textview(info, msg)) |
|
7b54e1675a58
Try to preserve HTML attributes in notification dialogs
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23319
diff
changeset
|
342 | gnt_text_view_append_text_with_flags(msg, strip, GNT_TEXT_FLAG_NORMAL); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
343 | gnt_text_view_scroll(msg, 0); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
344 | gnt_util_get_text_bound(strip, &ntvw, &ntvh); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
345 | ntvw += 3; |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
346 | ntvh++; |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
347 | |
|
17845
8ac5337e8f6d
Show information about the user requesting authorization.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17357
diff
changeset
|
348 | gnt_screen_resize_widget(GNT_WIDGET(ui_handle), width + MAX(0, ntvw - tvw), height + MAX(0, ntvh - tvh)); |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
349 | g_free(strip); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
350 | g_free(key); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
351 | } else { |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
352 | primary = g_strdup_printf(_("Info for %s"), who); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
353 | ui_handle = finch_notify_formatted(_("Buddy Information"), primary, NULL, info); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
354 | g_hash_table_insert(userinfo, key, ui_handle); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
355 | g_free(primary); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
356 | g_signal_connect(G_OBJECT(ui_handle), "destroy", G_CALLBACK(remove_userinfo), key); |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
357 | } |
|
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
358 | |
|
15207
31d9665a2a7d
[gaim-migrate @ 17931]
Evan Schoenberg <evands@pidgin.im>
parents:
14620
diff
changeset
|
359 | g_free(info); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
360 | return ui_handle; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
361 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
362 | |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
363 | static void |
| 15884 | 364 | notify_button_activated(GntWidget *widget, PurpleNotifySearchButton *b) |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
365 | { |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
366 | GList *list = NULL; |
| 15884 | 367 | PurpleAccount *account = g_object_get_data(G_OBJECT(widget), "notify-account"); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
368 | gpointer data = g_object_get_data(G_OBJECT(widget), "notify-data"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
369 | |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
370 | list = gnt_tree_get_selection_text_list(GNT_TREE(g_object_get_data(G_OBJECT(widget), "notify-tree"))); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
371 | |
| 15884 | 372 | b->callback(purple_account_get_connection(account), list, data); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
373 | g_list_foreach(list, (GFunc)g_free, NULL); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
374 | g_list_free(list); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
375 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
376 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
377 | static void |
| 15884 | 378 | finch_notify_sr_new_rows(PurpleConnection *gc, |
| 379 | PurpleNotifySearchResults *results, void *data) | |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
380 | { |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
381 | GntTree *tree = GNT_TREE(data); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
382 | GList *o; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
383 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
384 | /* XXX: Do I need to empty the tree here? */ |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
385 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
386 | for (o = results->rows; o; o = o->next) |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
387 | { |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
388 | gnt_tree_add_row_after(GNT_TREE(tree), o->data, |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
389 | gnt_tree_create_row_from_list(GNT_TREE(tree), o->data), |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
390 | NULL, NULL); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
391 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
392 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
393 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
394 | static void * |
| 15884 | 395 | finch_notify_searchresults(PurpleConnection *gc, const char *title, |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
396 | const char *primary, const char *secondary, |
| 15884 | 397 | PurpleNotifySearchResults *results, gpointer data) |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
398 | { |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
399 | GntWidget *window, *tree, *box, *button; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
400 | GList *iter; |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
401 | int columns, i; |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
402 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
403 | window = gnt_vbox_new(FALSE); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
404 | gnt_box_set_toplevel(GNT_BOX(window), TRUE); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
405 | gnt_box_set_title(GNT_BOX(window), title); |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
406 | gnt_box_set_fill(GNT_BOX(window), TRUE); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
407 | gnt_box_set_pad(GNT_BOX(window), 0); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
408 | gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
409 | |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
410 | if (primary) |
|
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
411 | gnt_box_add_widget(GNT_BOX(window), |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
412 | gnt_label_new_with_format(primary, GNT_TEXT_FLAG_BOLD)); |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
413 | if (secondary) |
|
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
414 | gnt_box_add_widget(GNT_BOX(window), |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
415 | gnt_label_new_with_format(secondary, GNT_TEXT_FLAG_NORMAL)); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
416 | |
|
20355
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
417 | columns = g_list_length(results->columns); |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
418 | tree = gnt_tree_new_with_columns(columns); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
419 | gnt_tree_set_show_title(GNT_TREE(tree), TRUE); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
420 | gnt_box_add_widget(GNT_BOX(window), tree); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
421 | |
|
20355
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
422 | i = 0; |
|
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
423 | for (iter = results->columns; iter; iter = iter->next) |
|
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
424 | { |
|
20984
d8539239d231
Fix the searchresult thingy nosnilmot fixed in pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20875
diff
changeset
|
425 | PurpleNotifySearchColumn *column = iter->data; |
|
d8539239d231
Fix the searchresult thingy nosnilmot fixed in pidgin.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
20875
diff
changeset
|
426 | gnt_tree_set_column_title(GNT_TREE(tree), i, column->title); |
|
20355
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
427 | i++; |
|
dacdf6087e16
Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents:
20147
diff
changeset
|
428 | } |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
429 | |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
430 | box = gnt_hbox_new(TRUE); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
431 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
432 | for (iter = results->buttons; iter; iter = iter->next) |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
433 | { |
| 15884 | 434 | PurpleNotifySearchButton *b = iter->data; |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
435 | const char *text; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
436 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
437 | switch (b->type) |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
438 | { |
| 15884 | 439 | case PURPLE_NOTIFY_BUTTON_LABELED: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
440 | text = b->label; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
441 | break; |
| 15884 | 442 | case PURPLE_NOTIFY_BUTTON_CONTINUE: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
443 | text = _("Continue"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
444 | break; |
| 15884 | 445 | case PURPLE_NOTIFY_BUTTON_ADD: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
446 | text = _("Add"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
447 | break; |
| 15884 | 448 | case PURPLE_NOTIFY_BUTTON_INFO: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
449 | text = _("Info"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
450 | break; |
| 15884 | 451 | case PURPLE_NOTIFY_BUTTON_IM: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
452 | text = _("IM"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
453 | break; |
| 15884 | 454 | case PURPLE_NOTIFY_BUTTON_JOIN: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
455 | text = _("Join"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
456 | break; |
| 15884 | 457 | case PURPLE_NOTIFY_BUTTON_INVITE: |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
458 | text = _("Invite"); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
459 | break; |
|
14260
a21577fbb4d2
[gaim-migrate @ 16870]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
460 | default: |
|
a21577fbb4d2
[gaim-migrate @ 16870]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14167
diff
changeset
|
461 | text = _("(none)"); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
462 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
463 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
464 | button = gnt_button_new(text); |
| 15884 | 465 | g_object_set_data(G_OBJECT(button), "notify-account", purple_connection_get_account(gc)); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
466 | g_object_set_data(G_OBJECT(button), "notify-data", data); |
|
18402
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
467 | g_object_set_data(G_OBJECT(button), "notify-tree", tree); |
|
f84b9b94e0ac
Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
18273
diff
changeset
|
468 | g_signal_connect(G_OBJECT(button), "activate", |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
469 | G_CALLBACK(notify_button_activated), b); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
470 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
471 | gnt_box_add_widget(GNT_BOX(box), button); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
472 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
473 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
474 | gnt_box_add_widget(GNT_BOX(window), box); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
475 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15252
diff
changeset
|
476 | finch_notify_sr_new_rows(gc, results, tree); |
|
14041
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
477 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
478 | gnt_widget_show(window); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
479 | g_object_set_data(G_OBJECT(window), "notify-results", results); |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
480 | |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
481 | return tree; |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
482 | } |
|
6afba85cfc30
[gaim-migrate @ 16540]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14033
diff
changeset
|
483 | |
|
22991
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
484 | static void * |
|
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
485 | finch_notify_uri(const char *url) |
|
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
486 | { |
|
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
487 | return finch_notify_message(PURPLE_NOTIFY_URI, _("URI"), url, NULL); |
|
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
488 | } |
|
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
489 | |
| 15884 | 490 | static PurpleNotifyUiOps ops = |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
491 | { |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
492 | finch_notify_message, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
493 | finch_notify_email, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
494 | finch_notify_emails, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
495 | finch_notify_formatted, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
496 | finch_notify_searchresults, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
497 | finch_notify_sr_new_rows, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
498 | finch_notify_userinfo, |
|
22991
a5a6aafb28b4
Show the url, instead of silently ignoring a url-open request.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22104
diff
changeset
|
499 | finch_notify_uri, |
|
17164
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
500 | finch_close_notify, /* The rest of the notify-uiops return a GntWidget. |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
501 | These widgets should be destroyed from here. */ |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
502 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
503 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
504 | NULL, |
|
3a005b9e8f28
Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@pidgin.im>
parents:
16981
diff
changeset
|
505 | NULL |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
506 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
507 | }; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
508 | |
| 15884 | 509 | PurpleNotifyUiOps *finch_notify_get_ui_ops() |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
510 | { |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
511 | return &ops; |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
512 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
513 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15252
diff
changeset
|
514 | void finch_notify_init() |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
515 | { |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
516 | userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
517 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
518 | |
|
15878
f52832b611fe
renamed gaim-text to finch
Sean Egan <seanegan@pidgin.im>
parents:
15252
diff
changeset
|
519 | void finch_notify_uninit() |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
520 | { |
|
16981
f4fd66d0bc51
When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16255
diff
changeset
|
521 | g_hash_table_destroy(userinfo); |
|
14014
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
522 | } |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
523 | |
|
223d99ce2f06
[gaim-migrate @ 16500]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
diff
changeset
|
524 |