pidgin/gtkaccount.c

Sun, 07 Jun 2020 02:39:43 -0500

author
Gary Kramlich <grim@reaperworld.com>
date
Sun, 07 Jun 2020 02:39:43 -0500
branch
Ball--Gy-rgy/update-screenshot-url-in-appdata-file-1591293245974
changeset 40438
708c6622acc6
parent 40350
72271baf92bc
child 40439
e9838d634d5e
permissions
-rw-r--r--

closing merged branch

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

mercurial