annotate finch/gntnotify.c @ 20612:ec247a10b12b

Making pidgin_dialogs_about _with_parent
author Gabriel Schulhof <nix@go-nix.ca>
date Sat, 22 Sep 2007 20:31:46 +0000
parents a3f07fa68e90
children e587a7be2916
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
1 /**
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
2 * @file gntnotify.c GNT Notify API
16194
0f0832c13fcb Rename the Doxygen group from gntui to finch and define the finch group
Richard Laager <rlaager@wiktel.com>
parents: 15871
diff changeset
3 * @ingroup finch
20074
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
4 */
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
5
6bf32c9e15a7 remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@gmail.com>
parents: 19680
diff changeset
6 /* finch
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
7 *
15871
66dff3dfdea6 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@wiktel.com>
parents: 15823
diff changeset
8 * Finch is the legal property of its developers, whose names are too numerous
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
9 * to list here. Please refer to the COPYRIGHT file distributed with this
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
10 * source distribution.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
11 *
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
12 * This program is free software; you can redistribute it and/or modify
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
13 * it under the terms of the GNU General Public License as published by
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
14 * the Free Software Foundation; either version 2 of the License, or
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
15 * (at your option) any later version.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
16 *
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
17 * This program is distributed in the hope that it will be useful,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
20 * GNU General Public License for more details.
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
21 *
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
22 * You should have received a copy of the GNU General Public License
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
23 * along with this program; if not, write to the Free Software
19680
44b4e8bd759b The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents: 18347
diff changeset
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
25 */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
26 #include <gnt.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
27 #include <gntbox.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
28 #include <gntbutton.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
29 #include <gntlabel.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
30 #include <gnttree.h>
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
31 #include <gntutils.h>
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
32
18210
b8572b937c09 #include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents: 17521
diff changeset
33 #include "finch.h"
b8572b937c09 #include reorganizations to allow compiling with glib < 2.8 using the
Stu Tomlinson <stu@nosnilmot.com>
parents: 17521
diff changeset
34
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
35 #include <util.h>
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
36
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
37 #include "gntnotify.h"
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
38
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
39 static struct
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
40 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
41 GntWidget *window;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
42 GntWidget *tree;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
43 } emaildialog;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
44
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
45 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
46 notify_msg_window_destroy_cb(GntWidget *window, PurpleNotifyMsgType type)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
47 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
48 purple_notify_close(type, window);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
49 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
50
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
51 static void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
52 finch_notify_message(PurpleNotifyMsgType type, const char *title,
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
53 const char *primary, const char *secondary)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
54 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
55 GntWidget *window, *button;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
56 GntTextFormatFlags pf = 0, sf = 0;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
57
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
58 switch (type)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
59 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
60 case PURPLE_NOTIFY_MSG_ERROR:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
61 sf |= GNT_TEXT_FLAG_BOLD;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
62 case PURPLE_NOTIFY_MSG_WARNING:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
63 pf |= GNT_TEXT_FLAG_UNDERLINE;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
64 case PURPLE_NOTIFY_MSG_INFO:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
65 pf |= GNT_TEXT_FLAG_BOLD;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
66 break;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
67 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
68
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
69 window = gnt_box_new(FALSE, TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
70 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
71 gnt_box_set_title(GNT_BOX(window), title);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
72 gnt_box_set_fill(GNT_BOX(window), FALSE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
73 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
17521
7f652ef12ed6 Remove the confusing 'OK' button from the auth dialog.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17520
diff changeset
74 gnt_box_set_pad(GNT_BOX(window), 0);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
75
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
76 if (primary)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
77 gnt_box_add_widget(GNT_BOX(window),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
78 gnt_label_new_with_format(primary, pf));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
79
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
80 button = gnt_button_new(_("OK"));
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
81
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
82 if (secondary) {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
83 GntWidget *msg;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
84 if (type == PURPLE_NOTIFY_FORMATTED) {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
85 int width = -1, height = -1;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
86 msg = gnt_text_view_new();
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
87 gnt_text_view_append_text_with_flags(GNT_TEXT_VIEW(msg), secondary, sf);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
88 gnt_text_view_scroll(GNT_TEXT_VIEW(msg), 0);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
89 gnt_text_view_attach_scroll_widget(GNT_TEXT_VIEW(msg), button);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
90 gnt_util_get_text_bound(secondary, &width, &height);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
91 gnt_widget_set_size(msg, width + 3, height + 1);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
92 } else {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
93 msg = gnt_label_new_with_format(secondary, sf);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
94 }
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
95 gnt_box_add_widget(GNT_BOX(window), msg);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
96 g_object_set_data(G_OBJECT(window), "info-widget", msg);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
97 }
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
98
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
99 gnt_box_add_widget(GNT_BOX(window), button);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
100 g_signal_connect_swapped(G_OBJECT(button), "activate",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
101 G_CALLBACK(gnt_widget_destroy), window);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
102 g_signal_connect(G_OBJECT(window), "destroy",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
103 G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
104
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
105 gnt_widget_show(window);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
106 return window;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
107 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
108
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
109 /* handle is, in all/most occasions, a GntWidget * */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
110 static void finch_close_notify(PurpleNotifyType type, void *handle)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
111 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
112 GntWidget *widget = handle;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
113
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
114 if (!widget)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
115 return;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
116
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
117 while (widget->parent)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
118 widget = widget->parent;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
119
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
120 if (type == PURPLE_NOTIFY_SEARCHRESULTS)
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
121 purple_notify_searchresults_free(g_object_get_data(handle, "notify-results"));
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
122 #if 1
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
123 /* This did not seem to be necessary */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
124 g_signal_handlers_disconnect_by_func(G_OBJECT(widget),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
125 G_CALLBACK(notify_msg_window_destroy_cb), GINT_TO_POINTER(type));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
126 #endif
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
127 gnt_widget_destroy(widget);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
128 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
129
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
130 static void *finch_notify_formatted(const char *title, const char *primary,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
131 const char *secondary, const char *text)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
132 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
133 /* XXX: For now, simply strip the html and use _notify_message. For future use,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
134 * there should be some way of parsing the makrups from GntTextView */
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
135 char *unformat = purple_markup_strip_html(text);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
136 char *t = g_strdup_printf("%s%s%s",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
137 secondary ? secondary : "",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
138 secondary ? "\n" : "",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
139 unformat ? unformat : "");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
140
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
141 void *ret = finch_notify_message(PURPLE_NOTIFY_FORMATTED, title, primary, t);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
142
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
143 g_free(t);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
144 g_free(unformat);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
145
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
146 return ret;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
147 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
148
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
149 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
150 reset_email_dialog()
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
151 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
152 emaildialog.window = NULL;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
153 emaildialog.tree = NULL;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
154 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
155
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
156 static void
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
157 setup_email_dialog()
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
158 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
159 GntWidget *box, *tree, *button;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
160 if (emaildialog.window)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
161 return;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
162
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
163 emaildialog.window = box = gnt_vbox_new(FALSE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
164 gnt_box_set_toplevel(GNT_BOX(box), TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
165 gnt_box_set_title(GNT_BOX(box), _("Emails"));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
166 gnt_box_set_fill(GNT_BOX(box), FALSE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
167 gnt_box_set_alignment(GNT_BOX(box), GNT_ALIGN_MID);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
168 gnt_box_set_pad(GNT_BOX(box), 0);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
169
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
170 gnt_box_add_widget(GNT_BOX(box),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
171 gnt_label_new_with_format(_("You have mail!"), GNT_TEXT_FLAG_BOLD));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
172
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
173 emaildialog.tree = tree = gnt_tree_new_with_columns(3);
17269
bac7cec1609d Fix #1159.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17104
diff changeset
174 gnt_tree_set_column_titles(GNT_TREE(tree), _("Account"), _("Sender"), _("Subject"));
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
175 gnt_tree_set_show_title(GNT_TREE(tree), TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
176 gnt_tree_set_col_width(GNT_TREE(tree), 0, 15);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
177 gnt_tree_set_col_width(GNT_TREE(tree), 1, 25);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
178 gnt_tree_set_col_width(GNT_TREE(tree), 2, 25);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
179
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
180 gnt_box_add_widget(GNT_BOX(box), tree);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
181
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
182 button = gnt_button_new(_("Close"));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
183 gnt_box_add_widget(GNT_BOX(box), button);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
184
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
185 g_signal_connect_swapped(G_OBJECT(button), "activate", G_CALLBACK(gnt_widget_destroy), box);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
186 g_signal_connect(G_OBJECT(box), "destroy", G_CALLBACK(reset_email_dialog), NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
187 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
188
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
189 static void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
190 finch_notify_emails(PurpleConnection *gc, size_t count, gboolean detailed,
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
191 const char **subjects, const char **froms, const char **tos,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
192 const char **urls)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
193 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
194 PurpleAccount *account = purple_connection_get_account(gc);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
195 GString *message = g_string_new(NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
196 void *ret;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
197
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
198 if (!detailed)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
199 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
200 g_string_append_printf(message,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
201 ngettext("%s (%s) has %d new message.",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
202 "%s (%s) has %d new messages.",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
203 (int)count),
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
204 tos ? *tos : purple_account_get_username(account),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
205 purple_account_get_protocol_name(account), (int)count);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
206 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
207 else
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
208 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
209 char *to;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
210
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
211 setup_email_dialog();
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
212
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
213 to = g_strdup_printf("%s (%s)", tos ? *tos : purple_account_get_username(account),
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
214 purple_account_get_protocol_name(account));
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
215 gnt_tree_add_row_after(GNT_TREE(emaildialog.tree), GINT_TO_POINTER(time(NULL)),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
216 gnt_tree_create_row(GNT_TREE(emaildialog.tree), to,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
217 froms ? *froms : "[Unknown sender]",
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
218 *subjects),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
219 NULL, NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
220 g_free(to);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
221 gnt_widget_show(emaildialog.window);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
222 return NULL;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
223 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
224
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
225 ret = finch_notify_message(PURPLE_NOTIFY_EMAIL, _("New Mail"), _("You have mail!"), message->str);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
226 g_string_free(message, TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
227 return ret;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
228 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
229
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
230 static void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
231 finch_notify_email(PurpleConnection *gc, const char *subject, const char *from,
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
232 const char *to, const char *url)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
233 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
234 return finch_notify_emails(gc, 1, subject != NULL,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
235 subject ? &subject : NULL,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
236 from ? &from : NULL,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
237 to ? &to : NULL,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
238 url ? &url : NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
239 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
240
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
241 /** User information. **/
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
242 static GHashTable *userinfo;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
243
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
244 static char *
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
245 userinfo_hash(PurpleAccount *account, const char *who)
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
246 {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
247 char key[256];
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
248 snprintf(key, sizeof(key), "%s - %s", purple_account_get_username(account), purple_normalize(account, who));
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
249 return g_utf8_strup(key, -1);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
250 }
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
251
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
252 static void
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
253 remove_userinfo(GntWidget *widget, gpointer key)
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
254 {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
255 g_hash_table_remove(userinfo, key);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
256 }
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
257
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
258 static void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
259 finch_notify_userinfo(PurpleConnection *gc, const char *who, PurpleNotifyUserInfo *user_info)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
260 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
261 char *primary;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
262 char *info;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
263 void *ui_handle;
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
264 char *key = userinfo_hash(purple_connection_get_account(gc), who);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
265
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
266 info = purple_notify_user_info_get_text_with_newline(user_info, "<BR>");
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
267
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
268 ui_handle = g_hash_table_lookup(userinfo, key);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
269 if (ui_handle != NULL) {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
270 GntTextView *msg = GNT_TEXT_VIEW(g_object_get_data(G_OBJECT(ui_handle), "info-widget"));
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
271 char *strip = purple_markup_strip_html(info);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
272 int tvw, tvh, width, height, ntvw, ntvh;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
273
17520
464840043c66 Show information about the user requesting authorization.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17269
diff changeset
274 while (GNT_WIDGET(ui_handle)->parent)
464840043c66 Show information about the user requesting authorization.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17269
diff changeset
275 ui_handle = GNT_WIDGET(ui_handle)->parent;
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
276 gnt_widget_get_size(GNT_WIDGET(ui_handle), &width, &height);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
277 gnt_widget_get_size(GNT_WIDGET(msg), &tvw, &tvh);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
278
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
279 gnt_text_view_clear(msg);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
280 gnt_text_view_append_text_with_flags(msg, strip, GNT_TEXT_FLAG_NORMAL);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
281 gnt_text_view_scroll(msg, 0);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
282 gnt_util_get_text_bound(strip, &ntvw, &ntvh);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
283 ntvw += 3;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
284 ntvh++;
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
285
17520
464840043c66 Show information about the user requesting authorization.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 17269
diff changeset
286 gnt_screen_resize_widget(GNT_WIDGET(ui_handle), width + MAX(0, ntvw - tvw), height + MAX(0, ntvh - tvh));
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
287 g_free(strip);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
288 g_free(key);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
289 } else {
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
290 primary = g_strdup_printf(_("Info for %s"), who);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
291 ui_handle = finch_notify_formatted(_("Buddy Information"), primary, NULL, info);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
292 g_hash_table_insert(userinfo, key, ui_handle);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
293 g_free(primary);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
294 g_signal_connect(G_OBJECT(ui_handle), "destroy", G_CALLBACK(remove_userinfo), key);
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
295 }
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
296
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
297 g_free(info);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
298 return ui_handle;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
299 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
300
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
301 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
302 notify_button_activated(GntWidget *widget, PurpleNotifySearchButton *b)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
303 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
304 GList *list = NULL;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
305 PurpleAccount *account = g_object_get_data(G_OBJECT(widget), "notify-account");
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
306 gpointer data = g_object_get_data(G_OBJECT(widget), "notify-data");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
307
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
308 list = gnt_tree_get_selection_text_list(GNT_TREE(g_object_get_data(G_OBJECT(widget), "notify-tree")));
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
309
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
310 b->callback(purple_account_get_connection(account), list, data);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
311 g_list_foreach(list, (GFunc)g_free, NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
312 g_list_free(list);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
313 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
314
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
315 static void
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
316 finch_notify_sr_new_rows(PurpleConnection *gc,
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
317 PurpleNotifySearchResults *results, void *data)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
318 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
319 GntTree *tree = GNT_TREE(data);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
320 GList *o;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
321
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
322 /* XXX: Do I need to empty the tree here? */
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
323
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
324 for (o = results->rows; o; o = o->next)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
325 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
326 gnt_tree_add_row_after(GNT_TREE(tree), o->data,
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
327 gnt_tree_create_row_from_list(GNT_TREE(tree), o->data),
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
328 NULL, NULL);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
329 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
330 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
331
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
332 static void *
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
333 finch_notify_searchresults(PurpleConnection *gc, const char *title,
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
334 const char *primary, const char *secondary,
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
335 PurpleNotifySearchResults *results, gpointer data)
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
336 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
337 GntWidget *window, *tree, *box, *button;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
338 GList *iter;
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
339 int columns, i;
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
340
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
341 window = gnt_vbox_new(FALSE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
342 gnt_box_set_toplevel(GNT_BOX(window), TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
343 gnt_box_set_title(GNT_BOX(window), title);
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
344 gnt_box_set_fill(GNT_BOX(window), TRUE);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
345 gnt_box_set_pad(GNT_BOX(window), 0);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
346 gnt_box_set_alignment(GNT_BOX(window), GNT_ALIGN_MID);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
347
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
348 if (primary)
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
349 gnt_box_add_widget(GNT_BOX(window),
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
350 gnt_label_new_with_format(primary, GNT_TEXT_FLAG_BOLD));
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
351 if (secondary)
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
352 gnt_box_add_widget(GNT_BOX(window),
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
353 gnt_label_new_with_format(secondary, GNT_TEXT_FLAG_NORMAL));
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
354
20100
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
355 columns = g_list_length(results->columns);
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
356 tree = gnt_tree_new_with_columns(columns);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
357 gnt_tree_set_show_title(GNT_TREE(tree), TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
358 gnt_box_add_widget(GNT_BOX(window), tree);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
359
20100
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
360 i = 0;
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
361 for (iter = results->columns; iter; iter = iter->next)
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
362 {
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
363 gnt_tree_set_column_title(GNT_TREE(tree), i, iter->data);
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
364 i++;
a3f07fa68e90 Access search results directly instead of going through the API because
Mark Doliner <mark@kingant.net>
parents: 20074
diff changeset
365 }
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
366
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
367 box = gnt_hbox_new(TRUE);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
368
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
369 for (iter = results->buttons; iter; iter = iter->next)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
370 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
371 PurpleNotifySearchButton *b = iter->data;
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
372 const char *text;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
373
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
374 switch (b->type)
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
375 {
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
376 case PURPLE_NOTIFY_BUTTON_LABELED:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
377 text = b->label;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
378 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
379 case PURPLE_NOTIFY_BUTTON_CONTINUE:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
380 text = _("Continue");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
381 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
382 case PURPLE_NOTIFY_BUTTON_ADD:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
383 text = _("Add");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
384 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
385 case PURPLE_NOTIFY_BUTTON_INFO:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
386 text = _("Info");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
387 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
388 case PURPLE_NOTIFY_BUTTON_IM:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
389 text = _("IM");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
390 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
391 case PURPLE_NOTIFY_BUTTON_JOIN:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
392 text = _("Join");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
393 break;
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
394 case PURPLE_NOTIFY_BUTTON_INVITE:
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
395 text = _("Invite");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
396 break;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
397 default:
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
398 text = _("(none)");
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
399 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
400
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
401 button = gnt_button_new(text);
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
402 g_object_set_data(G_OBJECT(button), "notify-account", purple_connection_get_account(gc));
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
403 g_object_set_data(G_OBJECT(button), "notify-data", data);
18347
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
404 g_object_set_data(G_OBJECT(button), "notify-tree", tree);
a90f9a0b90c8 Update search-api to not crash. Searching for users in xmpp/oscar works now.
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 18210
diff changeset
405 g_signal_connect(G_OBJECT(button), "activate",
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
406 G_CALLBACK(notify_button_activated), b);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
407
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
408 gnt_box_add_widget(GNT_BOX(box), button);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
409 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
410
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
411 gnt_box_add_widget(GNT_BOX(window), box);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
412
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
413 finch_notify_sr_new_rows(gc, results, tree);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
414
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
415 gnt_widget_show(window);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
416 g_object_set_data(G_OBJECT(window), "notify-results", results);
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
417
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
418 return tree;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
419 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
420
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
421 static PurpleNotifyUiOps ops =
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
422 {
17104
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
423 finch_notify_message,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
424 finch_notify_email,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
425 finch_notify_emails,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
426 finch_notify_formatted,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
427 finch_notify_searchresults,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
428 finch_notify_sr_new_rows,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
429 finch_notify_userinfo,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
430 NULL, /* notify_uri is of low-priority to me. --sadrul */
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
431 finch_close_notify, /* The rest of the notify-uiops return a GntWidget.
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
432 These widgets should be destroyed from here. */
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
433 NULL,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
434 NULL,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
435 NULL,
46f2f86e08e4 Death to more futuristic struct initialization. This should be the last.
Richard Laager <rlaager@wiktel.com>
parents: 16936
diff changeset
436 NULL
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
437
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
438 };
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
439
15823
32c366eeeb99 sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@gmail.com>
parents: 15818
diff changeset
440 PurpleNotifyUiOps *finch_notify_get_ui_ops()
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
441 {
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
442 return &ops;
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
443 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
444
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
445 void finch_notify_init()
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
446 {
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
447 userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
448 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
449
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
450 void finch_notify_uninit()
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
451 {
16936
9a568611fa4a When getting information, show "Information: Retrieving..." before the
Sadrul Habib Chowdhury <imadil@gmail.com>
parents: 16194
diff changeset
452 g_hash_table_destroy(userinfo);
15818
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
453 }
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
454
0e3a8505ebbe renamed gaim-text to finch
Sean Egan <seanegan@gmail.com>
parents:
diff changeset
455