pidgin/gtknotify.c

Sun, 09 Jun 2024 15:36:02 -0500

author
Markus Fischer <ivanhoe@fiscari.de>
date
Sun, 09 Jun 2024 15:36:02 -0500
changeset 42787
a96dfca87750
parent 42592
6b65c0e4ba15
child 42804
be8c8b5471ca
permissions
-rw-r--r--

IRCv3: Only set up SASL if the account requires a password

Testing Done:
Connected both an account with and without password.

Reviewed at https://reviews.imfreedom.org/r/3249/

20147
66f05a854eee applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents: 20113
diff changeset
1 /* pidgin
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
2 *
15931
716b5fac1895 Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents: 15884
diff changeset
3 * Pidgin is the legal property of its developers, whose names are too numerous
8046
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7920
diff changeset
4 * to list here. Please refer to the COPYRIGHT file distributed with this
c581b20a47d6 [gaim-migrate @ 8730]
Sean Egan <seanegan@pidgin.im>
parents: 7920
diff changeset
5 * source distribution.
6465
bd201d637ff4 [gaim-migrate @ 6974]
Christian Hammond <chipx86@chipx86.com>
parents: 6381
diff changeset
6 *
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
7 * This program is free software; you can redistribute it and/or modify
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
8 * it under the terms of the GNU General Public License as published by
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
9 * the Free Software Foundation; either version 2 of the License, or
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
10 * (at your option) any later version.
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
11 *
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful,
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
15 * GNU General Public License for more details.
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
16 *
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
17 * You should have received a copy of the GNU General Public License
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
18 * 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: 19832
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
20 */
40439
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
21
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
22 #include <glib/gi18n-lib.h>
e9838d634d5e Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents: 40360
diff changeset
23
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
24 #include <gdk/gdkkeysyms.h>
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
25
40360
e21f3bbcc2a5 Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents: 40197
diff changeset
26 #include <purple.h>
7455
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
27
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
28 #include "gtknotify.h"
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
29 #include "gtkutils.h"
40496
6941fece679b phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents: 40490
diff changeset
30 #include "pidgincore.h"
5872
754c63f29b77 [gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents: 5794
diff changeset
31
5519
5ac50d7f3689 [gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
32 typedef struct
5ac50d7f3689 [gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
33 {
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
34 GtkWidget *window;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
35 int count;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
36 } PidginUserInfo;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
37
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
38 typedef struct
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
39 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
40 PurpleAccount *account;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
41 GtkListStore *model;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
42 GtkWidget *treeview;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
43 GtkWidget *window;
13641
1173f8ca3fbf [gaim-migrate @ 16038]
Bartosz Oler <bartosz@pidgin.im>
parents: 13540
diff changeset
44 gpointer user_data;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
45 PurpleNotifySearchResults *results;
13641
1173f8ca3fbf [gaim-migrate @ 16038]
Bartosz Oler <bartosz@pidgin.im>
parents: 13540
diff changeset
46
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
47 } PidginNotifySearchResultsData;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
48
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
49 typedef struct
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
50 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
51 PurpleNotifySearchButton *button;
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
52 PidginNotifySearchResultsData *data;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
53
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
54 } PidginNotifySearchResultsButtonData;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
55
22999
3323b9070331 More plumbing work.
Daniel Atallah <datallah@pidgin.im>
parents: 22330
diff changeset
56 static void pidgin_close_notify(PurpleNotifyType type, void *ui_handle);
3323b9070331 More plumbing work.
Daniel Atallah <datallah@pidgin.im>
parents: 22330
diff changeset
57
5519
5ac50d7f3689 [gaim-migrate @ 5919]
Christian Hammond <chipx86@chipx86.com>
parents: 5476
diff changeset
58 static void
41947
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
59 message_response_cb(G_GNUC_UNUSED GtkDialog *dialog, G_GNUC_UNUSED gint id,
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
60 GtkWidget *widget)
6104
cf3241926c4e [gaim-migrate @ 6565]
Mark Doliner <markdoliner@pidgin.im>
parents: 5872
diff changeset
61 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
62 purple_notify_close(PURPLE_NOTIFY_MESSAGE, widget);
6104
cf3241926c4e [gaim-migrate @ 6565]
Mark Doliner <markdoliner@pidgin.im>
parents: 5872
diff changeset
63 }
cf3241926c4e [gaim-migrate @ 6565]
Mark Doliner <markdoliner@pidgin.im>
parents: 5872
diff changeset
64
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
65 static void
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
66 formatted_close_cb(GtkDialog *dialog, G_GNUC_UNUSED gint response,
41947
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
67 G_GNUC_UNUSED gpointer user_data)
7007
b687feec58a2 [gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
68 {
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
69 purple_notify_close(PURPLE_NOTIFY_FORMATTED, dialog);
7007
b687feec58a2 [gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
70 }
b687feec58a2 [gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
71
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
72 static void
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
73 searchresults_close_cb(G_GNUC_UNUSED GtkDialog *dialog,
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
74 G_GNUC_UNUSED gint response,
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
75 gpointer user_data)
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
76 {
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
77 PidginNotifySearchResultsData *data = user_data;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
78 purple_notify_close(PURPLE_NOTIFY_SEARCHRESULTS, data);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
79 }
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
80
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
81 static void
41947
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
82 searchresults_callback_wrapper_cb(G_GNUC_UNUSED GtkWidget *widget,
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
83 PidginNotifySearchResultsButtonData *bd)
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
84 {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
85 PidginNotifySearchResultsData *data = bd->data;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
86
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
87 GtkTreeSelection *selection;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
88 GtkTreeModel *model;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
89 GtkTreeIter iter;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
90 PurpleNotifySearchButton *button;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
91 GList *row = NULL;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
92 gchar *str;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
93 int i;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
94
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
95 g_return_if_fail(data != NULL);
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
96
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
97 selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(data->treeview));
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
98
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
99 if (gtk_tree_selection_get_selected(selection, &model, &iter))
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
100 {
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
101 for (i = 1; i < gtk_tree_model_get_n_columns(GTK_TREE_MODEL(model)); i++) {
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
102 gtk_tree_model_get(GTK_TREE_MODEL(model), &iter, i, &str, -1);
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
103 row = g_list_append(row, str);
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
104 }
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
105 }
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
106
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
107 button = bd->button;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
108 button->callback(purple_account_get_connection(data->account), row, data->user_data);
39897
16b440d4ab36 Use g_list_free_full instead of g_list_foreach+g_list_free.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39556
diff changeset
109 g_list_free_full(row, g_free);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
110 }
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
111
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
112 /* copy-paste from gtkrequest.c */
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
113 static void
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
114 pidgin_widget_decorate_account(GtkWidget *cont, PurpleAccount *account)
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
115 {
41962
f802660eaef2 Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents: 41947
diff changeset
116 PurpleContactInfo *info = NULL;
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
117 PurpleProtocol *protocol = NULL;
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
118 GtkWidget *image;
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
119 const gchar *icon_name = NULL;
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
120
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
121 if (!account)
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
122 return;
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
123
41962
f802660eaef2 Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents: 41947
diff changeset
124 info = PURPLE_CONTACT_INFO(account);
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
125 protocol = purple_account_get_protocol(account);
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
126 icon_name = purple_protocol_get_icon_name(protocol);
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
127
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
128 image = gtk_image_new_from_icon_name(icon_name);
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
129
41962
f802660eaef2 Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents: 41947
diff changeset
130 gtk_widget_set_tooltip_text(image, purple_contact_info_get_username(info));
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
131
40162
a8bdd1227991 Remove GtkDialog handling in pidgin_widget_decorate_account.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40150
diff changeset
132 if (GTK_IS_BOX(cont)) {
37990
710f725725a8 Replace the deprecated gtk_misc_set_alignment function.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37422
diff changeset
133 gtk_widget_set_halign(image, GTK_ALIGN_START);
710f725725a8 Replace the deprecated gtk_misc_set_alignment function.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37422
diff changeset
134 gtk_widget_set_valign(image, GTK_ALIGN_START);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
135 gtk_widget_set_hexpand(image, TRUE);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
136 gtk_box_append(GTK_BOX(cont), image);
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
137 }
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
138 }
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
139
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
140 static void *
37409
9dadde8529a8 Change enum name from PurpleNotifyMsgType to PurpleNotifyMessageType
Jorge Villaseñor <salinasv@pidgin.im>
parents: 37144
diff changeset
141 pidgin_notify_message(PurpleNotifyMessageType type, const char *title,
34449
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34274
diff changeset
142 const char *primary, const char *secondary,
bbcb198650b7 Notify API: extend purple_notify_message with PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34274
diff changeset
143 PurpleRequestCommonParameters *cpar)
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
144 {
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
145 GtkWidget *dialog;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
146 GtkWidget *hbox;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
147 GtkWidget *label;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
148 GtkWidget *img = NULL;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
149 char label_text[2048];
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
150 const char *icon_name = NULL;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
151 char *primary_esc, *secondary_esc;
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
152
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
153 switch (type)
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
154 {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
155 case PURPLE_NOTIFY_MSG_ERROR:
39146
af0a3b8c0354 Replace remaining usage of PIDGIN_STOCK_DIALOG_* with literal icon names
Mike Ruprecht <cmaiku@gmail.com>
parents: 39144
diff changeset
156 icon_name = "dialog-error";
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
157 break;
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
158
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
159 case PURPLE_NOTIFY_MSG_WARNING:
39146
af0a3b8c0354 Replace remaining usage of PIDGIN_STOCK_DIALOG_* with literal icon names
Mike Ruprecht <cmaiku@gmail.com>
parents: 39144
diff changeset
160 icon_name = "dialog-warning";
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
161 break;
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
162
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
163 case PURPLE_NOTIFY_MSG_INFO:
39146
af0a3b8c0354 Replace remaining usage of PIDGIN_STOCK_DIALOG_* with literal icon names
Mike Ruprecht <cmaiku@gmail.com>
parents: 39144
diff changeset
164 icon_name = "dialog-information";
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
165 break;
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
166
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
167 default:
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
168 icon_name = NULL;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
169 break;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
170 }
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
171
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
172 if (icon_name != NULL)
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
173 {
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
174 img = gtk_image_new_from_icon_name(icon_name);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
175 gtk_image_set_pixel_size(GTK_IMAGE(img), 48);
37990
710f725725a8 Replace the deprecated gtk_misc_set_alignment function.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37422
diff changeset
176 gtk_widget_set_halign(img, GTK_ALIGN_START);
710f725725a8 Replace the deprecated gtk_misc_set_alignment function.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37422
diff changeset
177 gtk_widget_set_valign(img, GTK_ALIGN_START);
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
178 }
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
179
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
180 dialog = gtk_dialog_new_with_buttons(title ? title : PIDGIN_ALERT_TITLE,
40693
4d91fb883f4b Replace stock items for dialog buttons with labels
Gary Kramlich <grim@reaperworld.com>
parents: 40683
diff changeset
181 NULL, 0, _("Close"),
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
182 GTK_RESPONSE_CLOSE, NULL);
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
183
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
184 g_signal_connect(G_OBJECT(dialog), "response",
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
185 G_CALLBACK(message_response_cb), dialog);
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
186
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
187 gtk_window_set_resizable(GTK_WINDOW(dialog), FALSE);
32422
c215bc5d85e4 Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 32394
diff changeset
188 gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
40490
fb6e46c4c63c Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
189 12);
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
190
40490
fb6e46c4c63c Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents: 40439
diff changeset
191 hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
192 gtk_box_append(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
193 hbox);
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
194
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
195 if (img != NULL) {
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
196 gtk_box_append(GTK_BOX(hbox), img);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
197 }
34450
0145b9f2d77c GTK Notify: decorete purple_notify_message windows with account icon
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34449
diff changeset
198
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
199 primary_esc = g_markup_escape_text(primary, -1);
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
200 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
201 g_snprintf(label_text, sizeof(label_text),
20869
e2db8ce46cda If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@pidgin.im>
parents: 20791
diff changeset
202 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
e2db8ce46cda If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@pidgin.im>
parents: 20791
diff changeset
203 primary_esc, (secondary ? "\n\n" : ""),
e2db8ce46cda If there is no secondary text in a notify, avoid adding "\n\n" and creating
Richard Laager <rlaager@pidgin.im>
parents: 20791
diff changeset
204 (secondary ? secondary_esc : ""));
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
205 g_free(primary_esc);
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
206 g_free(secondary_esc);
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
207
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
208 label = gtk_label_new(NULL);
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
209
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
210 gtk_label_set_markup(GTK_LABEL(label), label_text);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
211 gtk_label_set_wrap(GTK_LABEL(label), TRUE);
19222
f0fa371d6752 Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <datallah@pidgin.im>
parents: 18802
diff changeset
212 gtk_label_set_selectable(GTK_LABEL(label), TRUE);
38007
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
213 gtk_label_set_xalign(GTK_LABEL(label), 0);
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
214 gtk_label_set_yalign(GTK_LABEL(label), 0);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
215 gtk_box_append(GTK_BOX(hbox), label);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
216
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
217 pidgin_widget_decorate_account(hbox,
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
218 purple_request_cpar_get_account(cpar));
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
219
34451
b7165d4e1d73 Implement purple_*_is_valid_ui_handle, purple_request_cpar_*et_parent_from, pidgin_request_get_dialog_window
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34450
diff changeset
220 g_object_set_data(G_OBJECT(dialog), "pidgin-parent-from",
b7165d4e1d73 Implement purple_*_is_valid_ui_handle, purple_request_cpar_*et_parent_from, pidgin_request_get_dialog_window
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents: 34450
diff changeset
221 purple_request_cpar_get_parent_from(cpar));
22007
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
222 pidgin_auto_parent_window(dialog);
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
223
42202
2273647d24b0 Use gtk_widget_set_visible for everything
Gary Kramlich <grim@reaperworld.com>
parents: 42094
diff changeset
224 gtk_widget_set_visible(dialog, TRUE);
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
225
14865
533ea832c97c [gaim-migrate @ 17568]
Sean Egan <seanegan@pidgin.im>
parents: 14864
diff changeset
226 return dialog;
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
227 }
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
228
8337
07da3cefb9d3 [gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents: 8284
diff changeset
229 static gboolean
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
230 formatted_input_cb(GtkWidget *win, guint keyval, G_GNUC_UNUSED guint keycode,
41947
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
231 G_GNUC_UNUSED GdkModifierType state,
7b3312d0760c Bump C standard to C99 for Pidgin files and fix warnings
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41720
diff changeset
232 G_GNUC_UNUSED gpointer data)
7455
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
233 {
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
234 if (keyval == GDK_KEY_Escape) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
235 purple_notify_close(PURPLE_NOTIFY_FORMATTED, win);
8337
07da3cefb9d3 [gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents: 8284
diff changeset
236
7455
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
237 return TRUE;
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
238 }
8337
07da3cefb9d3 [gaim-migrate @ 9061]
Christian Hammond <chipx86@chipx86.com>
parents: 8284
diff changeset
239
7455
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
240 return FALSE;
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
241 }
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
242
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
243 static void *
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15497
diff changeset
244 pidgin_notify_formatted(const char *title, const char *primary,
12242
e7fc1748eb56 [gaim-migrate @ 14544]
Richard Laager <rlaager@pidgin.im>
parents: 12227
diff changeset
245 const char *secondary, const char *text)
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
246 {
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
247 GtkWidget *window;
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
248 GtkWidget *vbox;
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
249 GtkWidget *label;
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
250 GtkWidget *button;
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
251 GtkEventController *event = NULL;
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
252 GtkWidget *sw;
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
253 GtkWidget *view;
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
254 GtkTextBuffer *buffer;
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
255 char label_text[2048];
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
256 char *linked_text, *primary_esc, *secondary_esc;
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
257
19546
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
258 window = gtk_dialog_new();
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
259 gtk_window_set_title(GTK_WINDOW(window), title);
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
260 gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
261
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
262 g_signal_connect(window, "response", G_CALLBACK(formatted_close_cb), NULL);
7007
b687feec58a2 [gaim-migrate @ 7564]
Christian Hammond <chipx86@chipx86.com>
parents: 6982
diff changeset
263
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
264 /* Setup the main vbox */
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 30812
diff changeset
265 vbox = gtk_dialog_get_content_area(GTK_DIALOG(window));
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
266
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
267 /* Setup the descriptive label */
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
268 primary_esc = g_markup_escape_text(primary, -1);
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
269 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
270 g_snprintf(label_text, sizeof(label_text),
8338
15352ef157f9 [gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents: 8337
diff changeset
271 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
272 primary_esc,
8338
15352ef157f9 [gaim-migrate @ 9062]
Christian Hammond <chipx86@chipx86.com>
parents: 8337
diff changeset
273 (secondary ? "\n" : ""),
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
274 (secondary ? secondary_esc : ""));
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
275 g_free(primary_esc);
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
276 g_free(secondary_esc);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
277
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
278 label = gtk_label_new(NULL);
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
279
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
280 gtk_label_set_markup(GTK_LABEL(label), label_text);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
281 gtk_label_set_wrap(GTK_LABEL(label), TRUE);
19222
f0fa371d6752 Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <datallah@pidgin.im>
parents: 18802
diff changeset
282 gtk_label_set_selectable(GTK_LABEL(label), TRUE);
38007
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
283 gtk_label_set_xalign(GTK_LABEL(label), 0);
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
284 gtk_label_set_yalign(GTK_LABEL(label), 0);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
285 gtk_box_append(GTK_BOX(vbox), label);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
286
39214
d2eb8075734d Fix a comment
Gary Kramlich <grim@reaperworld.com>
parents: 39213
diff changeset
287 /* Add the view */
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
288 sw = gtk_scrolled_window_new();
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
289 gtk_box_append(GTK_BOX(vbox), sw);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
290 gtk_widget_set_vexpand(sw, TRUE);
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
291
42480
8c296ed85b26 Replace Talkatu in the notify api
Gary Kramlich <grim@reaperworld.com>
parents: 42251
diff changeset
292 view = gtk_text_view_new();
8c296ed85b26 Replace Talkatu in the notify api
Gary Kramlich <grim@reaperworld.com>
parents: 42251
diff changeset
293 buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
294 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), view);
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
295 gtk_widget_set_name(view, "pidgin_notify_view");
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
296 gtk_widget_set_size_request(view, 300, 250);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
297
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
298 /* Add the Close button. */
40693
4d91fb883f4b Replace stock items for dialog buttons with labels
Gary Kramlich <grim@reaperworld.com>
parents: 40683
diff changeset
299 button = gtk_dialog_add_button(GTK_DIALOG(window), _("Close"), GTK_RESPONSE_CLOSE);
19222
f0fa371d6752 Allow notification labels to be selectable (for copy-and-paste purposes). Fixes #563.
Daniel Atallah <datallah@pidgin.im>
parents: 18802
diff changeset
300 gtk_widget_grab_focus(button);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
301
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
302 event = gtk_event_controller_key_new();
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
303 gtk_widget_add_controller(window, event);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
304 g_signal_connect(G_OBJECT(event), "key-pressed",
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
305 G_CALLBACK(formatted_input_cb), NULL);
7455
f12dffd5fefd [gaim-migrate @ 8068]
Nathan Walp <nwalp@pidgin.im>
parents: 7399
diff changeset
306
8882
e1f85917a765 [gaim-migrate @ 9651]
Mark Doliner <markdoliner@pidgin.im>
parents: 8523
diff changeset
307 /* Make sure URLs are clickable */
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
308 linked_text = purple_markup_linkify(text);
42480
8c296ed85b26 Replace Talkatu in the notify api
Gary Kramlich <grim@reaperworld.com>
parents: 42251
diff changeset
309 gtk_text_buffer_set_text(buffer, linked_text, -1);
8882
e1f85917a765 [gaim-migrate @ 9651]
Mark Doliner <markdoliner@pidgin.im>
parents: 8523
diff changeset
310 g_free(linked_text);
7078
0d63d673f170 [gaim-migrate @ 7643]
Nathan Walp <nwalp@pidgin.im>
parents: 7039
diff changeset
311
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
312 g_object_set_data(G_OBJECT(window), "view-widget", view);
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
313
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
314 /* Show the window */
22007
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
315 pidgin_auto_parent_window(window);
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
316
42202
2273647d24b0 Use gtk_widget_set_visible for everything
Gary Kramlich <grim@reaperworld.com>
parents: 42094
diff changeset
317 gtk_widget_set_visible(window, TRUE);
6381
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
318
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
319 return window;
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
320 }
53203c44c731 [gaim-migrate @ 6886]
Christian Hammond <chipx86@chipx86.com>
parents: 6371
diff changeset
321
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
322 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
323 pidgin_notify_searchresults_new_rows(PurpleConnection *gc, PurpleNotifySearchResults *results,
13641
1173f8ca3fbf [gaim-migrate @ 16038]
Bartosz Oler <bartosz@pidgin.im>
parents: 13540
diff changeset
324 void *data_)
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
325 {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
326 PidginNotifySearchResultsData *data = data_;
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
327 PurpleProtocol *protocol = NULL;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
328 GtkListStore *model = data->model;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
329 GtkTreeIter iter;
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
330 GList *row, *column;
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
331 guint n;
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
332 const gchar *icon_name = NULL;
13091
b5ed878998dd [gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents: 12911
diff changeset
333
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
334 gtk_list_store_clear(data->model);
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
335
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
336 protocol = purple_account_get_protocol(purple_connection_get_account(gc));
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
337 icon_name = purple_protocol_get_icon_name(protocol);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
338
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
339 for (row = results->rows; row != NULL; row = row->next) {
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
340
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
341 gtk_list_store_append(model, &iter);
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
342 gtk_list_store_set(model, &iter, 0, icon_name, -1);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
343
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
344 n = 1;
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
345 for (column = row->data; column != NULL; column = column->next) {
12600
7ecd4441fdc7 [gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents: 12477
diff changeset
346 GValue v;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
347
12600
7ecd4441fdc7 [gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents: 12477
diff changeset
348 v.g_type = 0;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
349 g_value_init(&v, G_TYPE_STRING);
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
350 g_value_set_string(&v, column->data);
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
351 gtk_list_store_set_value(model, &iter, n, &v);
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
352 n++;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
353 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
354 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
355 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
356
9797
b69f82378b7b [gaim-migrate @ 10665]
Evan Schoenberg <evands@pidgin.im>
parents: 9791
diff changeset
357 static void *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
358 pidgin_notify_searchresults(PurpleConnection *gc, const char *title,
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
359 const char *primary, const char *secondary,
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
360 PurpleNotifySearchResults *results, gpointer user_data)
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
361 {
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
362 GtkWidget *window;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
363 GtkWidget *treeview;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
364 GType *col_types;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
365 GtkListStore *model;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
366 GtkCellRenderer *renderer;
12257
bc979ba39363 [gaim-migrate @ 14559]
Bartosz Oler <bartosz@pidgin.im>
parents: 12242
diff changeset
367 guint col_num;
20980
1599801ecbae Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20791
diff changeset
368 GList *columniter;
12257
bc979ba39363 [gaim-migrate @ 14559]
Bartosz Oler <bartosz@pidgin.im>
parents: 12242
diff changeset
369 guint i;
24816
bd870d9ff0ab The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@pidgin.im>
parents: 24658
diff changeset
370 GList *l;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
371
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
372 GtkWidget *vbox;
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
373 GtkWidget *sw;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
374 GtkWidget *label;
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
375 PidginNotifySearchResultsData *data;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
376 char *label_text;
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
377 char *primary_esc, *secondary_esc;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
378
12257
bc979ba39363 [gaim-migrate @ 14559]
Bartosz Oler <bartosz@pidgin.im>
parents: 12242
diff changeset
379 g_return_val_if_fail(gc != NULL, NULL);
bc979ba39363 [gaim-migrate @ 14559]
Bartosz Oler <bartosz@pidgin.im>
parents: 12242
diff changeset
380 g_return_val_if_fail(results != NULL, NULL);
bc979ba39363 [gaim-migrate @ 14559]
Bartosz Oler <bartosz@pidgin.im>
parents: 12242
diff changeset
381
39922
113b93e2bd2a Replace malloc(sizeof(...)) with g_new0(..., 1).
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 39913
diff changeset
382 data = g_new0(PidginNotifySearchResultsData, 1);
13641
1173f8ca3fbf [gaim-migrate @ 16038]
Bartosz Oler <bartosz@pidgin.im>
parents: 13540
diff changeset
383 data->user_data = user_data;
14038
3b7740b778ad [gaim-migrate @ 16534]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14037
diff changeset
384 data->results = results;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
385
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
386 /* Create the window */
19546
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
387 window = gtk_dialog_new();
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
388 gtk_window_set_title(GTK_WINDOW(window), title ? title :_("Search Results"));
b7a8a86af65a Use GtkDialog more often. Thanks nix_nix. Fixes #2618
Sean Egan <seanegan@pidgin.im>
parents: 19431
diff changeset
389 gtk_window_set_resizable(GTK_WINDOW(window), TRUE);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
390
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
391 g_signal_connect(window, "response", G_CALLBACK(searchresults_close_cb),
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
392 data);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
393
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
394 /* Setup the main vbox */
32394
f883709bdba4 compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents: 30812
diff changeset
395 vbox = gtk_dialog_get_content_area(GTK_DIALOG(window));
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
396
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
397 /* Setup the descriptive label */
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
398 primary_esc = (primary != NULL) ? g_markup_escape_text(primary, -1) : NULL;
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
399 secondary_esc = (secondary != NULL) ? g_markup_escape_text(secondary, -1) : NULL;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
400 label_text = g_strdup_printf(
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
401 "<span weight=\"bold\" size=\"larger\">%s</span>%s%s",
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
402 (primary ? primary_esc : ""),
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
403 (primary && secondary ? "\n" : ""),
10774
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
404 (secondary ? secondary_esc : ""));
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
405 g_free(primary_esc);
f4238d6312ff [gaim-migrate @ 12383]
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 10750
diff changeset
406 g_free(secondary_esc);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
407 label = gtk_label_new(NULL);
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
408 gtk_label_set_markup(GTK_LABEL(label), label_text);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
409 gtk_label_set_wrap(GTK_LABEL(label), TRUE);
38007
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
410 gtk_label_set_xalign(GTK_LABEL(label), 0);
3b971d2ecae1 Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 37994
diff changeset
411 gtk_label_set_yalign(GTK_LABEL(label), 0);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
412 gtk_box_append(GTK_BOX(vbox), label);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
413 g_free(label_text);
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
414
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
415 /* +1 is for the automagically created Status column. */
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
416 col_num = g_list_length(results->columns) + 1;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
417
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
418 /* Setup the list model */
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
419 col_types = g_new0(GType, col_num);
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
420
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
421 /* There always is this first column. */
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
422 col_types[0] = GDK_TYPE_PIXBUF;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
423 for (i = 1; i < col_num; i++) {
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
424 col_types[i] = G_TYPE_STRING;
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
425 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
426 model = gtk_list_store_newv(col_num, col_types);
22999
3323b9070331 More plumbing work.
Daniel Atallah <datallah@pidgin.im>
parents: 22330
diff changeset
427 g_free(col_types);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
428
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
429 /* Setup the treeview */
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
430 treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(model));
42592
6b65c0e4ba15 Remove unnecessary casts for GObject methods
Gary Kramlich <grim@reaperworld.com>
parents: 42551
diff changeset
431 g_object_unref(model);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
432 gtk_widget_set_size_request(treeview, 500, 400);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
433 gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)),
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
434 GTK_SELECTION_SINGLE);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
435 gtk_tree_view_set_headers_visible(GTK_TREE_VIEW(treeview), TRUE);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
436 sw = gtk_scrolled_window_new();
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
437 gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
438 GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
439 gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(sw), treeview);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
440 gtk_widget_set_vexpand(sw, TRUE);
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
441 gtk_box_append(GTK_BOX(vbox), sw);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
442
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
443 renderer = gtk_cell_renderer_pixbuf_new();
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
444 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview),
41575
d08b9a655b0e Remove pidgin_create_icon_from_protocol and pidgin_create_protocol_icon
Gary Kramlich <grim@reaperworld.com>
parents: 41534
diff changeset
445 -1, "", renderer, "icon-name", 0, NULL);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
446
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
447 i = 1;
20980
1599801ecbae Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20791
diff changeset
448 for (columniter = results->columns; columniter != NULL; columniter = columniter->next) {
1599801ecbae Fix pidgin_notify_searchresults to use the actual title for column headers,
Stu Tomlinson <nosnilmot@pidgin.im>
parents: 20791
diff changeset
449 PurpleNotifySearchColumn *column = columniter->data;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
450 renderer = gtk_cell_renderer_text_new();
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
451
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
452 gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(treeview), -1,
32691
d6eb58903f8b Hide struct PurpleNotifySearchColumn.
Andrew Victor <andrew.victor@mxit.com>
parents: 32678
diff changeset
453 purple_notify_searchresult_column_get_title(column), renderer, "text", i, NULL);
31696
67d180e0f68d Add API:
Andrew Victor <andrew.victor@mxit.com>
parents: 31565
diff changeset
454
67d180e0f68d Add API:
Andrew Victor <andrew.victor@mxit.com>
parents: 31565
diff changeset
455 if (!purple_notify_searchresult_column_is_visible(column))
67d180e0f68d Add API:
Andrew Victor <andrew.victor@mxit.com>
parents: 31565
diff changeset
456 gtk_tree_view_column_set_visible(gtk_tree_view_get_column(GTK_TREE_VIEW(treeview), i), FALSE);
67d180e0f68d Add API:
Andrew Victor <andrew.victor@mxit.com>
parents: 31565
diff changeset
457
20355
dacdf6087e16 Access search results directly instead of going through the API because
Mark Doliner <markdoliner@pidgin.im>
parents: 20330
diff changeset
458 i++;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
459 }
14286
9ff15ceacd34 [gaim-migrate @ 16905]
Daniel Atallah <datallah@pidgin.im>
parents: 14253
diff changeset
460
24816
bd870d9ff0ab The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@pidgin.im>
parents: 24658
diff changeset
461 for (l = results->buttons; l; l = l->next) {
bd870d9ff0ab The other day while struct hiding, I noticed a for loop that was checking
Richard Laager <rlaager@pidgin.im>
parents: 24658
diff changeset
462 PurpleNotifySearchButton *b = l->data;
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
463 GtkWidget *button = NULL;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
464 switch (b->type) {
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
465 case PURPLE_NOTIFY_BUTTON_LABELED:
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
466 if(b->label) {
38789
ad3e9caa955b Ensure labelled buttons are shown for search results in Pidgin.
Howard Chu <hyc@symas.com>
parents: 38737
diff changeset
467 button = gtk_dialog_add_button(GTK_DIALOG(window), b->label, GTK_RESPONSE_NONE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
468 } else {
19832
84b69b21672b Patch from QuLogic. Fixes #2903 ('Missing newlines in debug messages.')
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 19546
diff changeset
469 purple_debug_warning("gtknotify", "Missing button label\n");
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
470 }
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
471 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
472 case PURPLE_NOTIFY_BUTTON_CONTINUE:
40693
4d91fb883f4b Replace stock items for dialog buttons with labels
Gary Kramlich <grim@reaperworld.com>
parents: 40683
diff changeset
473 button = gtk_dialog_add_button(GTK_DIALOG(window), _("Forward"), GTK_RESPONSE_NONE);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
474 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
475 case PURPLE_NOTIFY_BUTTON_ADD:
40693
4d91fb883f4b Replace stock items for dialog buttons with labels
Gary Kramlich <grim@reaperworld.com>
parents: 40683
diff changeset
476 button = gtk_dialog_add_button(GTK_DIALOG(window), _("Add"), GTK_RESPONSE_NONE);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
477 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
478 case PURPLE_NOTIFY_BUTTON_INFO:
41021
74367ae3c5c3 Remove the usage of GtkStock from gtknotify.c
Gary Kramlich <grim@reaperworld.com>
parents: 40693
diff changeset
479 button = gtk_dialog_add_button(GTK_DIALOG(window), _("_Get Info"), GTK_RESPONSE_NONE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
480 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
481 case PURPLE_NOTIFY_BUTTON_IM:
41021
74367ae3c5c3 Remove the usage of GtkStock from gtknotify.c
Gary Kramlich <grim@reaperworld.com>
parents: 40693
diff changeset
482 button = gtk_dialog_add_button(GTK_DIALOG(window), _("I_M"), GTK_RESPONSE_NONE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
483 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
484 case PURPLE_NOTIFY_BUTTON_JOIN:
41021
74367ae3c5c3 Remove the usage of GtkStock from gtknotify.c
Gary Kramlich <grim@reaperworld.com>
parents: 40693
diff changeset
485 button = gtk_dialog_add_button(GTK_DIALOG(window), _("_Join"), GTK_RESPONSE_NONE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
486 break;
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
487 case PURPLE_NOTIFY_BUTTON_INVITE:
41021
74367ae3c5c3 Remove the usage of GtkStock from gtknotify.c
Gary Kramlich <grim@reaperworld.com>
parents: 40693
diff changeset
488 button = gtk_dialog_add_button(GTK_DIALOG(window), _("_Invite"), GTK_RESPONSE_NONE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
489 break;
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
490 default:
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
491 purple_debug_warning("gtknotify", "Incorrect button type: %d\n", b->type);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
492 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
493 if (button != NULL) {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
494 PidginNotifySearchResultsButtonData *bd;
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
495
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
496 bd = g_new0(PidginNotifySearchResultsButtonData, 1);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
497 bd->button = b;
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
498 bd->data = data;
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
499
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
500 g_signal_connect(G_OBJECT(button), "clicked",
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
501 G_CALLBACK(searchresults_callback_wrapper_cb), bd);
14038
3b7740b778ad [gaim-migrate @ 16534]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 14037
diff changeset
502 g_signal_connect_swapped(G_OBJECT(button), "destroy", G_CALLBACK(g_free), bd);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
503 }
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
504 }
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
505
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
506 /* Add the Close button */
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
507 gtk_dialog_add_button(GTK_DIALOG(window), _("Close"), GTK_RESPONSE_CLOSE);
12624
c1c92f08976b [gaim-migrate @ 14960]
Christopher O'Brien <siege@pidgin.im>
parents: 12600
diff changeset
508
32678
01f6312a4a7b On the way to hiding the PurpleConnection struct.
Andrew Victor <andrew.victor@mxit.com>
parents: 32521
diff changeset
509 data->account = purple_connection_get_account(gc);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
510 data->model = model;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
511 data->treeview = treeview;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
512 data->window = window;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
513
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
514 /* Insert rows. */
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15497
diff changeset
515 pidgin_notify_searchresults_new_rows(gc, results, data);
11359
9630f62029f2 [gaim-migrate @ 13581]
Bartosz Oler <bartosz@pidgin.im>
parents: 11293
diff changeset
516
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
517 /* Show the window */
22007
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
518 pidgin_auto_parent_window(window);
386062b58867 Try to make a window transient for a suitable parent window. This currently
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 21213
diff changeset
519
42202
2273647d24b0 Use gtk_widget_set_visible for everything
Gary Kramlich <grim@reaperworld.com>
parents: 42094
diff changeset
520 gtk_widget_set_visible(window, TRUE);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
521 return data;
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
522 }
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
523
41479
3d2e114380f6 Add source files to GObject introspection
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41231
diff changeset
524 /* Xerox'ed from Finch! How the tables have turned!! ;) */
3d2e114380f6 Add source files to GObject introspection
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41231
diff changeset
525 /* User information. */
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
526 static GHashTable *userinfo;
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
527
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
528 static char *
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
529 userinfo_hash(PurpleAccount *account, const char *who)
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
530 {
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
531 char key[256];
40094
8e6d91e4dd8f Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40048
diff changeset
532 g_snprintf(key, sizeof(key), "%s - %s",
41962
f802660eaef2 Update Pidgin to stop using deprecated account methods
Gary Kramlich <grim@reaperworld.com>
parents: 41947
diff changeset
533 purple_contact_info_get_username(PURPLE_CONTACT_INFO(account)),
40094
8e6d91e4dd8f Use g_(v)snprintf so we need less wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents: 40048
diff changeset
534 purple_normalize(account, who));
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
535 return g_utf8_strup(key, -1);
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
536 }
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
537
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
538 static void
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
539 remove_userinfo(GtkWidget *widget, gpointer key)
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
540 {
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
541 PidginUserInfo *pinfo = g_hash_table_lookup(userinfo, key);
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
542
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
543 while (pinfo->count--)
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
544 purple_notify_close(PURPLE_NOTIFY_USERINFO, widget);
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
545
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
546 g_hash_table_remove(userinfo, key);
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
547 }
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
548
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
549 static void *
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
550 pidgin_notify_userinfo(PurpleConnection *gc, const char *who,
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
551 PurpleNotifyUserInfo *user_info)
9797
b69f82378b7b [gaim-migrate @ 10665]
Evan Schoenberg <evands@pidgin.im>
parents: 9791
diff changeset
552 {
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
553 char *info;
11533
f58436975d44 [gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents: 11359
diff changeset
554 void *ui_handle;
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
555 char *key = userinfo_hash(purple_connection_get_account(gc), who);
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
556 PidginUserInfo *pinfo = NULL;
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
557
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
558 if (!userinfo) {
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
559 userinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
560 }
11533
f58436975d44 [gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents: 11359
diff changeset
561
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
562 info = purple_notify_user_info_get_text_with_newline(user_info, "<br />");
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
563 pinfo = g_hash_table_lookup(userinfo, key);
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
564 if (pinfo != NULL) {
39213
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
565 GtkWidget *view = g_object_get_data(G_OBJECT(pinfo->window), "view-widget");
be8cd7616e08 Remove webkit from gtknotify.c and replace it with talkatu. Having some issues with format rendering, but it's working otherwise
Gary Kramlich <grim@reaperworld.com>
parents: 39146
diff changeset
566 GtkTextBuffer *buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
567 char *linked_text = purple_markup_linkify(info);
42480
8c296ed85b26 Replace Talkatu in the notify api
Gary Kramlich <grim@reaperworld.com>
parents: 42251
diff changeset
568
8c296ed85b26 Replace Talkatu in the notify api
Gary Kramlich <grim@reaperworld.com>
parents: 42251
diff changeset
569 gtk_text_buffer_set_text(buffer, linked_text, -1);
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
570 g_free(linked_text);
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
571 g_free(key);
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
572 ui_handle = pinfo->window;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
573 pinfo->count++;
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
574 } else {
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
575 char *primary = g_strdup_printf(_("Info for %s"), who);
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
576 ui_handle = pidgin_notify_formatted(_("Buddy Information"), primary, NULL, info);
42246
3230f1a1fb8f Remove unnecessary casting from g_signal_handlers_disconnect
Gary Kramlich <grim@reaperworld.com>
parents: 42216
diff changeset
577 g_signal_handlers_disconnect_by_func(ui_handle, formatted_close_cb,
3230f1a1fb8f Remove unnecessary casting from g_signal_handlers_disconnect
Gary Kramlich <grim@reaperworld.com>
parents: 42216
diff changeset
578 NULL);
42014
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
579 g_signal_connect(ui_handle, "response", G_CALLBACK(remove_userinfo),
b6a9fcf02157 Replace obsolete delete_event signals
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41962
diff changeset
580 key);
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
581 g_free(primary);
17728
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
582 pinfo = g_new0(PidginUserInfo, 1);
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
583 pinfo->window = ui_handle;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
584 pinfo->count = 1;
323b1481c2bc sadrul's fix for the userinfo notify crash on disconnect that was caused by
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 17027
diff changeset
585 g_hash_table_insert(userinfo, key, pinfo);
17027
cad1dc392f1a Fix ticket #387.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents: 16752
diff changeset
586 }
15206
70520a610969 [gaim-migrate @ 17930]
Evan Schoenberg <evands@pidgin.im>
parents: 14865
diff changeset
587 g_free(info);
11533
f58436975d44 [gaim-migrate @ 13782]
Richard Laager <rlaager@pidgin.im>
parents: 11359
diff changeset
588 return ui_handle;
9797
b69f82378b7b [gaim-migrate @ 10665]
Evan Schoenberg <evands@pidgin.im>
parents: 9791
diff changeset
589 }
b69f82378b7b [gaim-migrate @ 10665]
Evan Schoenberg <evands@pidgin.im>
parents: 9791
diff changeset
590
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
591 static void
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
592 pidgin_close_notify(PurpleNotifyType type, void *ui_handle)
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
593 {
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
594 if (type == PURPLE_NOTIFY_SEARCHRESULTS) {
15882
1dbd5756b7bf More Gaim to Pidgin stuff
Sean Egan <seanegan@pidgin.im>
parents: 15880
diff changeset
595 PidginNotifySearchResultsData *data = (PidginNotifySearchResultsData *)ui_handle;
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
596
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
597 gtk_window_destroy(GTK_WINDOW(data->window));
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
598 purple_notify_searchresults_free(data->results);
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
599
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
600 g_free(data);
41534
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
601
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
602 } else if (ui_handle != NULL) {
ed3a7cfa0b0c Convert PidginNotify to GTK4
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 41526
diff changeset
603 gtk_window_destroy(GTK_WINDOW(ui_handle));
10439
5868d8f55fb1 [gaim-migrate @ 11697]
Alex Converse <alex.converse@gmail.com>
parents: 10297
diff changeset
604 }
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
605 }
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
606
7136
77f3c20bbed6 [gaim-migrate @ 7703]
Nathan Walp <nwalp@pidgin.im>
parents: 7078
diff changeset
607 static void *
40501
011cdaa64ecc Replace the manual browser opening code with gtk_show_uri_on_window
Gary Kramlich <grim@reaperworld.com>
parents: 40496
diff changeset
608 pidgin_notify_uri(const char *uri) {
42216
76245ac5cf36 Fix gtk_show_uri deprecations
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42202
diff changeset
609 GtkUriLauncher *launcher = NULL;
76245ac5cf36 Fix gtk_show_uri deprecations
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42202
diff changeset
610 launcher = gtk_uri_launcher_new(uri);
76245ac5cf36 Fix gtk_show_uri deprecations
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42202
diff changeset
611 gtk_uri_launcher_launch(launcher, NULL, NULL, NULL, NULL);
76245ac5cf36 Fix gtk_show_uri deprecations
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents: 42202
diff changeset
612 g_object_unref(launcher);
7136
77f3c20bbed6 [gaim-migrate @ 7703]
Nathan Walp <nwalp@pidgin.im>
parents: 7078
diff changeset
613
77f3c20bbed6 [gaim-migrate @ 7703]
Nathan Walp <nwalp@pidgin.im>
parents: 7078
diff changeset
614 return NULL;
77f3c20bbed6 [gaim-migrate @ 7703]
Nathan Walp <nwalp@pidgin.im>
parents: 7078
diff changeset
615 }
77f3c20bbed6 [gaim-migrate @ 7703]
Nathan Walp <nwalp@pidgin.im>
parents: 7078
diff changeset
616
27476
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
617 static void*
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
618 pidgin_notify_get_handle(void)
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
619 {
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
620 static int handle;
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
621 return &handle;
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
622 }
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
623
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
624 void pidgin_notify_init(void)
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
625 {
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
626 }
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
627
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
628 void pidgin_notify_uninit(void)
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
629 {
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
630 purple_signals_disconnect_by_handle(pidgin_notify_get_handle());
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
631 }
d44640cb5686 Clear the notifications via a signal instead of pidgin_close_notify.
Paul Aurich <darkrain42@pidgin.im>
parents: 27470
diff changeset
632
41720
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
633 static PurpleNotifyUiOps ops = {
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
634 .notify_message = pidgin_notify_message,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
635 .notify_formatted = pidgin_notify_formatted,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
636 .notify_searchresults = pidgin_notify_searchresults,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
637 .notify_searchresults_new_rows = pidgin_notify_searchresults_new_rows,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
638 .notify_userinfo = pidgin_notify_userinfo,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
639 .notify_uri = pidgin_notify_uri,
bcfc2c9e5213 Move all of the UiOps to use struct initializers
Gary Kramlich <grim@reaperworld.com>
parents: 41629
diff changeset
640 .close_notify = pidgin_close_notify,
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
641 };
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
642
15884
4de1981757fc sed -ie 's/gaim/purple/g'
Sean Egan <seanegan@pidgin.im>
parents: 15883
diff changeset
643 PurpleNotifyUiOps *
15562
8c8249fe5e3c gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents: 15497
diff changeset
644 pidgin_notify_get_ui_ops(void)
5437
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
645 {
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
646 return &ops;
4bd5c5d271e6 [gaim-migrate @ 5819]
Christian Hammond <chipx86@chipx86.com>
parents:
diff changeset
647 }

mercurial