Wed, 13 Jun 2018 03:16:37 +0000
Merged in CMaiku/pidgin (pull request #373)
Port PIDGIN_STOCK_DIALOG_* to GtkIconTheme
Approved-by: Gary Kramlich <grim@reaperworld.com>
Approved-by: Eion Robb <eionrobb@gmail.com>
Approved-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
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 | #define _PIDGIN_GTKDIALOGS_C_ |
|
5dbd0617a27d
Build everything with the *_DISABLE_DEPRECATED flags set. This allows us
Richard Laager <rlaager@pidgin.im>
parents:
24541
diff
changeset
|
22 | |
| 9791 | 23 | #include "internal.h" |
| 15577 | 24 | #include "pidgin.h" |
|
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
|
25 | #include "package_revision.h" |
|
38538
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
26 | #ifdef HAVE_MESON_CONFIG |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
27 | #include "meson-config.h" |
|
b542a6787116
Add meson arguments to About dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38429
diff
changeset
|
28 | #endif |
| 9709 | 29 | |
| 30 | #include "debug.h" | |
| 31 | #include "notify.h" | |
|
36367
891eea799578
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents:
36361
diff
changeset
|
32 | #include "plugins.h" |
|
36543
a8c3fecee2d3
Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents:
36516
diff
changeset
|
33 | #include "protocol.h" |
| 9709 | 34 | #include "request.h" |
| 35 | #include "util.h" | |
|
25702
41a5336bc2d6
applied changes from 20269e8849976ad6a0996f79ccbc0a12a311484f
Ethan Blanton <elb@pidgin.im>
parents:
25685
diff
changeset
|
36 | #include "core.h" |
| 9709 | 37 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
38 | #include "gtkblist.h" |
| 9709 | 39 | #include "gtkdialogs.h" |
| 40 | #include "gtklog.h" | |
| 41 | #include "gtkutils.h" | |
|
32439
2c681e5daeeb
Webkit Message views.
Arnold Noronha <tdrhq@soc.pidgin.im>
parents:
27941
diff
changeset
|
42 | #include "gtkwebview.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
|
43 | #include "pidginstock.h" |
| 9709 | 44 | |
|
33836
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
45 | #ifdef USE_GSTREAMER |
|
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
46 | #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
|
47 | #endif |
|
9555c8a2cd8b
Show GTK and GStreamer version in Build Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33599
diff
changeset
|
48 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
49 | #include "gtk3compat.h" |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
50 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
51 | static GList *dialogwindows = NULL; |
| 9709 | 52 | |
| 15882 | 53 | struct _PidginGroupMergeObject { |
| 15884 | 54 | PurpleGroup* parent; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
55 | char *new_name; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
56 | }; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
57 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
58 | 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
|
59 | pidgin_dialogs_destroy_all() |
| 9709 | 60 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
61 | while (dialogwindows) { |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
62 | gtk_widget_destroy(dialogwindows->data); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
63 | dialogwindows = g_list_remove(dialogwindows, dialogwindows->data); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
64 | } |
|
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 | |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
67 | static void destroy_win(GtkWidget *button, GtkWidget *win) |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
68 | { |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
69 | gtk_widget_destroy(win); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
70 | } |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
71 | |
|
20109
47e44a7b0fb9
applied changes from 6e915e14a78ccafa5e0ddfdcabccc2e174c734e3
Richard Laager <rlaager@pidgin.im>
parents:
20039
diff
changeset
|
72 | #if 0 |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
73 | /* 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
|
74 | * screen in Pidgin. */ |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
75 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
76 | pidgin_logo_versionize(GdkPixbuf **original, GtkWidget *widget) { |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
77 | GdkPixmap *pixmap; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
78 | GtkStyle *style; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
79 | PangoContext *context; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
80 | PangoLayout *layout; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
81 | gchar *markup; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
82 | gint width, height; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
83 | gint lwidth = 0, lheight = 0; |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
84 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
85 | style = gtk_widget_get_style(widget); |
|
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 | gdk_pixbuf_render_pixmap_and_mask(*original, &pixmap, NULL, 255); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
88 | width = gdk_pixbuf_get_width(*original); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
89 | height = gdk_pixbuf_get_height(*original); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
90 | g_object_unref(G_OBJECT(*original)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
91 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
92 | context = gtk_widget_get_pango_context(widget); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
93 | layout = pango_layout_new(context); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
94 | |
|
21106
b85fbef13eed
Add a --with-extraversion option to ./configure so packagers can fine tune
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
21091
diff
changeset
|
95 | 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
|
96 | pango_layout_set_font_description(layout, style->font_desc); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
97 | pango_layout_set_markup(layout, markup, strlen(markup)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
98 | g_free(markup); |
|
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 | pango_layout_get_pixel_size(layout, &lwidth, &lheight); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
101 | 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
|
102 | width - (lwidth + 3), 1, layout); |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
103 | g_object_unref(G_OBJECT(layout)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
104 | |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
105 | *original = gdk_pixbuf_get_from_drawable(NULL, pixmap, NULL, |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
106 | 0, 0, 0, 0, |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
107 | width, height); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
108 | g_object_unref(G_OBJECT(pixmap)); |
|
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
109 | } |
|
20109
47e44a7b0fb9
applied changes from 6e915e14a78ccafa5e0ddfdcabccc2e174c734e3
Richard Laager <rlaager@pidgin.im>
parents:
20039
diff
changeset
|
110 | #endif |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
111 | |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
112 | /* Note: Frees 'string' */ |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
113 | static GtkWidget * |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
114 | 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
|
115 | { |
|
32522
8dea964d2d5b
Use pidgin_create_webview to make the Help dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32507
diff
changeset
|
116 | GtkWidget *win, *vbox, *frame, *logo, *webview, *button; |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
117 | GdkPixbuf *pixbuf; |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
118 | AtkObject *obj; |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
119 | char *filename, *tmp; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
120 | |
|
33141
2001ba1d6827
Remove extra padding that makes things look not-so-good.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33138
diff
changeset
|
121 | 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
|
122 | 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
|
123 | gtk_window_set_default_size(GTK_WINDOW(win), 475, 450); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
124 | |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
125 | /* 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
|
126 | 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
|
127 | "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
|
128 | pixbuf = pidgin_pixbuf_new_from_file(filename); |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
129 | g_free(filename); |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
130 | |
|
20039
9fc4dcfbeeec
whoops! do if 0, not ifdef 0
Sean Egan <seanegan@pidgin.im>
parents:
20035
diff
changeset
|
131 | #if 0 /* Don't versionize the logo when the logo has the version in it */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
132 | pidgin_logo_versionize(&pixbuf, logo); |
| 20035 | 133 | #endif |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
134 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
135 | /* Insert the logo */ |
|
14252
d10dda2777a9
[gaim-migrate @ 16854]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14123
diff
changeset
|
136 | 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
|
137 | 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
|
138 | g_object_unref(G_OBJECT(pixbuf)); |
|
10266
073aeb0c9117
[gaim-migrate @ 11412]
Mark Doliner <markdoliner@pidgin.im>
parents:
10246
diff
changeset
|
139 | 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
|
140 | 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
|
141 | 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
|
142 | g_free(tmp); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
143 | gtk_box_pack_start(GTK_BOX(vbox), logo, FALSE, FALSE, 0); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
144 | |
|
34274
9169710b5af5
Hide GtkWebViewToolbar stuff within the GtkWebView.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33955
diff
changeset
|
145 | frame = pidgin_create_webview(FALSE, &webview, NULL); |
|
35500
ae6432ea326f
Fixed namespace issues in Pidgin.
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
146 | pidgin_webview_set_format_functions(PIDGIN_WEBVIEW(webview), PIDGIN_WEBVIEW_ALL ^ PIDGIN_WEBVIEW_SMILEY); |
|
10175
2bf5ed145e8a
[gaim-migrate @ 11290]
Mark Doliner <markdoliner@pidgin.im>
parents:
10167
diff
changeset
|
147 | gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0); |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
148 | |
|
35500
ae6432ea326f
Fixed namespace issues in Pidgin.
Ankit Vani <a@nevitus.org>
parents:
35499
diff
changeset
|
149 | pidgin_webview_append_html(PIDGIN_WEBVIEW(webview), string->str); |
|
29530
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
150 | |
|
39138
99c0f6e30bb1
gtkdialogs: Port from deprecated GtkStock to string literals
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
151 | 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
|
152 | G_CALLBACK(destroy_win), win); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
153 | |
|
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
|
154 | 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
|
155 | gtk_widget_grab_default(button); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
156 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
157 | gtk_widget_show_all(win); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
158 | 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
|
159 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
160 | g_string_free(string, TRUE); |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
161 | |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
162 | return win; |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
163 | } |
|
252b84468a95
Reduce some code duplications (71 insertions(+), 217 deletions(-))
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
29529
diff
changeset
|
164 | |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
165 | 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
|
166 | { |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
167 | GString *str; |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
168 | 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
|
169 | PurplePlugin *plugin = NULL; |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
170 | PurplePluginInfo *info; |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
171 | 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
|
172 | 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
|
173 | 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
|
174 | const char *pver, *plicense, *pwebsite, *pid; |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
175 | gboolean ploaded, ploadable; |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
176 | const char * const *authorlist; |
| 36978 | 177 | 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
|
178 | 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
|
179 | |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
180 | 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
|
181 | |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
182 | 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
|
183 | |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
184 | 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
|
185 | |
|
36413
8cf6f1734398
Refactored gtkdialogs to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
186 | 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
|
187 | plugin = PURPLE_PLUGIN(l->data); |
|
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
188 | info = purple_plugin_get_info(plugin); |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
189 | 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
|
190 | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
191 | pname = g_markup_escape_text(purple_plugin_info_get_name(info), -1); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
192 | authorlist = purple_plugin_info_get_authors(info); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
193 | |
| 36978 | 194 | if (authorlist) { |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
195 | authors = g_strjoinv(", ", (gchar **)authorlist); |
| 36978 | 196 | n_authors = g_strv_length((gchar **)authorlist); |
| 197 | } else { | |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
198 | authors = NULL; |
| 36978 | 199 | n_authors = 0; |
| 200 | } | |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
201 | |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
202 | if (authors) |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
203 | pauthors = g_markup_escape_text(authors, -1); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
204 | else |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
205 | pauthors = NULL; |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
206 | |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
207 | pver = purple_plugin_info_get_version(info); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
208 | plicense = purple_plugin_info_get_license_id(info); |
|
36431
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
209 | pwebsite = purple_plugin_info_get_website(info); |
|
ea007725fd4d
Refactored the codebase to use the plugin wrapper functions
Ankit Vani <a@nevitus.org>
parents:
36430
diff
changeset
|
210 | pid = purple_plugin_info_get_id(info); |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
211 | 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
|
212 | 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
|
213 | |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
214 | if (ploaded && extra_cb) |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
215 | pextra = extra_cb(plugin); |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
216 | else |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
217 | pextra = NULL; |
|
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
218 | |
| 35910 | 219 | g_string_append_printf(str, "<dt>%s</dt><dd>", pname); |
| 37140 | 220 | if (pauthors) |
| 221 | g_string_append_printf(str, "<b>%s:</b> %s<br/>", | |
| 222 | (n_authors > 1 ? "Authors" : "Author"), pauthors ? pauthors : ""); | |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
223 | 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
|
224 | "<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
|
225 | "<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
|
226 | "<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
|
227 | "<b>ID String:</b> %s<br/>" |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
228 | "<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
|
229 | "<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
|
230 | "<b>Loaded:</b> %s" |
|
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
231 | "</dd><br/>", |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
232 | pver ? pver : "", |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
233 | plicense ? plicense : "", |
|
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
234 | pwebsite ? pwebsite : "", |
|
36512
35b1e42281e5
Removed loadable field from plugin info dialog, and added license
Ankit Vani <a@nevitus.org>
parents:
36459
diff
changeset
|
235 | pid, |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
236 | pextra ? pextra : "", |
|
36516
cbf16b28176c
Refactored pidgin according to the changes
Ankit Vani <a@nevitus.org>
parents:
36512
diff
changeset
|
237 | 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
|
238 | 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
|
239 | |
|
2c5150da76c1
Fix a leak in the Plugin Information window. These variables are
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32866
diff
changeset
|
240 | g_free(pname); |
|
36976
46c2822b7c58
Added the "extra-cb" property for plugins.
Ankit Vani <a@nevitus.org>
parents:
36974
diff
changeset
|
241 | g_free(pextra); |
|
36644
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
242 | g_free(pauthors); |
|
e06a238d2864
Refactored pidgin to show multiple authors
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
243 | 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
|
244 | } |
|
36430
559d5d9d8a6c
Refactored the codebase to remove purple_plugins_free_found_list()
Ankit Vani <a@nevitus.org>
parents:
36413
diff
changeset
|
245 | 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
|
246 | |
|
32879
1f9009c3f0f4
Update the HTML in the Plugin Information dialog.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32878
diff
changeset
|
247 | g_string_append(str, "</dl>"); |
|
31945
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
248 | |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
249 | 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
|
250 | 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
|
251 | 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
|
252 | 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
|
253 | } |
|
f1d8ab1029c4
Add a plugin information dialog that shows information for all plugins, even
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
31889
diff
changeset
|
254 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
255 | 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
|
256 | pidgin_dialogs_im_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 257 | { |
| 15884 | 258 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
259 | const char *username; |
| 9709 | 260 | |
| 15884 | 261 | account = purple_request_fields_get_account(fields, "account"); |
| 262 | username = purple_request_fields_get_string(fields, "screenname"); | |
| 9709 | 263 | |
|
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
|
264 | pidgin_dialogs_im_with_user(account, username); |
| 9709 | 265 | } |
| 266 | ||
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
267 | static gboolean |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
268 | 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
|
269 | void *_fields) |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
270 | { |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
271 | PurpleRequestFields *fields = _fields; |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
272 | PurpleAccount *account; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
273 | PurpleProtocol *protocol; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
274 | const char *username; |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
275 | gboolean valid; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
276 | |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
277 | 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
|
278 | 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
|
279 | 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
|
280 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
281 | valid = purple_validate(protocol, username); |
|
33219
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
282 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
283 | if (errmsg && !valid) |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
284 | *errmsg = g_strdup(_("Invalid username")); |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
285 | |
|
06b19630bdb0
Validation for Request API fixes
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33213
diff
changeset
|
286 | return valid; |
|
33213
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
287 | } |
|
2852fbde4722
Validation for Request API; use it in 'new IM' dialog.
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
288 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
289 | 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
|
290 | pidgin_dialogs_im(void) |
| 9709 | 291 | { |
| 15884 | 292 | PurpleRequestFields *fields; |
| 293 | PurpleRequestFieldGroup *group; | |
| 294 | PurpleRequestField *field; | |
| 9709 | 295 | |
| 15884 | 296 | fields = purple_request_fields_new(); |
| 9709 | 297 | |
| 15884 | 298 | group = purple_request_field_group_new(NULL); |
| 299 | purple_request_fields_add_group(fields, group); | |
| 9709 | 300 | |
| 15884 | 301 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 302 | purple_request_field_set_type_hint(field, "screenname"); | |
| 303 | 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
|
304 | purple_request_field_set_validator(field, pidgin_dialogs_im_name_validator, fields); |
| 15884 | 305 | purple_request_field_group_add_field(group, field); |
| 9709 | 306 | |
| 15884 | 307 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 308 | purple_request_field_set_type_hint(field, "account"); | |
| 309 | purple_request_field_set_visible(field, | |
| 310 | (purple_connections_get_all() != NULL && | |
| 311 | purple_connections_get_all()->next != NULL)); | |
| 312 | purple_request_field_set_required(field, TRUE); | |
| 313 | purple_request_field_group_add_field(group, field); | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
314 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
315 | purple_request_fields(purple_blist_get_buddy_list(), _("New Instant Message"), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
316 | NULL, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22722
diff
changeset
|
317 | _("Please enter the username or alias of the person " |
| 10668 | 318 | "you would like to IM."), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
319 | fields, |
|
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
|
320 | _("OK"), G_CALLBACK(pidgin_dialogs_im_cb), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
321 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
322 | NULL, NULL); |
| 9709 | 323 | } |
| 324 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
325 | 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
|
326 | pidgin_dialogs_im_with_user(PurpleAccount *account, const char *username) |
| 9709 | 327 | { |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
328 | PurpleIMConversation *im; |
| 9709 | 329 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
330 | g_return_if_fail(account != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
331 | g_return_if_fail(username != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
332 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
333 | im = purple_conversations_find_im_with_account(username, account); |
| 9709 | 334 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
335 | if (im == NULL) |
|
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
336 | im = purple_im_conversation_new(account, username); |
|
12295
b81286b6bc54
[gaim-migrate @ 14599]
Luke Schierer <lschiere@pidgin.im>
parents:
12288
diff
changeset
|
337 | |
|
34662
f14347f38e3b
Refactor the remaining pidgin to use the GObject conversation API
Ankit Vani <a@nevitus.org>
parents:
34627
diff
changeset
|
338 | 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
|
339 | purple_conversation_present(PURPLE_CONVERSATION(im)); |
| 9709 | 340 | } |
| 341 | ||
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
342 | 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
|
343 | pidgin_dialogs_ee(const char *ee) |
| 9709 | 344 | { |
| 345 | GtkWidget *window; | |
| 346 | GtkWidget *hbox; | |
| 347 | GtkWidget *label; | |
|
10219
f088cb31ad7e
[gaim-migrate @ 11347]
Mark Doliner <markdoliner@pidgin.im>
parents:
10193
diff
changeset
|
348 | GtkWidget *img; |
| 15884 | 349 | gchar *norm = purple_strreplace(ee, "rocksmyworld", ""); |
| 9709 | 350 | |
| 351 | label = gtk_label_new(NULL); | |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
37872
diff
changeset
|
352 | if (purple_strequal(norm, "zilding")) |
| 9709 | 353 | gtk_label_set_markup(GTK_LABEL(label), |
| 354 | "<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
|
355 | else if (purple_strequal(norm, "robflynn")) |
| 9709 | 356 | gtk_label_set_markup(GTK_LABEL(label), |
| 357 | "<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
|
358 | else if (purple_strequal(norm, "flynorange")) |
| 9709 | 359 | gtk_label_set_markup(GTK_LABEL(label), |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
360 | "<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
|
361 | else if (purple_strequal(norm, "ewarmenhoven")) |
| 9709 | 362 | gtk_label_set_markup(GTK_LABEL(label), |
| 363 | "<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
|
364 | else if (purple_strequal(norm, "markster97")) |
| 9709 | 365 | gtk_label_set_markup(GTK_LABEL(label), |
| 366 | "<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
|
367 | else if (purple_strequal(norm, "seanegn")) |
| 9709 | 368 | gtk_label_set_markup(GTK_LABEL(label), |
| 369 | "<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
|
370 | else if (purple_strequal(norm, "chipx86")) |
| 9709 | 371 | gtk_label_set_markup(GTK_LABEL(label), |
| 372 | "<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
|
373 | else if (purple_strequal(norm, "markdoliner")) |
| 9709 | 374 | gtk_label_set_markup(GTK_LABEL(label), |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
375 | "<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
|
376 | else if (purple_strequal(norm, "lschiere")) |
| 9709 | 377 | gtk_label_set_markup(GTK_LABEL(label), |
| 378 | "<span weight=\"bold\" size=\"large\" foreground=\"gray\">I'm not anything.</span>"); | |
| 379 | g_free(norm); | |
| 380 | ||
| 381 | if (strlen(gtk_label_get_label(GTK_LABEL(label))) <= 0) | |
| 382 | return FALSE; | |
| 383 | ||
|
39138
99c0f6e30bb1
gtkdialogs: Port from deprecated GtkStock to string literals
Mike Ruprecht <cmaiku@gmail.com>
parents:
38668
diff
changeset
|
384 | 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
|
385 | _("_Close"), GTK_RESPONSE_OK, NULL); |
| 9709 | 386 | gtk_dialog_set_default_response (GTK_DIALOG(window), GTK_RESPONSE_OK); |
| 387 | g_signal_connect(G_OBJECT(window), "response", G_CALLBACK(gtk_widget_destroy), NULL); | |
| 388 | ||
| 15882 | 389 | gtk_container_set_border_width (GTK_CONTAINER(window), PIDGIN_HIG_BOX_SPACE); |
| 9709 | 390 | 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
|
391 | gtk_box_set_spacing(GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(window))), |
|
32422
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32414
diff
changeset
|
392 | PIDGIN_HIG_BORDER); |
|
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32414
diff
changeset
|
393 | gtk_container_set_border_width(GTK_CONTAINER(gtk_dialog_get_content_area(GTK_DIALOG(window))), |
|
c215bc5d85e4
Whitespace fixes. Try and check your editor settings before writing
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32414
diff
changeset
|
394 | PIDGIN_HIG_BOX_SPACE); |
| 9709 | 395 | |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35500
diff
changeset
|
396 | hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, PIDGIN_HIG_BORDER); |
|
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
|
397 | 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
|
398 | img = gtk_image_new_from_icon_name("dialog-cool", GTK_ICON_SIZE_DIALOG); |
| 9709 | 399 | gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0); |
| 400 | ||
| 401 | 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
|
402 | 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
|
403 | gtk_label_set_yalign(GTK_LABEL(label), 0); |
| 9709 | 404 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
| 405 | ||
| 406 | gtk_widget_show_all(window); | |
| 407 | return TRUE; | |
| 408 | } | |
| 409 | ||
| 410 | 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
|
411 | pidgin_dialogs_info_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 412 | { |
| 413 | char *username; | |
| 414 | gboolean found = FALSE; | |
| 15884 | 415 | PurpleAccount *account; |
| 9709 | 416 | |
| 15884 | 417 | account = purple_request_fields_get_account(fields, "account"); |
| 9709 | 418 | |
| 15884 | 419 | username = g_strdup(purple_normalize(account, |
| 420 | purple_request_fields_get_string(fields, "screenname"))); | |
| 9709 | 421 | |
| 15884 | 422 | if (username != NULL && purple_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
|
423 | found = pidgin_dialogs_ee(username); |
| 9709 | 424 | |
| 425 | 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
|
426 | pidgin_retrieve_user_info(purple_account_get_connection(account), username); |
| 9709 | 427 | |
| 428 | g_free(username); | |
| 429 | } | |
| 430 | ||
| 431 | 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
|
432 | pidgin_dialogs_info(void) |
| 9709 | 433 | { |
| 15884 | 434 | PurpleRequestFields *fields; |
| 435 | PurpleRequestFieldGroup *group; | |
| 436 | PurpleRequestField *field; | |
| 9709 | 437 | |
| 15884 | 438 | fields = purple_request_fields_new(); |
| 9709 | 439 | |
| 15884 | 440 | group = purple_request_field_group_new(NULL); |
| 441 | purple_request_fields_add_group(fields, group); | |
| 9709 | 442 | |
| 15884 | 443 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 444 | purple_request_field_set_type_hint(field, "screenname"); | |
| 445 | purple_request_field_set_required(field, TRUE); | |
| 446 | purple_request_field_group_add_field(group, field); | |
| 9709 | 447 | |
| 15884 | 448 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
| 449 | purple_request_field_set_type_hint(field, "account"); | |
| 450 | purple_request_field_set_visible(field, | |
| 451 | (purple_connections_get_all() != NULL && | |
| 452 | purple_connections_get_all()->next != NULL)); | |
| 453 | purple_request_field_set_required(field, TRUE); | |
| 454 | purple_request_field_group_add_field(group, field); | |
| 9709 | 455 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
456 | purple_request_fields(purple_blist_get_buddy_list(), _("Get User Info"), |
| 9709 | 457 | NULL, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22722
diff
changeset
|
458 | _("Please enter the username or alias of the person " |
| 10668 | 459 | "whose info you would like to view."), |
| 9709 | 460 | fields, |
|
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
|
461 | _("OK"), G_CALLBACK(pidgin_dialogs_info_cb), |
| 9709 | 462 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
463 | NULL, NULL); |
| 9709 | 464 | } |
| 465 | ||
| 466 | 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
|
467 | pidgin_dialogs_log_cb(gpointer data, PurpleRequestFields *fields) |
| 9709 | 468 | { |
| 469 | char *username; | |
| 15884 | 470 | PurpleAccount *account; |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
471 | GSList *cur; |
| 9709 | 472 | |
| 15884 | 473 | account = purple_request_fields_get_account(fields, "account"); |
| 9709 | 474 | |
| 15884 | 475 | username = g_strdup(purple_normalize(account, |
| 476 | purple_request_fields_get_string(fields, "screenname"))); | |
| 9709 | 477 | |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
478 | if (username != NULL && *username != '\0' && account != NULL) |
|
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
479 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
480 | PidginBuddyList *gtkblist = pidgin_blist_get_default_gtk_blist(); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
481 | GSList *buddies; |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
482 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
483 | pidgin_set_cursor(gtkblist->window, GDK_WATCH); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
484 | |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
485 | buddies = purple_blist_find_buddies(account, username); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
486 | for (cur = buddies; cur != NULL; cur = cur->next) |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
487 | { |
| 15884 | 488 | PurpleBlistNode *node = cur->data; |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
489 | if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL))) |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
490 | { |
| 15884 | 491 | pidgin_log_show_contact((PurpleContact *)node->parent); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
492 | g_slist_free(buddies); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
493 | pidgin_clear_cursor(gtkblist->window); |
|
14403
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
494 | g_free(username); |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
495 | return; |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
496 | } |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
497 | } |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
498 | g_slist_free(buddies); |
|
7e57df59c1bd
[gaim-migrate @ 17038]
Richard Laager <rlaager@pidgin.im>
parents:
14402
diff
changeset
|
499 | |
| 15884 | 500 | pidgin_log_show(PURPLE_LOG_IM, username, account); |
| 9709 | 501 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15498
diff
changeset
|
502 | pidgin_clear_cursor(gtkblist->window); |
|
12232
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
503 | } |
|
857f087ec86b
[gaim-migrate @ 14534]
Richard Laager <rlaager@pidgin.im>
parents:
12122
diff
changeset
|
504 | |
| 9709 | 505 | g_free(username); |
| 506 | } | |
| 507 | ||
|
9991
a02e6b4e0959
[gaim-migrate @ 10904]
Dave West <kat@users.sourceforge.net>
parents:
9976
diff
changeset
|
508 | /* |
|
a02e6b4e0959
[gaim-migrate @ 10904]
Dave West <kat@users.sourceforge.net>
parents:
9976
diff
changeset
|
509 | * 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
|
510 | */ |
| 9709 | 511 | 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
|
512 | pidgin_dialogs_log(void) |
| 9709 | 513 | { |
| 15884 | 514 | PurpleRequestFields *fields; |
| 515 | PurpleRequestFieldGroup *group; | |
| 516 | PurpleRequestField *field; | |
| 9709 | 517 | |
| 15884 | 518 | fields = purple_request_fields_new(); |
| 9709 | 519 | |
| 15884 | 520 | group = purple_request_field_group_new(NULL); |
| 521 | purple_request_fields_add_group(fields, group); | |
| 9709 | 522 | |
| 15884 | 523 | field = purple_request_field_string_new("screenname", _("_Name"), NULL, FALSE); |
| 524 | purple_request_field_set_type_hint(field, "screenname-all"); | |
| 525 | purple_request_field_set_required(field, TRUE); | |
| 526 | purple_request_field_group_add_field(group, field); | |
| 9709 | 527 | |
| 15884 | 528 | field = purple_request_field_account_new("account", _("_Account"), NULL); |
|
13824
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
529 | |
| 15884 | 530 | /* 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
|
531 | * 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
|
532 | * 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
|
533 | * account, not the first connected account. */ |
| 15884 | 534 | if (purple_accounts_get_all() != NULL) { |
| 535 | purple_request_field_account_set_default_value(field, purple_accounts_get_all()->data); | |
| 536 | 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
|
537 | } |
|
3e29de65083a
[gaim-migrate @ 16257]
Brian Chu <roast@users.sourceforge.net>
parents:
13816
diff
changeset
|
538 | |
| 15884 | 539 | purple_request_field_set_type_hint(field, "account"); |
| 540 | purple_request_field_account_set_show_all(field, TRUE); | |
| 541 | purple_request_field_set_visible(field, | |
| 542 | (purple_accounts_get_all() != NULL && | |
| 543 | purple_accounts_get_all()->next != NULL)); | |
| 544 | purple_request_field_set_required(field, TRUE); | |
| 545 | purple_request_field_group_add_field(group, field); | |
| 9709 | 546 | |
|
34726
af52ff6660c0
Replaced purple_get_blist() with purple_blist_get_buddy_list()
Ankit Vani <a@nevitus.org>
parents:
34717
diff
changeset
|
547 | purple_request_fields(purple_blist_get_buddy_list(), _("View User Log"), |
| 9709 | 548 | NULL, |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22722
diff
changeset
|
549 | _("Please enter the username or alias of the person " |
| 10668 | 550 | "whose log you would like to view."), |
| 9709 | 551 | fields, |
|
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 | _("OK"), G_CALLBACK(pidgin_dialogs_log_cb), |
| 9709 | 553 | _("Cancel"), NULL, |
|
34332
876483829700
Request API refactoring: switch purple_request_fields to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34331
diff
changeset
|
554 | NULL, NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
555 | } |
|
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 | 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
|
558 | 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
|
559 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
560 | purple_buddy_set_local_alias(buddy, new_alias); |
|
35499
c4c5e0a670b1
Fix namespaces issues in libpurple.
Ankit Vani <a@nevitus.org>
parents:
35469
diff
changeset
|
561 | purple_serv_alias_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
562 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
563 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
564 | 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
|
565 | pidgin_dialogs_alias_buddy(PurpleBuddy *buddy) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
566 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
567 | gchar *secondary; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
568 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
569 | g_return_if_fail(buddy != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
570 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
571 | 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
|
572 | |
| 15884 | 573 | 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
|
574 | 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
|
575 | _("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
|
576 | _("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
|
577 | 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
|
578 | buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
579 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
580 | g_free(secondary); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
581 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
582 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
583 | 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
|
584 | pidgin_dialogs_alias_chat_cb(PurpleChat *chat, const char *new_alias) |
| 9709 | 585 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
586 | purple_chat_set_alias(chat, new_alias); |
| 9709 | 587 | } |
| 588 | ||
| 589 | 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
|
590 | pidgin_dialogs_alias_chat(PurpleChat *chat) |
| 9709 | 591 | { |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
592 | gchar *alias; |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
593 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
594 | g_return_if_fail(chat != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
595 | |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
596 | 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
|
597 | |
| 15884 | 598 | purple_request_input(NULL, _("Alias Chat"), NULL, |
| 9709 | 599 | _("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
|
600 | 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
|
601 | _("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
|
602 | _("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
|
603 | 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
|
604 | chat); |
|
34923
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
605 | |
|
416a7736a401
Unref and free everything recieved from g_object_get
Ankit Vani <a@nevitus.org>
parents:
34887
diff
changeset
|
606 | g_free(alias); |
| 9709 | 607 | } |
| 608 | ||
| 609 | 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
|
610 | pidgin_dialogs_remove_contact_cb(PurpleContact *contact) |
| 9709 | 611 | { |
| 15884 | 612 | PurpleBlistNode *bnode, *cnode; |
| 613 | PurpleGroup *group; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
614 | |
| 15884 | 615 | cnode = (PurpleBlistNode *)contact; |
| 616 | group = (PurpleGroup*)cnode->parent; | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
617 | for (bnode = cnode->child; bnode; bnode = bnode->next) { |
| 15884 | 618 | PurpleBuddy *buddy = (PurpleBuddy*)bnode; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
619 | 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
|
620 | 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
|
621 | } |
| 15884 | 622 | purple_blist_remove_contact(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
623 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
624 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
625 | 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
|
626 | pidgin_dialogs_remove_contact(PurpleContact *contact) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
627 | { |
| 15884 | 628 | PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
629 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
630 | g_return_if_fail(contact != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
631 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
632 | |
|
24976
029a4828431c
Another one the cast fixer breaks.
Richard Laager <rlaager@pidgin.im>
parents:
24569
diff
changeset
|
633 | 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
|
634 | 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
|
635 | pidgin_dialogs_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
636 | } else { |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
637 | gchar *text; |
|
34739
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
638 | 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
|
639 | text = g_strdup_printf( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
640 | ngettext( |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
641 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
642 | "and %d other buddy from your buddy list. Do you " |
|
10324
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
643 | "want to continue?", |
|
3278c5d77bd8
[gaim-migrate @ 11531]
Mark Doliner <markdoliner@pidgin.im>
parents:
10297
diff
changeset
|
644 | "You are about to remove the contact containing %s " |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
645 | "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
|
646 | "want to continue?", contact_size - 1), |
|
7d507b8b9f92
Refactored pidgin to use the GObject BList API
Ankit Vani <a@nevitus.org>
parents:
34728
diff
changeset
|
647 | purple_buddy_get_name(buddy), contact_size - 1); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
648 | |
|
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
|
649 | 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
|
650 | 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
|
651 | 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
|
652 | _("_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
|
653 | _("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
|
654 | NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
655 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
656 | g_free(text); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
657 | } |
| 9709 | 658 | } |
| 659 | ||
| 15882 | 660 | static void free_ggmo(struct _PidginGroupMergeObject *ggp) |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
661 | { |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
662 | g_free(ggp->new_name); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
663 | g_free(ggp); |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
664 | } |
|
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
665 | |
|
14527
134a695b4fa0
[gaim-migrate @ 17179]
Mark Doliner <markdoliner@pidgin.im>
parents:
14526
diff
changeset
|
666 | 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
|
667 | pidgin_dialogs_merge_groups_cb(struct _PidginGroupMergeObject *GGP) |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
668 | { |
|
34728
8efd73063ecf
Renamed buddy list functions to more appropriate/simler names.
Ankit Vani <a@nevitus.org>
parents:
34726
diff
changeset
|
669 | purple_group_set_name(GGP->parent, GGP->new_name); |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
670 | free_ggmo(GGP); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
671 | } |
|
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 | 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
|
674 | 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
|
675 | { |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
676 | gchar *text; |
| 15882 | 677 | struct _PidginGroupMergeObject *ggp; |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
678 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
679 | g_return_if_fail(source != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
680 | g_return_if_fail(new_name != NULL); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
681 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
682 | text = g_strdup_printf( |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
683 | _("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
|
684 | "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
|
685 | |
| 15882 | 686 | ggp = g_new(struct _PidginGroupMergeObject, 1); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
687 | ggp->parent = source; |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
688 | ggp->new_name = g_strdup(new_name); |
|
25888
d0fdd378a635
Remove trailing whitespace
Mark Doliner <markdoliner@pidgin.im>
parents:
25869
diff
changeset
|
689 | |
|
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
|
690 | 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
|
691 | 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
|
692 | 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
|
693 | _("_Merge Groups"), G_CALLBACK(pidgin_dialogs_merge_groups_cb), |
|
14530
c0cfb1c41d3f
[gaim-migrate @ 17184]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
14527
diff
changeset
|
694 | _("Cancel"), G_CALLBACK(free_ggmo)); |
|
14526
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
695 | |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
696 | g_free(text); |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
697 | } |
|
272b75278ff1
[gaim-migrate @ 17178]
Aaron Sheldon <aaronsheldon@users.sourceforge.net>
parents:
14498
diff
changeset
|
698 | |
|
12406
89863d2d9b8d
[gaim-migrate @ 14713]
Richard Laager <rlaager@pidgin.im>
parents:
12374
diff
changeset
|
699 | 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
|
700 | pidgin_dialogs_remove_group_cb(PurpleGroup *group) |
| 9709 | 701 | { |
| 15884 | 702 | PurpleBlistNode *cnode, *bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
703 | |
| 15884 | 704 | cnode = ((PurpleBlistNode*)group)->child; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
705 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
706 | while (cnode) { |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
707 | if (PURPLE_IS_CONTACT(cnode)) { |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
708 | bnode = cnode->child; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
709 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
710 | while (bnode) { |
| 15884 | 711 | PurpleBuddy *buddy; |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
712 | if (PURPLE_IS_BUDDY(bnode)) { |
| 15884 | 713 | buddy = (PurpleBuddy*)bnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
714 | bnode = bnode->next; |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
715 | 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
|
716 | purple_account_remove_buddy(purple_buddy_get_account(buddy), buddy, group); |
| 15884 | 717 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
718 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
719 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
720 | bnode = bnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
721 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
722 | } |
|
34696
6e0d13978666
Global replace to use GObject-style macros. See details.
Ankit Vani <a@nevitus.org>
parents:
34662
diff
changeset
|
723 | } else if (PURPLE_IS_CHAT(cnode)) { |
| 15884 | 724 | PurpleChat *chat = (PurpleChat *)cnode; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
725 | cnode = cnode->next; |
|
32713
e5581dd86f9d
Use the PurpleChat accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32712
diff
changeset
|
726 | if (purple_account_is_connected(purple_chat_get_account(chat))) |
| 15884 | 727 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
728 | } else { |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
729 | cnode = cnode->next; |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
730 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
731 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
732 | |
| 15884 | 733 | purple_blist_remove_group(group); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
734 | } |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
735 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
736 | 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
|
737 | pidgin_dialogs_remove_group(PurpleGroup *group) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
738 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
739 | gchar *text; |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
740 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
741 | g_return_if_fail(group != NULL); |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
742 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
743 | 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
|
744 | purple_group_get_name(group)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
745 | |
|
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
|
746 | 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
|
747 | 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
|
748 | 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
|
749 | _("_Remove Group"), G_CALLBACK(pidgin_dialogs_remove_group_cb), |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
750 | _("Cancel"), NULL); |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
751 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
752 | g_free(text); |
| 9709 | 753 | } |
| 754 | ||
|
10246
aa5bff72f94c
[gaim-migrate @ 11386]
Mark Doliner <markdoliner@pidgin.im>
parents:
10222
diff
changeset
|
755 | /* XXX - Some of this should be moved into the core, methinks. */ |
| 9709 | 756 | 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
|
757 | pidgin_dialogs_remove_buddy_cb(PurpleBuddy *buddy) |
| 9709 | 758 | { |
| 15884 | 759 | PurpleGroup *group; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
760 | gchar *name; |
| 15884 | 761 | PurpleAccount *account; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
762 | |
| 15884 | 763 | group = purple_buddy_get_group(buddy); |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
764 | 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
|
765 | account = purple_buddy_get_account(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
766 | |
|
32709
0edad3ff7243
Use the PurpleBuddy accessor functions.
Andrew Victor <andrew.victor@mxit.com>
parents:
32577
diff
changeset
|
767 | purple_debug_info("blist", "Removing '%s' from buddy list.\n", purple_buddy_get_name(buddy)); |
| 15884 | 768 | /* 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
|
769 | purple_account_remove_buddy(account, buddy, group); |
| 15884 | 770 | purple_blist_remove_buddy(buddy); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
771 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
772 | g_free(name); |
| 9709 | 773 | } |
| 774 | ||
| 775 | 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
|
776 | pidgin_dialogs_remove_buddy(PurpleBuddy *buddy) |
| 9709 | 777 | { |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
778 | gchar *text; |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
779 | |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
780 | g_return_if_fail(buddy != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
781 | |
|
10816
ba2657f4c157
[gaim-migrate @ 12471]
Luke Schierer <lschiere@pidgin.im>
parents:
10813
diff
changeset
|
782 | 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
|
783 | purple_buddy_get_name(buddy)); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
784 | |
|
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
|
785 | 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
|
786 | purple_request_cpar_from_account( |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
787 | purple_buddy_get_account(buddy)), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
788 | buddy, 2, _("_Remove Buddy"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
789 | G_CALLBACK(pidgin_dialogs_remove_buddy_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
790 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
791 | g_free(text); |
|
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 | 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
|
795 | pidgin_dialogs_remove_chat_cb(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
796 | { |
| 15884 | 797 | purple_blist_remove_chat(chat); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
798 | } |
| 9709 | 799 | |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
800 | 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
|
801 | pidgin_dialogs_remove_chat(PurpleChat *chat) |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
802 | { |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
803 | const gchar *name; |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
804 | gchar *text; |
|
9753
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
805 | |
|
5951fd24250e
[gaim-migrate @ 10620]
Mark Doliner <markdoliner@pidgin.im>
parents:
9730
diff
changeset
|
806 | g_return_if_fail(chat != NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
807 | |
| 15884 | 808 | name = purple_chat_get_name(chat); |
|
10877
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
809 | 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
|
810 | name ? name : ""); |
|
4c7371150f56
[gaim-migrate @ 12569]
Daniel Atallah <datallah@pidgin.im>
parents:
10874
diff
changeset
|
811 | |
|
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
|
812 | 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
|
813 | 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
|
814 | chat, 2, _("_Remove Chat"), |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
815 | G_CALLBACK(pidgin_dialogs_remove_chat_cb), _("Cancel"), NULL); |
|
9730
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
816 | |
|
e59812364b8b
[gaim-migrate @ 10591]
Mark Doliner <markdoliner@pidgin.im>
parents:
9728
diff
changeset
|
817 | g_free(text); |
| 9709 | 818 | } |