Thu, 12 Sep 2013 19:55:22 +0530
Merged soc.2013.gobjectification branch
| 5563 | 1 | /** |
|
7820
06fc9f66d2cb
[gaim-migrate @ 8472]
Mark Doliner <markdoliner@pidgin.im>
parents:
7810
diff
changeset
|
2 | * @file gtkaccount.c GTK+ Account Editor UI |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16192
diff
changeset
|
3 | * @ingroup pidgin |
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5563 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
11 | * |
| 5563 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * 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
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 25 | */ |
| 9308 | 26 | |
| 9791 | 27 | #include "internal.h" |
| 15577 | 28 | #include "pidgin.h" |
| 5717 | 29 | |
| 5563 | 30 | #include "account.h" |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
31 | #include "accountopt.h" |
|
6229
1704facbe9a5
[gaim-migrate @ 6722]
Mark Doliner <markdoliner@pidgin.im>
parents:
6179
diff
changeset
|
32 | #include "core.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 | #include "debug.h" |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
34 | #include "notify.h" |
|
36367
891eea799578
Renamed plugin.[ch] to plugins.[ch], since we (will) no longer have a PurplePlugin structure.
Ankit Vani <a@nevitus.org>
parents:
36361
diff
changeset
|
35 | #include "plugins.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
36 | #include "prefs.h" |
|
36543
a8c3fecee2d3
Renamed prpl.[ch] to protocol.[ch]
Ankit Vani <a@nevitus.org>
parents:
36454
diff
changeset
|
37 | #include "protocol.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
38 | #include "request.h" |
|
11724
d3f71bc34b4f
[gaim-migrate @ 14015]
Mark Doliner <markdoliner@pidgin.im>
parents:
11654
diff
changeset
|
39 | #include "savedstatuses.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
40 | #include "signals.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
41 | #include "util.h" |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
42 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
43 | #include "gtkaccount.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
44 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9705
diff
changeset
|
45 | #include "gtkdialogs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
46 | #include "gtkutils.h" |
| 10649 | 47 | #include "gtkstatusbox.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
48 | #include "pidginstock.h" |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
49 | #include "minidialog.h" |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
50 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
51 | #include "gtk3compat.h" |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
52 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
53 | enum |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
54 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
55 | COLUMN_ICON, |
| 15240 | 56 | 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
|
57 | COLUMN_USERNAME, |
| 10400 | 58 | COLUMN_ENABLED, |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
59 | COLUMN_PROTOCOL, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
60 | COLUMN_DATA, |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
61 | NUM_COLUMNS |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
62 | }; |
| 5563 | 63 | |
| 64 | typedef struct | |
| 65 | { | |
| 15884 | 66 | PurpleAccount *account; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
67 | char *username; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
68 | char *alias; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
69 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
70 | } PidginAccountAddUserData; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
71 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
72 | typedef struct |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
73 | { |
| 5563 | 74 | GtkWidget *window; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
75 | GtkWidget *treeview; |
| 5563 | 76 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
77 | GtkWidget *modify_button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
78 | GtkWidget *delete_button; |
| 15053 | 79 | GtkWidget *notebook; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
80 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
81 | GtkListStore *model; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
82 | GtkTreeIter drag_iter; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
83 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
84 | GtkTreeViewColumn *username_col; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
85 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
86 | } AccountsWindow; |
| 5563 | 87 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
88 | typedef struct |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
89 | { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
90 | 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
|
91 | 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
|
92 | 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
|
93 | } ProtocolOptEntry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
94 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
95 | 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
|
96 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
97 | PidginAccountDialogType type; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
98 | |
| 15884 | 99 | PurpleAccount *account; |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
100 | char *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
101 | PurpleProtocol *protocol; |
| 15884 | 102 | |
| 103 | PurpleProxyType new_proxy_type; | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
104 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
105 | GList *user_split_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
106 | GList *protocol_opt_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
107 | |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
108 | GtkSizeGroup *sg; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
109 | GtkWidget *window; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
110 | |
|
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
|
111 | GtkWidget *notebook; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
112 | GtkWidget *top_vbox; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
113 | GtkWidget *ok_button; |
| 6141 | 114 | GtkWidget *register_button; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
115 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
116 | /* Login Options */ |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
117 | GtkWidget *login_frame; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
118 | GtkWidget *protocol_menu; |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
119 | GtkWidget *password_box; |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
120 | 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
|
121 | GtkWidget *username_entry; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
122 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
123 | GdkRGBA username_entry_hint_color; |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
124 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
125 | GdkColor *username_entry_hint_color; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
126 | #endif |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
127 | GtkWidget *password_entry; |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
128 | GtkWidget *alias_entry; |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
129 | GtkWidget *remember_pass_check; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
130 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
131 | /* User Options */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
132 | GtkWidget *user_frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
133 | GtkWidget *new_mail_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
134 | GtkWidget *icon_hbox; |
| 14195 | 135 | GtkWidget *icon_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
136 | GtkWidget *icon_entry; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
137 | GtkWidget *icon_filesel; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
138 | GtkWidget *icon_preview; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
139 | GtkWidget *icon_text; |
|
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
|
140 | PurpleStoredImage *icon_img; |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
141 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
142 | /* Protocol Options */ |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
143 | GtkWidget *protocol_frame; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
144 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
145 | /* Proxy Options */ |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
146 | GtkWidget *proxy_frame; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
147 | GtkWidget *proxy_vbox; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
148 | GtkWidget *proxy_dropdown; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
149 | GtkWidget *proxy_host_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
150 | GtkWidget *proxy_port_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
151 | GtkWidget *proxy_user_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
152 | GtkWidget *proxy_pass_entry; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
153 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
154 | /* 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
|
155 | 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
|
156 | 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
|
157 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
158 | } AccountPrefsDialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
159 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
160 | static AccountsWindow *accounts_window = NULL; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
161 | static GHashTable *account_pref_wins; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
162 | |
| 15884 | 163 | static void add_account_to_liststore(PurpleAccount *account, gpointer user_data); |
| 5774 | 164 | static void set_account(GtkListStore *store, GtkTreeIter *iter, |
| 15884 | 165 | PurpleAccount *account, GdkPixbuf *global_buddyicon); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
166 | |
|
34586
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
167 | /* privacy UI ops */ |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
168 | void pidgin_permit_added_removed(PurpleAccount *account, const char *name); |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
169 | void pidgin_deny_added_removed(PurpleAccount *account, const char *name); |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
170 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
171 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
172 | * Add/Modify Account dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
173 | **************************************************************************/ |
| 5774 | 174 | static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
| 175 | static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); | |
|
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
|
176 | static void add_protocol_options(AccountPrefsDialog *dialog); |
| 5774 | 177 | 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
|
178 | static void add_voice_options(AccountPrefsDialog *dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
179 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
180 | static GtkWidget * |
| 5774 | 181 | add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
182 | const char *text, GtkWidget *widget) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
183 | { |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22056
diff
changeset
|
184 | 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
|
185 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
186 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
187 | static void |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
188 | 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
|
189 | { |
|
14248
caf7bdfc3e0f
[gaim-migrate @ 16849]
Daniel Atallah <datallah@pidgin.im>
parents:
14235
diff
changeset
|
190 | GdkPixbuf *pixbuf = NULL; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
191 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
192 | |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
193 | dialog->icon_img = purple_imgstore_unref(dialog->icon_img); |
|
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
|
194 | if (data != NULL) |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
195 | { |
|
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
|
196 | if (len > 0) |
| 33661 | 197 | dialog->icon_img = purple_imgstore_new(data, len, new_icon_path); |
|
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
|
198 | 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
|
199 | g_free(data); |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
200 | } |
|
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
|
201 | |
|
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
|
202 | if (dialog->icon_img != NULL) { |
|
22897
93d7ad160755
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22455
diff
changeset
|
203 | pixbuf = pidgin_pixbuf_from_imgstore(dialog->icon_img); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
204 | } |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
205 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
206 | if (dialog->protocol) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
207 | 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
|
208 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
209 | 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
|
210 | { |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
211 | /* Scale the icon to something reasonable */ |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
212 | int width, height; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
213 | GdkPixbuf *scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
214 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
215 | pidgin_buddy_icon_get_scale_size(pixbuf, icon_spec, |
| 15884 | 216 | PURPLE_ICON_SCALE_DISPLAY, &width, &height); |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
217 | 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
|
218 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
219 | g_object_unref(G_OBJECT(pixbuf)); |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
220 | pixbuf = scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
221 | } |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
222 | |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
223 | if (pixbuf == NULL) |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
224 | { |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
225 | /* Show a placeholder icon */ |
|
16386
416b510e691e
New select-avatar image from hbons
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16351
diff
changeset
|
226 | GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); |
|
416b510e691e
New select-avatar image from hbons
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16351
diff
changeset
|
227 | pixbuf = gtk_widget_render_icon(dialog->window, PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, |
| 16351 | 228 | icon_size, "PidginAccount"); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
229 | } |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
230 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
231 | gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); |
|
14150
b9617d019b31
[gaim-migrate @ 16711]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
232 | if (pixbuf != NULL) |
|
b9617d019b31
[gaim-migrate @ 16711]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
233 | g_object_unref(G_OBJECT(pixbuf)); |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
234 | } |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
235 | |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
236 | static void |
|
32390
0e1bf474f222
Remove an extra "fake" check.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32388
diff
changeset
|
237 | set_account_protocol_cb(GtkWidget *widget, const char *id, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
238 | AccountPrefsDialog *dialog) |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
239 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
240 | PurpleProtocol *new_protocol; |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
241 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36607
diff
changeset
|
242 | new_protocol = purple_protocols_find(id); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
243 | |
|
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
244 | dialog->protocol = new_protocol; |
|
36407
311031b7f535
Refactored gtkaccount to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
245 | g_free(dialog->protocol_id); |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
246 | dialog->protocol_id = dialog->protocol ? g_strdup(purple_protocol_get_id(dialog->protocol)) : NULL; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
247 | |
|
9304
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
248 | if (dialog->account != NULL) |
| 15884 | 249 | purple_account_clear_settings(dialog->account); |
|
9304
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
250 | |
| 5774 | 251 | add_login_options(dialog, dialog->top_vbox); |
| 252 | add_user_options(dialog, dialog->top_vbox); | |
|
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
|
253 | add_protocol_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
|
254 | add_voice_options(dialog); |
| 6141 | 255 | |
|
20092
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
256 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
257 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
258 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, register_user)) { |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
259 | 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
|
260 | dialog->register_button), FALSE); |
| 6141 | 261 | gtk_widget_hide(dialog->register_button); |
| 11358 | 262 | } else { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
263 | if (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
264 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_REGISTER_NOSCREENNAME)) { |
| 11358 | 265 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
| 266 | } else { | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
267 | 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
|
268 | dialog->register_button), FALSE); |
| 11358 | 269 | gtk_widget_set_sensitive(dialog->register_button, FALSE); |
| 270 | } | |
| 6141 | 271 | gtk_widget_show(dialog->register_button); |
| 11358 | 272 | } |
|
5688
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 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
275 | static void |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
276 | username_changed_cb(GtkEntry *entry, AccountPrefsDialog *dialog) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
277 | { |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
278 | 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
|
279 | (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
|
280 | 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
|
281 | 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
|
282 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
283 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
284 | 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
|
285 | 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
|
286 | 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
|
287 | 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
|
288 | else |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
289 | 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
|
290 | username_valid); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
291 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
292 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
293 | if (dialog->register_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
294 | if (opt_noscreenname) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
295 | gtk_widget_set_sensitive(dialog->register_button, TRUE); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
296 | else |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
297 | gtk_widget_set_sensitive(dialog->register_button, |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
298 | username_valid); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
299 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
300 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
301 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
302 | #if !GTK_CHECK_VERSION(3,2,0) |
|
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 | static gboolean |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
304 | username_focus_cb(GtkWidget *widget, GdkEventFocus *event, 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
|
305 | { |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
306 | 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
|
307 | const char *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
|
308 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
309 | if (!dialog->protocol || ! PURPLE_PROTOCOL_IMPLEMENTS( |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
310 | dialog->protocol, get_account_text_table)) { |
|
33088
25315e6176cd
Fix a crash in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33087
diff
changeset
|
311 | return FALSE; |
|
25315e6176cd
Fix a crash in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33087
diff
changeset
|
312 | } |
|
25315e6176cd
Fix a crash in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33087
diff
changeset
|
313 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
314 | table = purple_protocol_iface_get_account_text_table(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
|
315 | 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
|
316 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
317 | if(!strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), 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
|
318 | gtk_entry_set_text(GTK_ENTRY(widget), ""); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
319 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
320 | gtk_widget_override_color(widget, GTK_STATE_NORMAL, NULL); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
321 | #else |
|
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
|
322 | gtk_widget_modify_text(widget, GTK_STATE_NORMAL,NULL); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
323 | #endif |
|
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
|
324 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
325 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
326 | 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
|
327 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
328 | return FALSE; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
329 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
330 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
331 | static gboolean |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
332 | username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, 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
|
333 | { |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
334 | GHashTable *table = NULL; |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
335 | const char *label = NULL; |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
336 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
337 | if(PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, get_account_text_table)) { |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
338 | table = purple_protocol_iface_get_account_text_table(dialog->protocol, NULL); |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
339 | label = g_hash_table_lookup(table, "login_label"); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
340 | |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
341 | if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
342 | /* We have to avoid hitting the username_changed_cb function |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
343 | * because it enables buttons we don't want enabled yet ;) |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
344 | */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
345 | g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
346 | gtk_entry_set_text(GTK_ENTRY(widget), label); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
347 | /* Make sure we can hit it again */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
348 | g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
349 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
350 | gtk_widget_override_color(widget, GTK_STATE_NORMAL, &dialog->username_entry_hint_color); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
351 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
352 | gtk_widget_modify_text(widget, GTK_STATE_NORMAL, dialog->username_entry_hint_color); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
353 | #endif |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
354 | } |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
355 | |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
356 | g_hash_table_destroy(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
|
357 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
358 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
359 | return FALSE; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
360 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
361 | |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
362 | static gboolean |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
363 | username_themechange_cb(GObject *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
364 | { |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
365 | GHashTable *table; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
366 | const char *label, *text; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
367 | char *temp_text = NULL; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
368 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
369 | GtkStyleContext *context; |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
370 | GtkBorder border; |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
371 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
372 | GtkStyle *style; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
373 | const GtkBorder *border = NULL; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
374 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
375 | gint xsize; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
376 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
377 | table = purple_protocol_iface_get_account_text_table(dialog->protocol, NULL); |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
378 | label = g_hash_table_lookup(table, "login_label"); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
379 | text = gtk_entry_get_text(GTK_ENTRY(widget)); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
380 | |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
381 | g_signal_handlers_block_by_func(widget, G_CALLBACK(username_themechange_cb), dialog); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
382 | g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
383 | if (strcmp(text, label)) { |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
384 | temp_text = g_strdup(text); |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
385 | gtk_entry_set_text(GTK_ENTRY(widget), label); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
386 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
387 | gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
388 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
389 | gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
390 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
391 | } |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
392 | |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
393 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
394 | context = gtk_widget_get_style_context(dialog->username_entry); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
395 | gtk_style_context_get_color(context, GTK_STATE_FLAG_INSENSITIVE, |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
396 | &dialog->username_entry_hint_color); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
397 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
398 | style = gtk_rc_get_style(dialog->username_entry); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
399 | dialog->username_entry_hint_color = &(style->fg[GTK_STATE_INSENSITIVE]); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
400 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
401 | |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
402 | pango_layout_get_pixel_size(gtk_entry_get_layout(GTK_ENTRY(widget)), &xsize, NULL); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
403 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
404 | gtk_style_context_get_margin(context, GTK_STATE_FLAG_NORMAL, &border); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
405 | xsize += border.left + border.right; |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
406 | gtk_style_context_get_padding(context, GTK_STATE_FLAG_NORMAL, &border); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
407 | xsize += border.left + border.right; |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
408 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
409 | xsize += 2 * style->xthickness; |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
410 | gtk_style_get(style, GTK_TYPE_ENTRY, "inner-border", &border, NULL); |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
411 | if (border) |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
412 | xsize += border->left + border->right; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
413 | else |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
414 | xsize += 4; /* 2 * default inner-border */ |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
415 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
416 | gtk_widget_set_size_request(GTK_WIDGET(widget), xsize, -1); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
417 | if (temp_text) { |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
418 | gtk_entry_set_text(GTK_ENTRY(widget), temp_text); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
419 | g_free(temp_text); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
420 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
421 | gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
422 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
423 | gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, NULL); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
424 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
425 | } else |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
426 | #if GTK_CHECK_VERSION(3,0,0) |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
427 | gtk_widget_override_color(GTK_WIDGET(widget), GTK_STATE_NORMAL, &dialog->username_entry_hint_color); |
|
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
428 | #else |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
429 | gtk_widget_modify_text(GTK_WIDGET(widget), GTK_STATE_NORMAL, dialog->username_entry_hint_color); |
|
33704
9abf92629647
Implement a GTK3 version of the placeholder text.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33703
diff
changeset
|
430 | #endif |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
431 | |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
432 | g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_themechange_cb), dialog); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
433 | g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
434 | g_hash_table_destroy(table); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
435 | |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
436 | return FALSE; |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
437 | } |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
438 | #endif |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
439 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
440 | static void |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
441 | register_button_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
442 | { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
443 | 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
|
444 | GTK_TOGGLE_BUTTON(dialog->register_button)); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
445 | 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
|
446 | (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
|
447 | 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
|
448 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
449 | #if !GTK_CHECK_VERSION(3,2,0) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
450 | /* get rid of login_label in username field */ |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
451 | username_focus_cb(dialog->username_entry, NULL, dialog); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
452 | #endif |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
453 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
454 | if (register_noscreenname) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
455 | gtk_entry_set_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
|
456 | gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), ""); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
457 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check), FALSE); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
458 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
459 | 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
|
460 | gtk_widget_set_sensitive(dialog->password_entry, !register_noscreenname); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
461 | gtk_widget_set_sensitive(dialog->remember_pass_check, !register_noscreenname); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
462 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
463 | if (dialog->ok_button) { |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
464 | 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
|
465 | (opt_noscreenname && register_checked) || |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
466 | *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
|
467 | != '\0'); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
468 | } |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
469 | |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
470 | #if !GTK_CHECK_VERSION(3,2,0) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
471 | username_nofocus_cb(dialog->username_entry, NULL, dialog); |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
472 | #endif |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
473 | } |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
474 | |
|
33057
26ce49409c17
Fix handling of login_label connected with OPT_PROTO_REGISTER_NOSCREENNAME in account setup dialog
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33055
diff
changeset
|
475 | static void |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
476 | icon_filesel_choose_cb(const char *filename, gpointer data) |
| 5826 | 477 | { |
|
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
|
478 | 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
|
479 | |
|
14765
c5c0c325481d
[gaim-migrate @ 17455]
Mark Doliner <markdoliner@pidgin.im>
parents:
14764
diff
changeset
|
480 | 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
|
481 | { |
|
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
|
482 | size_t len; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
483 | 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
|
484 | 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
|
485 | } |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
486 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
487 | dialog->icon_filesel = NULL; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
488 | } |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
489 | |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
490 | static void |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
491 | icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
492 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
493 | dialog->icon_filesel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(dialog->window), icon_filesel_choose_cb, dialog); |
| 14195 | 494 | gtk_widget_show_all(dialog->icon_filesel); |
| 5826 | 495 | } |
| 496 | ||
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
497 | static void |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
498 | icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
| 5826 | 499 | { |
|
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
|
500 | set_dialog_icon(dialog, NULL, 0, NULL); |
| 9308 | 501 | } |
| 502 | ||
| 9314 | 503 | static void |
| 504 | account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, | |
| 505 | GtkSelectionData *sd, guint info, guint t, AccountPrefsDialog *dialog) | |
| 506 | { | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
507 | 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
|
508 | gint length = gtk_selection_data_get_length(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
509 | gint format = gtk_selection_data_get_format(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
510 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
511 | if ((length >= 0) && (format == 8)) { |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
512 | /* Well, it looks like the drag event was cool. |
| 9314 | 513 | * Let's do something with it */ |
| 514 | if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
| 515 | GError *converr = NULL; | |
| 516 | 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
|
517 | gpointer 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
|
518 | size_t 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
|
519 | |
|
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
|
520 | /* It looks like we're dealing with a local file. */ |
| 9314 | 521 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
| 15884 | 522 | purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n", |
| 9314 | 523 | (converr ? converr->message : |
| 524 | "g_filename_from_uri error")); | |
| 525 | return; | |
| 526 | } | |
| 527 | if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) | |
| 528 | *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
|
529 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
530 | 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
|
531 | /* 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
|
532 | set_dialog_icon(dialog, data, len, tmp); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
533 | } |
| 9314 | 534 | gtk_drag_finish(dc, TRUE, FALSE, t); |
| 535 | } | |
| 536 | gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 537 | } | |
| 538 | ||
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
539 | static void |
| 15884 | 540 | update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
541 | { |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
542 | GtkStyle *style; |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
543 | gboolean set; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
544 | GList *l; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
545 | |
|
12843
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
546 | if (dialog->account == NULL) |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
547 | return; |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
548 | |
| 15884 | 549 | 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
|
550 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
551 | |
| 15884 | 552 | 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
|
553 | 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
|
554 | gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
555 | style = set ? NULL : gtk_widget_get_style(dialog->username_entry); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
556 | gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL, |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
557 | style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
558 | |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
559 | for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
560 | 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
|
561 | gtk_editable_set_editable(GTK_EDITABLE(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
|
562 | style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data)); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
563 | gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL, |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
564 | style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
565 | } else { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
566 | 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
|
567 | } |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
568 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
569 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
570 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
571 | static void |
| 5774 | 572 | add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
573 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
574 | 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
|
575 | GtkWidget *hbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
576 | GtkWidget *vbox; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
577 | GtkWidget *entry; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
578 | GList *user_splits; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
579 | GList *l, *l2; |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
580 | char *username = NULL; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
581 | |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
582 | 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
|
583 | { |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
584 | 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
|
585 | 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
|
586 | 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
|
587 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
588 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
589 | if (dialog->login_frame != NULL) |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
590 | gtk_widget_destroy(dialog->login_frame); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
591 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
592 | /* Build the login options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
593 | frame = pidgin_make_frame(parent, _("Login Options")); |
|
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 | /* cringe */ |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
596 | 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
|
597 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
598 | 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
|
599 | gtk_widget_show(dialog->login_frame); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
600 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
601 | /* Main vbox */ |
| 15882 | 602 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
603 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
604 | gtk_widget_show(vbox); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
605 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
606 | /* Protocol */ |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
607 | 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
|
608 | { |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
609 | dialog->protocol_menu = pidgin_protocol_option_menu_new( |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
610 | dialog->protocol_id, G_CALLBACK(set_account_protocol_cb), dialog); |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
611 | 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
|
612 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
613 | |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
614 | 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
|
615 | 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
|
616 | |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
617 | g_object_unref(G_OBJECT(dialog->protocol_menu)); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
618 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
619 | /* Username */ |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
620 | dialog->username_entry = gtk_entry_new(); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
621 | 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
|
622 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
623 | add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
624 | |
|
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
|
625 | 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
|
626 | 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
|
627 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
628 | if (!username && dialog->protocol |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
629 | && PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, 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
|
630 | 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
|
631 | const char *label; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
632 | table = purple_protocol_iface_get_account_text_table(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
|
633 | 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
|
634 | |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
635 | #if GTK_CHECK_VERSION(3,2,0) |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
636 | 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
|
637 | #else |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
638 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), label); |
|
33701
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
639 | username_themechange_cb(G_OBJECT(dialog->username_entry), NULL, dialog); |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
640 | g_signal_connect(G_OBJECT(dialog->username_entry), "style-set", |
|
408990fbee7b
Make the username_entry hint fully visible.
Stanislav Brabec <sbrabec@suse.cz>
parents:
33697
diff
changeset
|
641 | G_CALLBACK(username_themechange_cb), dialog); |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
642 | g_signal_connect(G_OBJECT(dialog->username_entry), "focus-in-event", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
643 | G_CALLBACK(username_focus_cb), dialog); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
644 | g_signal_connect(G_OBJECT(dialog->username_entry), "focus-out-event", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
645 | G_CALLBACK(username_nofocus_cb), dialog); |
|
33705
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
646 | #endif |
|
777039ec6a98
Use the builtin placeholder function on GTK3.2.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33704
diff
changeset
|
647 | |
|
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
|
648 | 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
|
649 | } |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
650 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
651 | 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
|
652 | G_CALLBACK(username_changed_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
653 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
654 | /* Do the user split thang */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
655 | if (dialog->protocol == NULL) |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
656 | user_splits = NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
657 | else |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
658 | user_splits = purple_protocol_get_user_splits(dialog->protocol); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
659 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
660 | if (dialog->user_split_entries != NULL) { |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
661 | g_list_free(dialog->user_split_entries); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
662 | dialog->user_split_entries = NULL; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
663 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
664 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
665 | for (l = user_splits; l != NULL; l = l->next) { |
| 15884 | 666 | PurpleAccountUserSplit *split = l->data; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
667 | char *buf; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
668 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
669 | buf = g_strdup_printf("_%s:", purple_account_user_split_get_text(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
670 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
671 | entry = gtk_entry_new(); |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
672 | |
| 5774 | 673 | add_pref_box(dialog, vbox, buf, entry); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
674 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
675 | g_free(buf); |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
676 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
677 | dialog->user_split_entries = |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
678 | g_list_append(dialog->user_split_entries, entry); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
679 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
680 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
681 | for (l = g_list_last(dialog->user_split_entries), |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
682 | l2 = g_list_last(user_splits); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
683 | l != NULL && l2 != NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
684 | l = l->prev, l2 = l2->prev) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
685 | |
|
5708
43f6fbb894d5
[gaim-migrate @ 6129]
Christian Hammond <chipx86@chipx86.com>
parents:
5705
diff
changeset
|
686 | GtkWidget *entry = l->data; |
| 15884 | 687 | 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
|
688 | const char *value = NULL; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
689 | char *c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
690 | |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
691 | if (dialog->account != 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
|
692 | 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
|
693 | 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
|
694 | 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
|
695 | 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
|
696 | c = strchr(username, |
| 15884 | 697 | purple_account_user_split_get_separator(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
698 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
699 | if (c != NULL) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
700 | *c = '\0'; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
701 | c++; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
702 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
703 | value = c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
704 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
705 | } |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
706 | if (value == NULL) |
| 15884 | 707 | value = purple_account_user_split_get_default_value(split); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
708 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
709 | if (value != NULL) |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
710 | gtk_entry_set_text(GTK_ENTRY(entry), value); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
711 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
712 | |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
713 | 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
|
714 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), username); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
715 | |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
716 | g_free(username); |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
717 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
718 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
719 | /* Password */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
720 | dialog->password_entry = gtk_entry_new(); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
721 | gtk_entry_set_visibility(GTK_ENTRY(dialog->password_entry), FALSE); |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
722 | dialog->password_box = add_pref_box(dialog, vbox, _("_Password:"), |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
723 | dialog->password_entry); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
724 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
725 | /* Remember Password */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
726 | dialog->remember_pass_check = |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
727 | gtk_check_button_new_with_mnemonic(_("Remember pass_word")); |
|
5783
0f26dee8622e
[gaim-migrate @ 6208]
Christian Hammond <chipx86@chipx86.com>
parents:
5782
diff
changeset
|
728 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->remember_pass_check), |
|
7810
63e622ceacf1
[gaim-migrate @ 8457]
Mark Doliner <markdoliner@pidgin.im>
parents:
7762
diff
changeset
|
729 | FALSE); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
730 | gtk_box_pack_start(GTK_BOX(vbox), dialog->remember_pass_check, |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
731 | FALSE, FALSE, 0); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
732 | gtk_widget_show(dialog->remember_pass_check); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
733 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
734 | /* Set the fields. */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
735 | if (dialog->account != NULL) { |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
736 | if (dialog->password && purple_account_get_remember_password( |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
737 | dialog->account)) { |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
738 | gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), |
|
34019
bc87f596bb4c
compile, appears to work too.
Ka-Hing Cheung <khc@pidgin.im>
parents:
34018
diff
changeset
|
739 | dialog->password); |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
740 | } |
| 15884 | 741 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
742 | gtk_toggle_button_set_active( |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
743 | GTK_TOGGLE_BUTTON(dialog->remember_pass_check), |
| 15884 | 744 | purple_account_get_remember_password(dialog->account)); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
745 | } |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
746 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
747 | if (dialog->protocol != NULL && |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
748 | (purple_protocol_get_options(dialog->protocol) & OPT_PROTO_NO_PASSWORD)) { |
|
5662
e938bbeef62c
[gaim-migrate @ 6076]
Christian Hammond <chipx86@chipx86.com>
parents:
5661
diff
changeset
|
749 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
750 | gtk_widget_hide(dialog->password_box); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
751 | gtk_widget_hide(dialog->remember_pass_check); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
752 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
753 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
754 | /* 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
|
755 | update_editable(NULL, dialog); |
| 15884 | 756 | 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
|
757 | G_CALLBACK(update_editable), dialog); |
| 15884 | 758 | 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
|
759 | G_CALLBACK(update_editable), dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
760 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
761 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
762 | static void |
| 14195 | 763 | icon_check_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
| 764 | { | |
| 765 | gtk_widget_set_sensitive(dialog->icon_hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); | |
| 766 | } | |
| 767 | ||
| 768 | static void | |
| 5774 | 769 | add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
770 | { |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
771 | GtkWidget *frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
772 | GtkWidget *vbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
773 | GtkWidget *vbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
774 | GtkWidget *hbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
775 | GtkWidget *hbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
776 | GtkWidget *button; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
777 | GtkWidget *label; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
778 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
779 | if (dialog->user_frame != NULL) |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
780 | gtk_widget_destroy(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
781 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
782 | /* Build the user options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
783 | frame = pidgin_make_frame(parent, _("User Options")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
784 | 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
|
785 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
786 | gtk_box_reorder_child(GTK_BOX(parent), dialog->user_frame, 1); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
787 | gtk_widget_show(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
788 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
789 | /* Main vbox */ |
| 15882 | 790 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
791 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
792 | gtk_widget_show(vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
793 | |
|
22933
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
794 | /* Alias */ |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
795 | 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
|
796 | 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
|
797 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
798 | /* New mail notifications */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
799 | dialog->new_mail_check = |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
800 | gtk_check_button_new_with_mnemonic(_("New _mail notifications")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
801 | gtk_box_pack_start(GTK_BOX(vbox), dialog->new_mail_check, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
802 | gtk_widget_show(dialog->new_mail_check); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
803 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
804 | /* 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
|
805 | dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); |
| 14195 | 806 | g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); |
| 807 | gtk_widget_show(dialog->icon_check); | |
| 808 | gtk_box_pack_start(GTK_BOX(vbox), dialog->icon_check, FALSE, FALSE, 0); | |
| 809 | ||
| 15882 | 810 | dialog->icon_hbox = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 14195 | 811 | 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
|
812 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
813 | gtk_widget_show(hbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
814 | |
| 14195 | 815 | label = gtk_label_new(" "); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
816 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
817 | gtk_widget_show(label); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
818 | |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
819 | button = gtk_button_new(); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
820 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
821 | gtk_widget_show(button); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
822 | g_signal_connect(G_OBJECT(button), "clicked", |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
823 | G_CALLBACK(icon_select_cb), dialog); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
824 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
825 | dialog->icon_entry = gtk_image_new(); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
826 | gtk_container_add(GTK_CONTAINER(button), dialog->icon_entry); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
827 | gtk_widget_show(dialog->icon_entry); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
828 | /* TODO: Uh, isn't this next line pretty useless? */ |
| 15568 | 829 | pidgin_set_accessible_label (dialog->icon_entry, label); |
|
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
|
830 | purple_imgstore_unref(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
|
831 | dialog->icon_img = NULL; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
832 | |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
833 | vbox2 = gtk_vbox_new(FALSE, 0); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
834 | gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
835 | gtk_widget_show(vbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
836 | |
| 15882 | 837 | hbox2 = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 838 | gtk_box_pack_start(GTK_BOX(vbox2), hbox2, FALSE, FALSE, PIDGIN_HIG_BORDER); | |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
839 | gtk_widget_show(hbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
840 | |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
841 | button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
| 5826 | 842 | g_signal_connect(G_OBJECT(button), "clicked", |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
843 | G_CALLBACK(icon_reset_cb), dialog); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
844 | 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
|
845 | gtk_widget_show(button); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
846 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
847 | if (dialog->protocol != NULL) { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
848 | PurpleBuddyIconSpec *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
|
849 | if (!(purple_protocol_get_options(dialog->protocol) & OPT_PROTO_MAIL_CHECK)) |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
850 | gtk_widget_hide(dialog->new_mail_check); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
851 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
852 | 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
|
853 | gtk_widget_hide(dialog->icon_check); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
854 | gtk_widget_hide(dialog->icon_hbox); |
| 19773 | 855 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
856 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
857 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
858 | if (dialog->account != 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
|
859 | PurpleStoredImage *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
|
860 | 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
|
861 | 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
|
862 | |
|
34589
428e92c79631
Renamed purple_account_[get,set]_alias to purple_account[get,set]_private_alias.
Ankit Vani <a@nevitus.org>
parents:
34586
diff
changeset
|
863 | 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
|
864 | 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
|
865 | 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
|
866 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
867 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), |
| 15884 | 868 | purple_account_get_check_mail(dialog->account)); |
|
14670
011e0da9c2a8
[gaim-migrate @ 17336]
Mark Doliner <markdoliner@pidgin.im>
parents:
14625
diff
changeset
|
869 | |
| 14195 | 870 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), |
| 15884 | 871 | !purple_account_get_bool(dialog->account, "use-global-buddyicon", |
| 14195 | 872 | 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
|
873 | |
|
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
|
874 | 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
|
875 | 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
|
876 | { |
|
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
|
877 | len = purple_imgstore_get_size(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
|
878 | data = g_memdup(purple_imgstore_get_data(img), 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
|
879 | } |
|
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
|
880 | 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
|
881 | 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
|
882 | } 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
|
883 | set_dialog_icon(dialog, NULL, 0, NULL); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
884 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
885 | |
|
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
|
886 | #if 0 |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
887 | if (!dialog->protocol || |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
888 | (!(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
|
889 | (purple_protocol_get_icon_spec(dialog->protocol).format == NULL))) { |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
890 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
891 | /* Nothing to see :( aww. */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
892 | gtk_widget_hide(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
893 | } |
|
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
|
894 | #endif |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
895 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
896 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
897 | static void |
|
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
|
898 | add_protocol_options(AccountPrefsDialog *dialog) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
899 | { |
| 15884 | 900 | PurpleAccountOption *option; |
| 901 | PurpleAccount *account; | |
|
32932
0672f4626f75
Replace Facebook's UI hack for default connection security.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32931
diff
changeset
|
902 | GtkWidget *vbox, *check, *entry, *combo; |
|
18190
bcf28ef7e8ff
Re-fix the DBus list handling code by killing const GList* / const GSList*
Richard Laager <rlaager@pidgin.im>
parents:
18186
diff
changeset
|
903 | GList *list, *node; |
| 12185 | 904 | gint i, idx, int_value; |
| 12106 | 905 | GtkListStore *model; |
| 906 | GtkTreeIter iter; | |
| 907 | GtkCellRenderer *renderer; | |
| 15884 | 908 | PurpleKeyValuePair *kvp; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
909 | GList *l; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
910 | char buf[1024]; |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
911 | 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
|
912 | const char *str_value; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
913 | 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
|
914 | ProtocolOptEntry *opt_entry; |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
915 | const GSList *str_hints; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
916 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
917 | 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
|
918 | gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1); |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
919 | dialog->protocol_frame = NULL; |
|
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
920 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
921 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
922 | while (dialog->protocol_opt_entries != NULL) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
923 | ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
924 | 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
|
925 | 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
|
926 | dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, dialog->protocol_opt_entries); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
927 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
928 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
929 | if (dialog->protocol == NULL || |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
930 | purple_protocol_get_protocol_options(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
|
931 | return; |
|
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
932 | |
|
5690
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
933 | account = dialog->account; |
|
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
934 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
935 | /* Main vbox */ |
|
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
|
936 | dialog->protocol_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
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
|
937 | gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER); |
|
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
|
938 | 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
|
939 | gtk_label_new_with_mnemonic(_("Ad_vanced")), 1); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
940 | gtk_widget_show(vbox); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
941 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
942 | for (l = purple_protocol_get_protocol_options(dialog->protocol); l != NULL; l = l->next) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
943 | { |
| 15884 | 944 | option = (PurpleAccountOption *)l->data; |
| 945 | ||
|
25450
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 = g_new0(ProtocolOptEntry, 1); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
947 | opt_entry->type = purple_account_option_get_type(option); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
948 | 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
|
949 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
950 | switch (opt_entry->type) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
951 | { |
| 15884 | 952 | case PURPLE_PREF_BOOLEAN: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
953 | if (account == NULL || |
| 15884 | 954 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
955 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
956 | { |
| 15884 | 957 | bool_value = purple_account_option_get_default_bool(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
958 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
959 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
960 | { |
| 15884 | 961 | bool_value = purple_account_get_bool(account, |
| 962 | purple_account_option_get_setting(option), | |
| 963 | purple_account_option_get_default_bool(option)); | |
| 7956 | 964 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
965 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
966 | 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
|
967 | 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
|
968 | g_free(tmp); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
969 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
970 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
971 | bool_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
972 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
973 | gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
974 | gtk_widget_show(check); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
975 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
976 | |
| 15884 | 977 | case PURPLE_PREF_INT: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
978 | if (account == NULL || |
| 15884 | 979 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
980 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
981 | { |
| 15884 | 982 | int_value = purple_account_option_get_default_int(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
983 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
984 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
985 | { |
| 15884 | 986 | int_value = purple_account_get_int(account, |
| 987 | purple_account_option_get_setting(option), | |
| 988 | purple_account_option_get_default_int(option)); | |
| 7956 | 989 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
990 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
991 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
992 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
993 | opt_entry->widget = entry = gtk_entry_new(); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
994 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
995 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
996 | title = g_strdup_printf("_%s:", |
| 15884 | 997 | purple_account_option_get_text(option)); |
| 5774 | 998 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
999 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1000 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1001 | |
| 15884 | 1002 | case PURPLE_PREF_STRING: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1003 | if (account == NULL || |
| 15884 | 1004 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1005 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1006 | { |
| 15884 | 1007 | str_value = purple_account_option_get_default_string(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1008 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1009 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1010 | { |
| 15884 | 1011 | str_value = purple_account_get_string(account, |
| 1012 | purple_account_option_get_setting(option), | |
| 1013 | purple_account_option_get_default_string(option)); | |
| 7956 | 1014 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1015 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1016 | 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
|
1017 | if (str_hints) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1018 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1019 | const GSList *hint_it = str_hints; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1020 | 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
|
1021 | while (hint_it) |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1022 | { |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1023 | const gchar *hint = hint_it->data; |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1024 | hint_it = g_slist_next(hint_it); |
|
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1025 | 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
|
1026 | hint); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1027 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1028 | } |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1029 | else |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1030 | entry = gtk_entry_new(); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1031 | |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1032 | opt_entry->widget = entry; |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1033 | 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
|
1034 | g_warn_if_reached(); |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1035 | else if (purple_account_option_string_get_masked(option)) |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
1036 | { |
|
10658
6223ea383921
[gaim-migrate @ 12190]
Richard Laager <rlaager@pidgin.im>
parents:
10649
diff
changeset
|
1037 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
1038 | } |
|
5663
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
1039 | |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1040 | if (str_value != NULL && str_hints) |
|
33268
a24713d9bbb3
Fix GTK+3 compile.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33267
diff
changeset
|
1041 | 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
|
1042 | str_value); |
|
33267
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1043 | else |
|
5663
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
1044 | gtk_entry_set_text(GTK_ENTRY(entry), str_value); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1045 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
1046 | title = g_strdup_printf("_%s:", |
| 15884 | 1047 | purple_account_option_get_text(option)); |
| 5774 | 1048 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1049 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1050 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1051 | |
| 15884 | 1052 | case PURPLE_PREF_STRING_LIST: |
| 12106 | 1053 | i = 0; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
1054 | idx = 0; |
| 12106 | 1055 | |
| 1056 | if (account == NULL || | |
| 15884 | 1057 | strcmp(purple_account_get_protocol_id(account), |
| 12106 | 1058 | dialog->protocol_id)) |
| 1059 | { | |
| 15884 | 1060 | str_value = purple_account_option_get_default_list_value(option); |
| 12106 | 1061 | } |
| 1062 | else | |
| 1063 | { | |
| 15884 | 1064 | str_value = purple_account_get_string(account, |
| 1065 | purple_account_option_get_setting(option), | |
| 1066 | purple_account_option_get_default_list_value(option)); | |
| 12106 | 1067 | } |
| 1068 | ||
| 15884 | 1069 | list = purple_account_option_get_list(option); |
| 12106 | 1070 | 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
|
1071 | opt_entry->widget = combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); |
| 12106 | 1072 | |
| 15884 | 1073 | /* Loop through list of PurpleKeyValuePair items */ |
| 12106 | 1074 | for (node = list; node != NULL; node = node->next) { |
| 1075 | if (node->data != NULL) { | |
| 15884 | 1076 | kvp = (PurpleKeyValuePair *) node->data; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
1077 | if ((kvp->value != NULL) && (str_value != NULL) && |
|
15080
bb09a291a99b
[gaim-migrate @ 17800]
Daniel Atallah <datallah@pidgin.im>
parents:
15054
diff
changeset
|
1078 | !g_utf8_collate(kvp->value, str_value)) |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
1079 | idx = i; |
| 12106 | 1080 | |
| 1081 | gtk_list_store_append(model, &iter); | |
| 1082 | gtk_list_store_set(model, &iter, | |
| 1083 | 0, kvp->key, | |
| 1084 | 1, kvp->value, | |
| 1085 | -1); | |
| 1086 | } | |
| 1087 | ||
| 1088 | i++; | |
| 1089 | } | |
| 1090 | ||
| 1091 | /* Set default */ | |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
1092 | gtk_combo_box_set_active(GTK_COMBO_BOX(combo), idx); |
| 12106 | 1093 | |
| 1094 | /* Define renderer */ | |
| 1095 | renderer = gtk_cell_renderer_text_new(); | |
| 1096 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, | |
| 1097 | TRUE); | |
| 1098 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), | |
| 1099 | renderer, "text", 0, NULL); | |
| 1100 | ||
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
1101 | title = g_strdup_printf("_%s:", |
| 15884 | 1102 | purple_account_option_get_text(option)); |
| 12106 | 1103 | add_pref_box(dialog, vbox, title, combo); |
| 1104 | g_free(title); | |
| 1105 | break; | |
| 1106 | ||
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1107 | 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
|
1108 | 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
|
1109 | 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
|
1110 | 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
|
1111 | 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
|
1112 | continue; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1113 | } |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1114 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1115 | 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
|
1116 | 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
|
1117 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1118 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1119 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1120 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1121 | static GtkWidget * |
| 5774 | 1122 | make_proxy_dropdown(void) |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1123 | { |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1124 | GtkWidget *dropdown; |
| 8555 | 1125 | GtkListStore *model; |
| 1126 | GtkTreeIter iter; | |
| 1127 | GtkCellRenderer *renderer; | |
| 1128 | ||
| 1129 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); | |
| 1130 | dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); | |
| 1131 | ||
| 1132 | gtk_list_store_append(model, &iter); | |
| 1133 | gtk_list_store_set(model, &iter, | |
| 15884 | 1134 | 0, purple_running_gnome() ? _("Use GNOME Proxy Settings") |
| 15109 | 1135 | :_("Use Global Proxy Settings"), |
| 15884 | 1136 | 1, PURPLE_PROXY_USE_GLOBAL, |
| 8555 | 1137 | -1); |
| 1138 | ||
| 1139 | gtk_list_store_append(model, &iter); | |
| 1140 | gtk_list_store_set(model, &iter, | |
| 1141 | 0, _("No Proxy"), | |
| 15884 | 1142 | 1, PURPLE_PROXY_NONE, |
| 8555 | 1143 | -1); |
| 1144 | ||
| 1145 | gtk_list_store_append(model, &iter); | |
| 1146 | gtk_list_store_set(model, &iter, | |
| 1147 | 0, _("SOCKS 4"), | |
| 15884 | 1148 | 1, PURPLE_PROXY_SOCKS4, |
| 8555 | 1149 | -1); |
| 1150 | ||
| 1151 | gtk_list_store_append(model, &iter); | |
| 1152 | gtk_list_store_set(model, &iter, | |
| 1153 | 0, _("SOCKS 5"), | |
| 15884 | 1154 | 1, PURPLE_PROXY_SOCKS5, |
| 8555 | 1155 | -1); |
| 1156 | ||
| 1157 | gtk_list_store_append(model, &iter); | |
| 1158 | 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
|
1159 | 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
|
1160 | 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
|
1161 | -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
|
1162 | |
|
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
|
1163 | 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
|
1164 | 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
|
1165 | 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
|
1166 | 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
|
1167 | -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
|
1168 | |
|
cec02d1d1c13
Fix account-specific proxy config GUI to use same ordering as global proxy GUI.
Daniel Atallah <datallah@pidgin.im>
parents:
31733
diff
changeset
|
1169 | 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
|
1170 | gtk_list_store_set(model, &iter, |
| 8555 | 1171 | 0, _("Use Environmental Settings"), |
| 15884 | 1172 | 1, PURPLE_PROXY_USE_ENVVAR, |
| 8555 | 1173 | -1); |
| 1174 | ||
| 1175 | renderer = gtk_cell_renderer_text_new(); | |
| 1176 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); | |
| 1177 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, | |
| 1178 | "text", 0, NULL); | |
| 1179 | ||
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1180 | return dropdown; |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1181 | } |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1182 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1183 | static void |
| 8555 | 1184 | proxy_type_changed_cb(GtkWidget *menu, AccountPrefsDialog *dialog) |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1185 | { |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1186 | GtkTreeIter iter; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1187 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1188 | 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
|
1189 | 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
|
1190 | 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
|
1191 | 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
|
1192 | 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
|
1193 | } |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1194 | |
| 15884 | 1195 | if (dialog->new_proxy_type == PURPLE_PROXY_USE_GLOBAL || |
| 1196 | dialog->new_proxy_type == PURPLE_PROXY_NONE || | |
| 1197 | dialog->new_proxy_type == PURPLE_PROXY_USE_ENVVAR) { | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1198 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1199 | gtk_widget_hide(dialog->proxy_vbox); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1200 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1201 | else |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1202 | gtk_widget_show_all(dialog->proxy_vbox); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1203 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1204 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1205 | static void |
| 5774 | 1206 | port_popup_cb(GtkWidget *w, GtkMenu *menu, gpointer data) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1207 | { |
|
13702
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1208 | GtkWidget *item1; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1209 | GtkWidget *item2; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1210 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1211 | /* This is an easter egg. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1212 | It means one of two things, both intended as humourus: |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1213 | 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
|
1214 | look at butterflies. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1215 | 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
|
1216 | 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
|
1217 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1218 | /* 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
|
1219 | 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
|
1220 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1221 | gtk_widget_show(item1); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1222 | gtk_widget_show(item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1223 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1224 | /* Prepend these in reverse order so they appear correctly. */ |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1225 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1226 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item1); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1227 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1228 | |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1229 | static void |
| 5774 | 1230 | add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1231 | { |
| 15884 | 1232 | PurpleProxyInfo *proxy_info; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1233 | GtkWidget *vbox; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1234 | 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
|
1235 | GtkTreeIter iter; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1236 | GtkTreeModel *proxy_model; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1237 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1238 | if (dialog->proxy_frame != NULL) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1239 | gtk_widget_destroy(dialog->proxy_frame); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1240 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1241 | /* Main vbox */ |
|
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
|
1242 | dialog->proxy_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
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
|
1243 | gtk_container_add(GTK_CONTAINER(parent), vbox); |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1244 | gtk_widget_show(vbox); |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1245 | |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1246 | /* Proxy Type drop-down. */ |
| 5774 | 1247 | dialog->proxy_dropdown = make_proxy_dropdown(); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1248 | |
| 5774 | 1249 | add_pref_box(dialog, vbox, _("Proxy _type:"), dialog->proxy_dropdown); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1250 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1251 | /* Setup the second vbox, which may be hidden at times. */ |
| 15882 | 1252 | dialog->proxy_vbox = vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 1253 | gtk_box_pack_start(GTK_BOX(vbox), vbox2, FALSE, FALSE, PIDGIN_HIG_BORDER); | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1254 | gtk_widget_show(vbox2); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1255 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1256 | /* Host */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1257 | dialog->proxy_host_entry = gtk_entry_new(); |
| 5774 | 1258 | add_pref_box(dialog, vbox2, _("_Host:"), dialog->proxy_host_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1259 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1260 | /* Port */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1261 | dialog->proxy_port_entry = gtk_entry_new(); |
| 5774 | 1262 | add_pref_box(dialog, vbox2, _("_Port:"), dialog->proxy_port_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1263 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1264 | g_signal_connect(G_OBJECT(dialog->proxy_port_entry), "populate-popup", |
| 5774 | 1265 | G_CALLBACK(port_popup_cb), NULL); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1266 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1267 | /* User */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1268 | dialog->proxy_user_entry = gtk_entry_new(); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1269 | |
| 5774 | 1270 | add_pref_box(dialog, vbox2, _("_Username:"), dialog->proxy_user_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1271 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1272 | /* Password */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1273 | dialog->proxy_pass_entry = gtk_entry_new(); |
|
5700
8a0df68ba664
[gaim-migrate @ 6121]
Christian Hammond <chipx86@chipx86.com>
parents:
5699
diff
changeset
|
1274 | gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE); |
| 5774 | 1275 | 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
|
1276 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1277 | if (dialog->account != NULL && |
| 15884 | 1278 | (proxy_info = purple_account_get_proxy_info(dialog->account)) != NULL) { |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1279 | const char *value; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1280 | int int_val; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1281 | |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1282 | dialog->new_proxy_type = purple_proxy_info_get_type(proxy_info); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1283 | |
| 15884 | 1284 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1285 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_host_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1286 | |
| 15884 | 1287 | 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
|
1288 | char buf[11]; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1289 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1290 | g_snprintf(buf, sizeof(buf), "%d", int_val); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1291 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1292 | 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
|
1293 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1294 | |
| 15884 | 1295 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1296 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_user_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1297 | |
| 15884 | 1298 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1299 | 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
|
1300 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1301 | } else |
| 15884 | 1302 | 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
|
1303 | |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1304 | 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
|
1305 | 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
|
1306 | 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
|
1307 | 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
|
1308 | do { |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1309 | 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
|
1310 | 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
|
1311 | 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
|
1312 | 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
|
1313 | break; |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1314 | } |
|
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1315 | } while(gtk_tree_model_iter_next(proxy_model, &iter)); |
|
6856
5ed6b8356ebc
[gaim-migrate @ 7401]
Mark Doliner <markdoliner@pidgin.im>
parents:
6751
diff
changeset
|
1316 | } |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1317 | |
|
31733
047a697778c3
Fix account-specific proxy selection GUI to not be dependent enum ordering.
Daniel Atallah <datallah@pidgin.im>
parents:
31677
diff
changeset
|
1318 | 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
|
1319 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1320 | /* Connect signals. */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1321 | g_signal_connect(G_OBJECT(dialog->proxy_dropdown), "changed", |
| 5774 | 1322 | G_CALLBACK(proxy_type_changed_cb), dialog); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1323 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1324 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1325 | static void |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1326 | 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
|
1327 | { |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1328 | #ifdef USE_VV |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1329 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, initiate_media)) { |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1330 | 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
|
1331 | 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
|
1332 | 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
|
1333 | 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
|
1334 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1335 | return; |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1336 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1337 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1338 | 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
|
1339 | dialog->voice_frame = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1340 | gtk_container_set_border_width(GTK_CONTAINER(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
|
1341 | PIDGIN_HIG_BORDER); |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1342 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1343 | 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
|
1344 | 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
|
1345 | 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
|
1346 | 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
|
1347 | |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1348 | 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
|
1349 | 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
|
1350 | 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
|
1351 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1352 | |
|
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
|
1353 | 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
|
1354 | 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
|
1355 | 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
|
1356 | } 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
|
1357 | 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
|
1358 | } |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1359 | #endif |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1360 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1361 | |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
1362 | static gboolean |
| 5774 | 1363 | account_win_destroy_cb(GtkWidget *w, GdkEvent *event, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1364 | AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1365 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1366 | g_hash_table_remove(account_pref_wins, dialog->account); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1367 | |
| 7450 | 1368 | gtk_widget_destroy(dialog->window); |
| 1369 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1370 | g_list_free(dialog->user_split_entries); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1371 | while (dialog->protocol_opt_entries != NULL) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1372 | ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1373 | 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
|
1374 | 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
|
1375 | dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, 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
|
1376 | } |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1377 | g_free(dialog->protocol_id); |
|
21123
7dbce8723eff
Fix a leak of a GtkSizeGroup.
Daniel Atallah <datallah@pidgin.im>
parents:
20228
diff
changeset
|
1378 | g_object_unref(dialog->sg); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1379 | |
|
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
|
1380 | purple_imgstore_unref(dialog->icon_img); |
|
10519
80801a34a246
[gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10432
diff
changeset
|
1381 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
1382 | if (dialog->icon_filesel) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
1383 | gtk_widget_destroy(dialog->icon_filesel); |
| 5826 | 1384 | |
| 15884 | 1385 | purple_signals_disconnect_by_handle(dialog); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
1386 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1387 | purple_str_wipe(dialog->password); |
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1388 | |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1389 | 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
|
1390 | return FALSE; |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1391 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1392 | |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1393 | static void |
| 5774 | 1394 | cancel_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1395 | { |
| 5774 | 1396 | account_win_destroy_cb(NULL, NULL, dialog); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1397 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1398 | |
|
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
|
1399 | static void |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1400 | 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
|
1401 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1402 | if (succeeded) |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1403 | { |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1404 | 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
|
1405 | 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
|
1406 | |
|
33055
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1407 | 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
|
1408 | 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
|
1409 | 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
|
1410 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1411 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1412 | else |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1413 | purple_accounts_delete(account); |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1414 | } |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1415 | |
|
c810d4c510f2
Fix registration dialog for protocols with REGISTER_NOSCREENNAME option
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
32932
diff
changeset
|
1416 | static void |
| 5774 | 1417 | ok_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1418 | { |
| 15884 | 1419 | PurpleProxyInfo *proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1420 | GList *l, *l2; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1421 | const char *value; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1422 | char *username; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1423 | 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
|
1424 | gboolean new_acct = FALSE, icon_change = FALSE; |
| 15884 | 1425 | PurpleAccount *account; |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1426 | gboolean remember; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1427 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1428 | |
|
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
|
1429 | /* 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
|
1430 | 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
|
1431 | |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1432 | 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
|
1433 | { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1434 | 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
|
1435 | 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
|
1436 | 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
|
1437 | 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
|
1438 | { |
|
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
|
1439 | 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
|
1440 | 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
|
1441 | 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
|
1442 | |
|
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
|
1443 | value = gtk_entry_get_text(entry); |
|
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
|
1444 | |
|
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
|
1445 | *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
|
1446 | |
|
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
|
1447 | 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
|
1448 | (*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
|
1449 | 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
|
1450 | 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
|
1451 | |
|
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
|
1452 | 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
|
1453 | 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
|
1454 | } |
|
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
|
1455 | } |
|
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
|
1456 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1457 | if (dialog->account == NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1458 | { |
|
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
|
1459 | if (purple_accounts_find(username, dialog->protocol_id) != 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
|
1460 | purple_debug_warning("gtkaccount", "Trying to add a duplicate %s account (%s).\n", |
|
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
|
1461 | dialog->protocol_id, 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
|
1462 | |
|
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
|
1463 | purple_notify_error(NULL, NULL, _("Unable to save new account"), |
|
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
|
1464 | _("An account already exists with the specified criteria.")); |
|
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
|
1465 | |
|
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
|
1466 | 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
|
1467 | 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
|
1468 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1469 | |
|
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
|
1470 | if (purple_accounts_get_all() == NULL) { |
|
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
|
1471 | /* We're adding our first account. Be polite and show the buddy list */ |
|
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
|
1472 | purple_blist_set_visible(TRUE); |
|
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
|
1473 | } |
|
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
|
1474 | |
|
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
|
1475 | 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
|
1476 | new_acct = TRUE; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1477 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1478 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1479 | { |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1480 | account = dialog->account; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1481 | |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1482 | /* Protocol */ |
| 15884 | 1483 | purple_account_set_protocol_id(account, dialog->protocol_id); |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1484 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1485 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1486 | /* Alias */ |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1487 | value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry)); |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1488 | |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1489 | 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
|
1490 | purple_account_set_private_alias(account, value); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1491 | 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
|
1492 | purple_account_set_private_alias(account, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1493 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1494 | /* Buddy Icon */ |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1495 | if (dialog->protocol != NULL) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1496 | 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
|
1497 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1498 | if (icon_spec && icon_spec->format != NULL) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1499 | { |
|
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
|
1500 | 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
|
1501 | |
|
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
|
1502 | 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
|
1503 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1504 | { |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1505 | icon_change = TRUE; |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1506 | } |
| 15884 | 1507 | 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
|
1508 | |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1509 | 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
|
1510 | { |
|
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
|
1511 | 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
|
1512 | { |
|
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
|
1513 | size_t len = purple_imgstore_get_size(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
|
1514 | purple_buddy_icons_set_account_icon(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
|
1515 | g_memdup(purple_imgstore_get_data(dialog->icon_img), 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
|
1516 | 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
|
1517 | purple_account_set_buddy_icon_path(account, purple_imgstore_get_filename(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
|
1518 | } |
|
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
|
1519 | 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
|
1520 | { |
|
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
|
1521 | 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
|
1522 | 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
|
1523 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1524 | } |
|
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
|
1525 | 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
|
1526 | { |
|
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
|
1527 | size_t len; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1528 | gpointer data = pidgin_convert_buddy_icon(dialog->protocol, filename, &len); |
| 15884 | 1529 | 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
|
1530 | purple_buddy_icons_set_account_icon(account, data, len); |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1531 | } |
| 14195 | 1532 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1533 | |
|
10432
da2df724be56
[gaim-migrate @ 11684]
Mark Doliner <markdoliner@pidgin.im>
parents:
10420
diff
changeset
|
1534 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1535 | /* Remember Password */ |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1536 | remember = gtk_toggle_button_get_active( |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1537 | GTK_TOGGLE_BUTTON(dialog->remember_pass_check)); |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1538 | if(!remember) |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
1539 | purple_keyring_set_password(account, NULL, NULL, NULL); |
|
33996
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1540 | |
|
ca5e901a5311
Implemented a password caching system to limit problems linked to the
Vivien Bernet-Rollande <scrouaf@soc.pidgin.im>
parents:
33995
diff
changeset
|
1541 | purple_account_set_remember_password(account, remember); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1542 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1543 | /* Check Mail */ |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1544 | if (dialog->protocol && purple_protocol_get_options(dialog->protocol) & OPT_PROTO_MAIL_CHECK) |
| 15884 | 1545 | purple_account_set_check_mail(account, |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1546 | gtk_toggle_button_get_active( |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1547 | GTK_TOGGLE_BUTTON(dialog->new_mail_check))); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1548 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1549 | /* Password */ |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1550 | value = gtk_entry_get_text(GTK_ENTRY(dialog->password_entry)); |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1551 | |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1552 | /* |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1553 | * We set the password if this is a new account because new accounts |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1554 | * will be set to online, and if the user has entered a password into |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1555 | * the account editor (but has not checked the 'save' box), then we |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1556 | * don't want to prompt them. |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1557 | */ |
|
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
|
1558 | if ((purple_account_get_remember_password(account) || new_acct) && (*value != '\0')) |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
1559 | purple_account_set_password(account, value, NULL, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1560 | else |
|
34029
059c1270db1f
Remove the silly destroy argument from purple_account_set_password and
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34028
diff
changeset
|
1561 | purple_account_set_password(account, NULL, NULL, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1562 | |
| 15884 | 1563 | purple_account_set_username(account, username); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1564 | g_free(username); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1565 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1566 | /* Add the protocol settings */ |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
1567 | 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
|
1568 | 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
|
1569 | 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
|
1570 | 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
|
1571 | 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
|
1572 | 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
|
1573 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1574 | 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
|
1575 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1576 | 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
|
1577 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1578 | switch (opt_entry->type) { |
| 15884 | 1579 | 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
|
1580 | 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
|
1581 | 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
|
1582 | else |
|
c3ee96290bfd
Account Options: hinted string options; fix perl plugins compilation
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
33170
diff
changeset
|
1583 | 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
|
1584 | purple_account_set_string(account, opt_entry->setting, value); |
| 7208 | 1585 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1586 | |
| 15884 | 1587 | 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
|
1588 | 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
|
1589 | purple_account_set_int(account, opt_entry->setting, int_value); |
| 7208 | 1590 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1591 | |
| 15884 | 1592 | case PURPLE_PREF_BOOLEAN: |
| 7208 | 1593 | 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
|
1594 | 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
|
1595 | purple_account_set_bool(account, opt_entry->setting, bool_value); |
| 7208 | 1596 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1597 | |
| 15884 | 1598 | case PURPLE_PREF_STRING_LIST: |
|
20228
ce019944d765
applied changes from 9d35dde0c779cca73548172223ba557f27d61882
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
1599 | 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
|
1600 | 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
|
1601 | 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
|
1602 | purple_account_set_string(account, opt_entry->setting, value2); |
| 12106 | 1603 | break; |
| 1604 | ||
| 7208 | 1605 | default: |
| 1606 | break; | |
| 1607 | } | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1608 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1609 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1610 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1611 | /* Set the proxy stuff. */ |
| 15884 | 1612 | proxy_info = purple_account_get_proxy_info(account); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1613 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1614 | /* Create the proxy info if it doesn't exist. */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1615 | if (proxy_info == NULL) { |
| 15884 | 1616 | proxy_info = purple_proxy_info_new(); |
| 1617 | purple_account_set_proxy_info(account, proxy_info); | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1618 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1619 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1620 | /* Set the proxy info type. */ |
| 15884 | 1621 | purple_proxy_info_set_type(proxy_info, dialog->new_proxy_type); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1622 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1623 | /* Host */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1624 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1625 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1626 | if (*value != '\0') |
| 15884 | 1627 | purple_proxy_info_set_host(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1628 | else |
| 15884 | 1629 | purple_proxy_info_set_host(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1630 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1631 | /* Port */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1632 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1633 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1634 | if (*value != '\0') |
| 15884 | 1635 | purple_proxy_info_set_port(proxy_info, atoi(value)); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1636 | else |
| 15884 | 1637 | purple_proxy_info_set_port(proxy_info, 0); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1638 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1639 | /* Username */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1640 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1641 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1642 | if (*value != '\0') |
| 15884 | 1643 | purple_proxy_info_set_username(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1644 | else |
| 15884 | 1645 | purple_proxy_info_set_username(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1646 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1647 | /* Password */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1648 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1649 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1650 | if (*value != '\0') |
| 15884 | 1651 | purple_proxy_info_set_password(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1652 | else |
| 15884 | 1653 | purple_proxy_info_set_password(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1654 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1655 | /* If there are no values set then proxy_info NULL */ |
| 15884 | 1656 | if ((purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_GLOBAL) && |
| 1657 | (purple_proxy_info_get_host(proxy_info) == NULL) && | |
| 1658 | (purple_proxy_info_get_port(proxy_info) == 0) && | |
| 1659 | (purple_proxy_info_get_username(proxy_info) == NULL) && | |
| 1660 | (purple_proxy_info_get_password(proxy_info) == NULL)) | |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1661 | { |
| 15884 | 1662 | purple_account_set_proxy_info(account, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1663 | proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1664 | } |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1665 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1666 | /* 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
|
1667 | 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
|
1668 | 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
|
1669 | 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
|
1670 | } |
|
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1671 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1672 | /* If this is a new account, add it to our list */ |
|
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
|
1673 | if (new_acct) |
| 15884 | 1674 | purple_accounts_add(account); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1675 | 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
|
1676 | purple_signal_emit(pidgin_accounts_get_handle(), "account-modified", account); |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1677 | |
|
11987
a6eb4a3f1136
[gaim-migrate @ 14280]
Mark Doliner <markdoliner@pidgin.im>
parents:
11986
diff
changeset
|
1678 | /* 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
|
1679 | 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
|
1680 | 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
|
1681 | 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
|
1682 | } else if (new_acct) { |
| 15884 | 1683 | const PurpleSavedStatus *saved_status; |
| 1684 | ||
| 1685 | saved_status = purple_savedstatus_get_current(); | |
|
12125
c1e55f812ded
[gaim-migrate @ 14425]
Mark Doliner <markdoliner@pidgin.im>
parents:
12123
diff
changeset
|
1686 | if (saved_status != NULL) { |
| 15884 | 1687 | purple_savedstatus_activate_for_account(saved_status, account); |
| 1688 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
|
12121
cc63210cdc8b
[gaim-migrate @ 14421]
Daniel Atallah <datallah@pidgin.im>
parents:
12106
diff
changeset
|
1689 | } |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1690 | } |
|
10932
a38fb730e964
[gaim-migrate @ 12711]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10931
diff
changeset
|
1691 | |
| 16889 | 1692 | /* We no longer need the data from the dialog window */ |
| 1693 | account_win_destroy_cb(NULL, NULL, dialog); | |
| 1694 | ||
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1695 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1696 | |
| 9314 | 1697 | 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
|
1698 | {"text/plain", 0, 0}, |
| 9314 | 1699 | {"text/uri-list", 0, 1}, |
| 1700 | {"STRING", 0, 2} | |
| 1701 | }; | |
| 1702 | ||
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1703 | static void |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1704 | pidgin_account_dialog_show_continue(PurpleAccount *account, |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1705 | const gchar *password, GError *error, gpointer _type) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1706 | { |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1707 | PidginAccountDialogType type = GPOINTER_TO_INT(_type); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1708 | AccountPrefsDialog *dialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1709 | GtkWidget *win; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1710 | GtkWidget *main_vbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1711 | GtkWidget *vbox; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1712 | GtkWidget *dbox; |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1713 | GtkWidget *notebook; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1714 | GtkWidget *button; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1715 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1716 | if (accounts_window != NULL && account != NULL && |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1717 | (dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1718 | { |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1719 | gtk_window_present(GTK_WINDOW(dialog->window)); |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1720 | return; |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1721 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1722 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1723 | dialog = g_new0(AccountPrefsDialog, 1); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1724 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1725 | if (accounts_window != NULL && account != NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1726 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1727 | g_hash_table_insert(account_pref_wins, account, dialog); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1728 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1729 | |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1730 | dialog->account = account; |
|
34019
bc87f596bb4c
compile, appears to work too.
Ka-Hing Cheung <khc@pidgin.im>
parents:
34018
diff
changeset
|
1731 | dialog->password = g_strdup(password); |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1732 | dialog->type = type; |
|
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1733 | dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1734 | |
|
9971
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1735 | if (dialog->account == NULL) { |
|
36407
311031b7f535
Refactored gtkaccount to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1736 | /* Select the first protocol in the list*/ |
|
311031b7f535
Refactored gtkaccount to use the new API
Ankit Vani <a@nevitus.org>
parents:
36367
diff
changeset
|
1737 | GList *protocol_list = purple_protocols_get_all(); |
|
36659
fbaa6f248ebc
Free the list returned by purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36633
diff
changeset
|
1738 | if (protocol_list != NULL) { |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1739 | dialog->protocol_id = g_strdup(purple_protocol_get_id(PURPLE_PROTOCOL(protocol_list->data))); |
|
36659
fbaa6f248ebc
Free the list returned by purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36633
diff
changeset
|
1740 | g_list_free(protocol_list); |
|
fbaa6f248ebc
Free the list returned by purple_protocols_get_all()
Ankit Vani <a@nevitus.org>
parents:
36633
diff
changeset
|
1741 | } |
|
9971
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1742 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1743 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1744 | { |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1745 | dialog->protocol_id = |
| 15884 | 1746 | g_strdup(purple_account_get_protocol_id(dialog->account)); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1747 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1748 | |
|
36434
a9a28b8e0d85
prevent a crash when no protocols are loaded
Ankit Vani <a@nevitus.org>
parents:
36407
diff
changeset
|
1749 | /* TODO if no protocols are loaded, this should inform the user that |
|
a9a28b8e0d85
prevent a crash when no protocols are loaded
Ankit Vani <a@nevitus.org>
parents:
36407
diff
changeset
|
1750 | protocols need to be loaded instead of just doing nothing */ |
| 36454 | 1751 | if (!dialog->protocol_id) |
|
36434
a9a28b8e0d85
prevent a crash when no protocols are loaded
Ankit Vani <a@nevitus.org>
parents:
36407
diff
changeset
|
1752 | return; |
|
a9a28b8e0d85
prevent a crash when no protocols are loaded
Ankit Vani <a@nevitus.org>
parents:
36407
diff
changeset
|
1753 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36607
diff
changeset
|
1754 | dialog->protocol = purple_protocols_find(dialog->protocol_id); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1755 | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
1756 | dialog->window = win = pidgin_create_dialog((type == PIDGIN_ADD_ACCOUNT_DIALOG) ? _("Add Account") : _("Modify Account"), |
|
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
|
1757 | PIDGIN_HIG_BOX_SPACE, "account", FALSE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1758 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1759 | g_signal_connect(G_OBJECT(win), "delete_event", |
| 5774 | 1760 | G_CALLBACK(account_win_destroy_cb), dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1761 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1762 | /* Setup the vbox */ |
|
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
|
1763 | main_vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BOX_SPACE); |
|
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
|
1764 | |
|
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
|
1765 | dialog->notebook = notebook = gtk_notebook_new(); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1766 | 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
|
1767 | gtk_widget_show(GTK_WIDGET(notebook)); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1768 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1769 | /* Setup the inner vbox */ |
| 15882 | 1770 | dialog->top_vbox = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 1771 | gtk_container_set_border_width(GTK_CONTAINER(vbox), PIDGIN_HIG_BORDER); | |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1772 | 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
|
1773 | gtk_label_new_with_mnemonic(_("_Basic"))); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1774 | gtk_widget_show(vbox); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1775 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1776 | /* Setup the top frames. */ |
| 5774 | 1777 | add_login_options(dialog, vbox); |
| 1778 | add_user_options(dialog, vbox); | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1779 | |
|
23266
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1780 | 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
|
1781 | _("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
|
1782 | 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
|
1783 | 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
|
1784 | 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
|
1785 | 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
|
1786 | 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
|
1787 | 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
|
1788 | |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
1789 | if (!dialog->protocol || !PURPLE_PROTOCOL_IMPLEMENTS(dialog->protocol, 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
|
1790 | 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
|
1791 | |
|
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
|
1792 | /* Setup the page with 'Advanced' (protocol options). */ |
|
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
|
1793 | add_protocol_options(dialog); |
|
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
|
1794 | |
|
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
|
1795 | /* Setup the page with 'Proxy'. */ |
|
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
|
1796 | dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 15882 | 1797 | gtk_container_set_border_width(GTK_CONTAINER(dbox), PIDGIN_HIG_BORDER); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1798 | 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
|
1799 | gtk_label_new_with_mnemonic(_("P_roxy"))); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1800 | gtk_widget_show(dbox); |
| 5774 | 1801 | add_proxy_options(dialog, dbox); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1802 | |
|
31566
fa37798387fa
Make the simple silence suppression stuff optional per-account. Fixes #13180.
Jakub Adam <jakub.adam@ktknet.cz>
parents:
31321
diff
changeset
|
1803 | 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
|
1804 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1805 | /* Cancel button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1806 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CANCEL, G_CALLBACK(cancel_account_prefs_cb), dialog); |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1807 | |
|
5850
9537237a7a87
[gaim-migrate @ 6281]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
1808 | /* Save button */ |
|
25390
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1809 | button = pidgin_dialog_add_button(GTK_DIALOG(win), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1810 | (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? GTK_STOCK_ADD : GTK_STOCK_SAVE, |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1811 | G_CALLBACK(ok_account_prefs_cb), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1812 | dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1813 | if (dialog->account == NULL) |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1814 | gtk_widget_set_sensitive(button, FALSE); |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1815 | dialog->ok_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1816 | |
| 9314 | 1817 | /* Set up DND */ |
| 1818 | gtk_drag_dest_set(dialog->window, | |
| 1819 | GTK_DEST_DEFAULT_MOTION | | |
| 1820 | GTK_DEST_DEFAULT_DROP, | |
| 1821 | dnd_targets, | |
| 1822 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), | |
| 1823 | GDK_ACTION_COPY); | |
| 1824 | ||
| 1825 | g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", | |
| 1826 | G_CALLBACK(account_dnd_recv), dialog); | |
| 1827 | ||
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1828 | /* Show the window. */ |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
1829 | 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
|
1830 | 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
|
1831 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1832 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1833 | |
|
34064
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1834 | void |
|
34145
fa72f1e5cd77
Some polishing on files modified on this branch (mostly formatting)
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34111
diff
changeset
|
1835 | 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
|
1836 | { |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1837 | /* this is to make sure the password will be cached */ |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1838 | purple_account_get_password(account, |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1839 | pidgin_account_dialog_show_continue, GINT_TO_POINTER(type)); |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1840 | } |
|
8958f4a2386a
Clean up Pidgin account changes.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
34029
diff
changeset
|
1841 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1842 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1843 | * Accounts Dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1844 | **************************************************************************/ |
|
7179
1769277c6e15
[gaim-migrate @ 7747]
Christian Hammond <chipx86@chipx86.com>
parents:
7159
diff
changeset
|
1845 | static void |
| 15884 | 1846 | signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1847 | { |
| 15884 | 1848 | PurpleAccount *account; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1849 | GtkTreeModel *model; |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1850 | GtkTreeIter iter; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1851 | GdkPixbuf *pixbuf; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1852 | size_t index; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1853 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1854 | /* Don't need to do anything if the accounts window is not visible */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1855 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1856 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1857 | |
| 15884 | 1858 | account = purple_connection_get_account(gc); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1859 | model = GTK_TREE_MODEL(accounts_window->model); |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1860 | index = g_list_index(purple_accounts_get_all(), account); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1861 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1862 | if (gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) |
|
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1863 | { |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
1864 | pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
| 15884 | 1865 | if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1866 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1867 | |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1868 | gtk_list_store_set(accounts_window->model, &iter, |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1869 | COLUMN_ICON, pixbuf, |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1870 | -1); |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1871 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1872 | if (pixbuf != NULL) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1873 | g_object_unref(G_OBJECT(pixbuf)); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1874 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1875 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1876 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1877 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1878 | * Get the GtkTreeIter of the specified account in the |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1879 | * GtkListStore |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1880 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1881 | static gboolean |
| 15884 | 1882 | accounts_window_find_account_in_treemodel(GtkTreeIter *iter, PurpleAccount *account) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1883 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1884 | GtkTreeModel *model; |
| 15884 | 1885 | PurpleAccount *cur; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1886 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1887 | g_return_val_if_fail(account != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1888 | g_return_val_if_fail(accounts_window != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1889 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1890 | model = GTK_TREE_MODEL(accounts_window->model); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1891 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1892 | if (!gtk_tree_model_get_iter_first(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1893 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1894 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1895 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1896 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1897 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1898 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1899 | while (gtk_tree_model_iter_next(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1900 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1901 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1902 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1903 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1904 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1905 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1906 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1907 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1908 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1909 | static void |
| 15884 | 1910 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1911 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1912 | AccountPrefsDialog *dialog; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1913 | GtkTreeIter iter; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1914 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1915 | /* If the account was being modified, close the edit window */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1916 | if ((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1917 | account_win_destroy_cb(NULL, NULL, dialog); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1918 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1919 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1920 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1921 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1922 | /* Remove the account from the GtkListStore */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1923 | if (accounts_window_find_account_in_treemodel(&iter, account)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1924 | gtk_list_store_remove(accounts_window->model, &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
|
1925 | |
| 15884 | 1926 | if (purple_accounts_get_all() == NULL) |
| 15053 | 1927 | gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1928 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1929 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1930 | static void |
| 15884 | 1931 | account_abled_cb(PurpleAccount *account, gpointer user_data) |
| 12070 | 1932 | { |
| 1933 | GtkTreeIter iter; | |
| 1934 | ||
| 1935 | if (accounts_window == NULL) | |
| 1936 | return; | |
| 1937 | ||
| 1938 | /* update the account in the GtkListStore */ | |
| 1939 | if (accounts_window_find_account_in_treemodel(&iter, account)) | |
| 1940 | gtk_list_store_set(accounts_window->model, &iter, | |
| 1941 | COLUMN_ENABLED, GPOINTER_TO_INT(user_data), | |
| 1942 | -1); | |
| 1943 | } | |
| 1944 | ||
| 1945 | static void | |
| 5774 | 1946 | drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1947 | GtkSelectionData *data, guint info, guint time, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1948 | AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1949 | { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1950 | GdkAtom target = gtk_selection_data_get_target(data); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1951 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
1952 | if (target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE)) { |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1953 | GtkTreeRowReference *ref; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1954 | GtkTreePath *source_row; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1955 | GtkTreeIter iter; |
| 15884 | 1956 | PurpleAccount *account = NULL; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1957 | GValue val; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1958 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1959 | 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
|
1960 | source_row = gtk_tree_row_reference_get_path(ref); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1961 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1962 | if (source_row == NULL) |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1963 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1964 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1965 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1966 | source_row); |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1967 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1968 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1969 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1970 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1971 | dialog->drag_iter = iter; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1972 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1973 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1974 | |
| 15884 | 1975 | 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
|
1976 | 8, (void *)&account, sizeof(account)); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1977 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1978 | gtk_tree_path_free(source_row); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1979 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1980 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1981 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1982 | static void |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1983 | move_account_after(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1984 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1985 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1986 | GtkTreeIter new_iter; |
| 15884 | 1987 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1988 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1989 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1990 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1991 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1992 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1993 | gtk_list_store_insert_after(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1994 | |
|
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
|
1995 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1996 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1997 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1998 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1999 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2000 | static void |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2001 | move_account_before(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2002 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2003 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2004 | GtkTreeIter new_iter; |
| 15884 | 2005 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2006 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2007 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2008 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2009 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2010 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2011 | gtk_list_store_insert_before(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2012 | |
|
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
|
2013 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2014 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2015 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2016 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2017 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2018 | static void |
| 5774 | 2019 | drag_data_received_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
2020 | guint x, guint y, GtkSelectionData *sd, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
2021 | guint info, guint t, AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2022 | { |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
2023 | GdkAtom target = gtk_selection_data_get_target(sd); |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
2024 | 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
|
2025 | |
|
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
2026 | if (target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE) && data) { |
|
12420
00bd43a1ac8a
[gaim-migrate @ 14727]
Richard Laager <rlaager@pidgin.im>
parents:
12376
diff
changeset
|
2027 | gint dest_index; |
| 15884 | 2028 | PurpleAccount *a = NULL; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2029 | GtkTreePath *path = NULL; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2030 | GtkTreeViewDropPosition position; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2031 | |
|
33133
9a31f084f259
Fix some merge errors.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33132
diff
changeset
|
2032 | memcpy(&a, data, sizeof(a)); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2033 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2034 | if (gtk_tree_view_get_dest_row_at_pos(GTK_TREE_VIEW(widget), x, y, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2035 | &path, &position)) { |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2036 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2037 | GtkTreeIter iter; |
| 15884 | 2038 | PurpleAccount *account; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
2039 | GValue val; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2040 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2041 | 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
|
2042 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2043 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2044 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2045 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2046 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2047 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2048 | switch (position) { |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2049 | case GTK_TREE_VIEW_DROP_AFTER: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2050 | case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2051 | move_account_after(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2052 | &iter); |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2053 | dest_index = g_list_index(purple_accounts_get_all(), |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2054 | account) + 1; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2055 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2056 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2057 | case GTK_TREE_VIEW_DROP_BEFORE: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2058 | case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2059 | dest_index = g_list_index(purple_accounts_get_all(), |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2060 | account); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2061 | |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2062 | move_account_before(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
2063 | &iter); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2064 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2065 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2066 | default: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2067 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2068 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2069 | |
|
34304
faf0414a8b51
Fix most of libpurple warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
2070 | if (dest_index >= 0) |
|
faf0414a8b51
Fix most of libpurple warnings about -Wsign-compare
Tomasz Wasilczyk <tomkiewicz@cpw.pidgin.im>
parents:
34145
diff
changeset
|
2071 | purple_accounts_reorder(a, dest_index); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2072 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2073 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2074 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2075 | |
|
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
|
2076 | static gboolean |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2077 | accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) |
| 5563 | 2078 | { |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2079 | 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
|
2080 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2081 | pidgin_accounts_window_hide(); |
|
7159
7b8db8de4054
[gaim-migrate @ 7726]
Mark Doliner <markdoliner@pidgin.im>
parents:
7107
diff
changeset
|
2082 | |
| 5563 | 2083 | return FALSE; |
| 2084 | } | |
| 2085 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2086 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2087 | add_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2088 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2089 | pidgin_account_dialog_show(PIDGIN_ADD_ACCOUNT_DIALOG, NULL); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2090 | } |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2091 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2092 | static void |
| 5774 | 2093 | modify_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
2094 | GtkTreeIter *iter, gpointer data) |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2095 | { |
| 15884 | 2096 | PurpleAccount *account; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2097 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2098 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2099 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2100 | if (account != NULL) |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2101 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2102 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2103 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2104 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2105 | modify_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2106 | { |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2107 | GtkTreeSelection *selection; |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2108 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2109 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
2110 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
2111 | gtk_tree_selection_selected_foreach(selection, modify_account_sel, dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2112 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2113 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2114 | static void |
| 15884 | 2115 | delete_account_cb(PurpleAccount *account) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2116 | { |
| 15884 | 2117 | purple_accounts_delete(account); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2118 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2119 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2120 | static void |
| 5774 | 2121 | ask_delete_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
2122 | GtkTreeIter *iter, gpointer data) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2123 | { |
| 15884 | 2124 | PurpleAccount *account; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2125 | |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2126 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2127 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2128 | if (account != NULL) { |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
2129 | char *buf; |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2130 | |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
2131 | buf = g_strdup_printf(_("Are you sure you want to delete %s?"), |
| 15884 | 2132 | purple_account_get_username(account)); |
| 2133 | ||
| 2134 | 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
|
2135 | 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
|
2136 | PURPLE_DEFAULT_ACTION_NONE, |
|
c8486462bb63
Request API refactoring: switch purple_request_action to PurpleRequestCommonParameters
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
34329
diff
changeset
|
2137 | 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
|
2138 | _("Delete"), delete_account_cb, _("Cancel"), NULL); |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
2139 | g_free(buf); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2140 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2141 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2142 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2143 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2144 | ask_delete_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2145 | { |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2146 | GtkTreeSelection *selection; |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2147 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2148 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2149 | |
| 5774 | 2150 | gtk_tree_selection_selected_foreach(selection, ask_delete_account_sel, |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
2151 | dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2152 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2153 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2154 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2155 | close_accounts_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2156 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2157 | pidgin_accounts_window_hide(); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2158 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2159 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2160 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2161 | static void |
| 10400 | 2162 | enabled_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2163 | gpointer data) |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2164 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2165 | AccountsWindow *dialog = (AccountsWindow *)data; |
| 15884 | 2166 | PurpleAccount *account; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2167 | GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2168 | GtkTreeIter iter; |
| 10400 | 2169 | gboolean enabled; |
| 15884 | 2170 | const PurpleSavedStatus *saved_status; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2171 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2172 | gtk_tree_model_get_iter_from_string(model, &iter, path_str); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2173 | gtk_tree_model_get(model, &iter, |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2174 | COLUMN_DATA, &account, |
| 10400 | 2175 | COLUMN_ENABLED, &enabled, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2176 | -1); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2177 | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2178 | /* |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2179 | * If we just enabled the account, then set the statuses |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2180 | * to the current status. |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2181 | */ |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2182 | if (!enabled) |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2183 | { |
| 15884 | 2184 | saved_status = purple_savedstatus_get_current(); |
| 2185 | purple_savedstatus_activate_for_account(saved_status, account); | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
2186 | } |
|
11724
d3f71bc34b4f
[gaim-migrate @ 14015]
Mark Doliner <markdoliner@pidgin.im>
parents:
11654
diff
changeset
|
2187 | |
| 15884 | 2188 | purple_account_set_enabled(account, PIDGIN_UI, !enabled); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2189 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2190 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2191 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2192 | add_columns(GtkWidget *treeview, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2193 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2194 | GtkCellRenderer *renderer; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2195 | GtkTreeViewColumn *column; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2196 | |
| 15240 | 2197 | /* Enabled */ |
| 2198 | renderer = gtk_cell_renderer_toggle_new(); | |
| 2199 | ||
| 2200 | g_signal_connect(G_OBJECT(renderer), "toggled", | |
| 2201 | G_CALLBACK(enabled_cb), dialog); | |
| 2202 | ||
| 2203 | column = gtk_tree_view_column_new_with_attributes(_("Enabled"), | |
| 2204 | renderer, "active", COLUMN_ENABLED, NULL); | |
| 2205 | ||
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
2206 | 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
|
2207 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 2208 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2209 | /* Username column */ |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2210 | 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
|
2211 | gtk_tree_view_column_set_title(column, _("Username")); |
| 9519 | 2212 | 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
|
2213 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2214 | |
|
15496
76b5ca00a36c
I think this takes care of protocol icons. Note there are still places
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
2215 | /* Buddy Icon */ |
| 15240 | 2216 | renderer = gtk_cell_renderer_pixbuf_new(); |
| 2217 | gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
| 2218 | gtk_tree_view_column_add_attribute(column, renderer, | |
| 2219 | "pixbuf", COLUMN_BUDDYICON); | |
| 2220 | ||
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
2221 | /* Username */ |
| 15240 | 2222 | renderer = gtk_cell_renderer_text_new(); |
| 2223 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 2224 | 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
|
2225 | "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
|
2226 | dialog->username_col = column; |
| 15240 | 2227 | |
| 2228 | ||
| 2229 | /* Protocol name */ | |
| 2230 | column = gtk_tree_view_column_new(); | |
| 2231 | 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
|
2232 | 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
|
2233 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 2234 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2235 | /* Icon */ |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2236 | renderer = gtk_cell_renderer_pixbuf_new(); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2237 | gtk_tree_view_column_pack_start(column, renderer, FALSE); |
|
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2238 | gtk_tree_view_column_add_attribute(column, renderer, |
| 5693 | 2239 | "pixbuf", COLUMN_ICON); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2240 | |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2241 | renderer = gtk_cell_renderer_text_new(); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2242 | gtk_tree_view_column_pack_start(column, renderer, TRUE); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2243 | gtk_tree_view_column_add_attribute(column, renderer, |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2244 | "text", COLUMN_PROTOCOL); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2245 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2246 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2247 | static void |
| 15884 | 2248 | 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
|
2249 | { |
|
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
|
2250 | GdkPixbuf *pixbuf, *buddyicon = 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
|
2251 | PurpleStoredImage *img = NULL; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2252 | PurpleProtocol *protocol = NULL; |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2253 | PurpleBuddyIconSpec *icon_spec = NULL; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2254 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2255 | pixbuf = pidgin_create_protocol_icon(account, PIDGIN_PROTOCOL_ICON_MEDIUM); |
| 15884 | 2256 | if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2257 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
2258 | |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36607
diff
changeset
|
2259 | protocol = purple_protocols_find(purple_account_get_protocol_id(account)); |
|
36633
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2260 | if (protocol != NULL) |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2261 | 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
|
2262 | |
|
2dcb81a189bd
Refactored pidgin to use the new protocol API
Ankit Vani <a@nevitus.org>
parents:
36626
diff
changeset
|
2263 | 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
|
2264 | 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
|
2265 | if (global_buddyicon != NULL) |
|
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
|
2266 | buddyicon = 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
|
2267 | else { |
|
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2268 | /* 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
|
2269 | 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
|
2270 | 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
|
2271 | if ((path != NULL) && (*path != '\0')) { |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2272 | img = purple_imgstore_new_from_file(path); |
|
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
|
2273 | } |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2274 | } |
|
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
|
2275 | } 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
|
2276 | 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
|
2277 | } |
|
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
|
2278 | } |
|
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
|
2279 | |
|
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
|
2280 | 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
|
2281 | GdkPixbuf *buddyicon_pixbuf; |
|
22897
93d7ad160755
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22455
diff
changeset
|
2282 | buddyicon_pixbuf = pidgin_pixbuf_from_imgstore(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
|
2283 | purple_imgstore_unref(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
|
2284 | |
|
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
|
2285 | 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
|
2286 | 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
|
2287 | 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
|
2288 | } |
| 15240 | 2289 | } |
| 2290 | ||
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2291 | gtk_list_store_set(store, iter, |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2292 | 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
|
2293 | 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
|
2294 | COLUMN_USERNAME, purple_account_get_username(account), |
| 15884 | 2295 | COLUMN_ENABLED, purple_account_get_enabled(account, PIDGIN_UI), |
| 2296 | COLUMN_PROTOCOL, purple_account_get_protocol_name(account), | |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2297 | COLUMN_DATA, account, |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2298 | -1); |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2299 | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2300 | if (pixbuf != NULL) |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2301 | 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
|
2302 | 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
|
2303 | g_object_unref(G_OBJECT(buddyicon)); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2304 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2305 | |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2306 | static void |
| 15884 | 2307 | add_account_to_liststore(PurpleAccount *account, gpointer user_data) |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2308 | { |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2309 | 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
|
2310 | GdkPixbuf *global_buddyicon = user_data; |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2311 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2312 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2313 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2314 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2315 | gtk_list_store_append(accounts_window->model, &iter); |
| 15053 | 2316 | gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook),1); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2317 | |
|
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
|
2318 | set_account(accounts_window->model, &iter, account, global_buddyicon); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2319 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2320 | |
| 15053 | 2321 | static gboolean |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2322 | populate_accounts_list(AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2323 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2324 | GList *l; |
| 15053 | 2325 | gboolean ret = FALSE; |
|
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
|
2326 | GdkPixbuf *global_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
|
2327 | const char *path; |
|
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
|
2328 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2329 | gtk_list_store_clear(dialog->model); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2330 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2331 | if ((path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) != NULL) { |
|
31889
96183796df0c
Start looking at the GError parameter every time we call these functions:
Mark Doliner <markdoliner@pidgin.im>
parents:
31734
diff
changeset
|
2332 | GdkPixbuf *pixbuf = pidgin_pixbuf_new_from_file(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
|
2333 | if (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
|
2334 | global_buddyicon = gdk_pixbuf_scale_simple(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
|
2335 | 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
|
2336 | } |
|
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
|
2337 | } |
|
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
|
2338 | |
| 15884 | 2339 | for (l = purple_accounts_get_all(); l != NULL; l = l->next) { |
| 15053 | 2340 | ret = TRUE; |
| 15884 | 2341 | add_account_to_liststore((PurpleAccount *)l->data, global_buddyicon); |
| 15053 | 2342 | } |
| 2343 | ||
|
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
|
2344 | if (global_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
|
2345 | g_object_unref(G_OBJECT(global_buddyicon)); |
|
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 | |
| 15053 | 2347 | return ret; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2348 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2349 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2350 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2351 | account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2352 | { |
|
8406
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2353 | gboolean selected = FALSE; |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2354 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2355 | selected = (gtk_tree_selection_count_selected_rows(sel) > 0); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2356 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2357 | gtk_widget_set_sensitive(dialog->modify_button, selected); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2358 | gtk_widget_set_sensitive(dialog->delete_button, selected); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2359 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2360 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2361 | static gboolean |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2362 | 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
|
2363 | { |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2364 | AccountsWindow *dialog; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2365 | GtkTreePath *path; |
| 11113 | 2366 | GtkTreeViewColumn *column; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2367 | GtkTreeIter iter; |
| 15884 | 2368 | PurpleAccount *account; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2369 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2370 | dialog = (AccountsWindow *)user_data; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2371 | |
|
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
|
2372 | 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
|
2373 | 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
|
2374 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2375 | /* Figure out which node was clicked */ |
| 11113 | 2376 | 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
|
2377 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2378 | 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
|
2379 | 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
|
2380 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2381 | } |
|
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
|
2382 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2383 | 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
|
2384 | gtk_tree_path_free(path); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2385 | 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
|
2386 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2387 | if ((account != NULL) && (event->button == 1) && |
|
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
|
2388 | (event->type == GDK_2BUTTON_PRESS)) |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2389 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2390 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2391 | return TRUE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2392 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2393 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2394 | return FALSE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2395 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2396 | |
| 5563 | 2397 | static GtkWidget * |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2398 | create_accounts_list(AccountsWindow *dialog) |
| 5563 | 2399 | { |
| 15053 | 2400 | GtkWidget *frame; |
| 2401 | GtkWidget *label; | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2402 | GtkWidget *treeview; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2403 | GtkTreeSelection *sel; |
| 15884 | 2404 | GtkTargetEntry gte[] = {{"PURPLE_ACCOUNT", GTK_TARGET_SAME_APP, 0}}; |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2405 | char *pretty, *tmp; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2406 | |
| 15053 | 2407 | frame = gtk_frame_new(NULL); |
| 2408 | gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
| 2409 | ||
| 2410 | accounts_window->notebook = gtk_notebook_new(); | |
| 2411 | gtk_notebook_set_show_tabs(GTK_NOTEBOOK(accounts_window->notebook), FALSE); | |
| 2412 | gtk_notebook_set_show_border(GTK_NOTEBOOK(accounts_window->notebook), FALSE); | |
| 2413 | gtk_container_add(GTK_CONTAINER(frame), accounts_window->notebook); | |
| 2414 | ||
| 2415 | /* Create a helpful first-time-use label */ | |
|
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
|
2416 | label = gtk_label_new(NULL); |
| 15084 | 2417 | /* Translators: Please maintain the use of -> or <- to represent the menu heirarchy */ |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2418 | tmp = g_strdup_printf(_( |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2419 | "<span size='larger' weight='bold'>Welcome to %s!</span>\n\n" |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2420 | |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2421 | "You have no IM accounts configured. To start connecting with %s " |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24578
diff
changeset
|
2422 | "press the <b>Add...</b> button below and configure your first " |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2423 | "account. If you want %s to connect to multiple IM accounts, " |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24578
diff
changeset
|
2424 | "press <b>Add...</b> again to configure them all.\n\n" |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2425 | |
| 15053 | 2426 | "You can come back to this window to add, edit, or remove " |
|
24136
9921664cfa6d
It's not "Accounts->Add/Edit" any more, it's now "Accounts->Manage Accounts".
Richard Laager <rlaager@pidgin.im>
parents:
23880
diff
changeset
|
2427 | "accounts from <b>Accounts->Manage Accounts</b> in the Buddy " |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2428 | "List window"), PIDGIN_NAME, PIDGIN_NAME, PIDGIN_NAME); |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2429 | pretty = pidgin_make_pretty_arrows(tmp); |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2430 | g_free(tmp); |
| 15086 | 2431 | gtk_label_set_markup(GTK_LABEL(label), pretty); |
| 2432 | g_free(pretty); | |
| 2433 | ||
| 15053 | 2434 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
| 2435 | gtk_widget_show(label); | |
| 2436 | ||
| 2437 | gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5); | |
| 2438 | gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL); | |
| 2439 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2440 | /* Create the list model. */ |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2441 | dialog->model = gtk_list_store_new(NUM_COLUMNS, |
| 14921 | 2442 | GDK_TYPE_PIXBUF, /* COLUMN_ICON */ |
| 15240 | 2443 | 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
|
2444 | G_TYPE_STRING, /* COLUMN_USERNAME */ |
| 14921 | 2445 | G_TYPE_BOOLEAN, /* COLUMN_ENABLED */ |
| 2446 | 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
|
2447 | G_TYPE_POINTER /* COLUMN_DATA */ |
| 14921 | 2448 | ); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2449 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2450 | /* And now the actual treeview */ |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2451 | 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
|
2452 | dialog->treeview = treeview; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2453 | gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); |
|
22214
e8a9916cb99e
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22177
diff
changeset
|
2454 | g_object_unref(G_OBJECT(dialog->model)); |
|
10418
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2455 | |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2456 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2457 | gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2458 | g_signal_connect(G_OBJECT(sel), "changed", |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2459 | G_CALLBACK(account_selected_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2460 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2461 | /* Handle double-clicking */ |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2462 | g_signal_connect(G_OBJECT(treeview), "button_press_event", |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2463 | G_CALLBACK(account_treeview_double_click_cb), dialog); |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2464 | |
|
31321
1fef3832cfa2
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31294
diff
changeset
|
2465 | gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), |
|
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
|
2466 | pidgin_make_scrollable(treeview, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC, GTK_SHADOW_NONE, -1, -1), |
|
31321
1fef3832cfa2
Add pidgin_make_scrollable and use it. Cleans up a bunch of duplicate code. Net code loss of 180 lines. Fixes #13073.
Gabriel Schulhof <nix@go-nix.ca>
parents:
31294
diff
changeset
|
2467 | NULL); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2468 | |
| 5774 | 2469 | 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
|
2470 | gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview)); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2471 | |
| 15053 | 2472 | if (populate_accounts_list(dialog)) |
| 2473 | gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 1); | |
|
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
|
2474 | else |
| 15053 | 2475 | gtk_notebook_set_current_page(GTK_NOTEBOOK(accounts_window->notebook), 0); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2476 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2477 | /* Setup DND. I wanna be an orc! */ |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2478 | gtk_tree_view_enable_model_drag_source( |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2479 | GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2480 | 1, GDK_ACTION_COPY); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2481 | gtk_tree_view_enable_model_drag_dest( |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2482 | GTK_TREE_VIEW(treeview), gte, 1, |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2483 | GDK_ACTION_COPY | GDK_ACTION_MOVE); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2484 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2485 | g_signal_connect(G_OBJECT(treeview), "drag-data-received", |
| 5774 | 2486 | G_CALLBACK(drag_data_received_cb), dialog); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2487 | g_signal_connect(G_OBJECT(treeview), "drag-data-get", |
| 5774 | 2488 | 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
|
2489 | |
| 15053 | 2490 | gtk_widget_show_all(frame); |
| 2491 | return frame; | |
| 5563 | 2492 | } |
| 2493 | ||
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2494 | static void |
| 15884 | 2495 | account_modified_cb(PurpleAccount *account, AccountsWindow *window) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2496 | { |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2497 | GtkTreeIter iter; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2498 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2499 | if (!accounts_window_find_account_in_treemodel(&iter, account)) |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2500 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2501 | |
|
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
|
2502 | set_account(window->model, &iter, account, NULL); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2503 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2504 | |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2505 | static void |
| 15884 | 2506 | global_buddyicon_changed(const char *name, PurplePrefType type, |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2507 | gconstpointer value, gpointer window) |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2508 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2509 | GList *list; |
| 15884 | 2510 | for (list = purple_accounts_get_all(); list; list = list->next) { |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2511 | account_modified_cb(list->data, window); |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2512 | } |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2513 | } |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2514 | |
| 5563 | 2515 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2516 | pidgin_accounts_window_show(void) |
| 5563 | 2517 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2518 | AccountsWindow *dialog; |
| 5563 | 2519 | GtkWidget *win; |
| 2520 | GtkWidget *vbox; | |
| 2521 | GtkWidget *sw; | |
| 2522 | GtkWidget *button; | |
| 2523 | int width, height; | |
| 2524 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2525 | if (accounts_window != NULL) { |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
2526 | gtk_window_present(GTK_WINDOW(accounts_window->window)); |
| 5563 | 2527 | return; |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2528 | } |
| 5563 | 2529 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2530 | accounts_window = dialog = g_new0(AccountsWindow, 1); |
| 5563 | 2531 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2532 | 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
|
2533 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height"); |
| 5563 | 2534 | |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
2535 | #if GTK_CHECK_VERSION(3,0,0) |
|
33141
2001ba1d6827
Remove extra padding that makes things look not-so-good.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33133
diff
changeset
|
2536 | dialog->window = win = pidgin_create_dialog(_("Accounts"), 0, "accounts", TRUE); |
|
33170
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
2537 | #else |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
2538 | dialog->window = win = pidgin_create_dialog(_("Accounts"), PIDGIN_HIG_BORDER, "accounts", TRUE); |
|
ce4447562d64
Add checks for old GTK+2 stuff.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33160
diff
changeset
|
2539 | #endif |
| 5563 | 2540 | gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
| 2541 | ||
| 2542 | g_signal_connect(G_OBJECT(win), "delete_event", | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2543 | G_CALLBACK(accedit_win_destroy_cb), accounts_window); |
| 5563 | 2544 | |
| 2545 | /* Setup the vbox */ | |
|
22000
5e7708f58d3d
Patch from fmoo. This makes a lot of the windows closeable with Escape. There
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
21630
diff
changeset
|
2546 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BORDER); |
| 5563 | 2547 | |
| 2548 | /* Setup the scrolled window that will contain the list of accounts. */ | |
| 5774 | 2549 | sw = create_accounts_list(dialog); |
| 5563 | 2550 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
| 2551 | gtk_widget_show(sw); | |
| 2552 | ||
| 2553 | /* Add button */ | |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24578
diff
changeset
|
2554 | pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2555 | |
| 5563 | 2556 | /* Modify button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2557 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(modify_account_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2558 | dialog->modify_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2559 | gtk_widget_set_sensitive(button, FALSE); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2560 | |
| 5563 | 2561 | /* Delete button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2562 | button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(ask_delete_account_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2563 | dialog->delete_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2564 | gtk_widget_set_sensitive(button, FALSE); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2565 | |
| 5563 | 2566 | /* Close button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2567 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(close_accounts_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2568 | |
|
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
|
2569 | purple_signal_connect(pidgin_accounts_get_handle(), "account-modified", |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2570 | accounts_window, |
| 15884 | 2571 | PURPLE_CALLBACK(account_modified_cb), accounts_window); |
| 2572 | 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
|
2573 | PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2574 | global_buddyicon_changed, accounts_window); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
2575 | |
| 5563 | 2576 | gtk_widget_show(win); |
| 2577 | } | |
| 2578 | ||
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2579 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2580 | pidgin_accounts_window_hide(void) |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2581 | { |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2582 | if (accounts_window == NULL) |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2583 | return; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2584 | |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2585 | 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
|
2586 | 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
|
2587 | |
| 15884 | 2588 | purple_signals_disconnect_by_handle(accounts_window); |
| 2589 | purple_prefs_disconnect_by_handle(accounts_window); | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2590 | |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2591 | g_free(accounts_window); |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2592 | accounts_window = NULL; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2593 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2594 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2595 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2596 | free_add_user_data(PidginAccountAddUserData *data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2597 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2598 | g_free(data->username); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2599 | g_free(data->alias); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2600 | g_free(data); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2601 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2602 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2603 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2604 | add_user_cb(PidginAccountAddUserData *data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2605 | { |
| 15884 | 2606 | PurpleConnection *gc = purple_account_get_connection(data->account); |
| 2607 | ||
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2608 | if (g_list_find(purple_connections_get_all(), gc)) |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2609 | { |
| 15884 | 2610 | purple_blist_request_add_buddy(data->account, data->username, |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2611 | NULL, data->alias); |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2612 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2613 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2614 | free_add_user_data(data); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2615 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2616 | |
| 12285 | 2617 | static char * |
| 15884 | 2618 | make_info(PurpleAccount *account, PurpleConnection *gc, const char *remote_user, |
| 12285 | 2619 | const char *id, const char *alias, const char *msg) |
| 2620 | { | |
|
12976
aedbdb6f9adb
[gaim-migrate @ 15329]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12960
diff
changeset
|
2621 | if (msg != NULL && *msg == '\0') |
|
12960
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2622 | msg = NULL; |
|
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2623 | |
| 12286 | 2624 | return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), |
| 12285 | 2625 | remote_user, |
| 2626 | (alias != NULL ? " (" : ""), | |
| 2627 | (alias != NULL ? alias : ""), | |
| 2628 | (alias != NULL ? ")" : ""), | |
| 2629 | (id != NULL | |
| 2630 | ? id | |
| 15884 | 2631 | : (purple_connection_get_display_name(gc) != NULL |
| 2632 | ? purple_connection_get_display_name(gc) | |
| 2633 | : purple_account_get_username(account))), | |
| 15096 | 2634 | (msg != NULL ? ": " : "."), |
| 12285 | 2635 | (msg != NULL ? msg : "")); |
| 2636 | } | |
| 2637 | ||
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2638 | static void |
| 15884 | 2639 | pidgin_accounts_notify_added(PurpleAccount *account, const char *remote_user, |
| 12285 | 2640 | const char *id, const char *alias, |
| 2641 | const char *msg) | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2642 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2643 | char *buffer; |
| 15884 | 2644 | PurpleConnection *gc; |
| 15094 | 2645 | GtkWidget *alert; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2646 | |
| 15884 | 2647 | gc = purple_account_get_connection(account); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2648 | |
| 12285 | 2649 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2650 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_INFO, buffer, |
| 15094 | 2651 | NULL, NULL, _("Close"), NULL, NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2652 | pidgin_blist_add_alert(alert); |
| 12285 | 2653 | |
| 2654 | g_free(buffer); | |
| 2655 | } | |
| 2656 | ||
| 2657 | static void | |
| 15884 | 2658 | pidgin_accounts_request_add(PurpleAccount *account, const char *remote_user, |
| 12285 | 2659 | const char *id, const char *alias, |
| 2660 | const char *msg) | |
| 2661 | { | |
| 2662 | char *buffer; | |
| 15884 | 2663 | PurpleConnection *gc; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2664 | PidginAccountAddUserData *data; |
| 15094 | 2665 | GtkWidget *alert; |
| 12285 | 2666 | |
| 15884 | 2667 | gc = purple_account_get_connection(account); |
| 12285 | 2668 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2669 | data = g_new0(PidginAccountAddUserData, 1); |
| 12285 | 2670 | data->account = account; |
| 2671 | data->username = g_strdup(remote_user); | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2672 | 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
|
2673 | |
| 12285 | 2674 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2675 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION, |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2676 | _("Add buddy to your list?"), buffer, data, |
| 15119 | 2677 | _("Add"), G_CALLBACK(add_user_cb), |
| 2678 | _("Cancel"), G_CALLBACK(free_add_user_data), NULL); | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2679 | 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
|
2680 | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2681 | g_free(buffer); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2682 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2683 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2684 | struct auth_request |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2685 | { |
| 15884 | 2686 | PurpleAccountRequestAuthorizationCb auth_cb; |
| 2687 | PurpleAccountRequestAuthorizationCb deny_cb; | |
| 15119 | 2688 | void *data; |
| 2689 | char *username; | |
| 2690 | char *alias; | |
| 15884 | 2691 | PurpleAccount *account; |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2692 | gboolean add_buddy_after_auth; |
| 15119 | 2693 | }; |
| 2694 | ||
| 2695 | static void | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2696 | free_auth_request(struct auth_request *ar) |
| 15119 | 2697 | { |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2698 | g_free(ar->username); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2699 | g_free(ar->alias); |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2700 | g_free(ar); |
| 15119 | 2701 | } |
| 2702 | ||
| 2703 | static void | |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2704 | 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
|
2705 | { |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2706 | 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
|
2707 | 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
|
2708 | 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
|
2709 | } |
| 15119 | 2710 | } |
| 2711 | ||
| 2712 | static void | |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2713 | 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
|
2714 | { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2715 | 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
|
2716 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2717 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2718 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2719 | authorize_reason_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
|
2720 | { |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2721 | const char *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2722 | PurpleProtocol *protocol = NULL; |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2723 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2724 | protocol_id = purple_account_get_protocol_id(ar->account); |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36607
diff
changeset
|
2725 | protocol = purple_protocols_find(protocol_id); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2726 | |
|
36607
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2727 | 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
|
2728 | /* 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
|
2729 | 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
|
2730 | 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
|
2731 | 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
|
2732 | aa->data = ar->data; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2733 | aa->account = ar->account; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2734 | 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
|
2735 | 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
|
2736 | 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
|
2737 | 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
|
2738 | 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
|
2739 | _("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
|
2740 | _("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
|
2741 | 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
|
2742 | aa); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2743 | /* 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
|
2744 | } else { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2745 | authorize_noreason_cb(ar); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2746 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2747 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2748 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2749 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2750 | 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
|
2751 | { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2752 | 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
|
2753 | } |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2754 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2755 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2756 | 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
|
2757 | { |
|
33687
0819d40769c8
Add a message to the authorization callbacks.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33661
diff
changeset
|
2758 | ar->deny_cb(NULL, ar->data); |
| 15119 | 2759 | } |
| 2760 | ||
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2761 | static void |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2762 | deny_reason_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
|
2763 | { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2764 | const char *protocol_id; |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2765 | PurpleProtocol *protocol = NULL; |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2766 | |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2767 | protocol_id = purple_account_get_protocol_id(ar->account); |
|
36626
18fc361b3704
Renamed purple_find_protocol_info to purple_protocols_find
Ankit Vani <a@nevitus.org>
parents:
36607
diff
changeset
|
2768 | protocol = purple_protocols_find(protocol_id); |
|
36544
1bf8b6ef5aea
Renamed PurplePluginProtocolInfo to PurpleProtocol
Ankit Vani <a@nevitus.org>
parents:
36543
diff
changeset
|
2769 | |
|
36607
7ad7681dcfd8
Use purple_protocol_get_* API instead of protocol->member
Ankit Vani <a@nevitus.org>
parents:
36606
diff
changeset
|
2770 | 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
|
2771 | /* 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
|
2772 | 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
|
2773 | 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
|
2774 | 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
|
2775 | aa->data = ar->data; |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2776 | 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
|
2777 | 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
|
2778 | 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
|
2779 | _("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
|
2780 | _("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
|
2781 | 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
|
2782 | aa); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2783 | /* 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
|
2784 | } else { |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2785 | deny_noreason_cb(ar); |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2786 | } |
| 15119 | 2787 | } |
| 2788 | ||
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2789 | static gboolean |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2790 | 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
|
2791 | 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
|
2792 | gpointer data) |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2793 | { |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2794 | 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
|
2795 | if (!strcmp(uri, "viewinfo")) { |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2796 | 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
|
2797 | return TRUE; |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2798 | } |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2799 | return FALSE; |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2800 | } |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2801 | |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2802 | static void |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2803 | send_im_cb(PidginMiniDialog *mini_dialog, |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2804 | GtkButton *button, |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2805 | gpointer data) |
| 15119 | 2806 | { |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2807 | 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
|
2808 | pidgin_dialogs_im_with_user(ar->account, ar->username); |
| 15119 | 2809 | } |
| 2810 | ||
|
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
|
2811 | 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
|
2812 | 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
|
2813 | 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
|
2814 | 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
|
2815 | 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
|
2816 | 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
|
2817 | 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
|
2818 | 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
|
2819 | 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
|
2820 | void *user_data) |
| 15119 | 2821 | { |
| 2822 | char *buffer; | |
| 15884 | 2823 | PurpleConnection *gc; |
| 15119 | 2824 | 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
|
2825 | PidginMiniDialog *dialog; |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2826 | GdkPixbuf *protocol_icon; |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2827 | 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
|
2828 | 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
|
2829 | 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
|
2830 | 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
|
2831 | char *escaped_alias; |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2832 | 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
|
2833 | char *escaped_message; |
| 15119 | 2834 | |
| 15884 | 2835 | 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
|
2836 | 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
|
2837 | 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
|
2838 | else |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2839 | 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
|
2840 | |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2841 | 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
|
2842 | (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
|
2843 | 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
|
2844 | 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
|
2845 | |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2846 | 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
|
2847 | |
|
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2848 | 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
|
2849 | 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
|
2850 | |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2851 | 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
|
2852 | escaped_remote_user, |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2853 | (have_valid_alias ? " (" : ""), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2854 | escaped_alias, |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2855 | (have_valid_alias ? ")" : ""), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2856 | escaped_our_name, |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2857 | (have_valid_alias ? ": " : "."), |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2858 | escaped_message); |
|
33703
273ec0b090d9
Fix definition/code order from Mark's last commit.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33702
diff
changeset
|
2859 | |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2860 | g_free(escaped_remote_user); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2861 | g_free(escaped_alias); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2862 | g_free(escaped_our_name); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2863 | 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
|
2864 | |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2865 | 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
|
2866 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2867 | 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
|
2868 | 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
|
2869 | 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
|
2870 | aa->data = user_data; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2871 | 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
|
2872 | 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
|
2873 | aa->account = account; |
|
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2874 | aa->add_buddy_after_auth = !on_list; |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31217
diff
changeset
|
2875 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2876 | alert = pidgin_make_mini_dialog_with_custom_icon( |
|
36545
23b59a16c808
Replaced some _prpl_ stuff with _protocol_
Ankit Vani <a@nevitus.org>
parents:
36544
diff
changeset
|
2877 | gc, protocol_icon, |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2878 | _("Authorize buddy?"), NULL, aa, |
|
33697
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2879 | _("Authorize"), authorize_reason_cb, |
|
33a5cca20993
Add the authorization message back in Pidgin proper.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
33687
diff
changeset
|
2880 | _("Deny"), deny_reason_cb, |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2881 | NULL); |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
31217
diff
changeset
|
2882 | |
|
31642
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2883 | dialog = PIDGIN_MINI_DIALOG(alert); |
|
33685
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2884 | pidgin_mini_dialog_enable_description_markup(dialog); |
|
4a3c6a2f80e7
Remove unneeded function.
Mark Doliner <mark@kingant.net>
parents:
33683
diff
changeset
|
2885 | 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
|
2886 | pidgin_mini_dialog_set_description(dialog, buffer); |
|
ad20028f085c
Finally merged the code that fixes #5038 to i.p.p.
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
31603
diff
changeset
|
2887 | 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
|
2888 | |
|
30635
e9893ecc9057
Display the protocol icon for the authorization request dialog
Ivan Komarov <ivan.komarov@pidgin.im>
parents:
29686
diff
changeset
|
2889 | 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
|
2890 | 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
|
2891 | pidgin_blist_add_alert(alert); |
| 15119 | 2892 | |
| 2893 | g_free(buffer); | |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2894 | |
|
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
|
2895 | 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
|
2896 | } |
|
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
|
2897 | |
|
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
|
2898 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2899 | 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
|
2900 | { |
|
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
|
2901 | gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
| 15119 | 2902 | } |
| 2903 | ||
| 15884 | 2904 | static PurpleAccountUiOps ui_ops = |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2905 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2906 | pidgin_accounts_notify_added, |
| 12285 | 2907 | NULL, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2908 | pidgin_accounts_request_add, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2909 | pidgin_accounts_request_authorization, |
|
16752
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16658
diff
changeset
|
2910 | pidgin_accounts_request_close, |
|
34586
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
2911 | pidgin_permit_added_removed, |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
2912 | pidgin_permit_added_removed, |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
2913 | pidgin_deny_added_removed, |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
2914 | pidgin_deny_added_removed, |
|
9ed4700451cc
Refactored gtkprivacy to use the new API. Added (moved) gtkprivacy's UI ops to gtkaccount's UI ops.
Ankit Vani <a@nevitus.org>
parents:
34585
diff
changeset
|
2915 | NULL, NULL, NULL, NULL |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2916 | }; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2917 | |
| 15884 | 2918 | PurpleAccountUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2919 | pidgin_accounts_get_ui_ops(void) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2920 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2921 | return &ui_ops; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2922 | } |
| 9609 | 2923 | |
| 2924 | 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
|
2925 | pidgin_accounts_get_handle(void) { |
| 9609 | 2926 | static int handle; |
| 2927 | ||
| 2928 | return &handle; | |
| 2929 | } | |
| 2930 | ||
| 2931 | 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
|
2932 | pidgin_accounts_init(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2933 | { |
|
15779
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2934 | char *default_avatar = NULL; |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2935 | 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
|
2936 | 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
|
2937 | 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
|
2938 | purple_prefs_add_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height", 321); |
|
15779
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2939 | default_avatar = g_build_filename(g_get_home_dir(), ".face.icon", NULL); |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2940 | if (!g_file_test(default_avatar, G_FILE_TEST_EXISTS)) { |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2941 | g_free(default_avatar); |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2942 | default_avatar = g_build_filename(g_get_home_dir(), ".face", NULL); |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2943 | if (!g_file_test(default_avatar, G_FILE_TEST_EXISTS)) { |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2944 | g_free(default_avatar); |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2945 | default_avatar = NULL; |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2946 | } |
|
9dab08219630
Use ~/.face (or ~/.face.icon) as the default avatar. GDM and KDM both use these. Daniel should make it use the default Windows icon too. Evan can probably do OS X if he wants.
Sean Egan <seanegan@pidgin.im>
parents:
15577
diff
changeset
|
2947 | } |
|
15785
97587447d0bf
Leak fix and printf removal.
Daniel Atallah <datallah@pidgin.im>
parents:
15779
diff
changeset
|
2948 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2949 | purple_prefs_add_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon", default_avatar); |
|
15785
97587447d0bf
Leak fix and printf removal.
Daniel Atallah <datallah@pidgin.im>
parents:
15779
diff
changeset
|
2950 | g_free(default_avatar); |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2951 | |
|
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
|
2952 | 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
|
2953 | 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
|
2954 | PURPLE_TYPE_ACCOUNT); |
| 15884 | 2955 | |
| 2956 | /* Setup some purple signal handlers. */ | |
| 2957 | 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
|
2958 | pidgin_accounts_get_handle(), |
| 15884 | 2959 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2960 | 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
|
2961 | pidgin_accounts_get_handle(), |
| 15884 | 2962 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2963 | 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
|
2964 | pidgin_accounts_get_handle(), |
| 15884 | 2965 | PURPLE_CALLBACK(add_account_to_liststore), NULL); |
| 2966 | 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
|
2967 | pidgin_accounts_get_handle(), |
| 15884 | 2968 | PURPLE_CALLBACK(account_removed_cb), NULL); |
| 2969 | 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
|
2970 | pidgin_accounts_get_handle(), |
| 15884 | 2971 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE)); |
| 2972 | 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
|
2973 | pidgin_accounts_get_handle(), |
| 15884 | 2974 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE)); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2975 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2976 | account_pref_wins = |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2977 | g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); |
| 9609 | 2978 | } |
| 2979 | ||
| 2980 | 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
|
2981 | pidgin_accounts_uninit(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2982 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2983 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2984 | * 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
|
2985 | * a callback function to use for the free-some-data-function |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2986 | * parameter of g_hash_table_new_full, above. |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2987 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2988 | g_hash_table_destroy(account_pref_wins); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2989 | |
|
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
|
2990 | 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
|
2991 | purple_signals_unregister_by_instance(pidgin_accounts_get_handle()); |
|
32901
221cc41b948a
Fix merge problem.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32900
diff
changeset
|
2992 | } |
|
221cc41b948a
Fix merge problem.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32900
diff
changeset
|
2993 |