Sat, 22 Aug 2020 04:02:53 -0500
Remove purple_chat_user_[sg]et_ui_data.
Remove `purple_chat_user_[gs]et_ui_data`.
Remove `deleting-chat-user` signal. It's unused now, and just a substitute for a finalization notification.
Testing Done:
Compile only.
Reviewed at https://reviews.imfreedom.org/r/83/
|
20147
66f05a854eee
applied changes from 8a731bbd0197fbcc91a705c2d8f528154216defa
Richard Laager <rlaager@pidgin.im>
parents:
20137
diff
changeset
|
1 | /* pidgin |
| 9709 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15906
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 9709 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
| 6 | * | |
| 7 | * This program is free software; you can redistribute it and/or modify | |
| 8 | * it under the terms of the GNU General Public License as published by | |
| 9 | * the Free Software Foundation; either version 2 of the License, or | |
| 10 | * (at your option) any later version. | |
| 11 | * | |
| 12 | * This program is distributed in the hope that it will be useful, | |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 15 | * GNU General Public License for more details. | |
| 16 | * | |
| 17 | * You should have received a copy of the GNU General Public License | |
| 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:
19693
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 9709 | 20 | */ |
|
24569
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24541
diff
changeset
|
21 | |
|
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
|
22 | #ifdef HAVE_CONFIG_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 | # include <config.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
|
24 | #endif |
|
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
|
25 | |
|
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
|
26 | #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
|
27 | |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
28 | #include <talkatu.h> |
|
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
29 | |
|
27945
93ece0c6a9ad
Add the MTN revision in the Pidgin About and finch --version dialogs.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
27941
diff
changeset
|
30 | #include "package_revision.h" |
|
38538
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
31 | #ifdef HAVE_MESON_CONFIG |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
32 | #include "meson-config.h" |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
33 | #endif |
| 9709 | 34 | |
|
40360
e21f3bbcc2a5
Update all of the pidgin code to include purple.h
Gary Kramlich <grim@reaperworld.com>
parents:
40240
diff
changeset
|
35 | #include <purple.h> |
| 9709 | 36 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
37 | #include "gtkblist.h" |
| 9709 | 38 | #include "gtkdialogs.h" |
| 39 | #include "gtkutils.h" | |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
40 | #include "pidgincore.h" |
|
39603
98fd85e156e0
Rename gtklog -> pidginlog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39471
diff
changeset
|
41 | #include "pidginlog.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
42 | #include "pidginstock.h" |
| 9709 | 43 | |
|
33836
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
44 | #ifdef USE_GSTREAMER |
|
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
45 | #include <gst/gst.h> |
|
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
46 | #endif |
|
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
47 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
48 | static GList *dialogwindows = NULL; |
| 9709 | 49 | |
| 15882 | 50 | struct _PidginGroupMergeObject { |
| 15884 | 51 | PurpleGroup* parent; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
52 | char *new_name; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
53 | }; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
54 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
55 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
56 | pidgin_dialogs_destroy_all() |
| 9709 | 57 | { |
|
40062
d25228fc7b8e
Use g_list_free_full instead of manual iterations
qarkai <qarkai@gmail.com>
parents:
39913
diff
changeset
|
58 | g_list_free_full(dialogwindows, (GDestroyNotify)gtk_widget_destroy); |
| 40064 | 59 | dialogwindows = NULL; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
60 | } |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
61 | |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
62 | static void destroy_win(GtkWidget *button, GtkWidget *win) |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
63 | { |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
64 | gtk_widget_destroy(win); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
65 | } |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
66 | |
|
20109
47e44a7b0fb9
applied changes from 6e915e14a78ccafa5e0ddfdcabccc2e174c734e3
Richard Laager <rlaager@pidgin.im>
parents:
20039
diff
changeset
|
67 | #if 0 |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
68 | /* This function puts the version number onto the pixmap we use in the 'about' |
|
16471
0b836d290d38
another s/Purple/Pidgin/ - how many years until we've found all of these?
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16464
diff
changeset
|
69 | * screen in Pidgin. */ |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
70 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
71 | pidgin_logo_versionize(GdkPixbuf **original, GtkWidget *widget) { |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
72 | GdkPixmap *pixmap; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
73 | GtkStyle *style; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
74 | PangoContext *context; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
75 | PangoLayout *layout; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
76 | gchar *markup; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
77 | gint width, height; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
78 | gint lwidth = 0, lheight = 0; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
79 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
80 | style = gtk_widget_get_style(widget); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
81 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
82 | gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
83 | width = gdk_pixbuf_get_width(*original); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
84 | height = gdk_pixbuf_get_height(*original); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
85 | g_object_unref(G_OBJECT(*original)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
86 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
87 | context = gtk_widget_get_pango_context(widget); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
88 | layout = pango_layout_new(context); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
89 | |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
90 | markup = g_strdup_printf("<span foreground=\"#000000\">%s</span>", DISPLAY_VERSION); |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
91 | pango_layout_set_font_description(layout, style->font_desc); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
92 | pango_layout_set_markup(layout, markup, strlen(markup)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
93 | g_free(markup); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
94 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
95 | pango_layout_get_pixel_size(layout, &lwidth, &lheight); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
96 | gdk_draw_layout(GDK_DRAWABLE(pixmap), style->bg_gc[GTK_STATE_NORMAL], |
|
19869
62a227ad812d
Add a new 2.2.0 about image from hbons and move the version number up and out of the way.
Kevin Stange <kstange@pidgin.im>
parents:
19863
diff
changeset
|
97 | width - (lwidth + 3), 1, layout); |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
98 | g_object_unref(G_OBJECT(layout)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
99 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
100 | *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
101 | 0, 0, 0, 0, |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
102 | width, height); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
103 | g_object_unref(G_OBJECT(pixmap)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
104 | } |
|
20109
47e44a7b0fb9
applied changes from 6e915e14a78ccafa5e0ddfdcabccc2e174c734e3
Richard Laager <rlaager@pidgin.im>
parents:
20039
diff
changeset
|
105 | #endif |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
106 | |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
107 | /* Note: Frees 'string' */ |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
108 | static GtkWidget * |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
109 | pidgin_build_help_dialog(const char *title, const char *role, GString *string) |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
110 | { |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
111 | GtkWidget *win, *vbox, *logo, *view, *button; |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
112 | GdkPixbuf *pixbuf; |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
113 | GtkTextBuffer *buffer; |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
114 | AtkObject *obj; |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
115 | char *filename, *tmp; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
116 | |
|
33141
2001ba1d6827
Remove extra padding that makes things look not-so-good.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33138
diff
changeset
|
117 | win = pidgin_create_dialog(title, 0, role, TRUE); |
|
2001ba1d6827
Remove extra padding that makes things look not-so-good.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33138
diff
changeset
|
118 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, 0); |
|
33145
eca262aa23ff
Increase the Help dialog widths to fit the revision by default.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33142
diff
changeset
|
119 | gtk_window_set_default_size(GTK_WINDOW(win), 475, 450); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
120 | |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
121 | /* Generate a logo with a version number */ |
|
35850
1abeda205d6c
cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35686
diff
changeset
|
122 | filename = g_build_filename(PURPLE_DATADIR, |
|
1abeda205d6c
cross-win32: make dirs more flexible, add them to the config.h
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35686
diff
changeset
|
123 | "pixmaps", "pidgin", "logo.png", NULL); |
|
31889
96183796df0c
Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents:
31849
diff
changeset
|
124 | pixbuf = pidgin_pixbuf_new_from_file(filename); |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
125 | g_free(filename); |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
126 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
127 | /* Insert the logo */ |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
128 | logo = gtk_image_new_from_pixbuf(pixbuf); |
|
30552
cd97874e325e
Don't assert if logo is missing. This shouldn't really affect people
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30197
diff
changeset
|
129 | if (pixbuf) |
|
cd97874e325e
Don't assert if logo is missing. This shouldn't really affect people
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30197
diff
changeset
|
130 | g_object_unref(G_OBJECT(pixbuf)); |
|
10266
073aeb0c9117
[gaim-migrate @ 11412]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
131 | obj = gtk_widget_get_accessible(logo); |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
132 | tmp = g_strconcat(PIDGIN_NAME, " " DISPLAY_VERSION, NULL); |
|
16977
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16961
diff
changeset
|
133 | atk_object_set_description(obj, tmp); |
|
c9cb49bea66d
Change the PIDGIN_NAME stuff to allow translators to transliterate the
Richard Laager <rlaager@pidgin.im>
parents:
16961
diff
changeset
|
134 | g_free(tmp); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
135 | gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
136 | |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
137 | buffer = talkatu_html_buffer_new(); |
|
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
138 | talkatu_markup_append_html(TALKATU_BUFFER(buffer), string->str, -1); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
139 | |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
140 | view = talkatu_view_new_with_buffer(buffer); |
|
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
141 | gtk_box_pack_start(GTK_BOX(vbox), view, TRUE, TRUE, 0); |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
142 | |
|
39138
99c0f6e30bb1
gtkdialogs: Port from deprecated GtkStock to string literals
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
143 | button = pidgin_dialog_add_button(GTK_DIALOG(win), _("_Close"), |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
144 | G_CALLBACK(destroy_win), win); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
145 | |
|
32914
9d3d02829373
Fix calls to GTK_WIDGET_SET_FLAGS, which oddly enough does not seem to
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32912
diff
changeset
|
146 | gtk_widget_set_can_default(button, TRUE); |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
147 | gtk_widget_grab_default(button); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
148 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
149 | gtk_widget_show_all(win); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
150 | gtk_window_present(GTK_WINDOW(win)); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
151 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
152 | g_string_free(string, TRUE); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
153 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
154 | return win; |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
155 | } |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
156 | |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
157 | void pidgin_dialogs_plugins_info(void) |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
158 | { |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
159 | GString *str; |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
160 | GList *plugins, *l = NULL; |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
161 | PurplePlugin *plugin = NULL; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
162 | PurplePluginInfo *info; |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
163 | GPluginPluginInfo *ginfo; |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
164 | PurplePluginExtraCb extra_cb; |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
165 | char *title = g_strdup_printf(_("%s Plugin Information"), PIDGIN_NAME); |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
166 | char *pname = NULL, *authors, *pauthors, *pextra; |
|
36512
35b1e42281e5
Removed loadable field from plugin info dialog, and added license
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
167 | const char *pver, *plicense, *pwebsite, *pid; |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
168 | gboolean ploaded, ploadable; |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
169 | const char * const *authorlist; |
| 36978 | 170 | guint n_authors; |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
171 | static GtkWidget *plugins_info = NULL; |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
172 | |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
173 | str = g_string_sized_new(4096); |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
174 | |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
175 | g_string_append_printf(str, "<h2>%s</h2><dl>", _("Plugin Information")); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
176 | |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
177 | plugins = purple_plugins_find_all(); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
178 | |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
179 | for(l = plugins; l; l = l->next) { |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
180 | plugin = PURPLE_PLUGIN(l->data); |
|
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
181 | info = purple_plugin_get_info(plugin); |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
182 | ginfo = GPLUGIN_PLUGIN_INFO(info); |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
183 | extra_cb = purple_plugin_info_get_extra_cb(info); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
184 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
185 | pname = g_markup_escape_text( |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
186 | gplugin_plugin_info_get_name(ginfo), -1); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
187 | authorlist = gplugin_plugin_info_get_authors(ginfo); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
188 | |
| 36978 | 189 | if (authorlist) { |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
190 | authors = g_strjoinv(", ", (gchar **)authorlist); |
| 36978 | 191 | n_authors = g_strv_length((gchar **)authorlist); |
| 192 | } else { | |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
193 | authors = NULL; |
| 36978 | 194 | n_authors = 0; |
| 195 | } | |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
196 | |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
197 | if (authors) |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
198 | pauthors = g_markup_escape_text(authors, -1); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
199 | else |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
200 | pauthors = NULL; |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
201 | |
|
39834
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
202 | pver = gplugin_plugin_info_get_version(ginfo); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
203 | plicense = gplugin_plugin_info_get_license_id(ginfo); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
204 | pwebsite = gplugin_plugin_info_get_website(ginfo); |
|
0345d198dbd6
Remove redundant purple_plugin_info_get_* wrappers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39814
diff
changeset
|
205 | pid = gplugin_plugin_info_get_id(ginfo); |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
206 | ploadable = !purple_plugin_info_get_error(info); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
207 | ploaded = purple_plugin_is_loaded(plugin); |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
208 | |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
209 | if (ploaded && extra_cb) |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
210 | pextra = extra_cb(plugin); |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
211 | else |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
212 | pextra = NULL; |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
213 | |
| 35910 | 214 | g_string_append_printf(str, "<dt>%s</dt><dd>", pname); |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
215 | if (pauthors) { |
| 37140 | 216 | g_string_append_printf(str, "<b>%s:</b> %s<br/>", |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
217 | (n_authors > 1 ? "Authors" : "Author"), |
|
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
218 | pauthors); |
|
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39834
diff
changeset
|
219 | } |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
220 | g_string_append_printf(str, |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
221 | "<b>Version:</b> %s<br/>" |
|
36512
35b1e42281e5
Removed loadable field from plugin info dialog, and added license
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
222 | "<b>License:</b> %s<br/>" |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
223 | "<b>Website:</b> %s<br/>" |
|
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
224 | "<b>ID String:</b> %s<br/>" |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
225 | "<b>Extra:</b> %s<br/>" |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
226 | "<b>Loadable:</b> %s<br/>" |
|
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
227 | "<b>Loaded:</b> %s" |
|
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
228 | "</dd><br/>", |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
229 | pver ? pver : "", |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
230 | plicense ? plicense : "", |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
231 | pwebsite ? pwebsite : "", |
|
36512
35b1e42281e5
Removed loadable field from plugin info dialog, and added license
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
232 | pid, |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
233 | pextra ? pextra : "", |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
234 | ploadable ? "Yes" : "<span style=\"color: #FF0000;\"><b>No</b></span>", |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
235 | ploaded ? "Yes" : "No"); |
|
32870
2c5150da76c1
Fix a leak in the Plugin Information window. These variables are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32866
diff
changeset
|
236 | |
|
2c5150da76c1
Fix a leak in the Plugin Information window. These variables are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32866
diff
changeset
|
237 | g_free(pname); |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
238 | g_free(pextra); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
239 | g_free(pauthors); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
240 | g_free(authors); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
241 | } |
|
36430
559d5d9d8a6c
Refactored the codebase to remove purple_plugins_free_found_list()
Ankit Vani <a@nevitus.org>
parents:
36413
diff
changeset
|
242 | g_list_free(plugins); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
243 | |
|
39471
46885fa0a1a8
Start of moving the plugin info dialog to talkatu. Still need to handle error messages and their formatting
Gary Kramlich <grim@reaperworld.com>
parents:
39149
diff
changeset
|
244 | g_string_append(str, "</dl><br/>"); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
245 | |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
246 | plugins_info = pidgin_build_help_dialog(title, "plugins_info", str); |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
247 | g_signal_connect(G_OBJECT(plugins_info), "destroy", |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
248 | G_CALLBACK(gtk_widget_destroyed), &plugins_info); |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
249 | g_free(title); |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
250 | } |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
251 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
252 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
253 | pidgin_dialogs_im_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 254 | { |
| 15884 | 255 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
256 | const char *username; |
| 9709 | 257 | |
| 15884 | 258 | account = purple_request_fields_get_account(fields, "account"); |
| 259 | username = purple_request_fields_get_string(fields, "screenname"); | |
| 9709 | 260 | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
261 | pidgin_dialogs_im_with_user(account, username); |
| 9709 | 262 | } |
| 263 | ||
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
264 | static gboolean |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
265 | pidgin_dialogs_im_name_validator(PurpleRequestField *field, gchar **errmsg, |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
266 | void *_fields) |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
267 | { |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
268 | PurpleRequestFields *fields = _fields; |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
269 | PurpleAccount *account; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
270 | PurpleProtocol *protocol; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
271 | const char *username; |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
272 | gboolean valid = FALSE; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
273 | |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
274 | account = purple_request_fields_get_account(fields, "account"); |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36568
diff
changeset
|
275 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
276 | username = purple_request_fields_get_string(fields, "screenname"); |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
277 | |
|
40240
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
278 | if (username) { |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
279 | valid = purple_validate(protocol, username); |
|
4adf32217c85
Fix a warning when opening the new IM dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40197
diff
changeset
|
280 | } |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
281 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
282 | if (errmsg && !valid) |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
283 | *errmsg = g_strdup(_("Invalid username")); |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
284 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
285 | return valid; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
286 | } |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
287 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
288 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
289 | pidgin_dialogs_im(void) |
| 9709 | 290 | { |
| 15884 | 291 | PurpleRequestFields *fields; |
| 292 | PurpleRequestFieldGroup *group; | |
| 293 | PurpleRequestField *field; | |
| 9709 | 294 | |
| 15884 | 295 | fields = purple_request_fields_new(); |
| 9709 | 296 | |
| 15884 | 297 | group = purple_request_field_group_new(NULL); |
| 298 | purple_request_fields_add_group(fields, group); | |
| 9709 | 299 | |
| 15884 | 300 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 301 | purple_request_field_set_type_hint(field, "screenname"); | |
| 302 | purple_request_field_set_required(field, TRUE); | |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
303 | purple_request_field_set_validator(field, pidgin_dialogs_im_name_validator, fields); |
| 15884 | 304 | purple_request_field_group_add_field(group, field); |
| 9709 | 305 | |
| 15884 | 306 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 307 | purple_request_field_set_type_hint(field, "account"); | |
| 308 | purple_request_field_set_visible(field, | |
| 309 | (purple_connections_get_all() != NULL && | |
| 310 | purple_connections_get_all()->next != NULL)); | |
| 311 | purple_request_field_set_required(field, TRUE); | |
| 312 | purple_request_field_group_add_field(group, field); | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
313 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
314 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
315 | purple_blist_get_default(), _("New Instant Message"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
316 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
317 | "you would like to IM."), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
318 | fields, _("OK"), G_CALLBACK(pidgin_dialogs_im_cb), _("Cancel"), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
319 | NULL, NULL, NULL); |
| 9709 | 320 | } |
| 321 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
322 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
323 | pidgin_dialogs_im_with_user(PurpleAccount *account, const char *username) |
| 9709 | 324 | { |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
325 | PurpleIMConversation *im; |
| 9709 | 326 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
327 | g_return_if_fail(account != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
328 | g_return_if_fail(username != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
329 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
330 | im = purple_conversations_find_im_with_account(username, account); |
| 9709 | 331 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
332 | if (im == NULL) |
|
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
333 | im = purple_im_conversation_new(account, username); |
|
12295
b81286b6bc54
[gaim-migrate @ 14599]
Luke Schierer <lschiere@pidgin.im>
parents:
12288
diff
changeset
|
334 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
335 | pidgin_conv_attach_to_conversation(PURPLE_CONVERSATION(im)); |
|
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
336 | purple_conversation_present(PURPLE_CONVERSATION(im)); |
| 9709 | 337 | } |
| 338 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
339 | static gboolean |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
340 | pidgin_dialogs_ee(const char *ee) |
| 9709 | 341 | { |
| 342 | GtkWidget *window; | |
| 343 | GtkWidget *hbox; | |
| 344 | GtkWidget *label; | |
|
10219
f088cb31ad7e
[gaim-migrate @ 11347]
Mark Doliner <markdoliner@pidgin.im>
parents:
10193
diff
changeset
|
345 | GtkWidget *img; |
| 15884 | 346 | gchar *norm = purple_strreplace(ee, "rocksmyworld", ""); |
| 9709 | 347 | |
| 348 | label = gtk_label_new(NULL); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
349 | if (purple_strequal(norm, "zilding")) |
| 9709 | 350 | gtk_label_set_markup(GTK_LABEL(label), |
| 351 | "<span weight=\"bold\" size=\"large\" foreground=\"purple\">Amazing! Simply Amazing!</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
352 | else if (purple_strequal(norm, "robflynn")) |
| 9709 | 353 | gtk_label_set_markup(GTK_LABEL(label), |
| 354 | "<span weight=\"bold\" size=\"large\" foreground=\"#1f6bad\">Pimpin\' Penguin Style! *Waddle Waddle*</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
355 | else if (purple_strequal(norm, "flynorange")) |
| 9709 | 356 | gtk_label_set_markup(GTK_LABEL(label), |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
357 | "<span weight=\"bold\" size=\"large\" foreground=\"blue\">You should be me. I'm so cute!</span>"); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
358 | else if (purple_strequal(norm, "ewarmenhoven")) |
| 9709 | 359 | gtk_label_set_markup(GTK_LABEL(label), |
| 360 | "<span weight=\"bold\" size=\"large\" foreground=\"orange\">Now that's what I like!</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
361 | else if (purple_strequal(norm, "markster97")) |
| 9709 | 362 | gtk_label_set_markup(GTK_LABEL(label), |
| 363 | "<span weight=\"bold\" size=\"large\" foreground=\"brown\">Ahh, and excellent choice!</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
364 | else if (purple_strequal(norm, "seanegn")) |
| 9709 | 365 | gtk_label_set_markup(GTK_LABEL(label), |
| 366 | "<span weight=\"bold\" size=\"large\" foreground=\"#009900\">Everytime you click my name, an angel gets its wings.</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
367 | else if (purple_strequal(norm, "chipx86")) |
| 9709 | 368 | gtk_label_set_markup(GTK_LABEL(label), |
| 369 | "<span weight=\"bold\" size=\"large\" foreground=\"red\">This sunflower seed taste like pizza.</span>"); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
370 | else if (purple_strequal(norm, "markdoliner")) |
| 9709 | 371 | gtk_label_set_markup(GTK_LABEL(label), |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
372 | "<span weight=\"bold\" size=\"large\" foreground=\"#6364B1\">Hey! I was in that tumbleweed!</span>"); |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
373 | else if (purple_strequal(norm, "lschiere")) |
| 9709 | 374 | gtk_label_set_markup(GTK_LABEL(label), |
| 375 | "<span weight=\"bold\" size=\"large\" foreground=\"gray\">I'm not anything.</span>"); | |
| 376 | g_free(norm); | |
| 377 | ||
| 378 | if (strlen(gtk_label_get_label(GTK_LABEL(label))) <= 0) | |
| 379 | return FALSE; | |
| 380 | ||
|
39138
99c0f6e30bb1
gtkdialogs: Port from deprecated GtkStock to string literals
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
381 | window = gtk_dialog_new_with_buttons(PIDGIN_ALERT_TITLE, NULL, 0, |
|
99c0f6e30bb1
gtkdialogs: Port from deprecated GtkStock to string literals
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
382 | _("_Close"), GTK_RESPONSE_OK, NULL); |
| 9709 | 383 | gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK); |
| 384 | g_signal_connect(G_OBJECT(window), "response", G_CALLBACK(gtk_widget_destroy), NULL); | |
| 385 | ||
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
386 | gtk_container_set_border_width (GTK_CONTAINER(window), 6); |
| 9709 | 387 | gtk_window_set_resizable(GTK_WINDOW(window), FALSE); |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30880
diff
changeset
|
388 | gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(window))), |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
389 | 12); |
|
32422
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32414
diff
changeset
|
390 | gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(window))), |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
391 | 6); |
| 9709 | 392 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
393 | hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12); |
|
32394
f883709bdba4
compiles using GTK+ 3 from git, beware it does not yet run, in fact it crashes...
Marcus Lundblad <malu@pidgin.im>
parents:
30880
diff
changeset
|
394 | gtk_container_add(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(window))), hbox); |
|
39146
af0a3b8c0354
Replace remaining usage of PIDGIN_STOCK_DIALOG_* with literal icon names
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
395 | img = gtk_image_new_from_icon_name("dialog-cool", GTK_ICON_SIZE_DIALOG); |
| 9709 | 396 | gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 397 | ||
| 398 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); | |
|
38007
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
399 | gtk_label_set_xalign(GTK_LABEL(label), 0); |
|
3b971d2ecae1
Simplify gtk_label_set_[xy]align calls.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
37990
diff
changeset
|
400 | gtk_label_set_yalign(GTK_LABEL(label), 0); |
| 9709 | 401 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 402 | ||
| 403 | gtk_widget_show_all(window); | |
| 404 | return TRUE; | |
| 405 | } | |
| 406 | ||
| 407 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
408 | pidgin_dialogs_info_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 409 | { |
| 410 | char *username; | |
| 411 | gboolean found = FALSE; | |
| 15884 | 412 | PurpleAccount *account; |
| 9709 | 413 | |
| 15884 | 414 | account = purple_request_fields_get_account(fields, "account"); |
| 9709 | 415 | |
| 15884 | 416 | username = g_strdup(purple_normalize(account, |
| 417 | purple_request_fields_get_string(fields, "screenname"))); | |
| 9709 | 418 | |
|
40125
a7acc7b00d79
Replace purple_str_has_{prefix,suffix} by g_str_has_{prefix,suffix}.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40064
diff
changeset
|
419 | if (username != NULL && g_str_has_suffix(username, "rocksmyworld")) { |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
420 | found = pidgin_dialogs_ee(username); |
|
40125
a7acc7b00d79
Replace purple_str_has_{prefix,suffix} by g_str_has_{prefix,suffix}.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
40064
diff
changeset
|
421 | } |
| 9709 | 422 | |
| 423 | if (!found && username != NULL && *username != '\0' && account != NULL) | |
|
17360
4b04b2ee459a
Use utility functions to get user info. Closes #964.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17311
diff
changeset
|
424 | pidgin_retrieve_user_info(purple_account_get_connection(account), username); |
| 9709 | 425 | |
| 426 | g_free(username); | |
| 427 | } | |
| 428 | ||
| 429 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
430 | pidgin_dialogs_info(void) |
| 9709 | 431 | { |
| 15884 | 432 | PurpleRequestFields *fields; |
| 433 | PurpleRequestFieldGroup *group; | |
| 434 | PurpleRequestField *field; | |
| 9709 | 435 | |
| 15884 | 436 | fields = purple_request_fields_new(); |
| 9709 | 437 | |
| 15884 | 438 | group = purple_request_field_group_new(NULL); |
| 439 | purple_request_fields_add_group(fields, group); | |
| 9709 | 440 | |
| 15884 | 441 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 442 | purple_request_field_set_type_hint(field, "screenname"); | |
| 443 | purple_request_field_set_required(field, TRUE); | |
| 444 | purple_request_field_group_add_field(group, field); | |
| 9709 | 445 | |
| 15884 | 446 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 447 | purple_request_field_set_type_hint(field, "account"); | |
| 448 | purple_request_field_set_visible(field, | |
| 449 | (purple_connections_get_all() != NULL && | |
| 450 | purple_connections_get_all()->next != NULL)); | |
| 451 | purple_request_field_set_required(field, TRUE); | |
| 452 | purple_request_field_group_add_field(group, field); | |
| 9709 | 453 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
454 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
455 | purple_blist_get_default(), _("Get User Info"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
456 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
457 | "whose info you would like to view."), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
458 | fields, _("OK"), G_CALLBACK(pidgin_dialogs_info_cb), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
459 | _("Cancel"), NULL, NULL, NULL); |
| 9709 | 460 | } |
| 461 | ||
| 462 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
463 | pidgin_dialogs_log_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 464 | { |
| 465 | char *username; | |
| 15884 | 466 | PurpleAccount *account; |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
467 | GSList *cur; |
| 9709 | 468 | |
| 15884 | 469 | account = purple_request_fields_get_account(fields, "account"); |
| 9709 | 470 | |
| 15884 | 471 | username = g_strdup(purple_normalize(account, |
| 472 | purple_request_fields_get_string(fields, "screenname"))); | |
| 9709 | 473 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
474 | if (username != NULL && *username != '\0' && account != NULL) |
|
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
475 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
476 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
477 | GSList *buddies; |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
478 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
479 | pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
480 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
481 | buddies = purple_blist_find_buddies(account, username); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
482 | for (cur = buddies; cur != NULL; cur = cur->next) |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
483 | { |
| 15884 | 484 | PurpleBlistNode *node = cur->data; |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
485 | if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
486 | { |
| 15884 | 487 | pidgin_log_show_contact((PurpleContact *)node->parent); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
488 | g_slist_free(buddies); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
489 | pidgin_clear_cursor(gtkblist->window); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
490 | g_free(username); |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
491 | return; |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
492 | } |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
493 | } |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
494 | g_slist_free(buddies); |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
495 | |
| 15884 | 496 | pidgin_log_show(PURPLE_LOG_IM, username, account); |
| 9709 | 497 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
498 | pidgin_clear_cursor(gtkblist->window); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
499 | } |
|
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
500 | |
| 9709 | 501 | g_free(username); |
| 502 | } | |
| 503 | ||
|
9991
a02e6b4e0959
[gaim-migrate @ 10904]
Dave West <kat@users.sourceforge.net>
parents:
9976
diff
changeset
|
504 | /* |
|
a02e6b4e0959
[gaim-migrate @ 10904]
Dave West <kat@users.sourceforge.net>
parents:
9976
diff
changeset
|
505 | * TODO - This needs to deal with logs of all types, not just IM logs. |
|
a02e6b4e0959
[gaim-migrate @ 10904]
Dave West <kat@users.sourceforge.net>
parents:
9976
diff
changeset
|
506 | */ |
| 9709 | 507 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
508 | pidgin_dialogs_log(void) |
| 9709 | 509 | { |
| 15884 | 510 | PurpleRequestFields *fields; |
| 511 | PurpleRequestFieldGroup *group; | |
| 512 | PurpleRequestField *field; | |
| 9709 | 513 | |
| 15884 | 514 | fields = purple_request_fields_new(); |
| 9709 | 515 | |
| 15884 | 516 | group = purple_request_field_group_new(NULL); |
| 517 | purple_request_fields_add_group(fields, group); | |
| 9709 | 518 | |
| 15884 | 519 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 520 | purple_request_field_set_type_hint(field, "screenname-all"); | |
| 521 | purple_request_field_set_required(field, TRUE); | |
| 522 | purple_request_field_group_add_field(group, field); | |
| 9709 | 523 | |
| 15884 | 524 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
|
13824
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
525 | |
| 15884 | 526 | /* purple_request_field_account_new() only sets a default value if you're |
|
13824
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
527 | * connected, and it sets it from the list of connected accounts. Since |
|
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
528 | * we're going to set show_all here, it makes sense to use the first |
|
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
529 | * account, not the first connected account. */ |
| 15884 | 530 | if (purple_accounts_get_all() != NULL) { |
| 531 | purple_request_field_account_set_default_value(field, purple_accounts_get_all()->data); | |
| 532 | purple_request_field_account_set_value(field, purple_accounts_get_all()->data); | |
|
13824
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
533 | } |
|
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
534 | |
| 15884 | 535 | purple_request_field_set_type_hint(field, "account"); |
| 536 | purple_request_field_account_set_show_all(field, TRUE); | |
| 537 | purple_request_field_set_visible(field, | |
| 538 | (purple_accounts_get_all() != NULL && | |
| 539 | purple_accounts_get_all()->next != NULL)); | |
| 540 | purple_request_field_set_required(field, TRUE); | |
| 541 | purple_request_field_group_add_field(group, field); | |
| 9709 | 542 | |
|
39665
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
543 | purple_request_fields( |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
544 | purple_blist_get_default(), _("View User Log"), NULL, |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
545 | _("Please enter the username or alias of the person " |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
546 | "whose log you would like to view."), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
547 | fields, _("OK"), G_CALLBACK(pidgin_dialogs_log_cb), _("Cancel"), |
|
2172e3b8eeef
Rename some buddy list accessor functions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39603
diff
changeset
|
548 | NULL, NULL, NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
549 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
550 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
551 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
552 | pidgin_dialogs_alias_buddy_cb(PurpleBuddy *buddy, const char *new_alias) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
553 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
554 | purple_buddy_set_local_alias(buddy, new_alias); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35469
diff
changeset
|
555 | purple_serv_alias_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
556 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
557 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
558 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
559 | pidgin_dialogs_alias_buddy(PurpleBuddy *buddy) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
560 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
561 | gchar *secondary; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
562 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
563 | g_return_if_fail(buddy != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
564 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
565 | secondary = g_strdup_printf(_("Enter an alias for %s."), purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
566 | |
| 15884 | 567 | purple_request_input(NULL, _("Alias Buddy"), NULL, |
|
34717
b3e588adef5a
Global replace purple_buddy_get_local_buddy_alias() with purple_buddy_get_local_alias()
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
568 | secondary, purple_buddy_get_local_alias(buddy), FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
569 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_buddy_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
570 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
571 | purple_request_cpar_from_account(purple_buddy_get_account(buddy)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
572 | buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
573 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
574 | g_free(secondary); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
575 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
576 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
577 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
578 | pidgin_dialogs_alias_chat_cb(PurpleChat *chat, const char *new_alias) |
| 9709 | 579 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
580 | purple_chat_set_alias(chat, new_alias); |
| 9709 | 581 | } |
| 582 | ||
| 583 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
584 | pidgin_dialogs_alias_chat(PurpleChat *chat) |
| 9709 | 585 | { |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
586 | gchar *alias; |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
587 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
588 | g_return_if_fail(chat != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
589 | |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
590 | g_object_get(chat, "alias", &alias, NULL); |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
591 | |
| 15884 | 592 | purple_request_input(NULL, _("Alias Chat"), NULL, |
| 9709 | 593 | _("Enter an alias for this chat."), |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
594 | alias, FALSE, FALSE, NULL, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
595 | _("Alias"), G_CALLBACK(pidgin_dialogs_alias_chat_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
596 | _("Cancel"), NULL, |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34301
diff
changeset
|
597 | purple_request_cpar_from_account(purple_chat_get_account(chat)), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
598 | chat); |
|
34923
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
599 | |
|
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
600 | g_free(alias); |
| 9709 | 601 | } |
| 602 | ||
| 603 | static void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
604 | pidgin_dialogs_remove_contact_cb(PurpleContact *contact) |
| 9709 | 605 | { |
| 15884 | 606 | PurpleBlistNode *bnode, *cnode; |
| 607 | PurpleGroup *group; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
608 | |
| 15884 | 609 | cnode = (PurpleBlistNode *)contact; |
| 610 | group = (PurpleGroup*)cnode->parent; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
611 | for (bnode = cnode->child; bnode; bnode = bnode->next) { |
| 15884 | 612 | PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
613 | if (purple_account_is_connected(purple_buddy_get_account(buddy))) |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
614 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
615 | } |
| 15884 | 616 | purple_blist_remove_contact(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
617 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
618 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
619 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
620 | pidgin_dialogs_remove_contact(PurpleContact *contact) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
621 | { |
| 15884 | 622 | PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
623 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
624 | g_return_if_fail(contact != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
625 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
626 | |
|
24976
029a4828431c
Another one the cast fixer breaks.
Richard Laager <rlaager@pidgin.im>
parents:
24569
diff
changeset
|
627 | if (PURPLE_BLIST_NODE(contact)->child == PURPLE_BLIST_NODE(buddy) && |
|
24977
b46bff38cd90
Make my last commit compile.
Richard Laager <rlaager@pidgin.im>
parents:
24976
diff
changeset
|
628 | PURPLE_BLIST_NODE(buddy)->next == NULL) { |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
629 | pidgin_dialogs_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
630 | } else { |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
631 | gchar *text; |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
632 | int contact_size = purple_counting_node_get_total_size(PURPLE_COUNTING_NODE(contact)); |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
633 | text = g_strdup_printf( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
634 | ngettext( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
635 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
636 | "and %d other buddy from your buddy list. Do you " |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
637 | "want to continue?", |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
638 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
639 | "and %d other buddies from your buddy list. Do you " |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
640 | "want to continue?", contact_size - 1), |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
641 | purple_buddy_get_name(buddy), contact_size - 1); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
642 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
643 | purple_request_action(contact, NULL, _("Remove Contact"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
644 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
645 | contact, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
646 | _("_Remove Contact"), G_CALLBACK(pidgin_dialogs_remove_contact_cb), |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
647 | _("Cancel"), |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
648 | NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
649 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
650 | g_free(text); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
651 | } |
| 9709 | 652 | } |
| 653 | ||
| 15882 | 654 | static void free_ggmo(struct _PidginGroupMergeObject *ggp) |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
655 | { |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
656 | g_free(ggp->new_name); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
657 | g_free(ggp); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
658 | } |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
659 | |
|
14527
134a695b4fa0
[gaim-migrate @ 17179]
Mark Doliner <markdoliner@pidgin.im>
parents:
14526
diff
changeset
|
660 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
661 | pidgin_dialogs_merge_groups_cb(struct _PidginGroupMergeObject *GGP) |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
662 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
663 | purple_group_set_name(GGP->parent, GGP->new_name); |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
664 | free_ggmo(GGP); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
665 | } |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
666 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
667 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
668 | pidgin_dialogs_merge_groups(PurpleGroup *source, const char *new_name) |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
669 | { |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
670 | gchar *text; |
| 15882 | 671 | struct _PidginGroupMergeObject *ggp; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
672 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
673 | g_return_if_fail(source != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
674 | g_return_if_fail(new_name != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
675 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
676 | text = g_strdup_printf( |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
677 | _("You are about to merge the group called %s into the group " |
|
32712
b0fbaebd28a2
Use the purple_group_get_name() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32709
diff
changeset
|
678 | "called %s. Do you want to continue?"), purple_group_get_name(source), new_name); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
679 | |
| 15882 | 680 | ggp = g_new(struct _PidginGroupMergeObject, 1); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
681 | ggp->parent = source; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
682 | ggp->new_name = g_strdup(new_name); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
683 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
684 | purple_request_action(source, NULL, _("Merge Groups"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
685 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
686 | ggp, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
687 | _("_Merge Groups"), G_CALLBACK(pidgin_dialogs_merge_groups_cb), |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
688 | _("Cancel"), G_CALLBACK(free_ggmo)); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
689 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
690 | g_free(text); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
691 | } |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
692 | |
|
12406
89863d2d9b8d
[gaim-migrate @ 14713]
Richard Laager <rlaager@pidgin.im>
parents:
12374
diff
changeset
|
693 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
694 | pidgin_dialogs_remove_group_cb(PurpleGroup *group) |
| 9709 | 695 | { |
| 15884 | 696 | PurpleBlistNode *cnode, *bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
697 | |
| 15884 | 698 | cnode = ((PurpleBlistNode*)group)->child; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
699 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
700 | while (cnode) { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
701 | if (PURPLE_IS_CONTACT(cnode)) { |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
702 | bnode = cnode->child; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
703 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
704 | while (bnode) { |
| 15884 | 705 | PurpleBuddy *buddy; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
706 | if (PURPLE_IS_BUDDY(bnode)) { |
| 15884 | 707 | buddy = (PurpleBuddy*)bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
708 | bnode = bnode->next; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
709 | if (purple_account_is_connected(purple_buddy_get_account(buddy))) { |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
710 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); |
| 15884 | 711 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
712 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
713 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
714 | bnode = bnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
715 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
716 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
717 | } else if (PURPLE_IS_CHAT(cnode)) { |
| 15884 | 718 | PurpleChat *chat = (PurpleChat *)cnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
719 | cnode = cnode->next; |
|
32713
e5581dd86f9d
Use the PurpleChat accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32712
diff
changeset
|
720 | if (purple_account_is_connected(purple_chat_get_account(chat))) |
| 15884 | 721 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
722 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
723 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
724 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
725 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
726 | |
| 15884 | 727 | purple_blist_remove_group(group); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
728 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
729 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
730 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
731 | pidgin_dialogs_remove_group(PurpleGroup *group) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
732 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
733 | gchar *text; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
734 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
735 | g_return_if_fail(group != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
736 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
737 | text = g_strdup_printf(_("You are about to remove the group %s and all its members from your buddy list. Do you want to continue?"), |
|
32712
b0fbaebd28a2
Use the purple_group_get_name() accessor function.
Andrew Victor <andrew.victor@mxit.com>
parents:
32709
diff
changeset
|
738 | purple_group_get_name(group)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
739 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
740 | purple_request_action(group, NULL, _("Remove Group"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
741 | NULL, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
742 | group, 2, |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
743 | _("_Remove Group"), G_CALLBACK(pidgin_dialogs_remove_group_cb), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
744 | _("Cancel"), NULL); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
745 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
746 | g_free(text); |
| 9709 | 747 | } |
| 748 | ||
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10222
diff
changeset
|
749 | /* XXX - Some of this should be moved into the core, methinks. */ |
| 9709 | 750 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
751 | pidgin_dialogs_remove_buddy_cb(PurpleBuddy *buddy) |
| 9709 | 752 | { |
| 15884 | 753 | PurpleGroup *group; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
754 | gchar *name; |
| 15884 | 755 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
756 | |
| 15884 | 757 | group = purple_buddy_get_group(buddy); |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
758 | name = g_strdup(purple_buddy_get_name(buddy)); /* purple_buddy_get_name() is a crasher after remove_buddy */ |
|
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
759 | account = purple_buddy_get_account(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
760 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
761 | purple_debug_info("blist", "Removing '%s' from buddy list.\n", purple_buddy_get_name(buddy)); |
| 15884 | 762 | /* TODO - Should remove from blist first... then call purple_account_remove_buddy()? */ |
|
30706
612b36b49058
Kill off many dead assignments and any useless remaining variables.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
30557
diff
changeset
|
763 | purple_account_remove_buddy(account, buddy, group); |
| 15884 | 764 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
765 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
766 | g_free(name); |
| 9709 | 767 | } |
| 768 | ||
| 769 | void | |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
770 | pidgin_dialogs_remove_buddy(PurpleBuddy *buddy) |
| 9709 | 771 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
772 | gchar *text; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
773 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
774 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
775 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
776 | text = g_strdup_printf(_("You are about to remove %s from your buddy list. Do you want to continue?"), |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
777 | purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
778 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
779 | purple_request_action(buddy, NULL, _("Remove Buddy"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
780 | purple_request_cpar_from_account( |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
781 | purple_buddy_get_account(buddy)), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
782 | buddy, 2, _("_Remove Buddy"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
783 | G_CALLBACK(pidgin_dialogs_remove_buddy_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
784 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
785 | g_free(text); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
786 | } |
| 9709 | 787 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
788 | static void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
789 | pidgin_dialogs_remove_chat_cb(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
790 | { |
| 15884 | 791 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
792 | } |
| 9709 | 793 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
794 | void |
|
16263
27e0ef0f38e6
Word on the street is that we don't want things named pidginfoo_bar(), but
Richard Laager <rlaager@pidgin.im>
parents:
16254
diff
changeset
|
795 | pidgin_dialogs_remove_chat(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
796 | { |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
797 | const gchar *name; |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
798 | gchar *text; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
799 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
800 | g_return_if_fail(chat != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
801 | |
| 15884 | 802 | name = purple_chat_get_name(chat); |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
803 | text = g_strdup_printf(_("You are about to remove the chat %s from your buddy list. Do you want to continue?"), |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
804 | name ? name : ""); |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
805 | |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16471
diff
changeset
|
806 | purple_request_action(chat, NULL, _("Remove Chat"), text, 0, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
807 | purple_request_cpar_from_account(purple_chat_get_account(chat)), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
808 | chat, 2, _("_Remove Chat"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
809 | G_CALLBACK(pidgin_dialogs_remove_chat_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
810 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
811 | g_free(text); |
| 9709 | 812 | } |