Sun, 09 Jan 2022 12:11:21 -0600
Remove some deprecated accounts api
Testing Done:
Compiled and ran
Reviewed at https://reviews.imfreedom.org/r/1222/
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
1 | /* pidgin |
| 5563 | 2 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
3 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 4 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 5 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
6 | * |
| 5563 | 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:
19773
diff
changeset
|
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 20 | */ |
| 9308 | 21 | |
|
40439
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
22 | #ifdef HAVE_CONFIG_H |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
23 | # include <config.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
24 | #endif |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
25 | |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
26 | #include <glib/gi18n-lib.h> |
|
e9838d634d5e
Make sure that internal.h can only be included by libpurple and split out some pieces to purpleprivate.h
Gary Kramlich <grim@reaperworld.com>
parents:
40350
diff
changeset
|
27 | |
|
40350
72271baf92bc
Split PurpleKeyValuePair out to it's own file and try to do some cleanup in the files that need to include it.
Gary Kramlich <grim@reaperworld.com>
parents:
40299
diff
changeset
|
28 | #include <purple.h> |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
29 | #include "libpurple/glibcompat.h" |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
30 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
31 | #include "gtkaccount.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
32 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9705
diff
changeset
|
33 | #include "gtkdialogs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
34 | #include "gtkutils.h" |
| 10649 | 35 | #include "gtkstatusbox.h" |
|
40496
6941fece679b
phase2 of pidgin.h: move existing file to pidgincore.h
Gary Kramlich <grim@reaperworld.com>
parents:
40490
diff
changeset
|
36 | #include "pidgincore.h" |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
37 | #include "pidgindialog.h" |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
38 | #include "minidialog.h" |
|
41144
910bdda75c74
Move the pidgin_pixbuf stuff to pidgingdkpixbuf.[ch]
Gary Kramlich <grim@reaperworld.com>
parents:
41058
diff
changeset
|
39 | #include "pidgingdkpixbuf.h" |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
40 | #include "pidginprotocolchooser.h" |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
41 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
42 | enum |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
43 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
44 | COLUMN_ICON, |
| 15240 | 45 | COLUMN_BUDDYICON, |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
46 | COLUMN_USERNAME, |
| 10400 | 47 | COLUMN_ENABLED, |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
48 | COLUMN_PROTOCOL, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
49 | COLUMN_DATA, |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
50 | NUM_COLUMNS |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
51 | }; |
| 5563 | 52 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
53 | enum { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
54 | RESPONSE_ADD = 0, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
55 | RESPONSE_MODIFY, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
56 | RESPONSE_DELETE, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
57 | RESPONSE_CLOSE, |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
58 | }; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
59 | |
| 5563 | 60 | typedef struct |
| 61 | { | |
| 15884 | 62 | PurpleAccount *account; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
63 | char *username; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
64 | char *alias; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
65 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
66 | } PidginAccountAddUserData; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
67 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
68 | typedef struct |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
69 | { |
| 5563 | 70 | GtkWidget *window; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
71 | GtkWidget *treeview; |
| 5563 | 72 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
73 | GtkWidget *modify_button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
74 | GtkWidget *delete_button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
75 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
76 | GtkListStore *model; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
77 | GtkTreeIter drag_iter; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
78 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
79 | GtkTreeViewColumn *username_col; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
80 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
81 | } AccountsWindow; |
| 5563 | 82 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
83 | typedef struct |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
84 | { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
85 | GtkWidget *widget; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
86 | gchar *setting; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
87 | PurplePrefType type; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
88 | } ProtocolOptEntry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
89 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
90 | typedef struct |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
91 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
92 | PidginAccountDialogType type; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
93 | |
| 15884 | 94 | PurpleAccount *account; |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
95 | char *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
96 | PurpleProtocol *protocol; |
| 15884 | 97 | |
| 98 | PurpleProxyType new_proxy_type; | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
99 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
100 | GList *user_split_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
101 | GList *protocol_opt_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
102 | |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
103 | GtkSizeGroup *sg; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
104 | GtkWidget *window; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
105 | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
106 | GtkWidget *notebook; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
107 | GtkWidget *top_vbox; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
108 | GtkWidget *ok_button; |
| 6141 | 109 | GtkWidget *register_button; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
110 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
111 | /* Login Options */ |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
112 | GtkWidget *login_frame; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
113 | GtkWidget *protocol_menu; |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
114 | gchar *password; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
115 | GtkWidget *username_entry; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
116 | GdkRGBA username_entry_hint_color; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
117 | GtkWidget *alias_entry; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
118 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
119 | /* User Options */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
120 | GtkWidget *user_frame; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
121 | GtkWidget *icon_hbox; |
| 14195 | 122 | GtkWidget *icon_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
123 | GtkWidget *icon_entry; |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
124 | GtkFileChooserNative *icon_filesel; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
125 | GtkWidget *icon_preview; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
126 | GtkWidget *icon_text; |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
127 | PurpleImage *icon_img; |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
128 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
129 | /* Protocol Options */ |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
130 | GtkWidget *protocol_frame; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
131 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
132 | /* Proxy Options */ |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
133 | GtkWidget *proxy_frame; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
134 | GtkWidget *proxy_vbox; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
135 | GtkWidget *proxy_dropdown; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
136 | GtkWidget *proxy_host_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
137 | GtkWidget *proxy_port_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
138 | GtkWidget *proxy_user_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
139 | GtkWidget *proxy_pass_entry; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
140 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
141 | /* Voice & Video Options*/ |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
142 | GtkWidget *voice_frame; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
143 | GtkWidget *suppression_check; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
144 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
145 | } AccountPrefsDialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
146 | |
|
40680
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
147 | typedef struct { |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
148 | PurpleAccount *account; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
149 | PidginAccountDialogType type; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
150 | } PidginAccountDialogShowData; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
151 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
152 | static AccountsWindow *accounts_window = NULL; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
153 | static GHashTable *account_pref_wins; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
154 | |
| 15884 | 155 | static void add_account_to_liststore(PurpleAccount *account, gpointer user_data); |
| 5774 | 156 | static void set_account(GtkListStore *store, GtkTreeIter *iter, |
| 15884 | 157 | PurpleAccount *account, GdkPixbuf *global_buddyicon); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
158 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
159 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
160 | * Add/Modify Account dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
161 | **************************************************************************/ |
| 5774 | 162 | static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
| 163 | static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); | |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
164 | static void add_account_options(AccountPrefsDialog *dialog); |
| 5774 | 165 | static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
166 | static void add_voice_options(AccountPrefsDialog *dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
167 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
168 | static GtkWidget * |
| 5774 | 169 | add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
170 | const char *text, GtkWidget *widget) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
171 | { |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22056
diff
changeset
|
172 | return pidgin_add_widget_to_vbox(GTK_BOX(parent), text, dialog->sg, widget, TRUE, NULL); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
173 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
174 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
175 | static void |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
176 | set_dialog_icon(AccountPrefsDialog *dialog, gpointer data, size_t len, gchar *new_icon_path) |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
177 | { |
|
14248
caf7bdfc3e0f
[gaim-migrate @ 16849]
Daniel Atallah <datallah@pidgin.im>
parents:
14235
diff
changeset
|
178 | GdkPixbuf *pixbuf = NULL; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
179 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
180 | |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
181 | if (dialog->icon_img) { |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
182 | g_object_unref(dialog->icon_img); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
183 | dialog->icon_img = NULL; |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
184 | } |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
185 | |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
186 | if (new_icon_path != NULL) { |
|
38285
72824d3b7190
Update pidgin for the PurpleImage and PurpleSmiley changes
Gary Kramlich <grim@reaperworld.com>
parents:
38277
diff
changeset
|
187 | dialog->icon_img = purple_image_new_from_file(new_icon_path, NULL); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
188 | purple_debug_warning("gtkaccount", "data was not necessary"); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
189 | g_free(data); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
190 | } else if (data != NULL) { |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
191 | if (len > 0) |
|
39463
d47e230b9d75
Fix leaky calls to purple_image_new_from_data.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39333
diff
changeset
|
192 | dialog->icon_img = purple_image_new_take_data(data, len); |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
193 | else |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
194 | g_free(data); |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
195 | } |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
196 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
197 | if (dialog->icon_img != NULL) { |
|
35814
8d99745b6214
imgstore: rip from Pidgin (mostly gtkwebview)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35806
diff
changeset
|
198 | pixbuf = pidgin_pixbuf_from_image(dialog->icon_img); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
199 | } |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
200 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
201 | if (dialog->protocol) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
202 | icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
203 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
204 | if (pixbuf && icon_spec && (icon_spec->scale_rules & PURPLE_ICON_SCALE_DISPLAY)) |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
205 | { |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
206 | /* Scale the icon to something reasonable */ |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
207 | int width, height; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
208 | GdkPixbuf *scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
209 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
210 | pidgin_buddy_icon_get_scale_size(pixbuf, icon_spec, |
| 15884 | 211 | PURPLE_ICON_SCALE_DISPLAY, &width, &height); |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
212 | scale = gdk_pixbuf_scale_simple(pixbuf, width, height, GDK_INTERP_BILINEAR); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
213 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
214 | g_object_unref(G_OBJECT(pixbuf)); |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
215 | pixbuf = scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
216 | } |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
217 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
218 | purple_buddy_icon_spec_free(icon_spec); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
219 | |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
220 | if (pixbuf == NULL) |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
221 | { |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
222 | /* Show a placeholder icon */ |
|
39053
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
223 | gtk_image_set_from_icon_name(GTK_IMAGE(dialog->icon_entry), |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
224 | "select-avatar", GTK_ICON_SIZE_LARGE_TOOLBAR); |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
225 | } else { |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
226 | gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); |
|
58a0a87c7038
gtkaccount: Port avatar selector default image to GtkIconTheme
Mike Ruprecht <cmaiku@gmail.com>
parents:
39052
diff
changeset
|
227 | g_object_unref(G_OBJECT(pixbuf)); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
228 | } |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
229 | } |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
230 | |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
231 | static void |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
232 | set_account_protocol_cb(GtkWidget *widget, AccountPrefsDialog *dialog) { |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
233 | PidginProtocolChooser *chooser = PIDGIN_PROTOCOL_CHOOSER(widget); |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
234 | PurpleProtocol *protocol = pidgin_protocol_chooser_get_selected(chooser); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
235 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
236 | if(g_set_object(&dialog->protocol, protocol)) { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
237 | g_clear_pointer(&dialog->protocol_id, g_free); |
|
5955
4f964635c095
[gaim-migrate @ 6399]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
238 | } |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
239 | g_object_unref(G_OBJECT(protocol)); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
240 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
241 | if(PURPLE_IS_PROTOCOL(dialog->protocol)) { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
242 | dialog->protocol_id = g_strdup(purple_protocol_get_id(dialog->protocol)); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
243 | } |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
244 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
245 | if (dialog->account != NULL) { |
| 15884 | 246 | purple_account_clear_settings(dialog->account); |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
247 | } |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
248 | |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
249 | add_login_options(dialog, dialog->top_vbox); |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
250 | add_user_options(dialog, dialog->top_vbox); |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
251 | add_account_options(dialog); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
252 | add_voice_options(dialog); |
| 6141 | 253 | |
|
20092
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
254 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
255 | |
|
40299
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
256 | if (!dialog->protocol || |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
257 | !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER, register_user)) |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
258 | { |
|
e2f8638bac5a
Clean up set_account_protocol_cb and change some accessors for PidginProtocolChooser
Gary Kramlich <grim@reaperworld.com>
parents:
40297
diff
changeset
|
259 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->register_button), FALSE); |
| 6141 | 260 | gtk_widget_hide(dialog->register_button); |
| 11358 | 261 | } else { |
|
39913
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
262 | if (purple_protocol_get_options(dialog->protocol) & |
|
ce96d4639dc7
Remove redundant conditions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
263 | OPT_PROTO_REGISTER_NOSCREENNAME) { |
| 11358 | 264 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
| 265 | } else { | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
266 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON( |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
267 | dialog->register_button), FALSE); |
| 11358 | 268 | gtk_widget_set_sensitive(dialog->register_button, FALSE); |
| 269 | } | |
| 6141 | 270 | gtk_widget_show(dialog->register_button); |
| 11358 | 271 | } |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
272 | } |
|
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
273 | |
|
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
274 | static void |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
275 | username_changed_cb(GtkEntry *entry, AccountPrefsDialog *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
276 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
277 | gboolean opt_noscreenname = (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
278 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_REGISTER_NOSCREENNAME)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
279 | gboolean username_valid = purple_validate(dialog->protocol, |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
280 | gtk_entry_get_text(entry)); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
281 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
282 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
283 | if (opt_noscreenname && dialog->register_button && |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
284 | gtk_toggle_button_get_active( |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
285 | GTK_TOGGLE_BUTTON(dialog->register_button))) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
286 | gtk_widget_set_sensitive(dialog->ok_button, TRUE); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
287 | else |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
288 | gtk_widget_set_sensitive(dialog->ok_button, |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
289 | username_valid); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
290 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
291 | |
| 11358 | 292 | if (dialog->register_button) { |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
293 | if (opt_noscreenname) |
| 11358 | 294 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
| 295 | else | |
| 296 | gtk_widget_set_sensitive(dialog->register_button, | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
297 | username_valid); |
| 11358 | 298 | } |
| 5826 | 299 | } |
| 6732 | 300 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
301 | static void |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
302 | register_button_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
303 | { |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
304 | int register_checked = gtk_toggle_button_get_active( |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
305 | GTK_TOGGLE_BUTTON(dialog->register_button)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
306 | int opt_noscreenname = (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
307 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_REGISTER_NOSCREENNAME)); |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
308 | int register_noscreenname = (opt_noscreenname && register_checked); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
309 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
310 | if (register_noscreenname) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
311 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), ""); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
312 | } |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
313 | gtk_widget_set_sensitive(dialog->username_entry, !register_noscreenname); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
314 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
315 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
316 | gtk_widget_set_sensitive(dialog->ok_button, |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
317 | (opt_noscreenname && register_checked) || |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
318 | *gtk_entry_get_text(GTK_ENTRY(dialog->username_entry)) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
319 | != '\0'); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
320 | } |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
321 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
322 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
323 | static void |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
324 | icon_filesel_choose_cb(const char *filename, gpointer data) |
| 5826 | 325 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
326 | AccountPrefsDialog *dialog = data; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
327 | |
|
14765
c5c0c325481d
[gaim-migrate @ 17455]
Mark Doliner <markdoliner@pidgin.im>
parents:
14764
diff
changeset
|
328 | if (filename != NULL) |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
329 | { |
|
34988
81d8c99ac9b3
Initialize len = 0 before pidgin_convert_buddy_icon()
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
330 | size_t len = 0; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
331 | gpointer data = pidgin_convert_buddy_icon(dialog->protocol, filename, &len); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
332 | set_dialog_icon(dialog, data, len, g_strdup(filename)); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
333 | } |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
334 | |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
335 | g_clear_object(&dialog->icon_filesel); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
336 | } |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
337 | |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
338 | static void |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
339 | icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
340 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
341 | dialog->icon_filesel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(dialog->window), icon_filesel_choose_cb, dialog); |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
342 | gtk_native_dialog_show(GTK_NATIVE_DIALOG(dialog->icon_filesel)); |
| 5826 | 343 | } |
| 344 | ||
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
345 | static void |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
346 | icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
| 5826 | 347 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
348 | set_dialog_icon(dialog, NULL, 0, NULL); |
| 9308 | 349 | } |
| 350 | ||
| 9314 | 351 | static void |
| 352 | account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, | |
| 353 | GtkSelectionData *sd, guint info, guint t, AccountPrefsDialog *dialog) | |
| 354 | { | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
355 | const gchar *name = (gchar *)gtk_selection_data_get_data(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
356 | gint length = gtk_selection_data_get_length(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
357 | gint format = gtk_selection_data_get_format(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
358 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
359 | if ((length >= 0) && (format == 8)) { |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
360 | /* Well, it looks like the drag event was cool. |
| 9314 | 361 | * Let's do something with it */ |
| 362 | if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
| 363 | GError *converr = NULL; | |
| 364 | gchar *tmp, *rtmp; | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
365 | gpointer data; |
|
34988
81d8c99ac9b3
Initialize len = 0 before pidgin_convert_buddy_icon()
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
366 | size_t len = 0; |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
367 | |
|
16412
ee04eb24fcb9
A comment in here mentions "untar", so I think it was copied from the
Richard Laager <rlaager@pidgin.im>
parents:
16386
diff
changeset
|
368 | /* It looks like we're dealing with a local file. */ |
| 9314 | 369 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
|
40765
a5381c20e802
Use specific purple_debug_* functions
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40756
diff
changeset
|
370 | purple_debug_error("buddyicon", "%s", |
|
a5381c20e802
Use specific purple_debug_* functions
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40756
diff
changeset
|
371 | converr ? converr->message : |
|
a5381c20e802
Use specific purple_debug_* functions
Arkadiy Illarionov <qarkai@gmail.com>
parents:
40756
diff
changeset
|
372 | "g_filename_from_uri error"); |
| 9314 | 373 | return; |
| 374 | } | |
| 375 | if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) | |
| 376 | *rtmp = '\0'; | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
377 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
378 | data = pidgin_convert_buddy_icon(dialog->protocol, tmp, &len); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
379 | /* This takes ownership of tmp */ |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
380 | set_dialog_icon(dialog, data, len, tmp); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
381 | } |
| 9314 | 382 | gtk_drag_finish(dc, TRUE, FALSE, t); |
| 383 | } | |
| 384 | gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 385 | } | |
| 386 | ||
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
387 | static void |
| 15884 | 388 | update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
389 | { |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
390 | GtkStyleContext *style; |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
391 | gboolean set; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
392 | GList *l; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
393 | |
|
12843
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
394 | if (dialog->account == NULL) |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
395 | return; |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
396 | |
| 15884 | 397 | if (gc != NULL && dialog->account != purple_connection_get_account(gc)) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
398 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
399 | |
| 15884 | 400 | set = !(purple_account_is_connected(dialog->account) || purple_account_is_connecting(dialog->account)); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
401 | gtk_widget_set_sensitive(dialog->protocol_menu, set); |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
402 | gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); |
|
39054
1b17478d1d4f
gtkaccount: Fix accidental double-space
Mike Ruprecht <cmaiku@gmail.com>
parents:
39053
diff
changeset
|
403 | style = gtk_widget_get_style_context(dialog->username_entry); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
404 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
405 | if (set) { |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
406 | gtk_style_context_remove_class(style, "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
407 | } else { |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
408 | gtk_style_context_add_class(style, "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
409 | } |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
410 | |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
411 | for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
412 | if (l->data == NULL) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
413 | continue; |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
414 | if (GTK_IS_EDITABLE(l->data)) { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
415 | gtk_editable_set_editable(GTK_EDITABLE(l->data), set); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
416 | style = gtk_widget_get_style_context(GTK_WIDGET(l->data)); |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
417 | if (set) { |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
418 | gtk_style_context_remove_class(style, |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
419 | "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
420 | } else { |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
421 | gtk_style_context_add_class(style, |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
422 | "copyable-insensitive"); |
|
35510
0e6c78789caa
Fix some GtkStyle deprecations.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35475
diff
changeset
|
423 | } |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
424 | } else { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
425 | gtk_widget_set_sensitive(GTK_WIDGET(l->data), set); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
426 | } |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
427 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
428 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
429 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
430 | static void |
| 5774 | 431 | add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
432 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
433 | GtkWidget *frame; |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
434 | GtkWidget *hbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
435 | GtkWidget *vbox; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
436 | GtkWidget *entry; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
437 | GList *user_splits; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
438 | GList *l, *l2; |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
439 | char *username = NULL; |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
440 | GtkCssProvider *entry_css; |
|
41030
ec8b76f3bf0a
Fix the resource path so we can use the automatic stuff that GtkApplication supports
Gary Kramlich <grim@reaperworld.com>
parents:
41012
diff
changeset
|
441 | const gchar *res = "/im/pidgin/Pidgin3/Accounts/entry.css"; |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
442 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
443 | entry_css = gtk_css_provider_new(); |
|
40552
eb0f386cea6b
Moved all of the inline css in pidgin to resource files
Gary Kramlich <grim@reaperworld.com>
parents:
40533
diff
changeset
|
444 | gtk_css_provider_load_from_resource(entry_css, res); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
445 | |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
446 | if (dialog->protocol_menu != NULL) |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
447 | { |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
448 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
449 | hbox = g_object_get_data(G_OBJECT(dialog->protocol_menu), "container"); |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
450 | gtk_container_remove(GTK_CONTAINER(hbox), dialog->protocol_menu); |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
451 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
452 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
453 | if (dialog->login_frame != NULL) |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
454 | gtk_widget_destroy(dialog->login_frame); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
455 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
456 | /* Build the login options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
457 | frame = pidgin_make_frame(parent, _("Login Options")); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
458 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
459 | /* cringe */ |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
460 | dialog->login_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
461 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
462 | gtk_box_reorder_child(GTK_BOX(parent), dialog->login_frame, 0); |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
463 | gtk_widget_show(dialog->login_frame); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
464 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
465 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
466 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
467 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
468 | gtk_widget_show(vbox); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
469 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
470 | /* Protocol */ |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
471 | if(dialog->protocol_menu == NULL) { |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
472 | dialog->protocol_menu = pidgin_protocol_chooser_new(); |
|
40741
850137e8737c
Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
40707
diff
changeset
|
473 | pidgin_protocol_chooser_set_selected_id(PIDGIN_PROTOCOL_CHOOSER(dialog->protocol_menu), |
|
850137e8737c
Select the proper protocol in the account editor.
Gary Kramlich <grim@reaperworld.com>
parents:
40707
diff
changeset
|
474 | dialog->protocol_id); |
|
40297
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
475 | g_signal_connect(G_OBJECT(dialog->protocol_menu), "changed", |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
476 | G_CALLBACK(set_account_protocol_cb), dialog); |
|
082c07053a79
Add the new PidginProtocolChooser and implement it in account dialog
Gary Kramlich <grim@reaperworld.com>
parents:
40197
diff
changeset
|
477 | gtk_widget_show(dialog->protocol_menu); |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
478 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
479 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
480 | |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
481 | hbox = add_pref_box(dialog, vbox, _("Pro_tocol:"), dialog->protocol_menu); |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
482 | g_object_set_data(G_OBJECT(dialog->protocol_menu), "container", hbox); |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
483 | |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
484 | g_object_unref(G_OBJECT(dialog->protocol_menu)); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
485 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
486 | /* Username */ |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
487 | dialog->username_entry = gtk_entry_new(); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
488 | gtk_style_context_add_provider( |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
489 | gtk_widget_get_style_context(dialog->username_entry), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
490 | GTK_STYLE_PROVIDER(entry_css), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
491 | GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
492 | g_object_set(G_OBJECT(dialog->username_entry), "truncate-multiline", TRUE, NULL); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
493 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
494 | add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
495 | |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
496 | if (dialog->account != NULL) |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
497 | username = g_strdup(purple_account_get_username(dialog->account)); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
498 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
499 | if (!username && dialog->protocol |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
500 | && PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, CLIENT, get_account_text_table)) { |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
501 | GHashTable *table; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
502 | const char *label; |
|
40634
4d3018b00ad4
Fix the PurpleProtocolClient interface and split it out to its own file.
Gary Kramlich <grim@reaperworld.com>
parents:
40552
diff
changeset
|
503 | table = purple_protocol_client_get_account_text_table(PURPLE_PROTOCOL_CLIENT(dialog->protocol), NULL); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
504 | label = g_hash_table_lookup(table, "login_label"); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
505 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
506 | gtk_entry_set_placeholder_text(GTK_ENTRY(dialog->username_entry), label); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
507 | |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
508 | g_hash_table_destroy(table); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
509 | } |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
510 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
511 | g_signal_connect(G_OBJECT(dialog->username_entry), "changed", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
512 | G_CALLBACK(username_changed_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
513 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
514 | /* Do the user split thang */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
515 | if (dialog->protocol == NULL) |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
516 | user_splits = NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
517 | else |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
518 | user_splits = purple_protocol_get_user_splits(dialog->protocol); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
519 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
520 | if (dialog->user_split_entries != NULL) { |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
521 | g_list_free(dialog->user_split_entries); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
522 | dialog->user_split_entries = NULL; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
523 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
524 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
525 | for (l = user_splits; l != NULL; l = l->next) { |
| 15884 | 526 | PurpleAccountUserSplit *split = l->data; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
527 | char *buf; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
528 | |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
529 | if (purple_account_user_split_is_constant(split)) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
530 | entry = NULL; |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
531 | else { |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
532 | buf = g_strdup_printf("_%s:", purple_account_user_split_get_text(split)); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
533 | entry = gtk_entry_new(); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
534 | gtk_style_context_add_provider( |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
535 | gtk_widget_get_style_context(entry), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
536 | GTK_STYLE_PROVIDER(entry_css), |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
537 | GTK_STYLE_PROVIDER_PRIORITY_APPLICATION); |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
538 | add_pref_box(dialog, vbox, buf, entry); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
539 | g_free(buf); |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
540 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
541 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
542 | dialog->user_split_entries = |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
543 | g_list_append(dialog->user_split_entries, entry); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
544 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
545 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
546 | for (l = g_list_last(dialog->user_split_entries), |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
547 | l2 = g_list_last(user_splits); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
548 | l != NULL && l2 != NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
549 | l = l->prev, l2 = l2->prev) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
550 | |
|
5708
43f6fbb894d5
[gaim-migrate @ 6129]
Christian Hammond <chipx86@chipx86.com>
parents:
5705
diff
changeset
|
551 | GtkWidget *entry = l->data; |
| 15884 | 552 | PurpleAccountUserSplit *split = l2->data; |
|
17851
02fbbecd95f5
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17302
diff
changeset
|
553 | const char *value = NULL; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
554 | char *c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
555 | |
|
35689
1e257009ac10
Fix Pidgin clang scan-build warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
556 | if (dialog->account != NULL && username != NULL) { |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
557 | if(purple_account_user_split_get_reverse(split)) |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
558 | c = strrchr(username, |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
559 | purple_account_user_split_get_separator(split)); |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
560 | else |
|
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
561 | c = strchr(username, |
| 15884 | 562 | purple_account_user_split_get_separator(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
563 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
564 | if (c != NULL) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
565 | *c = '\0'; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
566 | c++; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
567 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
568 | value = c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
569 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
570 | } |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
571 | if (value == NULL) |
| 15884 | 572 | value = purple_account_user_split_get_default_value(split); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
573 | |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
574 | if (value != NULL && entry != NULL) |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
575 | gtk_entry_set_text(GTK_ENTRY(entry), value); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
576 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
577 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
578 | g_list_free_full(user_splits, |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
579 | (GDestroyNotify)purple_account_user_split_destroy); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
580 | |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
581 | if (username != NULL) |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
582 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), username); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
583 | |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
584 | g_free(username); |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
585 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
586 | /* Do not let the user change the protocol/username while connected. */ |
|
12555
3c978a4400f2
[gaim-migrate @ 14874]
Richard Laager <rlaager@pidgin.im>
parents:
12521
diff
changeset
|
587 | update_editable(NULL, dialog); |
| 15884 | 588 | purple_signal_connect(purple_connections_get_handle(), "signing-on", dialog, |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
589 | G_CALLBACK(update_editable), dialog); |
| 15884 | 590 | purple_signal_connect(purple_connections_get_handle(), "signed-off", dialog, |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
591 | G_CALLBACK(update_editable), dialog); |
|
39050
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
592 | |
|
2d6a6d41702b
gtkaccount: Replace deprecated gtk_widget_override_background_color()
Mike Ruprecht <cmaiku@gmail.com>
parents:
38712
diff
changeset
|
593 | g_object_unref(entry_css); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
594 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
595 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
596 | static void |
| 14195 | 597 | icon_check_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
| 598 | { | |
| 599 | gtk_widget_set_sensitive(dialog->icon_hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); | |
| 600 | } | |
| 601 | ||
| 602 | static void | |
| 5774 | 603 | add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
604 | { |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
605 | GtkWidget *frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
606 | GtkWidget *vbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
607 | GtkWidget *vbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
608 | GtkWidget *hbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
609 | GtkWidget *hbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
610 | GtkWidget *button; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
611 | GtkWidget *label; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
612 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
613 | if (dialog->user_frame != NULL) |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
614 | gtk_widget_destroy(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
615 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
616 | /* Build the user options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
617 | frame = pidgin_make_frame(parent, _("User Options")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
618 | dialog->user_frame = gtk_widget_get_parent(gtk_widget_get_parent(frame)); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
619 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
620 | gtk_box_reorder_child(GTK_BOX(parent), dialog->user_frame, 1); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
621 | gtk_widget_show(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
622 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
623 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
624 | vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
625 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
626 | gtk_widget_show(vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
627 | |
|
22933
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
628 | /* Alias */ |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
629 | dialog->alias_entry = gtk_entry_new(); |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
630 | add_pref_box(dialog, vbox, _("_Local alias:"), dialog->alias_entry); |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
631 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
632 | /* Buddy icon */ |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
633 | dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); |
| 14195 | 634 | g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); |
| 635 | gtk_widget_show(dialog->icon_check); | |
| 636 | gtk_box_pack_start(GTK_BOX(vbox), dialog->icon_check, FALSE, FALSE, 0); | |
| 637 | ||
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
638 | dialog->icon_hbox = hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
| 14195 | 639 | gtk_widget_set_sensitive(hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
640 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
641 | gtk_widget_show(hbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
642 | |
| 14195 | 643 | label = gtk_label_new(" "); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
644 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
645 | gtk_widget_show(label); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
646 | |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
647 | button = gtk_button_new(); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
648 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
649 | gtk_widget_show(button); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
650 | g_signal_connect(G_OBJECT(button), "clicked", |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
651 | G_CALLBACK(icon_select_cb), dialog); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
652 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
653 | dialog->icon_entry = gtk_image_new(); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
654 | gtk_container_add(GTK_CONTAINER(button), dialog->icon_entry); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
655 | gtk_widget_show(dialog->icon_entry); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
656 | /* TODO: Uh, isn't this next line pretty useless? */ |
|
35721
abae078d0525
Fix some warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35527
diff
changeset
|
657 | pidgin_set_accessible_label(dialog->icon_entry, GTK_LABEL(label)); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
658 | if (dialog->icon_img) { |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
659 | g_object_unref(dialog->icon_img); |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
660 | dialog->icon_img = NULL; |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
661 | } |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
662 | |
|
35527
707c3c2b2c8a
Fix more gtk_[hv]box_new gtk3 deprecation warnings
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35510
diff
changeset
|
663 | vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
664 | gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
665 | gtk_widget_show(vbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
666 | |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
667 | hbox2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
668 | gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, 12); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
669 | gtk_widget_show(hbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
670 | |
|
39051
1b8c6378f8ba
gtkaccount: Replace GTK_STOCK_* and PIDGIN_STOCK_* usage with strings
Mike Ruprecht <cmaiku@gmail.com>
parents:
39050
diff
changeset
|
671 | button = gtk_button_new_with_mnemonic(_("_Remove")); |
| 5826 | 672 | g_signal_connect(G_OBJECT(button), "clicked", |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
673 | G_CALLBACK(icon_reset_cb), dialog); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
674 | gtk_box_pack_start(GTK_BOX(hbox2), button, FALSE, FALSE, 0); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
675 | gtk_widget_show(button); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
676 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
677 | if (dialog->protocol != NULL) { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
678 | PurpleBuddyIconSpec *icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
679 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
680 | if (!icon_spec || icon_spec->format == NULL) { |
|
19764
9485b7cccfca
If a prpl doesn't support icons then hide the "use a custom icon?"
Mark Doliner <markdoliner@pidgin.im>
parents:
19683
diff
changeset
|
681 | gtk_widget_hide(dialog->icon_check); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
682 | gtk_widget_hide(dialog->icon_hbox); |
| 19773 | 683 | } |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
684 | |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
685 | purple_buddy_icon_spec_free(icon_spec); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
686 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
687 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
688 | if (dialog->account != NULL) { |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
689 | PurpleImage *img; |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
690 | gpointer data = NULL; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
691 | size_t len = 0; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
692 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
693 | if (purple_account_get_private_alias(dialog->account)) |
|
22982
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
694 | gtk_entry_set_text(GTK_ENTRY(dialog->alias_entry), |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
695 | purple_account_get_private_alias(dialog->account)); |
|
22982
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
696 | |
| 14195 | 697 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), |
| 15884 | 698 | !purple_account_get_bool(dialog->account, "use-global-buddyicon", |
| 14195 | 699 | TRUE)); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
700 | |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
701 | img = purple_buddy_icons_find_account_icon(dialog->account); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
702 | if (img) |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
703 | { |
|
38298
f0a8f63f9312
rename purple_image_get_size to purple_image_get_data_size and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
38285
diff
changeset
|
704 | len = purple_image_get_data_size(img); |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
705 | data = g_memdup2(purple_image_get_data(img), len); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
706 | } |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
707 | set_dialog_icon(dialog, data, len, |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
708 | g_strdup(purple_account_get_buddy_icon_path(dialog->account))); |
|
15132
672c39839af1
[gaim-migrate @ 17854]
Mark Huetsch <markhuetsch@users.sourceforge.net>
parents:
15119
diff
changeset
|
709 | } else { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
710 | set_dialog_icon(dialog, NULL, 0, NULL); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
711 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
712 | |
|
22940
380c5bd5df65
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22933
diff
changeset
|
713 | #if 0 |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
714 | if (!dialog->protocol || |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
715 | (!(purple_protocol_get_options(dialog->protocol) & OPT_PROTO_MAIL_CHECK) && |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
716 | (purple_protocol_get_icon_spec(dialog->protocol).format == NULL))) { |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
717 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
718 | /* Nothing to see :( aww. */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
719 | gtk_widget_hide(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
720 | } |
|
22940
380c5bd5df65
This fixes the lack of the Local Alias field for IRC accounts since I moved
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22933
diff
changeset
|
721 | #endif |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
722 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
723 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
724 | static void |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
725 | protocol_opt_entry_free(ProtocolOptEntry *opt_entry) |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
726 | { |
| 40139 | 727 | g_return_if_fail(opt_entry != NULL); |
| 728 | ||
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
729 | g_free(opt_entry->setting); |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
730 | g_free(opt_entry); |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
731 | } |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
732 | |
|
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
733 | static void |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
734 | add_account_options(AccountPrefsDialog *dialog) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
735 | { |
| 15884 | 736 | PurpleAccountOption *option; |
| 737 | PurpleAccount *account; | |
|
38091
be8d0f7d0041
Remove Facebook (XMPP) account option and support code
Mike Ruprecht <cmaiku@gmail.com>
parents:
35929
diff
changeset
|
738 | GtkWidget *vbox, *check, *entry, *combo; |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
739 | GList *list, *node, *opts; |
| 12185 | 740 | gint i, idx, int_value; |
| 12106 | 741 | GtkListStore *model; |
| 742 | GtkTreeIter iter; | |
| 743 | GtkCellRenderer *renderer; | |
| 15884 | 744 | PurpleKeyValuePair *kvp; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
745 | GList *l; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
746 | char buf[1024]; |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
747 | char *title, *tmp; |
|
17851
02fbbecd95f5
Make sure if some plugin used pidgin_protocol_option_menu_new, they continue
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
17302
diff
changeset
|
748 | const char *str_value; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
749 | gboolean bool_value; |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
750 | ProtocolOptEntry *opt_entry; |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
751 | const GSList *str_hints; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
752 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
753 | if (dialog->protocol_frame != NULL) { |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
754 | gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1); |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
755 | dialog->protocol_frame = NULL; |
|
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
756 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
757 | |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
758 | g_list_free_full(dialog->protocol_opt_entries, (GDestroyNotify)protocol_opt_entry_free); |
| 40141 | 759 | dialog->protocol_opt_entries = NULL; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
760 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
761 | if (dialog->protocol == NULL) { |
|
25730
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
762 | return; |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
763 | } |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
764 | |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
765 | opts = purple_protocol_get_account_options(dialog->protocol); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
766 | if(opts == NULL) { |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
767 | return; |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
768 | } |
|
25730
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
769 | |
|
5690
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
770 | account = dialog->account; |
|
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
771 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
772 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
773 | dialog->protocol_frame = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
774 | gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
775 | gtk_notebook_insert_page(GTK_NOTEBOOK(dialog->notebook), vbox, |
|
27668
536cb7a2d348
s/_Advanced/Ad_vanced/ and s/_Proxy/P_roxy/ in the tabs of the Add/Modify
Etan Reisner <deryni@pidgin.im>
parents:
27603
diff
changeset
|
776 | gtk_label_new_with_mnemonic(_("Ad_vanced")), 1); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
777 | gtk_widget_show(vbox); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
778 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
779 | for (l = opts; l != NULL; l = l->next) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
780 | { |
| 15884 | 781 | option = (PurpleAccountOption *)l->data; |
| 782 | ||
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
783 | opt_entry = g_new0(ProtocolOptEntry, 1); |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35040
diff
changeset
|
784 | opt_entry->type = purple_account_option_get_pref_type(option); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
785 | opt_entry->setting = g_strdup(purple_account_option_get_setting(option)); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
786 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
787 | switch (opt_entry->type) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
788 | { |
| 15884 | 789 | case PURPLE_PREF_BOOLEAN: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
790 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
791 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
792 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
793 | { |
| 15884 | 794 | bool_value = purple_account_option_get_default_bool(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
795 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
796 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
797 | { |
| 15884 | 798 | bool_value = purple_account_get_bool(account, |
| 799 | purple_account_option_get_setting(option), | |
| 800 | purple_account_option_get_default_bool(option)); | |
| 7956 | 801 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
802 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
803 | tmp = g_strconcat("_", purple_account_option_get_text(option), NULL); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
804 | opt_entry->widget = check = gtk_check_button_new_with_mnemonic(tmp); |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
805 | g_free(tmp); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
806 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
807 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
808 | bool_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
809 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
810 | gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
811 | gtk_widget_show(check); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
812 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
813 | |
| 15884 | 814 | case PURPLE_PREF_INT: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
815 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
816 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
817 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
818 | { |
| 15884 | 819 | int_value = purple_account_option_get_default_int(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
820 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
821 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
822 | { |
| 15884 | 823 | int_value = purple_account_get_int(account, |
| 824 | purple_account_option_get_setting(option), | |
| 825 | purple_account_option_get_default_int(option)); | |
| 7956 | 826 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
827 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
828 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
829 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
830 | opt_entry->widget = entry = gtk_entry_new(); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
831 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
832 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
833 | title = g_strdup_printf("_%s:", |
| 15884 | 834 | purple_account_option_get_text(option)); |
| 5774 | 835 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
836 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
837 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
838 | |
| 15884 | 839 | case PURPLE_PREF_STRING: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
840 | if (account == NULL || |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
841 | !purple_strequal(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
842 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
843 | { |
| 15884 | 844 | str_value = purple_account_option_get_default_string(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
845 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
846 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
847 | { |
| 15884 | 848 | str_value = purple_account_get_string(account, |
| 849 | purple_account_option_get_setting(option), | |
| 850 | purple_account_option_get_default_string(option)); | |
| 7956 | 851 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
852 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
853 | str_hints = purple_account_option_string_get_hints(option); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
854 | if (str_hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
855 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
856 | const GSList *hint_it = str_hints; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
857 | entry = gtk_combo_box_text_new_with_entry(); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
858 | while (hint_it) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
859 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
860 | const gchar *hint = hint_it->data; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
861 | hint_it = g_slist_next(hint_it); |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
862 | gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(entry), |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
863 | hint); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
864 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
865 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
866 | else |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
867 | entry = gtk_entry_new(); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
868 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
869 | opt_entry->widget = entry; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
870 | if (purple_account_option_string_get_masked(option) && str_hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
871 | g_warn_if_reached(); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
872 | else if (purple_account_option_string_get_masked(option)) |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
873 | { |
|
10658
6223ea383921
[gaim-migrate @ 12190]
Richard Laager <rlaager@pidgin.im>
parents:
10649
diff
changeset
|
874 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
875 | } |
|
5663
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
876 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
877 | if (str_value != NULL && str_hints) |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
878 | gtk_entry_set_text(GTK_ENTRY(gtk_bin_get_child(GTK_BIN(entry))), |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
879 | str_value); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
880 | else |
|
36019
b12e7444a0cb
Facebook XMPP: disable some unsupported features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35972
diff
changeset
|
881 | gtk_entry_set_text(GTK_ENTRY(entry), str_value ? str_value : ""); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
882 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
883 | title = g_strdup_printf("_%s:", |
| 15884 | 884 | purple_account_option_get_text(option)); |
| 5774 | 885 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
886 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
887 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
888 | |
| 15884 | 889 | case PURPLE_PREF_STRING_LIST: |
| 12106 | 890 | i = 0; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
891 | idx = 0; |
| 12106 | 892 | |
| 893 | if (account == NULL || | |
|
38259
c593fc9f5438
Replace strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38258
diff
changeset
|
894 | !purple_strequal(purple_account_get_protocol_id(account), |
| 12106 | 895 | dialog->protocol_id)) |
| 896 | { | |
| 15884 | 897 | str_value = purple_account_option_get_default_list_value(option); |
| 12106 | 898 | } |
| 899 | else | |
| 900 | { | |
| 15884 | 901 | str_value = purple_account_get_string(account, |
| 902 | purple_account_option_get_setting(option), | |
| 903 | purple_account_option_get_default_list_value(option)); | |
| 12106 | 904 | } |
| 905 | ||
| 15884 | 906 | list = purple_account_option_get_list(option); |
| 12106 | 907 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
908 | opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); |
| 12106 | 909 | |
| 15884 | 910 | /* Loop through list of PurpleKeyValuePair items */ |
| 12106 | 911 | for (node = list; node != NULL; node = node->next) { |
| 912 | if (node->data != NULL) { | |
| 15884 | 913 | kvp = (PurpleKeyValuePair *) node->data; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
914 | if ((kvp->value != NULL) && (str_value != NULL) && |
|
15080
bb09a291a99b
[gaim-migrate @ 17800]
Daniel Atallah <datallah@pidgin.im>
parents:
15054
diff
changeset
|
915 | !g_utf8_collate(kvp->value, str_value)) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
916 | idx = i; |
| 12106 | 917 | |
| 918 | gtk_list_store_append(model, &iter); | |
| 919 | gtk_list_store_set(model, &iter, | |
| 920 | 0, kvp->key, | |
| 921 | 1, kvp->value, | |
| 922 | -1); | |
| 923 | } | |
| 924 | ||
| 925 | i++; | |
| 926 | } | |
| 927 | ||
| 928 | /* Set default */ | |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
929 | gtk_combo_box_set_active(GTK_COMBO_BOX(combo), idx); |
| 12106 | 930 | |
| 931 | /* Define renderer */ | |
| 932 | renderer = gtk_cell_renderer_text_new(); | |
| 933 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, | |
| 934 | TRUE); | |
| 935 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), | |
| 936 | renderer, "text", 0, NULL); | |
| 937 | ||
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
938 | title = g_strdup_printf("_%s:", |
| 15884 | 939 | purple_account_option_get_text(option)); |
| 12106 | 940 | add_pref_box(dialog, vbox, title, combo); |
| 941 | g_free(title); | |
| 942 | break; | |
| 943 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
944 | default: |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
945 | purple_debug_error("gtkaccount", "Invalid Account Option pref type (%d)\n", |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
946 | opt_entry->type); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
947 | g_free(opt_entry->setting); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
948 | g_free(opt_entry); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
949 | continue; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
950 | } |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
951 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
952 | dialog->protocol_opt_entries = |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
953 | g_list_append(dialog->protocol_opt_entries, opt_entry); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
954 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
955 | } |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
956 | g_list_free_full(opts, (GDestroyNotify)purple_account_option_destroy); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
957 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
958 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
959 | static GtkWidget * |
| 5774 | 960 | make_proxy_dropdown(void) |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
961 | { |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
962 | GtkWidget *dropdown; |
| 8555 | 963 | GtkListStore *model; |
| 964 | GtkTreeIter iter; | |
| 965 | GtkCellRenderer *renderer; | |
| 966 | ||
| 967 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); | |
| 968 | dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); | |
| 969 | ||
| 970 | gtk_list_store_append(model, &iter); | |
| 971 | gtk_list_store_set(model, &iter, | |
| 15884 | 972 | 0, purple_running_gnome() ? _("Use GNOME Proxy Settings") |
| 15109 | 973 | :_("Use Global Proxy Settings"), |
| 15884 | 974 | 1, PURPLE_PROXY_USE_GLOBAL, |
| 8555 | 975 | -1); |
| 976 | ||
| 977 | gtk_list_store_append(model, &iter); | |
| 978 | gtk_list_store_set(model, &iter, | |
| 979 | 0, _("No Proxy"), | |
| 15884 | 980 | 1, PURPLE_PROXY_NONE, |
| 8555 | 981 | -1); |
| 982 | ||
| 983 | gtk_list_store_append(model, &iter); | |
| 984 | gtk_list_store_set(model, &iter, | |
| 985 | 0, _("SOCKS 4"), | |
| 15884 | 986 | 1, PURPLE_PROXY_SOCKS4, |
| 8555 | 987 | -1); |
| 988 | ||
| 989 | gtk_list_store_append(model, &iter); | |
| 990 | gtk_list_store_set(model, &iter, | |
| 991 | 0, _("SOCKS 5"), | |
| 15884 | 992 | 1, PURPLE_PROXY_SOCKS5, |
| 8555 | 993 | -1); |
| 994 | ||
| 995 | gtk_list_store_append(model, &iter); | |
| 996 | gtk_list_store_set(model, &iter, | |
|
31677
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
997 | 0, _("Tor/Privacy (SOCKS5)"), |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
998 | 1, PURPLE_PROXY_TOR, |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
999 | -1); |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
1000 | |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
1001 | gtk_list_store_append(model, &iter); |
|
042eaab1468c
Add a new proxy type of "Tor". This is really just a SOCKS5 proxy, but can be
Daniel Atallah <datallah@pidgin.im>
parents:
31642
diff
changeset
|
1002 | gtk_list_store_set(model, &iter, |
|
31734
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1003 | 0, _("HTTP"), |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1004 | 1, PURPLE_PROXY_HTTP, |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1005 | -1); |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1006 | |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1007 | gtk_list_store_append(model, &iter); |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1008 | gtk_list_store_set(model, &iter, |
| 8555 | 1009 | 0, _("Use Environmental Settings"), |
| 15884 | 1010 | 1, PURPLE_PROXY_USE_ENVVAR, |
| 8555 | 1011 | -1); |
| 1012 | ||
| 1013 | renderer = gtk_cell_renderer_text_new(); | |
| 1014 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); | |
| 1015 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, | |
| 1016 | "text", 0, NULL); | |
| 1017 | ||
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1018 | return dropdown; |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1019 | } |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1020 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1021 | static void |
| 8555 | 1022 | proxy_type_changed_cb(GtkWidget *menu, AccountPrefsDialog *dialog) |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1023 | { |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1024 | GtkTreeIter iter; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1025 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1026 | if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(menu), &iter)) { |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1027 | int int_value; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1028 | gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(menu)), &iter, |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1029 | 1, &int_value, -1); |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1030 | dialog->new_proxy_type = int_value; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1031 | } |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1032 | |
| 15884 | 1033 | if (dialog->new_proxy_type == PURPLE_PROXY_USE_GLOBAL || |
| 1034 | dialog->new_proxy_type == PURPLE_PROXY_NONE || | |
| 1035 | dialog->new_proxy_type == PURPLE_PROXY_USE_ENVVAR) { | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1036 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1037 | gtk_widget_hide(dialog->proxy_vbox); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1038 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1039 | else |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1040 | gtk_widget_show_all(dialog->proxy_vbox); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1041 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1042 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1043 | static void |
| 5774 | 1044 | port_popup_cb(GtkWidget *w, GtkMenu *menu, gpointer data) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1045 | { |
|
13702
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1046 | GtkWidget *item1; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1047 | GtkWidget *item2; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1048 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1049 | /* This is an easter egg. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1050 | It means one of two things, both intended as humourus: |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1051 | A) your network is really slow and you have nothing better to do than |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1052 | look at butterflies. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1053 | B)You are looking really closely at something that shouldn't matter. */ |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1054 | item1 = gtk_menu_item_new_with_label(_("If you look real closely")); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1055 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1056 | /* This is an easter egg. See the comment on the previous line in the source. */ |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1057 | item2 = gtk_menu_item_new_with_label(_("you can see the butterflies mating")); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1058 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1059 | gtk_widget_show(item1); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1060 | gtk_widget_show(item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1061 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1062 | /* Prepend these in reverse order so they appear correctly. */ |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1063 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1064 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item1); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1065 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1066 | |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1067 | static void |
| 5774 | 1068 | add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1069 | { |
| 15884 | 1070 | PurpleProxyInfo *proxy_info; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1071 | GtkWidget *vbox; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1072 | GtkWidget *vbox2; |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1073 | GtkTreeIter iter; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1074 | GtkTreeModel *proxy_model; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1075 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1076 | if (dialog->proxy_frame != NULL) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1077 | gtk_widget_destroy(dialog->proxy_frame); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1078 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1079 | /* Main vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1080 | dialog->proxy_frame = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1081 | gtk_container_add(GTK_CONTAINER(parent), vbox); |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1082 | gtk_widget_show(vbox); |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1083 | |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1084 | /* Proxy Type drop-down. */ |
| 5774 | 1085 | dialog->proxy_dropdown = make_proxy_dropdown(); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1086 | |
| 5774 | 1087 | add_pref_box(dialog, vbox, _("Proxy _type:"), dialog->proxy_dropdown); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1088 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1089 | /* Setup the second vbox, which may be hidden at times. */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1090 | dialog->proxy_vbox = vbox2 = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1091 | gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, 12); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1092 | gtk_widget_show(vbox2); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1093 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1094 | /* Host */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1095 | dialog->proxy_host_entry = gtk_entry_new(); |
| 5774 | 1096 | add_pref_box(dialog, vbox2, _("_Host:"), dialog->proxy_host_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1097 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1098 | /* Port */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1099 | dialog->proxy_port_entry = gtk_entry_new(); |
| 5774 | 1100 | add_pref_box(dialog, vbox2, _("_Port:"), dialog->proxy_port_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1101 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1102 | g_signal_connect(G_OBJECT(dialog->proxy_port_entry), "populate-popup", |
| 5774 | 1103 | G_CALLBACK(port_popup_cb), NULL); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1104 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1105 | /* User */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1106 | dialog->proxy_user_entry = gtk_entry_new(); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1107 | |
| 5774 | 1108 | add_pref_box(dialog, vbox2, _("_Username:"), dialog->proxy_user_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1109 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1110 | /* Password */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1111 | dialog->proxy_pass_entry = gtk_entry_new(); |
|
5700
8a0df68ba664
[gaim-migrate @ 6121]
Christian Hammond <chipx86@chipx86.com>
parents:
5699
diff
changeset
|
1112 | gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE); |
| 5774 | 1113 | add_pref_box(dialog, vbox2, _("Pa_ssword:"), dialog->proxy_pass_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1114 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1115 | if (dialog->account != NULL && |
| 15884 | 1116 | (proxy_info = purple_account_get_proxy_info(dialog->account)) != NULL) { |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1117 | const char *value; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1118 | int int_val; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1119 | |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35040
diff
changeset
|
1120 | dialog->new_proxy_type = purple_proxy_info_get_proxy_type(proxy_info); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1121 | |
| 15884 | 1122 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1123 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_host_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1124 | |
| 15884 | 1125 | if ((int_val = purple_proxy_info_get_port(proxy_info)) != 0) { |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1126 | char buf[11]; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1127 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1128 | g_snprintf(buf, sizeof(buf), "%d", int_val); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1129 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1130 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_port_entry), buf); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1131 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1132 | |
| 15884 | 1133 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1134 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_user_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1135 | |
| 15884 | 1136 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1137 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_pass_entry), value); |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1138 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1139 | } else |
| 15884 | 1140 | dialog->new_proxy_type = PURPLE_PROXY_USE_GLOBAL; |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1141 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1142 | proxy_model = gtk_combo_box_get_model( |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1143 | GTK_COMBO_BOX(dialog->proxy_dropdown)); |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1144 | if (gtk_tree_model_get_iter_first(proxy_model, &iter)) { |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1145 | int int_val; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1146 | do { |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1147 | gtk_tree_model_get(proxy_model, &iter, 1, &int_val, -1); |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1148 | if (int_val == dialog->new_proxy_type) { |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1149 | gtk_combo_box_set_active_iter( |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1150 | GTK_COMBO_BOX(dialog->proxy_dropdown), &iter); |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1151 | break; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1152 | } |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1153 | } while(gtk_tree_model_iter_next(proxy_model, &iter)); |
|
6856
5ed6b8356ebc
[gaim-migrate @ 7401]
Mark Doliner <markdoliner@pidgin.im>
parents:
6751
diff
changeset
|
1154 | } |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1155 | |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1156 | proxy_type_changed_cb(dialog->proxy_dropdown, dialog); |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1157 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1158 | /* Connect signals. */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1159 | g_signal_connect(G_OBJECT(dialog->proxy_dropdown), "changed", |
| 5774 | 1160 | G_CALLBACK(proxy_type_changed_cb), dialog); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1161 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1162 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1163 | static void |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1164 | add_voice_options(AccountPrefsDialog *dialog) |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1165 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1166 | #ifdef USE_VV |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
1167 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, MEDIA, initiate_session)) { |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1168 | if (dialog->voice_frame) { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1169 | gtk_widget_destroy(dialog->voice_frame); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1170 | dialog->voice_frame = NULL; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1171 | dialog->suppression_check = NULL; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1172 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1173 | return; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1174 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1175 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1176 | if (!dialog->voice_frame) { |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1177 | dialog->voice_frame = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1178 | gtk_container_set_border_width(GTK_CONTAINER(dialog->voice_frame), 12); |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1179 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1180 | dialog->suppression_check = |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1181 | gtk_check_button_new_with_mnemonic(_("Use _silence suppression")); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1182 | gtk_box_pack_start(GTK_BOX(dialog->voice_frame), dialog->suppression_check, |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1183 | FALSE, FALSE, 0); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1184 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1185 | gtk_notebook_append_page(GTK_NOTEBOOK(dialog->notebook), |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1186 | dialog->voice_frame, gtk_label_new_with_mnemonic(_("_Voice and Video"))); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1187 | gtk_widget_show_all(dialog->voice_frame); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1188 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1189 | |
|
32931
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1190 | if (dialog->account) { |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1191 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->suppression_check), |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1192 | purple_account_get_silence_suppression(dialog->account)); |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1193 | } else { |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1194 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->suppression_check), FALSE); |
|
5aaf2dd75f1c
Use a reasonable default in VV prefs if the account isn't created yet.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32929
diff
changeset
|
1195 | } |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1196 | #endif |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1197 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1198 | |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
1199 | static gboolean |
| 5774 | 1200 | account_win_destroy_cb(GtkWidget *w, GdkEvent *event, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1201 | AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1202 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1203 | g_hash_table_remove(account_pref_wins, dialog->account); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1204 | |
| 7450 | 1205 | gtk_widget_destroy(dialog->window); |
| 1206 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1207 | g_list_free(dialog->user_split_entries); |
|
40137
016690872c6c
Add new and free functions for structs to reduce duplication
qarkai <qarkai@gmail.com>
parents:
40046
diff
changeset
|
1208 | g_list_free_full(dialog->protocol_opt_entries, (GDestroyNotify)protocol_opt_entry_free); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1209 | g_free(dialog->protocol_id); |
|
21123
7dbce8723eff
Fix a leak of a GtkSizeGroup.
Daniel Atallah <datallah@pidgin.im>
parents:
20228
diff
changeset
|
1210 | g_object_unref(dialog->sg); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1211 | |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1212 | if (dialog->icon_img) |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1213 | g_object_unref(dialog->icon_img); |
|
10519
80801a34a246
[gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10432
diff
changeset
|
1214 | |
|
39930
411f3df51bcd
Convert to GtkFileChooserNative.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39759
diff
changeset
|
1215 | g_clear_object(&dialog->icon_filesel); |
| 5826 | 1216 | |
| 15884 | 1217 | purple_signals_disconnect_by_handle(dialog); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
1218 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1219 | purple_str_wipe(dialog->password); |
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1220 | |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1221 | g_free(dialog); |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
1222 | return FALSE; |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1223 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1224 | |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1225 | static void |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1226 | account_register_cb(PurpleAccount *account, gboolean succeeded, void *user_data) |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1227 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1228 | if (succeeded) |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1229 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1230 | const PurpleSavedStatus *saved_status = purple_savedstatus_get_current(); |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1231 | purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account); |
|
33090
99d719d058df
Remove extra trailing whitespace.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33088
diff
changeset
|
1232 | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1233 | if (saved_status != NULL && purple_account_get_remember_password(account)) { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1234 | purple_savedstatus_activate_for_account(saved_status, account); |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1235 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1236 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1237 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1238 | else |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1239 | purple_accounts_delete(account); |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1240 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1241 | |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1242 | static void |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1243 | account_prefs_save(AccountPrefsDialog *dialog) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1244 | PurpleAccountManager *manager = NULL; |
| 15884 | 1245 | PurpleProxyInfo *proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1246 | GList *l, *l2; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1247 | const char *value; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1248 | char *username; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1249 | char *tmp; |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1250 | gboolean new_acct = FALSE, icon_change = FALSE; |
| 15884 | 1251 | PurpleAccount *account; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1252 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1253 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1254 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1255 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1256 | /* Build the username string. */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
1257 | username = g_strdup(gtk_entry_get_text(GTK_ENTRY(dialog->username_entry))); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1258 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1259 | if (dialog->protocol != NULL) |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1260 | { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1261 | for (l = purple_protocol_get_user_splits(dialog->protocol), |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1262 | l2 = dialog->user_split_entries; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1263 | l != NULL && l2 != NULL; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1264 | l = l->next, l2 = l2->next) |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1265 | { |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1266 | PurpleAccountUserSplit *split = l->data; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1267 | GtkEntry *entry = l2->data; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1268 | char sep[2] = " "; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1269 | |
|
36020
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
1270 | value = entry ? gtk_entry_get_text(entry) : ""; |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
1271 | if (!value) |
|
47474e8b92dd
Implement purple_account_user_split_(is|set)_constant, remove unsupported Facebook XMPP features
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
36019
diff
changeset
|
1272 | value = ""; |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1273 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1274 | *sep = purple_account_user_split_get_separator(split); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1275 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1276 | tmp = g_strconcat(username, sep, |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1277 | (*value ? value : |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1278 | purple_account_user_split_get_default_value(split)), |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1279 | NULL); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1280 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1281 | g_free(username); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1282 | username = tmp; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1283 | } |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1284 | } |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1285 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1286 | if (dialog->account == NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1287 | { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1288 | account = purple_account_manager_find(manager, username, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1289 | dialog->protocol_id); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1290 | if(PURPLE_IS_ACCOUNT(account)) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1291 | purple_debug_warning("gtkaccount", |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1292 | "Trying to add a duplicate %s account (%s).\n", |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1293 | dialog->protocol_id, username); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1294 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1295 | purple_notify_error(NULL, NULL, _("Unable to save new account"), |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1296 | _("An account already exists with the " |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1297 | "specified criteria."), |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1298 | NULL); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1299 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1300 | g_free(username); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1301 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1302 | return; |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1303 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1304 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1305 | if(purple_account_manager_get_all(manager) == NULL) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1306 | /* We're adding our first account. Be polite and show the buddy |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1307 | * list. |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1308 | */ |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1309 | PidginBuddyList *blist = pidgin_blist_get_default_gtk_blist(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1310 | if(blist != NULL && blist->window != NULL) { |
|
39333
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39145
diff
changeset
|
1311 | gtk_window_present(GTK_WINDOW(blist->window)); |
|
2da5959eb42c
pidgin: Use gtk_window_present() to present buddy list
Mike Ruprecht <cmaiku@gmail.com>
parents:
39145
diff
changeset
|
1312 | } |
|
19049
63cbab1c4036
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <markdoliner@pidgin.im>
parents:
18841
diff
changeset
|
1313 | } |
|
63cbab1c4036
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <markdoliner@pidgin.im>
parents:
18841
diff
changeset
|
1314 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1315 | account = purple_account_new(username, dialog->protocol_id); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1316 | new_acct = TRUE; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1317 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1318 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1319 | { |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1320 | account = dialog->account; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1321 | |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1322 | /* Protocol */ |
| 15884 | 1323 | purple_account_set_protocol_id(account, dialog->protocol_id); |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1324 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1325 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1326 | /* Alias */ |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1327 | value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry)); |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1328 | |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1329 | if (*value != '\0') |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
1330 | purple_account_set_private_alias(account, value); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1331 | else |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
1332 | purple_account_set_private_alias(account, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1333 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1334 | /* Buddy Icon */ |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1335 | if (dialog->protocol != NULL) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1336 | icon_spec = purple_protocol_get_icon_spec(dialog->protocol); |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1337 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1338 | if (icon_spec && icon_spec->format != NULL) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1339 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1340 | const char *filename; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1341 | |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1342 | if (new_acct || purple_account_get_bool(account, "use-global-buddyicon", TRUE) == |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1343 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1344 | { |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1345 | icon_change = TRUE; |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1346 | } |
| 15884 | 1347 | purple_account_set_bool(account, "use-global-buddyicon", !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1348 | |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1349 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1350 | { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1351 | if (dialog->icon_img) |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1352 | { |
|
38298
f0a8f63f9312
rename purple_image_get_size to purple_image_get_data_size and deal with the fallout
Gary Kramlich <grim@reaperworld.com>
parents:
38285
diff
changeset
|
1353 | size_t len = purple_image_get_data_size(dialog->icon_img); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1354 | purple_buddy_icons_set_account_icon(account, |
|
40756
3a58ef28ee44
Implement mitigation for GHSL-2021-045
Gary Kramlich <grim@reaperworld.com>
parents:
40741
diff
changeset
|
1355 | g_memdup2(purple_image_get_data(dialog->icon_img), len), len); |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1356 | purple_account_set_buddy_icon_path(account, |
|
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
1357 | purple_image_get_path(dialog->icon_img)); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1358 | } |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1359 | else |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1360 | { |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1361 | purple_buddy_icons_set_account_icon(account, NULL, 0); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1362 | purple_account_set_buddy_icon_path(account, NULL); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1363 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1364 | } |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1365 | else if ((filename = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) && icon_change) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1366 | { |
|
34988
81d8c99ac9b3
Initialize len = 0 before pidgin_convert_buddy_icon()
Ankit Vani <a@nevitus.org>
parents:
34955
diff
changeset
|
1367 | size_t len = 0; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1368 | gpointer data = pidgin_convert_buddy_icon(dialog->protocol, filename, &len); |
| 15884 | 1369 | purple_account_set_buddy_icon_path(account, filename); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1370 | purple_buddy_icons_set_account_icon(account, data, len); |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1371 | } |
| 14195 | 1372 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1373 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
1374 | purple_buddy_icon_spec_free(icon_spec); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
1375 | |
| 15884 | 1376 | purple_account_set_username(account, username); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1377 | g_free(username); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1378 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1379 | /* Add the protocol settings */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1380 | if (dialog->protocol) { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1381 | ProtocolOptEntry *opt_entry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1382 | GtkTreeIter iter; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1383 | char *value2; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1384 | int int_value; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1385 | gboolean bool_value; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1386 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1387 | for (l2 = dialog->protocol_opt_entries; l2; l2 = l2->next) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1388 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1389 | opt_entry = l2->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1390 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1391 | switch (opt_entry->type) { |
| 15884 | 1392 | case PURPLE_PREF_STRING: |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1393 | if (GTK_IS_COMBO_BOX(opt_entry->widget)) |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1394 | value = gtk_combo_box_text_get_active_text(GTK_COMBO_BOX_TEXT(opt_entry->widget)); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1395 | else |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1396 | value = gtk_entry_get_text(GTK_ENTRY(opt_entry->widget)); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1397 | purple_account_set_string(account, opt_entry->setting, value); |
| 7208 | 1398 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1399 | |
| 15884 | 1400 | case PURPLE_PREF_INT: |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1401 | int_value = atoi(gtk_entry_get_text(GTK_ENTRY(opt_entry->widget))); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1402 | purple_account_set_int(account, opt_entry->setting, int_value); |
| 7208 | 1403 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1404 | |
| 15884 | 1405 | case PURPLE_PREF_BOOLEAN: |
| 7208 | 1406 | bool_value = |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1407 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(opt_entry->widget)); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1408 | purple_account_set_bool(account, opt_entry->setting, bool_value); |
| 7208 | 1409 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1410 | |
| 15884 | 1411 | case PURPLE_PREF_STRING_LIST: |
|
20228
ce019944d765
applied changes from 9d35dde0c779cca73548172223ba557f27d61882
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
1412 | value2 = NULL; |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1413 | if (gtk_combo_box_get_active_iter(GTK_COMBO_BOX(opt_entry->widget), &iter)) |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1414 | gtk_tree_model_get(gtk_combo_box_get_model(GTK_COMBO_BOX(opt_entry->widget)), &iter, 1, &value2, -1); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1415 | purple_account_set_string(account, opt_entry->setting, value2); |
| 12106 | 1416 | break; |
| 1417 | ||
| 7208 | 1418 | default: |
| 1419 | break; | |
| 1420 | } | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1421 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1422 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1423 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1424 | /* Set the proxy stuff. */ |
| 15884 | 1425 | proxy_info = purple_account_get_proxy_info(account); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1426 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1427 | /* Create the proxy info if it doesn't exist. */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1428 | if (proxy_info == NULL) { |
| 15884 | 1429 | proxy_info = purple_proxy_info_new(); |
| 1430 | purple_account_set_proxy_info(account, proxy_info); | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1431 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1432 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1433 | /* Set the proxy info type. */ |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35040
diff
changeset
|
1434 | purple_proxy_info_set_proxy_type(proxy_info, dialog->new_proxy_type); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1435 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1436 | /* Host */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1437 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1438 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1439 | if (*value != '\0') |
| 15884 | 1440 | purple_proxy_info_set_host(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1441 | else |
| 15884 | 1442 | purple_proxy_info_set_host(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1443 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1444 | /* Port */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1445 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1446 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1447 | if (*value != '\0') |
| 15884 | 1448 | purple_proxy_info_set_port(proxy_info, atoi(value)); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1449 | else |
| 15884 | 1450 | purple_proxy_info_set_port(proxy_info, 0); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1451 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1452 | /* Username */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1453 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1454 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1455 | if (*value != '\0') |
| 15884 | 1456 | purple_proxy_info_set_username(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1457 | else |
| 15884 | 1458 | purple_proxy_info_set_username(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1459 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1460 | /* Password */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1461 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1462 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1463 | if (*value != '\0') |
| 15884 | 1464 | purple_proxy_info_set_password(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1465 | else |
| 15884 | 1466 | purple_proxy_info_set_password(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1467 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1468 | /* If there are no values set then proxy_info NULL */ |
|
35378
5d9e2581005b
gtk-doc prep: *_get_type() functions are hidden as standard GType-returning funcs, so rename them.
Ankit Vani <a@nevitus.org>
parents:
35040
diff
changeset
|
1469 | if ((purple_proxy_info_get_proxy_type(proxy_info) == PURPLE_PROXY_USE_GLOBAL) && |
| 15884 | 1470 | (purple_proxy_info_get_host(proxy_info) == NULL) && |
| 1471 | (purple_proxy_info_get_port(proxy_info) == 0) && | |
| 1472 | (purple_proxy_info_get_username(proxy_info) == NULL) && | |
| 1473 | (purple_proxy_info_get_password(proxy_info) == NULL)) | |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1474 | { |
| 15884 | 1475 | purple_account_set_proxy_info(account, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1476 | proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1477 | } |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1478 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1479 | /* Voice and Video settings */ |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1480 | if (dialog->voice_frame) { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1481 | purple_account_set_silence_suppression(account, |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1482 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->suppression_check))); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1483 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1484 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1485 | /* If this is a new account, add it to our list */ |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1486 | if(new_acct) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1487 | purple_account_manager_add(manager, account); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1488 | } else { |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
1489 | purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1490 | } |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1491 | |
|
11987
a6eb4a3f1136
[gaim-migrate @ 14280]
Mark Doliner <markdoliner@pidgin.im>
parents:
11986
diff
changeset
|
1492 | /* If this is a new account, then sign on! */ |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1493 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_button))) { |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1494 | purple_account_set_register_callback(account, account_register_cb, NULL); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1495 | purple_account_register(account); |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1496 | } else if (new_acct) { |
| 15884 | 1497 | const PurpleSavedStatus *saved_status; |
| 1498 | ||
| 1499 | saved_status = purple_savedstatus_get_current(); | |
|
12125
c1e55f812ded
[gaim-migrate @ 14425]
Mark Doliner <markdoliner@pidgin.im>
parents:
12123
diff
changeset
|
1500 | if (saved_status != NULL) { |
| 15884 | 1501 | purple_savedstatus_activate_for_account(saved_status, account); |
| 1502 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
|
12121
cc63210cdc8b
[gaim-migrate @ 14421]
Daniel Atallah <datallah@pidgin.im>
parents:
12106
diff
changeset
|
1503 | } |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1504 | } |
|
10932
a38fb730e964
[gaim-migrate @ 12711]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10931
diff
changeset
|
1505 | |
| 16889 | 1506 | /* We no longer need the data from the dialog window */ |
| 1507 | account_win_destroy_cb(NULL, NULL, dialog); | |
| 1508 | ||
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1509 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1510 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1511 | static void |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1512 | account_prefs_response_cb(GtkDialog *dialog, gint response_id, gpointer data) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1513 | AccountPrefsDialog *window = (AccountPrefsDialog *)data; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1514 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1515 | switch(response_id) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1516 | case RESPONSE_ADD: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1517 | account_prefs_save(window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1518 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1519 | case RESPONSE_CLOSE: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1520 | account_win_destroy_cb(NULL, NULL, window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1521 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1522 | default: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1523 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1524 | } |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1525 | } |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1526 | |
| 9314 | 1527 | static const GtkTargetEntry dnd_targets[] = { |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
1528 | {"text/plain", 0, 0}, |
| 9314 | 1529 | {"text/uri-list", 0, 1}, |
| 1530 | {"STRING", 0, 2} | |
| 1531 | }; | |
| 1532 | ||
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1533 | static void |
| 40691 | 1534 | pidgin_account_dialog_show_continue(PidginAccountDialogType type, |
| 1535 | PurpleAccount *account, | |
| 1536 | const gchar *password) | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1537 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1538 | AccountPrefsDialog *dialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1539 | GtkWidget *win; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1540 | GtkWidget *main_vbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1541 | GtkWidget *vbox; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1542 | GtkWidget *dbox; |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1543 | GtkWidget *notebook; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1544 | GtkWidget *button; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1545 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1546 | if (accounts_window != NULL && account != NULL && |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1547 | (dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1548 | { |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1549 | gtk_window_present(GTK_WINDOW(dialog->window)); |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1550 | return; |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1551 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1552 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1553 | dialog = g_new0(AccountPrefsDialog, 1); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1554 | |
|
40787
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1555 | if(PURPLE_IS_ACCOUNT(account)) { |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1556 | dialog->protocol_id = g_strdup(purple_account_get_protocol_id(account)); |
|
39465
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1557 | } |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1558 | |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1559 | if (accounts_window != NULL && account != NULL) |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1560 | { |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1561 | g_hash_table_insert(account_pref_wins, account, dialog); |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1562 | } |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1563 | |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1564 | dialog->account = account; |
| 40691 | 1565 | dialog->password = g_strdup(password); |
|
39465
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1566 | dialog->type = type; |
|
3b48e07c3625
Fix a leak in Pidgin.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39463
diff
changeset
|
1567 | dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
40787
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1568 | |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1569 | if(dialog->protocol_id != NULL) { |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1570 | PurpleProtocolManager *manager = purple_protocol_manager_get_default(); |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1571 | |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1572 | dialog->protocol = purple_protocol_manager_find(manager, |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1573 | dialog->protocol_id); |
|
8a5a20a49e9b
Fix some issues with the protocol chooser and clean up its usage in GtkAccount
Gary Kramlich <grim@reaperworld.com>
parents:
40765
diff
changeset
|
1574 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1575 | |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
1576 | dialog->window = win = pidgin_dialog_new((type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("Add Account") : _("Modify Account"), |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1577 | 6, "account", FALSE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1578 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1579 | g_signal_connect(win, "delete_event", G_CALLBACK(account_win_destroy_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1580 | dialog); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1581 | g_signal_connect(win, "response", G_CALLBACK(account_prefs_response_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1582 | dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1583 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1584 | /* Setup the vbox */ |
|
41058
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
1585 | main_vbox = gtk_dialog_get_content_area(GTK_DIALOG(win)); |
|
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
1586 | gtk_box_set_spacing(GTK_BOX(main_vbox), 6); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1587 | |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1588 | dialog->notebook = notebook = gtk_notebook_new(); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1589 | gtk_box_pack_start(GTK_BOX(main_vbox), notebook, FALSE, FALSE, 0); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1590 | gtk_widget_show(GTK_WIDGET(notebook)); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1591 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1592 | /* Setup the inner vbox */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1593 | dialog->top_vbox = vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1594 | gtk_container_set_border_width(GTK_CONTAINER(vbox), 12); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1595 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), vbox, |
|
12240
194dc3367706
[gaim-migrate @ 14542]
Björn Voigt <bjoern@cs.tu-berlin.de>
parents:
12185
diff
changeset
|
1596 | gtk_label_new_with_mnemonic(_("_Basic"))); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1597 | gtk_widget_show(vbox); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1598 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1599 | /* Setup the top frames. */ |
| 5774 | 1600 | add_login_options(dialog, vbox); |
| 1601 | add_user_options(dialog, vbox); | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1602 | |
|
23266
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1603 | button = gtk_check_button_new_with_mnemonic( |
|
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1604 | _("Create _this new account on the server")); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1605 | gtk_box_pack_start(GTK_BOX(main_vbox), button, FALSE, FALSE, 0); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1606 | gtk_widget_show(button); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1607 | dialog->register_button = button; |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1608 | g_signal_connect(G_OBJECT(dialog->register_button), "toggled", G_CALLBACK(register_button_cb), dialog); |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1609 | if (dialog->account == NULL) |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1610 | gtk_widget_set_sensitive(button, FALSE); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1611 | |
|
39759
ea1401483849
Rename *_GET_*_IFACE to more standard *_GET_IFACE.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
39611
diff
changeset
|
1612 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, SERVER, register_user)) |
|
19575
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1613 | gtk_widget_hide(button); |
|
b1829eda1afa
Instead of a Register button, show a checkbox between the Notebook and the button box. But don't show it if we're using the fake Google Talk prpl. Fixes #1647
Sean Egan <seanegan@pidgin.im>
parents:
19125
diff
changeset
|
1614 | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1615 | /* Setup the page with 'Advanced' (protocol options). */ |
|
37038
8832d14d7d0c
Rename 'protocol_options' field of PurpleProtocol to more appropriate 'account_options'
Ankit Vani <a@nevitus.org>
parents:
36928
diff
changeset
|
1616 | add_account_options(dialog); |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1617 | |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1618 | /* Setup the page with 'Proxy'. */ |
|
40490
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1619 | dbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12); |
|
fb6e46c4c63c
Remove PIDGIN_HIG_* constants
Gary Kramlich <grim@reaperworld.com>
parents:
40439
diff
changeset
|
1620 | gtk_container_set_border_width(GTK_CONTAINER(dbox), 12); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1621 | gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dbox, |
|
27668
536cb7a2d348
s/_Advanced/Ad_vanced/ and s/_Proxy/P_roxy/ in the tabs of the Add/Modify
Etan Reisner <deryni@pidgin.im>
parents:
27603
diff
changeset
|
1622 | gtk_label_new_with_mnemonic(_("P_roxy"))); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1623 | gtk_widget_show(dbox); |
| 5774 | 1624 | add_proxy_options(dialog, dbox); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1625 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1626 | add_voice_options(dialog); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1627 | |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1628 | /* Buttons */ |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1629 | gtk_dialog_add_button(GTK_DIALOG(win), _("_Cancel"), RESPONSE_CLOSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1630 | dialog->ok_button = gtk_dialog_add_button(GTK_DIALOG(win), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1631 | (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("_Add") : _("_Save"), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1632 | RESPONSE_ADD); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1633 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1634 | if (dialog->account == NULL) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1635 | gtk_widget_set_sensitive(dialog->ok_button, FALSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1636 | } |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1637 | |
| 9314 | 1638 | /* Set up DND */ |
| 1639 | gtk_drag_dest_set(dialog->window, | |
| 1640 | GTK_DEST_DEFAULT_MOTION | | |
| 1641 | GTK_DEST_DEFAULT_DROP, | |
| 1642 | dnd_targets, | |
| 1643 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), | |
| 1644 | GDK_ACTION_COPY); | |
| 1645 | ||
| 1646 | g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", | |
| 1647 | G_CALLBACK(account_dnd_recv), dialog); | |
| 1648 | ||
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1649 | /* Show the window. */ |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
1650 | gtk_widget_show(win); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
1651 | if (!account) |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
1652 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1653 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1654 | |
| 40691 | 1655 | static void |
| 1656 | pidgin_account_dialog_read_password_cb(GObject *obj, GAsyncResult *res, | |
| 1657 | gpointer data) | |
| 1658 | { | |
| 1659 | PurpleCredentialManager *manager = PURPLE_CREDENTIAL_MANAGER(obj); | |
| 1660 | PidginAccountDialogShowData *d = (PidginAccountDialogShowData *)data; | |
|
40823
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1661 | GError *error = NULL; |
| 40691 | 1662 | gchar *password; |
| 1663 | ||
| 1664 | password = purple_credential_manager_read_password_finish(manager, res, | |
|
40823
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1665 | &error); |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1666 | |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1667 | if(error != NULL) { |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1668 | purple_debug_warning("gtkaccount", "failed to read password: %s", |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1669 | error->message); |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1670 | |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1671 | g_error_free(error); |
|
338bba38df77
Port the KWallet Keyring to the new CredentialProvider API.
Gary Kramlich <grim@reaperworld.com>
parents:
40813
diff
changeset
|
1672 | } |
| 40691 | 1673 | |
| 1674 | pidgin_account_dialog_show_continue(d->type, d->account, password); | |
| 1675 | ||
| 1676 | g_free(password); | |
| 1677 | g_free(d); | |
| 1678 | } | |
| 1679 | ||
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1680 | void |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1681 | pidgin_account_dialog_show(PidginAccountDialogType type, PurpleAccount *account) |
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1682 | { |
|
40680
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
1683 | PurpleCredentialManager *manager = NULL; |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
1684 | |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
1685 | manager = purple_credential_manager_get_default(); |
|
f9ea6d5e8992
Use PurpleCredentialManager instead of the old keyring api.
Gary Kramlich <grim@reaperworld.com>
parents:
40634
diff
changeset
|
1686 | |
| 40691 | 1687 | if(PURPLE_IS_ACCOUNT(account)) { |
|
40808
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1688 | /* this is kind of dangerous, but it's no worse than the old version. |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1689 | * Regardless this dialog needs a lot of TLC. |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1690 | */ |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1691 | PidginAccountDialogShowData *data = NULL; |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1692 | data = g_new0(PidginAccountDialogShowData, 1); |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1693 | data->account = account; |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1694 | data->type = type; |
|
afc646d2e7cb
Fix a possible leak.
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40803
diff
changeset
|
1695 | |
| 40691 | 1696 | purple_credential_manager_read_password_async(manager, account, NULL, |
| 1697 | pidgin_account_dialog_read_password_cb, | |
| 1698 | data); | |
| 1699 | } else { | |
| 1700 | pidgin_account_dialog_show_continue(type, account, NULL); | |
| 1701 | } | |
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1702 | } |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1703 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1704 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1705 | * Accounts Dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1706 | **************************************************************************/ |
|
7179
1769277c6e15
[gaim-migrate @ 7747]
Christian Hammond <chipx86@chipx86.com>
parents:
7159
diff
changeset
|
1707 | static void |
| 15884 | 1708 | signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1709 | { |
| 15884 | 1710 | PurpleAccount *account; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1711 | PurpleAccountManager *manager = NULL; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1712 | GtkTreeModel *model; |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1713 | GtkTreeIter iter; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1714 | GdkPixbuf *pixbuf; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1715 | GList *accounts = NULL; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1716 | size_t index; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1717 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1718 | /* Don't need to do anything if the accounts window is not visible */ |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1719 | if(accounts_window == NULL) { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1720 | return; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1721 | } |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1722 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1723 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1724 | accounts = purple_account_manager_get_all(manager); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1725 | |
| 15884 | 1726 | account = purple_connection_get_account(gc); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1727 | model = GTK_TREE_MODEL(accounts_window->model); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1728 | index = g_list_index(accounts, account); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1729 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1730 | if(gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) { |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
1731 | pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1732 | if((pixbuf != NULL) && purple_account_is_disconnected(account)) { |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1733 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1734 | } |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1735 | |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1736 | gtk_list_store_set(accounts_window->model, &iter, |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1737 | COLUMN_ICON, pixbuf, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1738 | -1); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1739 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1740 | if(pixbuf != NULL) { |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1741 | g_object_unref(G_OBJECT(pixbuf)); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1742 | } |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1743 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1744 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1745 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1746 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1747 | * Get the GtkTreeIter of the specified account in the |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1748 | * GtkListStore |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1749 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1750 | static gboolean |
| 15884 | 1751 | accounts_window_find_account_in_treemodel(GtkTreeIter *iter, PurpleAccount *account) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1752 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1753 | GtkTreeModel *model; |
| 15884 | 1754 | PurpleAccount *cur; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1755 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1756 | g_return_val_if_fail(account != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1757 | g_return_val_if_fail(accounts_window != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1758 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1759 | model = GTK_TREE_MODEL(accounts_window->model); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1760 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1761 | if (!gtk_tree_model_get_iter_first(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1762 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1763 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1764 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1765 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1766 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1767 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1768 | while (gtk_tree_model_iter_next(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1769 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1770 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1771 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1772 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1773 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1774 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1775 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1776 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1777 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1778 | static void |
| 15884 | 1779 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1780 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1781 | AccountPrefsDialog *dialog; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1782 | GtkTreeIter iter; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1783 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1784 | /* If the account was being modified, close the edit window */ |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1785 | if((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1786 | account_win_destroy_cb(NULL, NULL, dialog); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1787 | } |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1788 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1789 | if(accounts_window == NULL) { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1790 | return; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1791 | } |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1792 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1793 | /* Remove the account from the GtkListStore */ |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1794 | if(accounts_window_find_account_in_treemodel(&iter, account)) { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1795 | gtk_list_store_remove(accounts_window->model, &iter); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1796 | } |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1797 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1798 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1799 | static void |
| 15884 | 1800 | account_abled_cb(PurpleAccount *account, gpointer user_data) |
| 12070 | 1801 | { |
| 1802 | GtkTreeIter iter; | |
| 1803 | ||
| 1804 | if (accounts_window == NULL) | |
| 1805 | return; | |
| 1806 | ||
| 1807 | /* update the account in the GtkListStore */ | |
| 1808 | if (accounts_window_find_account_in_treemodel(&iter, account)) | |
| 1809 | gtk_list_store_set(accounts_window->model, &iter, | |
| 1810 | COLUMN_ENABLED, GPOINTER_TO_INT(user_data), | |
| 1811 | -1); | |
| 1812 | } | |
| 1813 | ||
| 1814 | static void | |
| 5774 | 1815 | drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1816 | GtkSelectionData *data, guint info, guint time, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1817 | AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1818 | { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1819 | GdkAtom target = gtk_selection_data_get_target(data); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1820 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1821 | if (target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE)) { |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1822 | GtkTreeRowReference *ref; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1823 | GtkTreePath *source_row; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1824 | GtkTreeIter iter; |
| 15884 | 1825 | PurpleAccount *account = NULL; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1826 | GValue val; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1827 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1828 | ref = g_object_get_data(G_OBJECT(ctx), "gtk-tree-view-source-row"); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1829 | source_row = gtk_tree_row_reference_get_path(ref); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1830 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1831 | if (source_row == NULL) |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1832 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1833 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1834 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1835 | source_row); |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1836 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1837 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1838 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1839 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1840 | dialog->drag_iter = iter; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1841 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1842 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1843 | |
| 15884 | 1844 | gtk_selection_data_set(data, gdk_atom_intern("PURPLE_ACCOUNT", FALSE), |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1845 | 8, (void *)&account, sizeof(account)); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1846 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1847 | gtk_tree_path_free(source_row); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1848 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1849 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1850 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1851 | static void |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1852 | move_account_after(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1853 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1854 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1855 | GtkTreeIter new_iter; |
| 15884 | 1856 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1857 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1858 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1859 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1860 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1861 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1862 | gtk_list_store_insert_after(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1863 | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
1864 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1865 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1866 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1867 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1868 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1869 | static void |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1870 | move_account_before(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1871 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1872 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1873 | GtkTreeIter new_iter; |
| 15884 | 1874 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1875 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1876 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1877 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1878 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1879 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1880 | gtk_list_store_insert_before(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1881 | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
1882 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1883 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1884 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1885 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1886 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1887 | static void |
| 5774 | 1888 | drag_data_received_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1889 | guint x, guint y, GtkSelectionData *sd, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1890 | guint info, guint t, AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1891 | { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1892 | GdkAtom target = gtk_selection_data_get_target(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1893 | const guchar *data = gtk_selection_data_get_data(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1894 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1895 | if (target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE) && data) { |
|
12420
00bd43a1ac8a
[gaim-migrate @ 14727]
Richard Laager <rlaager@pidgin.im>
parents:
12376
diff
changeset
|
1896 | gint dest_index; |
| 15884 | 1897 | PurpleAccount *a = NULL; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1898 | GtkTreePath *path = NULL; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1899 | GtkTreeViewDropPosition position; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1900 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1901 | memcpy(&a, data, sizeof(a)); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1902 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1903 | if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1904 | &path, &position)) |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1905 | { |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1906 | GtkTreeIter iter; |
| 15884 | 1907 | PurpleAccount *account; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1908 | PurpleAccountManager *manager = NULL; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1909 | GValue val; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1910 | GList *accounts = NULL; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1911 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1912 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1913 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1914 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1915 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1916 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1917 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1918 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1919 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1920 | accounts = purple_account_manager_get_all(manager); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1921 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1922 | switch (position) { |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1923 | case GTK_TREE_VIEW_DROP_AFTER: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1924 | case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1925 | move_account_after(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1926 | &iter); |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1927 | dest_index = g_list_index(accounts, account) + 1; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1928 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1929 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1930 | case GTK_TREE_VIEW_DROP_BEFORE: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1931 | case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1932 | dest_index = g_list_index(accounts, account); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1933 | |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1934 | move_account_before(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1935 | &iter); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1936 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1937 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1938 | default: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1939 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1940 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1941 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1942 | if (dest_index >= 0) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1943 | purple_account_manager_reorder(manager, a, dest_index); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
1944 | } |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1945 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1946 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1947 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1948 | |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
1949 | static gboolean |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1950 | accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) |
| 5563 | 1951 | { |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
1952 | dialog->window = NULL; |
|
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
1953 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1954 | pidgin_accounts_window_hide(); |
|
7159
7b8db8de4054
[gaim-migrate @ 7726]
Mark Doliner <markdoliner@pidgin.im>
parents:
7107
diff
changeset
|
1955 | |
| 5563 | 1956 | return FALSE; |
| 1957 | } | |
| 1958 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1959 | static void |
| 5774 | 1960 | modify_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1961 | GtkTreeIter *iter, gpointer data) |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1962 | { |
| 15884 | 1963 | PurpleAccount *account; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1964 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1965 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1966 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1967 | if (account != NULL) |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1968 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1969 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1970 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1971 | static void |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
1972 | modify_account(AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1973 | { |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1974 | GtkTreeSelection *selection; |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1975 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1976 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1977 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1978 | gtk_tree_selection_selected_foreach(selection, modify_account_sel, dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1979 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1980 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1981 | static void |
| 15884 | 1982 | delete_account_cb(PurpleAccount *account) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1983 | { |
| 15884 | 1984 | purple_accounts_delete(account); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1985 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1986 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1987 | static void |
| 5774 | 1988 | ask_delete_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1989 | GtkTreeIter *iter, gpointer data) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1990 | { |
| 15884 | 1991 | PurpleAccount *account; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1992 | |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1993 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1994 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1995 | if (account != NULL) { |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
1996 | char *buf; |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1997 | |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
1998 | buf = g_strdup_printf(_("Are you sure you want to delete %s?"), |
| 15884 | 1999 | purple_account_get_username(account)); |
| 2000 | ||
| 2001 | purple_request_close_with_handle(account); | |
|
22385
d14ac3ae2007
The Gnome Human Interface Guidelines say, "if pressing this button by
Mark Doliner <markdoliner@pidgin.im>
parents:
22214
diff
changeset
|
2002 | purple_request_action(account, NULL, buf, NULL, |
|
34331
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
2003 | PURPLE_DEFAULT_ACTION_NONE, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
2004 | purple_request_cpar_from_account(account), account, 2, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
2005 | _("Delete"), delete_account_cb, _("Cancel"), NULL); |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
2006 | g_free(buf); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2007 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2008 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2009 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2010 | static void |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2011 | ask_delete_account(AccountsWindow *dialog) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2012 | { |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2013 | GtkTreeSelection *selection; |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2014 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2015 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2016 | |
| 5774 | 2017 | gtk_tree_selection_selected_foreach(selection, ask_delete_account_sel, |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2018 | dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2019 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2020 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2021 | static void |
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2022 | accedit_win_response_cb(GtkDialog *dialog, guint response, gpointer data) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2023 | AccountsWindow *window = data; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2024 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2025 | switch(response) { |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2026 | case RESPONSE_ADD: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2027 | pidgin_account_dialog_show(PIDGIN_ADD_ACCOUNT_DIALOG, NULL); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2028 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2029 | case RESPONSE_MODIFY: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2030 | modify_account(window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2031 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2032 | case RESPONSE_DELETE: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2033 | ask_delete_account(window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2034 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2035 | case RESPONSE_CLOSE: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2036 | pidgin_accounts_window_hide(); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2037 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2038 | default: |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2039 | break; |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2040 | } |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2041 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2042 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2043 | static void |
| 10400 | 2044 | enabled_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2045 | gpointer data) |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2046 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2047 | AccountsWindow *dialog = (AccountsWindow *)data; |
| 15884 | 2048 | PurpleAccount *account; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2049 | GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2050 | GtkTreeIter iter; |
| 10400 | 2051 | gboolean enabled; |
| 15884 | 2052 | const PurpleSavedStatus *saved_status; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2053 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2054 | gtk_tree_model_get_iter_from_string(model, &iter, path_str); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2055 | gtk_tree_model_get(model, &iter, |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2056 | COLUMN_DATA, &account, |
| 10400 | 2057 | COLUMN_ENABLED, &enabled, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2058 | -1); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2059 | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2060 | /* |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2061 | * If we just enabled the account, then set the statuses |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2062 | * to the current status. |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2063 | */ |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2064 | if (!enabled) |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2065 | { |
| 15884 | 2066 | saved_status = purple_savedstatus_get_current(); |
| 2067 | purple_savedstatus_activate_for_account(saved_status, account); | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2068 | } |
|
11724
d3f71bc34b4f
[gaim-migrate @ 14015]
Mark Doliner <markdoliner@pidgin.im>
parents:
11654
diff
changeset
|
2069 | |
| 15884 | 2070 | purple_account_set_enabled(account, PIDGIN_UI, !enabled); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2071 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2072 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2073 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2074 | add_columns(GtkWidget *treeview, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2075 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2076 | GtkCellRenderer *renderer; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2077 | GtkTreeViewColumn *column; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2078 | |
| 15240 | 2079 | /* Enabled */ |
| 2080 | renderer = gtk_cell_renderer_toggle_new(); | |
| 2081 | ||
| 2082 | g_signal_connect(G_OBJECT(renderer), "toggled", | |
| 2083 | G_CALLBACK(enabled_cb), dialog); | |
| 2084 | ||
| 2085 | column = gtk_tree_view_column_new_with_attributes(_("Enabled"), | |
| 2086 | renderer, "active", COLUMN_ENABLED, NULL); | |
| 2087 | ||
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2088 | gtk_tree_view_column_set_resizable(column, FALSE); |
|
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2089 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 2090 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2091 | /* Username column */ |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2092 | column = gtk_tree_view_column_new(); |
|
22942
2bf494f8e2a4
Change the string "screen name" to "username" everywhere. I think most
Mark Doliner <markdoliner@pidgin.im>
parents:
22941
diff
changeset
|
2093 | gtk_tree_view_column_set_title(column, _("Username")); |
| 9519 | 2094 | gtk_tree_view_column_set_resizable(column, TRUE); |
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2095 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2096 | |
|
15496
76b5ca00a36c
I think this takes care of protocol icons. Note there are still places
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2097 | /* Buddy Icon */ |
| 15240 | 2098 | renderer = gtk_cell_renderer_pixbuf_new(); |
| 2099 | gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
| 2100 | gtk_tree_view_column_add_attribute(column, renderer, | |
| 2101 | "pixbuf", COLUMN_BUDDYICON); | |
| 2102 | ||
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2103 | /* Username */ |
| 15240 | 2104 | renderer = gtk_cell_renderer_text_new(); |
| 2105 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 2106 | gtk_tree_view_column_add_attribute(column, renderer, | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2107 | "text", COLUMN_USERNAME); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2108 | dialog->username_col = column; |
| 15240 | 2109 | |
| 2110 | ||
| 2111 | /* Protocol name */ | |
| 2112 | column = gtk_tree_view_column_new(); | |
| 2113 | gtk_tree_view_column_set_title(column, _("Protocol")); | |
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2114 | gtk_tree_view_column_set_resizable(column, FALSE); |
|
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2115 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 2116 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2117 | /* Icon */ |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2118 | renderer = gtk_cell_renderer_pixbuf_new(); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2119 | gtk_tree_view_column_pack_start(column, renderer, FALSE); |
|
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2120 | gtk_tree_view_column_add_attribute(column, renderer, |
| 5693 | 2121 | "pixbuf", COLUMN_ICON); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2122 | |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2123 | renderer = gtk_cell_renderer_text_new(); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2124 | gtk_tree_view_column_pack_start(column, renderer, TRUE); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2125 | gtk_tree_view_column_add_attribute(column, renderer, |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2126 | "text", COLUMN_PROTOCOL); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2127 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2128 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2129 | static void |
| 15884 | 2130 | set_account(GtkListStore *store, GtkTreeIter *iter, PurpleAccount *account, GdkPixbuf *global_buddyicon) |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2131 | { |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2132 | GdkPixbuf *pixbuf, *buddyicon = NULL; |
|
35818
f01e2638301f
imgstore: rip the rest of imgstore references from Pidgin
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35815
diff
changeset
|
2133 | PurpleImage *img = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2134 | PurpleProtocol *protocol = NULL; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2135 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2136 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2137 | pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
| 15884 | 2138 | if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2139 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
2140 | |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40787
diff
changeset
|
2141 | protocol = purple_account_get_protocol(account); |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2142 | if (protocol != NULL) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2143 | icon_spec = purple_protocol_get_icon_spec(protocol); |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2144 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2145 | if (icon_spec != NULL && icon_spec->format != NULL) { |
|
17484
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2146 | if (purple_account_get_bool(account, "use-global-buddyicon", TRUE)) { |
|
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2147 | if (global_buddyicon != NULL) |
|
39052
f0614ec30627
gtkaccount: Typecast GdkPixbuf to silence warning
Mike Ruprecht <cmaiku@gmail.com>
parents:
39051
diff
changeset
|
2148 | buddyicon = GDK_PIXBUF(g_object_ref(G_OBJECT(global_buddyicon))); |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2149 | else { |
|
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2150 | /* This is for when set_account() is called for a single account */ |
|
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2151 | const char *path; |
|
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2152 | path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon"); |
|
27581
c9711347326d
Don't try to load an image from an empty path. It just spews to the debug log.
Etan Reisner <deryni@pidgin.im>
parents:
26820
diff
changeset
|
2153 | if ((path != NULL) && (*path != '\0')) { |
|
38285
72824d3b7190
Update pidgin for the PurpleImage and PurpleSmiley changes
Gary Kramlich <grim@reaperworld.com>
parents:
38277
diff
changeset
|
2154 | img = purple_image_new_from_file(path, NULL); |
|
27581
c9711347326d
Don't try to load an image from an empty path. It just spews to the debug log.
Etan Reisner <deryni@pidgin.im>
parents:
26820
diff
changeset
|
2155 | } |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2156 | } |
|
17484
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2157 | } else { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2158 | img = purple_buddy_icons_find_account_icon(account); |
|
17484
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2159 | } |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2160 | } |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2161 | |
|
40813
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
2162 | purple_buddy_icon_spec_free(icon_spec); |
|
71305a7d7423
Modernize PurpleProtocol
Gary Kramlich <grim@reaperworld.com>
parents:
40808
diff
changeset
|
2163 | |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2164 | if (img != NULL) { |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2165 | GdkPixbuf *buddyicon_pixbuf; |
|
35814
8d99745b6214
imgstore: rip from Pidgin (mostly gtkwebview)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35806
diff
changeset
|
2166 | buddyicon_pixbuf = pidgin_pixbuf_from_image(img); |
|
8d99745b6214
imgstore: rip from Pidgin (mostly gtkwebview)
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
35806
diff
changeset
|
2167 | g_object_unref(img); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2168 | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2169 | if (buddyicon_pixbuf != NULL) { |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2170 | buddyicon = gdk_pixbuf_scale_simple(buddyicon_pixbuf, 22, 22, GDK_INTERP_HYPER); |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2171 | g_object_unref(G_OBJECT(buddyicon_pixbuf)); |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2172 | } |
| 15240 | 2173 | } |
| 2174 | ||
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2175 | gtk_list_store_set(store, iter, |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2176 | COLUMN_ICON, pixbuf, |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2177 | COLUMN_BUDDYICON, buddyicon, |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2178 | COLUMN_USERNAME, purple_account_get_username(account), |
| 15884 | 2179 | COLUMN_ENABLED, purple_account_get_enabled(account, PIDGIN_UI), |
| 2180 | COLUMN_PROTOCOL, purple_account_get_protocol_name(account), | |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2181 | COLUMN_DATA, account, |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2182 | -1); |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2183 | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2184 | if (pixbuf != NULL) |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2185 | g_object_unref(G_OBJECT(pixbuf)); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2186 | if (buddyicon != NULL) |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2187 | g_object_unref(G_OBJECT(buddyicon)); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2188 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2189 | |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2190 | static void |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2191 | add_account_to_liststore(PurpleAccount *account, gpointer user_data) { |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2192 | GtkTreeIter iter; |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2193 | GdkPixbuf *global_buddyicon = user_data; |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2194 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2195 | if(accounts_window == NULL) { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2196 | return; |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2197 | } |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2198 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2199 | gtk_list_store_append(accounts_window->model, &iter); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2200 | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2201 | set_account(accounts_window->model, &iter, account, global_buddyicon); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2202 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2203 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2204 | static void |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2205 | populate_accounts_list(AccountsWindow *dialog) { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2206 | PurpleAccountManager *manager = NULL; |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2207 | GdkPixbuf *global_buddyicon = NULL; |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2208 | const gchar *path; |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2209 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2210 | gtk_list_store_clear(dialog->model); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2211 | |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2212 | path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon"); |
|
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2213 | if(path != NULL && *path != '\0') { |
|
31889
96183796df0c
Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents:
31734
diff
changeset
|
2214 | GdkPixbuf *pixbuf = pidgin_pixbuf_new_from_file(path); |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2215 | if(pixbuf != NULL) { |
|
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2216 | global_buddyicon = gdk_pixbuf_scale_simple(pixbuf, 22, 22, |
|
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2217 | GDK_INTERP_HYPER); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2218 | g_object_unref(G_OBJECT(pixbuf)); |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2219 | } |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2220 | } |
|
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2221 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2222 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2223 | purple_account_manager_foreach(manager, add_account_to_liststore, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2224 | global_buddyicon); |
| 15053 | 2225 | |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2226 | if(global_buddyicon != NULL) { |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2227 | g_object_unref(G_OBJECT(global_buddyicon)); |
|
41167
e2c60e7de2b1
Make sure the path for a buddy icon isn't an empty string before we attempt to load it as a pixbuf
Gary Kramlich <grim@reaperworld.com>
parents:
41144
diff
changeset
|
2228 | } |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2229 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2230 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2231 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2232 | account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2233 | { |
|
8406
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2234 | gboolean selected = FALSE; |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2235 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2236 | selected = (gtk_tree_selection_count_selected_rows(sel) > 0); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2237 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2238 | gtk_widget_set_sensitive(dialog->modify_button, selected); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2239 | gtk_widget_set_sensitive(dialog->delete_button, selected); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2240 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2241 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2242 | static gboolean |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2243 | account_treeview_double_click_cb(GtkTreeView *treeview, GdkEventButton *event, gpointer user_data) |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2244 | { |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2245 | AccountsWindow *dialog; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2246 | GtkTreePath *path; |
| 11113 | 2247 | GtkTreeViewColumn *column; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2248 | GtkTreeIter iter; |
| 15884 | 2249 | PurpleAccount *account; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2250 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2251 | dialog = (AccountsWindow *)user_data; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2252 | |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2253 | if (event->window != gtk_tree_view_get_bin_window(treeview)) |
|
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2254 | return FALSE; |
|
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2255 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2256 | /* Figure out which node was clicked */ |
| 11113 | 2257 | if (!gtk_tree_view_get_path_at_pos(GTK_TREE_VIEW(dialog->treeview), event->x, event->y, &path, &column, NULL, NULL)) |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2258 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2259 | if (column == gtk_tree_view_get_column(treeview, 0)) { |
|
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2260 | gtk_tree_path_free(path); |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2261 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2262 | } |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2263 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2264 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, path); |
|
10641
0a83c0aea347
[gaim-migrate @ 12149]
Mark Doliner <markdoliner@pidgin.im>
parents:
10640
diff
changeset
|
2265 | gtk_tree_path_free(path); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2266 | gtk_tree_model_get(GTK_TREE_MODEL(dialog->model), &iter, COLUMN_DATA, &account, -1); |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2267 | |
|
38712
ea49cd76cf47
Use GDK button constants instead of magic numbers.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
38583
diff
changeset
|
2268 | if ((account != NULL) && (event->button == GDK_BUTTON_PRIMARY) && |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2269 | (event->type == GDK_2BUTTON_PRESS)) |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2270 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2271 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2272 | return TRUE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2273 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2274 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2275 | return FALSE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2276 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2277 | |
| 5563 | 2278 | static GtkWidget * |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2279 | create_accounts_list(AccountsWindow *dialog) |
| 5563 | 2280 | { |
| 15053 | 2281 | GtkWidget *frame; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2282 | GtkWidget *treeview; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2283 | GtkTreeSelection *sel; |
| 15884 | 2284 | GtkTargetEntry gte[] = {{"PURPLE_ACCOUNT", GTK_TARGET_SAME_APP, 0}}; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2285 | |
| 15053 | 2286 | frame = gtk_frame_new(NULL); |
| 2287 | gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
| 2288 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2289 | /* Create the list model. */ |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2290 | dialog->model = gtk_list_store_new(NUM_COLUMNS, |
| 14921 | 2291 | GDK_TYPE_PIXBUF, /* COLUMN_ICON */ |
| 15240 | 2292 | GDK_TYPE_PIXBUF, /* COLUMN_BUDDYICON */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2293 | G_TYPE_STRING, /* COLUMN_USERNAME */ |
| 14921 | 2294 | G_TYPE_BOOLEAN, /* COLUMN_ENABLED */ |
| 2295 | G_TYPE_STRING, /* COLUMN_PROTOCOL */ | |
|
23376
d8292fe4bb5c
eperez noticed that there's an extra unused column here.
Daniel Atallah <datallah@pidgin.im>
parents:
23313
diff
changeset
|
2296 | G_TYPE_POINTER /* COLUMN_DATA */ |
| 14921 | 2297 | ); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2298 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2299 | /* And now the actual treeview */ |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2300 | treeview = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dialog->model)); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2301 | dialog->treeview = treeview; |
|
22214
e8a9916cb99e
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22177
diff
changeset
|
2302 | g_object_unref(G_OBJECT(dialog->model)); |
|
10418
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2303 | |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2304 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2305 | gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2306 | g_signal_connect(G_OBJECT(sel), "changed", |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2307 | G_CALLBACK(account_selected_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2308 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2309 | /* Handle double-clicking */ |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2310 | g_signal_connect(G_OBJECT(treeview), "button_press_event", |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2311 | G_CALLBACK(account_treeview_double_click_cb), dialog); |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2312 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2313 | gtk_container_add(GTK_CONTAINER(frame), |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2314 | pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1)); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2315 | |
| 5774 | 2316 | add_columns(treeview, dialog); |
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2317 | gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview)); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2318 | |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2319 | populate_accounts_list(dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2320 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2321 | /* Setup DND. I wanna be an orc! */ |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2322 | gtk_tree_view_enable_model_drag_source( |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2323 | GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2324 | 1, GDK_ACTION_COPY); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2325 | gtk_tree_view_enable_model_drag_dest( |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2326 | GTK_TREE_VIEW(treeview), gte, 1, |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2327 | GDK_ACTION_COPY | GDK_ACTION_MOVE); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2328 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2329 | g_signal_connect(G_OBJECT(treeview), "drag-data-received", |
| 5774 | 2330 | G_CALLBACK(drag_data_received_cb), dialog); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2331 | g_signal_connect(G_OBJECT(treeview), "drag-data-get", |
| 5774 | 2332 | G_CALLBACK(drag_data_get_cb), dialog); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2333 | |
| 15053 | 2334 | gtk_widget_show_all(frame); |
| 2335 | return frame; | |
| 5563 | 2336 | } |
| 2337 | ||
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2338 | static void |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2339 | account_modified_cb(PurpleAccount *account, gpointer data) { |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2340 | AccountsWindow *window = (AccountsWindow *)data; |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2341 | GtkTreeIter iter; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2342 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2343 | if (!accounts_window_find_account_in_treemodel(&iter, account)) |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2344 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2345 | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2346 | set_account(window->model, &iter, account, NULL); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2347 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2348 | |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2349 | static void |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2350 | global_buddyicon_changed(const gchar *name, PurplePrefType type, |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2351 | gconstpointer value, gpointer window) |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2352 | { |
|
41209
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2353 | PurpleAccountManager *manager = NULL; |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2354 | |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2355 | manager = purple_account_manager_get_default(); |
|
909561f42b1f
port Pidgin to the new PurpleAccountManager api
Gary Kramlich <grim@reaperworld.com>
parents:
41189
diff
changeset
|
2356 | purple_account_manager_foreach(manager, account_modified_cb, window); |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2357 | } |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2358 | |
| 5563 | 2359 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2360 | pidgin_accounts_window_show(void) |
| 5563 | 2361 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2362 | AccountsWindow *dialog; |
| 5563 | 2363 | GtkWidget *win; |
| 2364 | GtkWidget *vbox; | |
| 2365 | GtkWidget *sw; | |
| 2366 | int width, height; | |
| 2367 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2368 | if (accounts_window != NULL) { |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
2369 | gtk_window_present(GTK_WINDOW(accounts_window->window)); |
| 5563 | 2370 | return; |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2371 | } |
| 5563 | 2372 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2373 | accounts_window = dialog = g_new0(AccountsWindow, 1); |
| 5563 | 2374 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2375 | width = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2376 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height"); |
| 5563 | 2377 | |
|
40533
b1921b17b683
Replace some utility functions with actual widgets
Gary Kramlich <grim@reaperworld.com>
parents:
40496
diff
changeset
|
2378 | dialog->window = win = pidgin_dialog_new(_("Accounts"), 0, "accounts", TRUE); |
| 5563 | 2379 | gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
| 2380 | ||
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2381 | g_signal_connect(win, "delete_event", G_CALLBACK(accedit_win_destroy_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2382 | accounts_window); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2383 | g_signal_connect(win, "response", G_CALLBACK(accedit_win_response_cb), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2384 | accounts_window); |
| 5563 | 2385 | |
| 2386 | /* Setup the vbox */ | |
|
41058
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
2387 | vbox = gtk_dialog_get_content_area(GTK_DIALOG(win)); |
|
18f3ea2e7e6d
Remove pidgin_dialog* helper functions
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
41036
diff
changeset
|
2388 | gtk_box_set_spacing(GTK_BOX(vbox), 12); |
| 5563 | 2389 | |
| 2390 | /* Setup the scrolled window that will contain the list of accounts. */ | |
| 5774 | 2391 | sw = create_accounts_list(dialog); |
| 5563 | 2392 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
| 2393 | gtk_widget_show(sw); | |
| 2394 | ||
|
41036
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2395 | /* Add buttons */ |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2396 | gtk_dialog_add_button(GTK_DIALOG(win), _("_Add..."), RESPONSE_ADD); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2397 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2398 | dialog->modify_button = gtk_dialog_add_button(GTK_DIALOG(win), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2399 | _("_Modify..."), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2400 | RESPONSE_MODIFY); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2401 | gtk_widget_set_sensitive(dialog->modify_button, FALSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2402 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2403 | dialog->delete_button = gtk_dialog_add_button(GTK_DIALOG(win), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2404 | _("_Delete"), |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2405 | RESPONSE_DELETE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2406 | gtk_widget_set_sensitive(dialog->delete_button, FALSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2407 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2408 | gtk_dialog_add_button(GTK_DIALOG(win), _("_Close"), RESPONSE_CLOSE); |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2409 | |
|
c2a9da21b8c0
Replace the deprecated API in gtkaccount.c
Gary Kramlich <grim@reaperworld.com>
parents:
41030
diff
changeset
|
2410 | /* Signals */ |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2411 | purple_signal_connect(pidgin_accounts_get_handle(), "account-modified", |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2412 | accounts_window, |
| 15884 | 2413 | PURPLE_CALLBACK(account_modified_cb), accounts_window); |
| 2414 | purple_prefs_connect_callback(accounts_window, | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2415 | PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2416 | global_buddyicon_changed, accounts_window); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
2417 | |
| 5563 | 2418 | gtk_widget_show(win); |
| 2419 | } | |
| 2420 | ||
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2421 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2422 | pidgin_accounts_window_hide(void) |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2423 | { |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2424 | if (accounts_window == NULL) |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2425 | return; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2426 | |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2427 | if (accounts_window->window != NULL) |
|
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2428 | gtk_widget_destroy(accounts_window->window); |
|
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2429 | |
| 15884 | 2430 | purple_signals_disconnect_by_handle(accounts_window); |
| 2431 | purple_prefs_disconnect_by_handle(accounts_window); | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2432 | |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2433 | g_free(accounts_window); |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2434 | accounts_window = NULL; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2435 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2436 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2437 | static void |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2438 | free_add_user_data(G_GNUC_UNUSED PidginMiniDialog *mini_dialog, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2439 | G_GNUC_UNUSED GtkButton *button, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2440 | gpointer user_data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2441 | { |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2442 | PidginAccountAddUserData *data = user_data; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2443 | g_free(data->username); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2444 | g_free(data->alias); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2445 | g_free(data); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2446 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2447 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2448 | static void |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2449 | add_user_cb(G_GNUC_UNUSED PidginMiniDialog *mini_dialog, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2450 | G_GNUC_UNUSED GtkButton *button, gpointer user_data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2451 | { |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2452 | PidginAccountAddUserData *data = user_data; |
| 15884 | 2453 | PurpleConnection *gc = purple_account_get_connection(data->account); |
| 2454 | ||
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2455 | if (g_list_find(purple_connections_get_all(), gc)) |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2456 | { |
| 15884 | 2457 | purple_blist_request_add_buddy(data->account, data->username, |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2458 | NULL, data->alias); |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2459 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2460 | |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2461 | free_add_user_data(NULL, NULL, user_data); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2462 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2463 | |
| 12285 | 2464 | static char * |
| 15884 | 2465 | make_info(PurpleAccount *account, PurpleConnection *gc, const char *remote_user, |
| 12285 | 2466 | const char *id, const char *alias, const char *msg) |
| 2467 | { | |
|
12976
aedbdb6f9adb
[gaim-migrate @ 15329]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12960
diff
changeset
|
2468 | if (msg != NULL && *msg == '\0') |
|
12960
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2469 | msg = NULL; |
|
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2470 | |
| 12286 | 2471 | return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), |
| 12285 | 2472 | remote_user, |
| 2473 | (alias != NULL ? " (" : ""), | |
| 2474 | (alias != NULL ? alias : ""), | |
| 2475 | (alias != NULL ? ")" : ""), | |
| 2476 | (id != NULL | |
| 2477 | ? id | |
| 15884 | 2478 | : (purple_connection_get_display_name(gc) != NULL |
| 2479 | ? purple_connection_get_display_name(gc) | |
| 2480 | : purple_account_get_username(account))), | |
| 15096 | 2481 | (msg != NULL ? ": " : "."), |
| 12285 | 2482 | (msg != NULL ? msg : "")); |
| 2483 | } | |
| 2484 | ||
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2485 | static void |
| 15884 | 2486 | pidgin_accounts_notify_added(PurpleAccount *account, const char *remote_user, |
| 12285 | 2487 | const char *id, const char *alias, |
| 2488 | const char *msg) | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2489 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2490 | char *buffer; |
| 15884 | 2491 | PurpleConnection *gc; |
| 15094 | 2492 | GtkWidget *alert; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2493 | |
| 15884 | 2494 | gc = purple_account_get_connection(account); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2495 | |
| 12285 | 2496 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2497 | alert = pidgin_mini_dialog_new_with_buttons( |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2498 | buffer, NULL, "dialog-information", NULL, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2499 | _("Close"), NULL, NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2500 | pidgin_blist_add_alert(alert); |
| 12285 | 2501 | |
| 2502 | g_free(buffer); | |
| 2503 | } | |
| 2504 | ||
| 2505 | static void | |
| 15884 | 2506 | pidgin_accounts_request_add(PurpleAccount *account, const char *remote_user, |
| 12285 | 2507 | const char *id, const char *alias, |
| 2508 | const char *msg) | |
| 2509 | { | |
| 2510 | char *buffer; | |
| 15884 | 2511 | PurpleConnection *gc; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2512 | PidginAccountAddUserData *data; |
| 15094 | 2513 | GtkWidget *alert; |
| 12285 | 2514 | |
| 15884 | 2515 | gc = purple_account_get_connection(account); |
| 12285 | 2516 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2517 | data = g_new0(PidginAccountAddUserData, 1); |
| 12285 | 2518 | data->account = account; |
| 2519 | data->username = g_strdup(remote_user); | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2520 | data->alias = g_strdup(alias); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2521 | |
| 12285 | 2522 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2523 | alert = pidgin_mini_dialog_new_with_buttons( |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2524 | _("Add buddy to your list?"), buffer, "dialog-question", data, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2525 | _("Add"), add_user_cb, _("Cancel"), free_add_user_data, NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2526 | pidgin_blist_add_alert(alert); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2527 | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2528 | g_free(buffer); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2529 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2530 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2531 | struct auth_request |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2532 | { |
| 15884 | 2533 | PurpleAccountRequestAuthorizationCb auth_cb; |
| 2534 | PurpleAccountRequestAuthorizationCb deny_cb; | |
| 15119 | 2535 | void *data; |
| 2536 | char *username; | |
| 2537 | char *alias; | |
| 15884 | 2538 | PurpleAccount *account; |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2539 | gboolean add_buddy_after_auth; |
| 15119 | 2540 | }; |
| 2541 | ||
| 2542 | static void | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2543 | free_auth_request(struct auth_request *ar) |
| 15119 | 2544 | { |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2545 | g_free(ar->username); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2546 | g_free(ar->alias); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2547 | g_free(ar); |
| 15119 | 2548 | } |
| 2549 | ||
| 2550 | static void | |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2551 | authorize_and_add_cb(struct auth_request *ar, const char *message) |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2552 | { |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2553 | ar->auth_cb(message, ar->data); |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2554 | if (ar->add_buddy_after_auth) { |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2555 | purple_blist_request_add_buddy(ar->account, ar->username, NULL, ar->alias); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2556 | } |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2557 | } |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2558 | |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2559 | static void |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2560 | authorize_noreason_cb(struct auth_request *ar) |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2561 | { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2562 | authorize_and_add_cb(ar, NULL); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2563 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2564 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2565 | static void |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2566 | authorize_reason_cb(G_GNUC_UNUSED PidginMiniDialog *mini_dialog, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2567 | G_GNUC_UNUSED GtkButton *button, gpointer user_data) |
| 15119 | 2568 | { |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2569 | struct auth_request *ar = user_data; |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40787
diff
changeset
|
2570 | PurpleProtocol *protocol = purple_account_get_protocol(ar->account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2571 | |
|
36607
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2572 | if (protocol && (purple_protocol_get_options(protocol) & OPT_PROTO_AUTHORIZATION_GRANTED_MESSAGE)) { |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2573 | /* Duplicate information because ar is freed by closing minidialog */ |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2574 | struct auth_request *aa = g_new0(struct auth_request, 1); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2575 | aa->auth_cb = ar->auth_cb; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2576 | aa->deny_cb = ar->deny_cb; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2577 | aa->data = ar->data; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2578 | aa->account = ar->account; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2579 | aa->username = g_strdup(ar->username); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2580 | aa->alias = g_strdup(ar->alias); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2581 | aa->add_buddy_after_auth = ar->add_buddy_after_auth; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2582 | purple_request_input(ar->account, NULL, _("Authorization acceptance message:"), |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2583 | NULL, _("No reason given."), TRUE, FALSE, NULL, |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2584 | _("OK"), G_CALLBACK(authorize_and_add_cb), |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2585 | _("Cancel"), G_CALLBACK(authorize_noreason_cb), |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34304
diff
changeset
|
2586 | purple_request_cpar_from_account(ar->account), |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2587 | aa); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2588 | /* FIXME: aa is going to leak now. */ |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2589 | } else { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2590 | authorize_noreason_cb(ar); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2591 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2592 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2593 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2594 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2595 | deny_no_add_cb(struct auth_request *ar, const char *message) |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2596 | { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2597 | ar->deny_cb(message, ar->data); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2598 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2599 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2600 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2601 | deny_noreason_cb(struct auth_request *ar) |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2602 | { |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33661
diff
changeset
|
2603 | ar->deny_cb(NULL, ar->data); |
| 15119 | 2604 | } |
| 2605 | ||
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2606 | static void |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2607 | deny_reason_cb(G_GNUC_UNUSED PidginMiniDialog *mini_dialog, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2608 | G_GNUC_UNUSED GtkButton *button, gpointer user_data) |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2609 | { |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2610 | struct auth_request *ar = user_data; |
|
40803
0e11ce1049b2
Port Pidgin from purple_protocols to PurpleProtocolManager
Gary Kramlich <grim@reaperworld.com>
parents:
40787
diff
changeset
|
2611 | PurpleProtocol *protocol = purple_account_get_protocol(ar->account); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2612 | |
|
36607
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2613 | if (protocol && (purple_protocol_get_options(protocol) & OPT_PROTO_AUTHORIZATION_DENIED_MESSAGE)) { |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2614 | /* Duplicate information because ar is freed by closing minidialog */ |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2615 | struct auth_request *aa = g_new0(struct auth_request, 1); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2616 | aa->auth_cb = ar->auth_cb; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2617 | aa->deny_cb = ar->deny_cb; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2618 | aa->data = ar->data; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2619 | aa->add_buddy_after_auth = ar->add_buddy_after_auth; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2620 | purple_request_input(ar->account, NULL, _("Authorization denied message:"), |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2621 | NULL, _("No reason given."), TRUE, FALSE, NULL, |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2622 | _("OK"), G_CALLBACK(deny_no_add_cb), |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2623 | _("Cancel"), G_CALLBACK(deny_noreason_cb), |
|
34329
ddbc1337332c
Request API refactoring: introduce PurpleRequestCommonParameters and switch purple_request_input to it
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34304
diff
changeset
|
2624 | purple_request_cpar_from_account(ar->account), |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2625 | aa); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2626 | /* FIXME: aa is going to leak now. */ |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2627 | } else { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2628 | deny_noreason_cb(ar); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2629 | } |
| 15119 | 2630 | } |
| 2631 | ||
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2632 | static gboolean |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2633 | get_user_info_cb(GtkWidget *label, |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2634 | const gchar *uri, |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2635 | gpointer data) |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2636 | { |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2637 | struct auth_request *ar = data; |
|
38258
9a6551eba09c
Replace !strcmp() with purple_strequal()
qarkai <qarkai@gmail.com>
parents:
38091
diff
changeset
|
2638 | if (purple_strequal(uri, "viewinfo")) { |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2639 | pidgin_retrieve_user_info(purple_account_get_connection(ar->account), ar->username); |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2640 | return TRUE; |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2641 | } |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2642 | return FALSE; |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2643 | } |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2644 | |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2645 | static void |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2646 | send_im_cb(G_GNUC_UNUSED PidginMiniDialog *mini_dialog, |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2647 | G_GNUC_UNUSED GtkButton *button, |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2648 | gpointer data) |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2649 | { |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2650 | struct auth_request *ar = data; |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2651 | pidgin_dialogs_im_with_user(ar->account, ar->username); |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2652 | } |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2653 | |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15518
diff
changeset
|
2654 | static void * |
|
19125
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2655 | pidgin_accounts_request_authorization(PurpleAccount *account, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2656 | const char *remote_user, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2657 | const char *id, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2658 | const char *alias, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2659 | const char *message, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2660 | gboolean on_list, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2661 | PurpleAccountRequestAuthorizationCb auth_cb, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2662 | PurpleAccountRequestAuthorizationCb deny_cb, |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2663 | void *user_data) |
| 15119 | 2664 | { |
| 2665 | char *buffer; | |
| 15884 | 2666 | PurpleConnection *gc; |
| 15119 | 2667 | GtkWidget *alert; |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2668 | PidginMiniDialog *dialog; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2669 | GdkPixbuf *protocol_icon; |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2670 | struct auth_request *aa; |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2671 | const char *our_name; |
|
33703
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2672 | gboolean have_valid_alias; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2673 | char *escaped_remote_user; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2674 | char *escaped_alias; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2675 | char *escaped_our_name; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2676 | char *escaped_message; |
| 15119 | 2677 | |
| 15884 | 2678 | gc = purple_account_get_connection(account); |
|
33703
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2679 | if (message != NULL && *message != '\0') |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2680 | escaped_message = g_markup_escape_text(message, -1); |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2681 | else |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2682 | escaped_message = g_strdup(""); |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2683 | |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2684 | our_name = (id != NULL) ? id : |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2685 | (purple_connection_get_display_name(gc) != NULL) ? purple_connection_get_display_name(gc) : |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2686 | purple_account_get_username(account); |
|
33703
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2687 | escaped_our_name = g_markup_escape_text(our_name, -1); |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2688 | |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2689 | escaped_remote_user = g_markup_escape_text(remote_user, -1); |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2690 | |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2691 | have_valid_alias = alias && *alias; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2692 | escaped_alias = have_valid_alias ? g_markup_escape_text(alias, -1) : g_strdup(""); |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2693 | |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2694 | buffer = g_strdup_printf(_("<a href=\"viewinfo\">%s</a>%s%s%s wants to add you (%s) to his or her buddy list%s%s"), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2695 | escaped_remote_user, |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2696 | (have_valid_alias ? " (" : ""), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2697 | escaped_alias, |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2698 | (have_valid_alias ? ")" : ""), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2699 | escaped_our_name, |
|
36122
638471098869
Small bug fix to the wording of add buddy requests.
Mark Doliner <mark@kingant.net>
parents:
36020
diff
changeset
|
2700 | (*escaped_message ? ": " : "."), |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2701 | escaped_message); |
|
33703
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2702 | |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2703 | g_free(escaped_remote_user); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2704 | g_free(escaped_alias); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2705 | g_free(escaped_our_name); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2706 | g_free(escaped_message); |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2707 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2708 | protocol_icon = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_SMALL); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31217
diff
changeset
|
2709 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2710 | aa = g_new0(struct auth_request, 1); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2711 | aa->auth_cb = auth_cb; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2712 | aa->deny_cb = deny_cb; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2713 | aa->data = user_data; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2714 | aa->username = g_strdup(remote_user); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2715 | aa->alias = g_strdup(alias); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2716 | aa->account = account; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2717 | aa->add_buddy_after_auth = !on_list; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31217
diff
changeset
|
2718 | |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2719 | dialog = pidgin_mini_dialog_new_with_custom_icon( |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2720 | _("Authorize buddy?"), NULL, protocol_icon); |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2721 | alert = GTK_WIDGET(dialog); |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2722 | |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2723 | pidgin_mini_dialog_enable_description_markup(dialog); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2724 | pidgin_mini_dialog_set_link_callback(dialog, G_CALLBACK(get_user_info_cb), aa); |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2725 | pidgin_mini_dialog_set_description(dialog, buffer); |
|
40991
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2726 | pidgin_mini_dialog_add_button(dialog, _("Authorize"), authorize_reason_cb, aa); |
|
d92defc9ba95
Move minidialog stuff from utils to its source file
Elliott Sales de Andrade <quantum.analyst@gmail.com>
parents:
40975
diff
changeset
|
2727 | pidgin_mini_dialog_add_button(dialog, _("Deny"), deny_reason_cb, aa); |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2728 | pidgin_mini_dialog_add_non_closing_button(dialog, _("Send Instant Message"), send_im_cb, aa); |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2729 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2730 | g_signal_connect_swapped(G_OBJECT(alert), "destroy", G_CALLBACK(free_auth_request), aa); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2731 | g_signal_connect(G_OBJECT(alert), "destroy", G_CALLBACK(purple_account_request_close), NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2732 | pidgin_blist_add_alert(alert); |
| 15119 | 2733 | |
| 2734 | g_free(buffer); | |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2735 | |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
2736 | return alert; |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15518
diff
changeset
|
2737 | } |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15518
diff
changeset
|
2738 | |
|
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15518
diff
changeset
|
2739 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2740 | pidgin_accounts_request_close(void *ui_handle) |
|
15537
5d7473f14c67
The accounts request API now keeps track of a returned ui_handle for authorization requests, which can be closed on demand individually or all-at-once by account. When a connection is destroyed, its associated requests are closed.
Evan Schoenberg <evands@pidgin.im>
parents:
15518
diff
changeset
|
2741 | { |
|
22177
d3858cc821a8
This makes authorization requests go away when the account is disconnected. It will leak the protocol's user_data, but without an API change, there isn't much that can be done about that. References #4609
Daniel Atallah <datallah@pidgin.im>
parents:
22131
diff
changeset
|
2742 | gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
| 15119 | 2743 | } |
| 2744 | ||
| 15884 | 2745 | static PurpleAccountUiOps ui_ops = |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2746 | { |
|
40707
f84f2b4ef0e5
Fix some warnings about missing braces by moving to struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
40694
diff
changeset
|
2747 | .notify_added = pidgin_accounts_notify_added, |
|
f84f2b4ef0e5
Fix some warnings about missing braces by moving to struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
40694
diff
changeset
|
2748 | .request_add = pidgin_accounts_request_add, |
|
f84f2b4ef0e5
Fix some warnings about missing braces by moving to struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
40694
diff
changeset
|
2749 | .request_authorize = pidgin_accounts_request_authorization, |
|
f84f2b4ef0e5
Fix some warnings about missing braces by moving to struct initializers
Gary Kramlich <grim@reaperworld.com>
parents:
40694
diff
changeset
|
2750 | .close_account_request = pidgin_accounts_request_close, |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2751 | }; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2752 | |
| 15884 | 2753 | PurpleAccountUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2754 | pidgin_accounts_get_ui_ops(void) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2755 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2756 | return &ui_ops; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2757 | } |
| 9609 | 2758 | |
| 2759 | void * | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2760 | pidgin_accounts_get_handle(void) { |
| 9609 | 2761 | static int handle; |
| 2762 | ||
| 2763 | return &handle; | |
| 2764 | } | |
| 2765 | ||
| 2766 | void | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2767 | pidgin_accounts_init(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2768 | { |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2769 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2770 | purple_prefs_add_none(PIDGIN_PREFS_ROOT "/accounts/dialog"); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2771 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/width", 520); |
|
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2772 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height", 321); |
|
41189
b779665790a2
Don't use ~/.face.icon as a default profile picture.
Gary Kramlich <grim@reaperworld.com>
parents:
41167
diff
changeset
|
2773 | |
|
b779665790a2
Don't use ~/.face.icon as a default profile picture.
Gary Kramlich <grim@reaperworld.com>
parents:
41167
diff
changeset
|
2774 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", NULL); |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2775 | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2776 | purple_signal_register(pidgin_accounts_get_handle(), "account-modified", |
|
34827
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
2777 | purple_marshal_VOID__POINTER, G_TYPE_NONE, 1, |
|
1615d90aa584
Refactored pidgin to use GType instead of PurpleValue
Ankit Vani <a@nevitus.org>
parents:
34708
diff
changeset
|
2778 | PURPLE_TYPE_ACCOUNT); |
| 15884 | 2779 | |
| 2780 | /* Setup some purple signal handlers. */ | |
| 2781 | purple_signal_connect(purple_connections_get_handle(), "signed-on", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2782 | pidgin_accounts_get_handle(), |
| 15884 | 2783 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2784 | purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2785 | pidgin_accounts_get_handle(), |
| 15884 | 2786 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2787 | purple_signal_connect(purple_accounts_get_handle(), "account-added", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2788 | pidgin_accounts_get_handle(), |
| 15884 | 2789 | PURPLE_CALLBACK(add_account_to_liststore), NULL); |
| 2790 | purple_signal_connect(purple_accounts_get_handle(), "account-removed", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2791 | pidgin_accounts_get_handle(), |
| 15884 | 2792 | PURPLE_CALLBACK(account_removed_cb), NULL); |
| 2793 | purple_signal_connect(purple_accounts_get_handle(), "account-disabled", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2794 | pidgin_accounts_get_handle(), |
| 15884 | 2795 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE)); |
| 2796 | purple_signal_connect(purple_accounts_get_handle(), "account-enabled", | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2797 | pidgin_accounts_get_handle(), |
| 15884 | 2798 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE)); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2799 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2800 | account_pref_wins = |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2801 | g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); |
| 9609 | 2802 | } |
| 2803 | ||
| 2804 | void | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2805 | pidgin_accounts_uninit(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2806 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2807 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2808 | * TODO: Need to free all the dialogs in here. Could probably create |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2809 | * a callback function to use for the free-some-data-function |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2810 | * parameter of g_hash_table_new_full, above. |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2811 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2812 | g_hash_table_destroy(account_pref_wins); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2813 | |
|
34585
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2814 | purple_signals_disconnect_by_handle(pidgin_accounts_get_handle()); |
|
cc4b9443deb9
Renamed pidgin_account_[init,uninit,get_handle] to pidgin_accounts_[init,uninit,get_handle].
Ankit Vani <a@nevitus.org>
parents:
34145
diff
changeset
|
2815 | purple_signals_unregister_by_instance(pidgin_accounts_get_handle()); |
| 9609 | 2816 | } |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2817 |