Mon, 26 Jul 2010 05:40:49 +0000
Remove an extra "fake" check.
| 5563 | 1 | /** |
|
7820
06fc9f66d2cb
[gaim-migrate @ 8472]
Mark Doliner <markdoliner@pidgin.im>
parents:
7810
diff
changeset
|
2 | * @file gtkaccount.c GTK+ Account Editor UI |
|
16254
eeb2bba4dc94
Rename the Doxygen group from gtkui to pidgin.
Richard Laager <rlaager@pidgin.im>
parents:
16192
diff
changeset
|
3 | * @ingroup pidgin |
|
20330
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
4 | */ |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
5 | |
|
650a7af9c238
remove gpl boilerplate from doxygen docs
Sean Egan <seanegan@pidgin.im>
parents:
19859
diff
changeset
|
6 | /* pidgin |
| 5563 | 7 | * |
|
15931
716b5fac1895
Re-sed the copyright notices so they don't all talk about Purple.
Richard Laager <rlaager@pidgin.im>
parents:
15884
diff
changeset
|
8 | * Pidgin is the legal property of its developers, whose names are too numerous |
| 8046 | 9 | * to list here. Please refer to the COPYRIGHT file distributed with this |
| 10 | * source distribution. | |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
11 | * |
| 5563 | 12 | * This program is free software; you can redistribute it and/or modify |
| 13 | * it under the terms of the GNU General Public License as published by | |
| 14 | * the Free Software Foundation; either version 2 of the License, or | |
| 15 | * (at your option) any later version. | |
| 16 | * | |
| 17 | * This program is distributed in the hope that it will be useful, | |
| 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 20 | * GNU General Public License for more details. | |
| 21 | * | |
| 22 | * You should have received a copy of the GNU General Public License | |
| 23 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19773
diff
changeset
|
24 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 5563 | 25 | */ |
| 9308 | 26 | |
| 9791 | 27 | #include "internal.h" |
| 15577 | 28 | #include "pidgin.h" |
| 5717 | 29 | |
| 5563 | 30 | #include "account.h" |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
31 | #include "accountopt.h" |
|
6229
1704facbe9a5
[gaim-migrate @ 6722]
Mark Doliner <markdoliner@pidgin.im>
parents:
6179
diff
changeset
|
32 | #include "core.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
33 | #include "debug.h" |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
34 | #include "notify.h" |
|
5852
33a438531278
[gaim-migrate @ 6283]
Christian Hammond <chipx86@chipx86.com>
parents:
5851
diff
changeset
|
35 | #include "plugin.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
36 | #include "prefs.h" |
| 9308 | 37 | #include "prpl.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
38 | #include "request.h" |
|
11724
d3f71bc34b4f
[gaim-migrate @ 14015]
Mark Doliner <markdoliner@pidgin.im>
parents:
11654
diff
changeset
|
39 | #include "savedstatuses.h" |
|
6485
3c7ba18e32f1
[gaim-migrate @ 6999]
Christian Hammond <chipx86@chipx86.com>
parents:
6371
diff
changeset
|
40 | #include "signals.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
41 | #include "util.h" |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
42 | |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
43 | #include "gtkaccount.h" |
|
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
44 | #include "gtkblist.h" |
|
9709
2e73f176cc80
[gaim-migrate @ 10570]
Mark Doliner <markdoliner@pidgin.im>
parents:
9705
diff
changeset
|
45 | #include "gtkdialogs.h" |
|
5872
754c63f29b77
[gaim-migrate @ 6304]
Christian Hammond <chipx86@chipx86.com>
parents:
5870
diff
changeset
|
46 | #include "gtkutils.h" |
| 10649 | 47 | #include "gtkstatusbox.h" |
|
15883
969b74a3e27a
According to etags, pidgin/ should be completely clean of references to 'gaim' as a client
Sean Egan <seanegan@pidgin.im>
parents:
15882
diff
changeset
|
48 | #include "pidginstock.h" |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
49 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
50 | enum |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
51 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
52 | COLUMN_ICON, |
| 15240 | 53 | 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
|
54 | COLUMN_USERNAME, |
| 10400 | 55 | COLUMN_ENABLED, |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
56 | COLUMN_PROTOCOL, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
57 | COLUMN_DATA, |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
58 | NUM_COLUMNS |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
59 | }; |
| 5563 | 60 | |
| 61 | typedef struct | |
| 62 | { | |
| 15884 | 63 | PurpleAccount *account; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
64 | char *username; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
65 | char *alias; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
66 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
67 | } PidginAccountAddUserData; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
68 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
69 | typedef struct |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
70 | { |
| 5563 | 71 | GtkWidget *window; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
72 | GtkWidget *treeview; |
| 5563 | 73 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
74 | GtkWidget *modify_button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
75 | GtkWidget *delete_button; |
| 15053 | 76 | GtkWidget *notebook; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
77 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
78 | GtkListStore *model; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
79 | GtkTreeIter drag_iter; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
80 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
81 | GtkTreeViewColumn *username_col; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
82 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
83 | } AccountsWindow; |
| 5563 | 84 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
85 | typedef struct |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
86 | { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
87 | 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
|
88 | 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
|
89 | 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
|
90 | } ProtocolOptEntry; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
91 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
92 | 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
|
93 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
94 | PidginAccountDialogType type; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
95 | |
| 15884 | 96 | PurpleAccount *account; |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
97 | char *protocol_id; |
| 15884 | 98 | PurplePlugin *plugin; |
| 99 | PurplePluginProtocolInfo *prpl_info; | |
| 100 | ||
| 101 | PurpleProxyType new_proxy_type; | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
102 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
103 | GList *user_split_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
104 | GList *protocol_opt_entries; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
105 | |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
106 | GtkSizeGroup *sg; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
107 | GtkWidget *window; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
108 | |
|
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
|
109 | GtkWidget *notebook; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
110 | GtkWidget *top_vbox; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
111 | GtkWidget *ok_button; |
| 6141 | 112 | GtkWidget *register_button; |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
113 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
114 | /* Login Options */ |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
115 | GtkWidget *login_frame; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
116 | GtkWidget *protocol_menu; |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
117 | GtkWidget *password_box; |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
118 | GtkWidget *username_entry; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
119 | GtkWidget *password_entry; |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
120 | GtkWidget *alias_entry; |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
121 | GtkWidget *remember_pass_check; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
122 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
123 | /* User Options */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
124 | GtkWidget *user_frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
125 | GtkWidget *new_mail_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
126 | GtkWidget *icon_hbox; |
| 14195 | 127 | GtkWidget *icon_check; |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
128 | GtkWidget *icon_entry; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
129 | GtkWidget *icon_filesel; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
130 | GtkWidget *icon_preview; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
131 | GtkWidget *icon_text; |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
132 | PurpleStoredImage *icon_img; |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
133 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
134 | /* Protocol Options */ |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
135 | GtkWidget *protocol_frame; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
136 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
137 | /* Proxy Options */ |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
138 | GtkWidget *proxy_frame; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
139 | GtkWidget *proxy_vbox; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
140 | GtkWidget *proxy_dropdown; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
141 | GtkWidget *proxy_host_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
142 | GtkWidget *proxy_port_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
143 | GtkWidget *proxy_user_entry; |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
144 | GtkWidget *proxy_pass_entry; |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
145 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
146 | } AccountPrefsDialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
147 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
148 | static AccountsWindow *accounts_window = NULL; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
149 | static GHashTable *account_pref_wins; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
150 | |
| 15884 | 151 | static void add_account_to_liststore(PurpleAccount *account, gpointer user_data); |
| 5774 | 152 | static void set_account(GtkListStore *store, GtkTreeIter *iter, |
| 15884 | 153 | PurpleAccount *account, GdkPixbuf *global_buddyicon); |
|
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 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
156 | * Add/Modify Account dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
157 | **************************************************************************/ |
| 5774 | 158 | static void add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
| 159 | static void add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent); | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
160 | static void add_protocol_options(AccountPrefsDialog *dialog); |
| 5774 | 161 | static void add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
162 | |
|
32388
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
163 | static const char * |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
164 | google_talk_default_domain_hackery(GtkWidget *protocol_combo, const char *value_if_gtalk) |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
165 | { |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
166 | GtkTreeModel *model; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
167 | GtkTreeIter iter; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
168 | const char *value = NULL; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
169 | |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
170 | model = gtk_combo_box_get_model(GTK_COMBO_BOX(protocol_combo)); |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
171 | if (model != NULL && gtk_combo_box_get_active_iter(GTK_COMBO_BOX(protocol_combo), &iter)) { |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
172 | char *protocol = NULL; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
173 | |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
174 | /* protocol is not stored as G_TYPE_STRING in the model so no g_free necessary */ |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
175 | gtk_tree_model_get(model, &iter, 2, &protocol, -1); |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
176 | if (protocol && !strcmp("prpl-jabber", protocol)) { |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
177 | char *item_name = NULL; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
178 | |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
179 | gtk_tree_model_get(model, &iter, 1, &item_name, -1); |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
180 | if (item_name) { |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
181 | if (!strcmp(item_name, _("Google Talk"))) |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
182 | value = value_if_gtalk; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
183 | g_free(item_name); |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
184 | } |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
185 | /* If it's not GTalk, but still Jabber then the value is not NULL, it's empty */ |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
186 | if (NULL == value) |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
187 | value = ""; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
188 | } |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
189 | } |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
190 | |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
191 | return value; |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
192 | } |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
193 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
194 | static GtkWidget * |
| 5774 | 195 | add_pref_box(AccountPrefsDialog *dialog, GtkWidget *parent, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
196 | const char *text, GtkWidget *widget) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
197 | { |
|
22131
12b395dc8c59
Remove a lot of duplication from a lot of places. Closes #4558.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22056
diff
changeset
|
198 | 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
|
199 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
200 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
201 | static void |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
202 | 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
|
203 | { |
|
14248
caf7bdfc3e0f
[gaim-migrate @ 16849]
Daniel Atallah <datallah@pidgin.im>
parents:
14235
diff
changeset
|
204 | GdkPixbuf *pixbuf = NULL; |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
205 | |
|
16658
d5b9b112b758
Part of the patch in ticket #383:
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
16545
diff
changeset
|
206 | dialog->icon_img = purple_imgstore_unref(dialog->icon_img); |
|
16539
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
207 | if (data != NULL) |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
208 | { |
|
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
|
209 | if (len > 0) |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
210 | dialog->icon_img = purple_imgstore_add(data, len, new_icon_path); |
|
75a20ae3a527
Change the imgstore and by extension, then the buddy icon code to take over
Richard Laager <rlaager@pidgin.im>
parents:
16538
diff
changeset
|
211 | 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
|
212 | g_free(data); |
|
16544
945caa0d6436
Kill some compiler warnings and TODOs of mine.
Richard Laager <rlaager@pidgin.im>
parents:
16539
diff
changeset
|
213 | } |
|
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
|
214 | |
|
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
|
215 | if (dialog->icon_img != NULL) { |
|
22897
93d7ad160755
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22455
diff
changeset
|
216 | pixbuf = pidgin_pixbuf_from_imgstore(dialog->icon_img); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
217 | } |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
218 | |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
219 | if (pixbuf && dialog->prpl_info && |
| 15884 | 220 | (dialog->prpl_info->icon_spec.scale_rules & PURPLE_ICON_SCALE_DISPLAY)) |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
221 | { |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
222 | /* Scale the icon to something reasonable */ |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
223 | int width, height; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
224 | GdkPixbuf *scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
225 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
226 | pidgin_buddy_icon_get_scale_size(pixbuf, &dialog->prpl_info->icon_spec, |
| 15884 | 227 | PURPLE_ICON_SCALE_DISPLAY, &width, &height); |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
228 | 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
|
229 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
230 | g_object_unref(G_OBJECT(pixbuf)); |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
231 | pixbuf = scale; |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
232 | } |
|
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
233 | |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
234 | if (pixbuf == NULL) |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
235 | { |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
236 | /* Show a placeholder icon */ |
|
16386
416b510e691e
New select-avatar image from hbons
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16351
diff
changeset
|
237 | GtkIconSize icon_size = gtk_icon_size_from_name(PIDGIN_ICON_SIZE_TANGO_SMALL); |
|
416b510e691e
New select-avatar image from hbons
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16351
diff
changeset
|
238 | pixbuf = gtk_widget_render_icon(dialog->window, PIDGIN_STOCK_TOOLBAR_SELECT_AVATAR, |
| 16351 | 239 | icon_size, "PidginAccount"); |
|
14671
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
240 | } |
|
4981d4ab59f8
[gaim-migrate @ 17337]
Mark Doliner <markdoliner@pidgin.im>
parents:
14670
diff
changeset
|
241 | |
|
13222
03cf8fa2f29e
[gaim-migrate @ 15585]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
13091
diff
changeset
|
242 | gtk_image_set_from_pixbuf(GTK_IMAGE(dialog->icon_entry), pixbuf); |
|
14150
b9617d019b31
[gaim-migrate @ 16711]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
243 | if (pixbuf != NULL) |
|
b9617d019b31
[gaim-migrate @ 16711]
Mark Doliner <markdoliner@pidgin.im>
parents:
14097
diff
changeset
|
244 | g_object_unref(G_OBJECT(pixbuf)); |
|
11286
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
245 | } |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
246 | |
|
148a24541acd
[gaim-migrate @ 13483]
Richard Laager <rlaager@pidgin.im>
parents:
11256
diff
changeset
|
247 | static void |
|
32390
0e1bf474f222
Remove an extra "fake" check.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32388
diff
changeset
|
248 | set_account_protocol_cb(GtkWidget *widget, const char *id, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
249 | AccountPrefsDialog *dialog) |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
250 | { |
| 15884 | 251 | PurplePlugin *new_plugin; |
| 252 | ||
| 253 | new_plugin = purple_find_prpl(id); | |
|
9304
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
254 | |
|
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
255 | dialog->plugin = new_plugin; |
|
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
256 | |
|
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
257 | if (dialog->plugin != NULL) |
|
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
258 | { |
| 15884 | 259 | dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
260 | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
261 | g_free(dialog->protocol_id); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
262 | dialog->protocol_id = g_strdup(dialog->plugin->info->id); |
|
5955
4f964635c095
[gaim-migrate @ 6399]
Christian Hammond <chipx86@chipx86.com>
parents:
5943
diff
changeset
|
263 | } |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
264 | |
|
9304
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
265 | if (dialog->account != NULL) |
| 15884 | 266 | purple_account_clear_settings(dialog->account); |
|
9304
5077b31f5526
[gaim-migrate @ 10112]
Christian Hammond <chipx86@chipx86.com>
parents:
8903
diff
changeset
|
267 | |
| 5774 | 268 | add_login_options(dialog, dialog->top_vbox); |
| 269 | add_user_options(dialog, dialog->top_vbox); | |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
270 | add_protocol_options(dialog); |
| 6141 | 271 | |
|
20092
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
272 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
814ecfc91244
applied changes from bb3c9dec65d16afdcc4bcedd5fd184b7207cc624
Richard Laager <rlaager@pidgin.im>
parents:
19859
diff
changeset
|
273 | |
|
32390
0e1bf474f222
Remove an extra "fake" check.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
32388
diff
changeset
|
274 | if (!dialog->prpl_info || !dialog->prpl_info->register_user) { |
| 6141 | 275 | gtk_widget_hide(dialog->register_button); |
| 11358 | 276 | } else { |
| 277 | if (dialog->prpl_info != NULL && | |
| 278 | (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME)) { | |
| 279 | gtk_widget_set_sensitive(dialog->register_button, TRUE); | |
| 280 | } else { | |
| 281 | gtk_widget_set_sensitive(dialog->register_button, FALSE); | |
| 282 | } | |
| 6141 | 283 | gtk_widget_show(dialog->register_button); |
| 11358 | 284 | } |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
285 | } |
|
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
286 | |
|
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
|
287 | static gboolean |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
288 | username_focus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
289 | { |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
290 | 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
|
291 | const char *label; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
292 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
293 | table = dialog->prpl_info->get_account_text_table(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
|
294 | 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
|
295 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
296 | if(!strcmp(gtk_entry_get_text(GTK_ENTRY(widget)), label)) { |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
297 | gtk_entry_set_text(GTK_ENTRY(widget), ""); |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
298 | gtk_widget_modify_text(widget, GTK_STATE_NORMAL,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
|
299 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
300 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
301 | 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
|
302 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
303 | return FALSE; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
304 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
305 | |
|
5688
c185c90d9811
[gaim-migrate @ 6109]
Christian Hammond <chipx86@chipx86.com>
parents:
5687
diff
changeset
|
306 | 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
|
307 | username_changed_cb(GtkEntry *entry, AccountPrefsDialog *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
308 | { |
| 6732 | 309 | if (dialog->ok_button) |
| 310 | gtk_widget_set_sensitive(dialog->ok_button, | |
| 311 | *gtk_entry_get_text(entry) != '\0'); | |
| 11358 | 312 | if (dialog->register_button) { |
| 313 | if (dialog->prpl_info != NULL && (dialog->prpl_info->options & OPT_PROTO_REGISTER_NOSCREENNAME)) | |
| 314 | gtk_widget_set_sensitive(dialog->register_button, TRUE); | |
| 315 | else | |
| 316 | gtk_widget_set_sensitive(dialog->register_button, | |
| 317 | *gtk_entry_get_text(entry) != '\0'); | |
| 318 | } | |
| 5826 | 319 | } |
| 6732 | 320 | |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
321 | static gboolean |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
322 | username_nofocus_cb(GtkWidget *widget, GdkEventFocus *event, AccountPrefsDialog *dialog) |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
323 | { |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
324 | GdkColor color = {0, 34952, 35466, 34181}; |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
325 | GHashTable *table = NULL; |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
326 | const char *label = NULL; |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
327 | |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
328 | if(PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, get_account_text_table)) { |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
329 | table = dialog->prpl_info->get_account_text_table(NULL); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
330 | label = g_hash_table_lookup(table, "login_label"); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
331 | |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
332 | if (*gtk_entry_get_text(GTK_ENTRY(widget)) == '\0') { |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
333 | /* We have to avoid hitting the username_changed_cb function |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
334 | * because it enables buttons we don't want enabled yet ;) |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
335 | */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
336 | g_signal_handlers_block_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
337 | gtk_entry_set_text(GTK_ENTRY(widget), label); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
338 | /* Make sure we can hit it again */ |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
339 | g_signal_handlers_unblock_by_func(widget, G_CALLBACK(username_changed_cb), dialog); |
|
25318
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
340 | gtk_widget_modify_text(widget, GTK_STATE_NORMAL, &color); |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
341 | } |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
342 | |
|
3e95e0da6e0d
Make sure the prpl has a get_account_text_table function before trying to
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
24861
diff
changeset
|
343 | g_hash_table_destroy(table); |
|
23277
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
344 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
345 | |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
346 | return FALSE; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
347 | } |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
348 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
349 | static void |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
350 | icon_filesel_choose_cb(const char *filename, gpointer data) |
| 5826 | 351 | { |
|
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
|
352 | 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
|
353 | |
|
14765
c5c0c325481d
[gaim-migrate @ 17455]
Mark Doliner <markdoliner@pidgin.im>
parents:
14764
diff
changeset
|
354 | 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
|
355 | { |
|
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 | size_t len; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
357 | gpointer data = pidgin_convert_buddy_icon(dialog->plugin, filename, &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
|
358 | 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
|
359 | } |
|
14203
f3a50c328ddc
[gaim-migrate @ 16783]
Mark Doliner <markdoliner@pidgin.im>
parents:
14195
diff
changeset
|
360 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
361 | dialog->icon_filesel = NULL; |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
362 | } |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
363 | |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
364 | static void |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
365 | icon_select_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
366 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
367 | dialog->icon_filesel = pidgin_buddy_icon_chooser_new(GTK_WINDOW(dialog->window), icon_filesel_choose_cb, dialog); |
| 14195 | 368 | gtk_widget_show_all(dialog->icon_filesel); |
| 5826 | 369 | } |
| 370 | ||
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
371 | static void |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
372 | icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) |
| 5826 | 373 | { |
|
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
|
374 | set_dialog_icon(dialog, NULL, 0, NULL); |
| 9308 | 375 | } |
| 376 | ||
| 9314 | 377 | static void |
| 378 | account_dnd_recv(GtkWidget *widget, GdkDragContext *dc, gint x, gint y, | |
| 379 | GtkSelectionData *sd, guint info, guint t, AccountPrefsDialog *dialog) | |
| 380 | { | |
|
11137
cf40226ddff7
[gaim-migrate @ 13201]
Mark Doliner <markdoliner@pidgin.im>
parents:
11113
diff
changeset
|
381 | gchar *name = (gchar *)sd->data; |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
382 | |
| 9314 | 383 | if ((sd->length >= 0) && (sd->format == 8)) { |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
384 | /* Well, it looks like the drag event was cool. |
| 9314 | 385 | * Let's do something with it */ |
| 386 | if (!g_ascii_strncasecmp(name, "file://", 7)) { | |
| 387 | GError *converr = NULL; | |
| 388 | 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
|
389 | gpointer data; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
390 | size_t len; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
391 | |
|
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
|
392 | /* It looks like we're dealing with a local file. */ |
| 9314 | 393 | if(!(tmp = g_filename_from_uri(name, NULL, &converr))) { |
| 15884 | 394 | purple_debug(PURPLE_DEBUG_ERROR, "buddyicon", "%s\n", |
| 9314 | 395 | (converr ? converr->message : |
| 396 | "g_filename_from_uri error")); | |
| 397 | return; | |
| 398 | } | |
| 399 | if ((rtmp = strchr(tmp, '\r')) || (rtmp = strchr(tmp, '\n'))) | |
| 400 | *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
|
401 | |
|
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
|
402 | data = pidgin_convert_buddy_icon(dialog->plugin, tmp, &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
|
403 | /* 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
|
404 | set_dialog_icon(dialog, data, len, tmp); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
405 | } |
| 9314 | 406 | gtk_drag_finish(dc, TRUE, FALSE, t); |
| 407 | } | |
| 408 | gtk_drag_finish(dc, FALSE, FALSE, t); | |
| 409 | } | |
| 410 | ||
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
411 | static void |
| 15884 | 412 | update_editable(PurpleConnection *gc, AccountPrefsDialog *dialog) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
413 | { |
|
29226
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
414 | GtkStyle *style; |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
415 | gboolean set; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
416 | GList *l; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
417 | |
|
12843
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
418 | if (dialog->account == NULL) |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
419 | return; |
|
323bd864a6f1
[gaim-migrate @ 15191]
Richard Laager <rlaager@pidgin.im>
parents:
12671
diff
changeset
|
420 | |
| 15884 | 421 | 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
|
422 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
423 | |
| 15884 | 424 | 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
|
425 | 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
|
426 | gtk_editable_set_editable(GTK_EDITABLE(dialog->username_entry), set); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
427 | style = set ? NULL : gtk_widget_get_style(dialog->username_entry); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
428 | gtk_widget_modify_base(dialog->username_entry, GTK_STATE_NORMAL, |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
429 | style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
430 | |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
431 | for (l = dialog->user_split_entries ; l != NULL ; l = l->next) { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
432 | 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
|
433 | gtk_editable_set_editable(GTK_EDITABLE(l->data), set); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
434 | style = set ? NULL : gtk_widget_get_style(GTK_WIDGET(l->data)); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
435 | gtk_widget_modify_base(GTK_WIDGET(l->data), GTK_STATE_NORMAL, |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
436 | style ? &style->base[GTK_STATE_INSENSITIVE] : NULL); |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
437 | } else { |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
438 | 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
|
439 | } |
|
88232e6c5591
Allow copying username (and other settings) for a connected account from
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
27668
diff
changeset
|
440 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
441 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
442 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
443 | static void |
| 5774 | 444 | add_login_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
445 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
446 | 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
|
447 | GtkWidget *hbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
448 | GtkWidget *vbox; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
449 | GtkWidget *entry; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
450 | GList *user_splits; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
451 | GList *l, *l2; |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
452 | char *username = NULL; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
453 | |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
454 | 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
|
455 | { |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
456 | #if GTK_CHECK_VERSION(2,12,0) |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
457 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
458 | #else |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
459 | gtk_widget_ref(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
|
460 | #endif |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
461 | 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
|
462 | 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
|
463 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
464 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
465 | if (dialog->login_frame != NULL) |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
466 | gtk_widget_destroy(dialog->login_frame); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
467 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
468 | /* Build the login options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
469 | frame = pidgin_make_frame(parent, _("Login Options")); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
470 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
471 | /* cringe */ |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
472 | 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
|
473 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
474 | 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
|
475 | gtk_widget_show(dialog->login_frame); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
476 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
477 | /* Main vbox */ |
| 15882 | 478 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
479 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
480 | gtk_widget_show(vbox); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
481 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
482 | /* Protocol */ |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
483 | 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
|
484 | { |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
485 | dialog->protocol_menu = pidgin_protocol_option_menu_new( |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
486 | dialog->protocol_id, G_CALLBACK(set_account_protocol_cb), dialog); |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
487 | #if GTK_CHECK_VERSION(2,12,0) |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
488 | g_object_ref(G_OBJECT(dialog->protocol_menu)); |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
489 | #else |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
490 | gtk_widget_ref(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
|
491 | #endif |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
492 | } |
|
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
493 | |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
494 | 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
|
495 | 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
|
496 | |
|
26820
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
497 | #if GTK_CHECK_VERSION(2,12,0) |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
498 | g_object_unref(G_OBJECT(dialog->protocol_menu)); |
|
76f90ca8f6f2
Use g_object_ref/unref instead of the deprecated versions.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
26543
diff
changeset
|
499 | #else |
|
17035
c3070e07f6a7
Make Google Talk stick when chosen, rather than jumping right to XMPP.
Richard Laager <rlaager@pidgin.im>
parents:
16889
diff
changeset
|
500 | gtk_widget_unref(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
|
501 | #endif |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
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 | /* Username */ |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
504 | dialog->username_entry = gtk_entry_new(); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
505 | 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
|
506 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
507 | add_pref_box(dialog, vbox, _("_Username:"), dialog->username_entry); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
508 | |
|
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
|
509 | 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
|
510 | 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
|
511 | |
|
24432
066a123fd39c
Fix NULL pointer deref. Fixes #7258. Thanks to "jonassa" for noticing.
Daniel Atallah <datallah@pidgin.im>
parents:
24415
diff
changeset
|
512 | if (!username && dialog->prpl_info |
|
066a123fd39c
Fix NULL pointer deref. Fixes #7258. Thanks to "jonassa" for noticing.
Daniel Atallah <datallah@pidgin.im>
parents:
24415
diff
changeset
|
513 | && PURPLE_PROTOCOL_PLUGIN_HAS_FUNC(dialog->prpl_info, 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
|
514 | GdkColor color = {0, 34952, 35466, 34181}; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
515 | 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
|
516 | const char *label; |
|
ea315a8d5bad
Patch from Jaywalker to let prpls add some helpful text for some account
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23272
diff
changeset
|
517 | table = dialog->prpl_info->get_account_text_table(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
|
518 | 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
|
519 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
520 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), label); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
521 | g_signal_connect(G_OBJECT(dialog->username_entry), "focus-in-event", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
522 | G_CALLBACK(username_focus_cb), dialog); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
523 | g_signal_connect(G_OBJECT(dialog->username_entry), "focus-out-event", |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
524 | G_CALLBACK(username_nofocus_cb), dialog); |
|
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
525 | gtk_widget_modify_text(dialog->username_entry, GTK_STATE_NORMAL, &color); |
|
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
|
526 | 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
|
527 | } |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
528 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
529 | 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
|
530 | G_CALLBACK(username_changed_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
531 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
532 | /* Do the user split thang */ |
| 24636 | 533 | if (dialog->prpl_info == NULL) |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
534 | user_splits = NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
535 | else |
|
5662
e938bbeef62c
[gaim-migrate @ 6076]
Christian Hammond <chipx86@chipx86.com>
parents:
5661
diff
changeset
|
536 | user_splits = dialog->prpl_info->user_splits; |
|
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 | if (dialog->user_split_entries != NULL) { |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
539 | g_list_free(dialog->user_split_entries); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
540 | dialog->user_split_entries = NULL; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
541 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
542 | |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
543 | for (l = user_splits; l != NULL; l = l->next) { |
| 15884 | 544 | PurpleAccountUserSplit *split = l->data; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
545 | char *buf; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
546 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
547 | buf = g_strdup_printf("_%s:", purple_account_user_split_get_text(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
548 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
549 | entry = gtk_entry_new(); |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
550 | |
| 5774 | 551 | add_pref_box(dialog, vbox, buf, entry); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
552 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
553 | g_free(buf); |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
554 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
555 | dialog->user_split_entries = |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
556 | g_list_append(dialog->user_split_entries, entry); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
557 | } |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
558 | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
559 | for (l = g_list_last(dialog->user_split_entries), |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
560 | l2 = g_list_last(user_splits); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
561 | l != NULL && l2 != NULL; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
562 | l = l->prev, l2 = l2->prev) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
563 | |
|
5708
43f6fbb894d5
[gaim-migrate @ 6129]
Christian Hammond <chipx86@chipx86.com>
parents:
5705
diff
changeset
|
564 | GtkWidget *entry = l->data; |
| 15884 | 565 | 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
|
566 | const char *value = NULL; |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
567 | char *c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
568 | |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
569 | if (dialog->account != NULL) { |
|
18099
f38988d232f7
jabber can contain @ symbols and / in the resource, so we have to look for
Nathan Walp <nwalp@pidgin.im>
parents:
18096
diff
changeset
|
570 | 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
|
571 | 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
|
572 | 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
|
573 | 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
|
574 | c = strchr(username, |
| 15884 | 575 | purple_account_user_split_get_separator(split)); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
576 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
577 | if (c != NULL) { |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
578 | *c = '\0'; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
579 | c++; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
580 | |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
581 | value = c; |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
582 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
583 | } |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
584 | if (value == NULL) |
| 15884 | 585 | value = purple_account_user_split_get_default_value(split); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
586 | |
|
17301
7af76e506062
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@pidgin.im>
parents:
17035
diff
changeset
|
587 | /* Google Talk default domain hackery! */ |
|
32388
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
588 | if (!strcmp(_("Domain"), purple_account_user_split_get_text(split)) && !value) |
|
9fc7219b95cc
Apply final changes from nix_nix's patch.
Gabriel Schulhof <nix@go-nix.ca>
parents:
29686
diff
changeset
|
589 | value = google_talk_default_domain_hackery(dialog->protocol_menu, "gmail.com"); |
|
17301
7af76e506062
Use gmail.com as the default domain for Google Talk accounts
Sean Egan <seanegan@pidgin.im>
parents:
17035
diff
changeset
|
590 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
591 | if (value != NULL) |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
592 | gtk_entry_set_text(GTK_ENTRY(entry), value); |
|
5653
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
593 | } |
|
a9e3cbee4d0c
[gaim-migrate @ 6067]
Christian Hammond <chipx86@chipx86.com>
parents:
5651
diff
changeset
|
594 | |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
595 | 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
|
596 | gtk_entry_set_text(GTK_ENTRY(dialog->username_entry), username); |
|
5656
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
597 | |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
598 | g_free(username); |
|
b3eb9f503cdc
[gaim-migrate @ 6070]
Christian Hammond <chipx86@chipx86.com>
parents:
5653
diff
changeset
|
599 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
600 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
601 | /* Password */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
602 | dialog->password_entry = gtk_entry_new(); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
603 | gtk_entry_set_visibility(GTK_ENTRY(dialog->password_entry), FALSE); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
604 | #if !GTK_CHECK_VERSION(2,16,0) |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15352
diff
changeset
|
605 | if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->password_entry)) == '*') |
| 15882 | 606 | gtk_entry_set_invisible_char(GTK_ENTRY(dialog->password_entry), PIDGIN_INVISIBLE_CHAR); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
607 | #endif /* Less than GTK+ 2.16 */ |
|
17563
eb3c8a19ceff
Add some mnemonics to the new/modify account dialog. These are also taken
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17562
diff
changeset
|
608 | dialog->password_box = add_pref_box(dialog, vbox, _("_Password:"), |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
609 | dialog->password_entry); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
610 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
611 | /* Remember Password */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
612 | 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
|
613 | gtk_check_button_new_with_mnemonic(_("Remember pass_word")); |
|
5783
0f26dee8622e
[gaim-migrate @ 6208]
Christian Hammond <chipx86@chipx86.com>
parents:
5782
diff
changeset
|
614 | 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
|
615 | FALSE); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
616 | gtk_box_pack_start(GTK_BOX(vbox), dialog->remember_pass_check, |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
617 | FALSE, FALSE, 0); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
618 | gtk_widget_show(dialog->remember_pass_check); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
619 | |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
620 | /* Set the fields. */ |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
621 | if (dialog->account != NULL) { |
|
24578
4b0fd98a170c
Don't populate the password field on the modify account dialog if we are
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24432
diff
changeset
|
622 | if (purple_account_get_password(dialog->account) && |
|
4b0fd98a170c
Don't populate the password field on the modify account dialog if we are
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
24432
diff
changeset
|
623 | purple_account_get_remember_password(dialog->account)) |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
624 | gtk_entry_set_text(GTK_ENTRY(dialog->password_entry), |
| 15884 | 625 | purple_account_get_password(dialog->account)); |
| 626 | ||
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
627 | gtk_toggle_button_set_active( |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
628 | GTK_TOGGLE_BUTTON(dialog->remember_pass_check), |
| 15884 | 629 | purple_account_get_remember_password(dialog->account)); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
630 | } |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
631 | |
|
5662
e938bbeef62c
[gaim-migrate @ 6076]
Christian Hammond <chipx86@chipx86.com>
parents:
5661
diff
changeset
|
632 | if (dialog->prpl_info != NULL && |
|
e938bbeef62c
[gaim-migrate @ 6076]
Christian Hammond <chipx86@chipx86.com>
parents:
5661
diff
changeset
|
633 | (dialog->prpl_info->options & OPT_PROTO_NO_PASSWORD)) { |
|
e938bbeef62c
[gaim-migrate @ 6076]
Christian Hammond <chipx86@chipx86.com>
parents:
5661
diff
changeset
|
634 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
635 | gtk_widget_hide(dialog->password_box); |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
636 | gtk_widget_hide(dialog->remember_pass_check); |
|
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
637 | } |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
638 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
639 | /* 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
|
640 | update_editable(NULL, dialog); |
| 15884 | 641 | 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
|
642 | G_CALLBACK(update_editable), dialog); |
| 15884 | 643 | 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
|
644 | G_CALLBACK(update_editable), dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
645 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
646 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
647 | static void |
| 14195 | 648 | icon_check_cb(GtkWidget *checkbox, AccountPrefsDialog *dialog) |
| 649 | { | |
| 650 | gtk_widget_set_sensitive(dialog->icon_hbox, gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))); | |
| 651 | } | |
| 652 | ||
| 653 | static void | |
| 5774 | 654 | add_user_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
655 | { |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
656 | GtkWidget *frame; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
657 | GtkWidget *vbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
658 | GtkWidget *vbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
659 | GtkWidget *hbox; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
660 | GtkWidget *hbox2; |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
661 | GtkWidget *button; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
662 | GtkWidget *label; |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
663 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
664 | if (dialog->user_frame != NULL) |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
665 | gtk_widget_destroy(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
666 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
667 | /* Build the user options frame. */ |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
668 | frame = pidgin_make_frame(parent, _("User Options")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
669 | 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
|
670 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
671 | gtk_box_reorder_child(GTK_BOX(parent), dialog->user_frame, 1); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
672 | gtk_widget_show(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
673 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
674 | /* Main vbox */ |
| 15882 | 675 | vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
676 | gtk_container_add(GTK_CONTAINER(frame), vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
677 | gtk_widget_show(vbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
678 | |
|
22933
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
679 | /* Alias */ |
|
fe1e09e03bcb
Move the Local Alias field into the User Options section of the account
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22455
diff
changeset
|
680 | 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
|
681 | 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
|
682 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
683 | /* New mail notifications */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
684 | 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
|
685 | gtk_check_button_new_with_mnemonic(_("New _mail notifications")); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
686 | 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
|
687 | gtk_widget_show(dialog->new_mail_check); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
688 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
689 | /* 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
|
690 | dialog->icon_check = gtk_check_button_new_with_mnemonic(_("Use this buddy _icon for this account:")); |
| 14195 | 691 | g_signal_connect(G_OBJECT(dialog->icon_check), "toggled", G_CALLBACK(icon_check_cb), dialog); |
| 692 | gtk_widget_show(dialog->icon_check); | |
| 693 | gtk_box_pack_start(GTK_BOX(vbox), dialog->icon_check, FALSE, FALSE, 0); | |
| 694 | ||
| 15882 | 695 | dialog->icon_hbox = hbox = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 14195 | 696 | 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
|
697 | gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
698 | gtk_widget_show(hbox); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
699 | |
| 14195 | 700 | label = gtk_label_new(" "); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
701 | gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
702 | gtk_widget_show(label); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
703 | |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
704 | button = gtk_button_new(); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
705 | gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
706 | gtk_widget_show(button); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
707 | g_signal_connect(G_OBJECT(button), "clicked", |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
708 | G_CALLBACK(icon_select_cb), dialog); |
|
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
709 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
710 | dialog->icon_entry = gtk_image_new(); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
711 | gtk_container_add(GTK_CONTAINER(button), dialog->icon_entry); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
712 | gtk_widget_show(dialog->icon_entry); |
|
14764
1a07873891aa
[gaim-migrate @ 17454]
Mark Doliner <markdoliner@pidgin.im>
parents:
14671
diff
changeset
|
713 | /* TODO: Uh, isn't this next line pretty useless? */ |
| 15568 | 714 | pidgin_set_accessible_label (dialog->icon_entry, label); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
715 | purple_imgstore_unref(dialog->icon_img); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
716 | dialog->icon_img = NULL; |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
717 | |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
718 | vbox2 = gtk_vbox_new(FALSE, 0); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
719 | gtk_box_pack_start(GTK_BOX(hbox), vbox2, TRUE, TRUE, 0); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
720 | gtk_widget_show(vbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
721 | |
| 15882 | 722 | hbox2 = gtk_hbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 723 | 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
|
724 | gtk_widget_show(hbox2); |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
725 | |
|
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
726 | button = gtk_button_new_from_stock(GTK_STOCK_REMOVE); |
| 5826 | 727 | g_signal_connect(G_OBJECT(button), "clicked", |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
728 | G_CALLBACK(icon_reset_cb), dialog); |
|
9333
d8b5ebef7b28
[gaim-migrate @ 10141]
Christian Hammond <chipx86@chipx86.com>
parents:
9318
diff
changeset
|
729 | 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
|
730 | gtk_widget_show(button); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
731 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
732 | if (dialog->prpl_info != NULL) { |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
733 | if (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK)) |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
734 | gtk_widget_hide(dialog->new_mail_check); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
735 | |
| 19773 | 736 | if (dialog->prpl_info->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
|
737 | gtk_widget_hide(dialog->icon_check); |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
738 | gtk_widget_hide(dialog->icon_hbox); |
| 19773 | 739 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
740 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
741 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
742 | if (dialog->account != NULL) { |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
743 | PurpleStoredImage *img; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
744 | 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
|
745 | 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
|
746 | |
|
22982
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
747 | if (purple_account_get_alias(dialog->account)) |
|
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
748 | gtk_entry_set_text(GTK_ENTRY(dialog->alias_entry), |
|
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
749 | purple_account_get_alias(dialog->account)); |
|
bd5a732d899b
Fix the breakage with account aliases that I introduced when I moved the
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
22942
diff
changeset
|
750 | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
751 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->new_mail_check), |
| 15884 | 752 | purple_account_get_check_mail(dialog->account)); |
|
14670
011e0da9c2a8
[gaim-migrate @ 17336]
Mark Doliner <markdoliner@pidgin.im>
parents:
14625
diff
changeset
|
753 | |
| 14195 | 754 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(dialog->icon_check), |
| 15884 | 755 | !purple_account_get_bool(dialog->account, "use-global-buddyicon", |
| 14195 | 756 | 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
|
757 | |
|
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
|
758 | 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
|
759 | 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
|
760 | { |
|
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
|
761 | len = purple_imgstore_get_size(img); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
762 | data = g_memdup(purple_imgstore_get_data(img), len); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
763 | } |
|
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
|
764 | 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
|
765 | 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
|
766 | } 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
|
767 | set_dialog_icon(dialog, NULL, 0, NULL); |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
768 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
769 | |
|
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
|
770 | #if 0 |
| 7207 | 771 | if (!dialog->prpl_info || |
| 772 | (!(dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) && | |
| 9308 | 773 | (dialog->prpl_info->icon_spec.format == NULL))) { |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
774 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
775 | /* Nothing to see :( aww. */ |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
776 | gtk_widget_hide(dialog->user_frame); |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
777 | } |
|
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
|
778 | #endif |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
779 | } |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
780 | |
|
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
781 | static void |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
782 | add_protocol_options(AccountPrefsDialog *dialog) |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
783 | { |
| 15884 | 784 | PurpleAccountOption *option; |
| 785 | PurpleAccount *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
|
786 | 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
|
787 | GList *list, *node; |
| 12185 | 788 | gint i, idx, int_value; |
| 12106 | 789 | GtkListStore *model; |
| 790 | GtkTreeIter iter; | |
| 791 | GtkCellRenderer *renderer; | |
| 15884 | 792 | PurpleKeyValuePair *kvp; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
793 | GList *l; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
794 | char buf[1024]; |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
795 | 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
|
796 | const char *str_value; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
797 | 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
|
798 | ProtocolOptEntry *opt_entry; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
799 | |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
800 | 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
|
801 | gtk_notebook_remove_page (GTK_NOTEBOOK(dialog->notebook), 1); |
|
5689
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
802 | dialog->protocol_frame = NULL; |
|
340d70c1ba9d
[gaim-migrate @ 6110]
Christian Hammond <chipx86@chipx86.com>
parents:
5688
diff
changeset
|
803 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
804 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
805 | while (dialog->protocol_opt_entries != NULL) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
806 | ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
807 | 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
|
808 | 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
|
809 | dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, dialog->protocol_opt_entries); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
810 | } |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
811 | |
|
25730
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
812 | if (dialog->prpl_info == NULL || |
|
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
813 | dialog->prpl_info->protocol_options == NULL) |
|
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
814 | return; |
|
c2698534cbb1
Backport 96cf043274a971d5a2b9e01ef85fb60ca2a4bcd1 (#8747 - Crash when a prpl has no protocol options.)
Daniel Atallah <datallah@pidgin.im>
parents:
25529
diff
changeset
|
815 | |
|
5690
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
816 | account = dialog->account; |
|
282596819f53
[gaim-migrate @ 6111]
Christian Hammond <chipx86@chipx86.com>
parents:
5689
diff
changeset
|
817 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
818 | /* Main vbox */ |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
819 | dialog->protocol_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
820 | 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
|
821 | 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
|
822 | gtk_label_new_with_mnemonic(_("Ad_vanced")), 1); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
823 | gtk_widget_show(vbox); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
824 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
825 | for (l = dialog->prpl_info->protocol_options; l != NULL; l = l->next) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
826 | { |
| 15884 | 827 | option = (PurpleAccountOption *)l->data; |
| 828 | ||
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
829 | opt_entry = g_new0(ProtocolOptEntry, 1); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
830 | opt_entry->type = purple_account_option_get_type(option); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
831 | 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
|
832 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
833 | switch (opt_entry->type) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
834 | { |
| 15884 | 835 | case PURPLE_PREF_BOOLEAN: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
836 | if (account == NULL || |
| 15884 | 837 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
838 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
839 | { |
| 15884 | 840 | bool_value = purple_account_option_get_default_bool(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
841 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
842 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
843 | { |
| 15884 | 844 | bool_value = purple_account_get_bool(account, |
| 845 | purple_account_option_get_setting(option), | |
| 846 | purple_account_option_get_default_bool(option)); | |
| 7956 | 847 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
848 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
849 | 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
|
850 | 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
|
851 | g_free(tmp); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
852 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
853 | gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check), |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
854 | bool_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
855 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
856 | gtk_box_pack_start(GTK_BOX(vbox), check, FALSE, FALSE, 0); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
857 | gtk_widget_show(check); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
858 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
859 | |
| 15884 | 860 | case PURPLE_PREF_INT: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
861 | if (account == NULL || |
| 15884 | 862 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
863 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
864 | { |
| 15884 | 865 | int_value = purple_account_option_get_default_int(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
866 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
867 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
868 | { |
| 15884 | 869 | int_value = purple_account_get_int(account, |
| 870 | purple_account_option_get_setting(option), | |
| 871 | purple_account_option_get_default_int(option)); | |
| 7956 | 872 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
873 | |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
874 | g_snprintf(buf, sizeof(buf), "%d", int_value); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
875 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
876 | opt_entry->widget = entry = gtk_entry_new(); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
877 | gtk_entry_set_text(GTK_ENTRY(entry), buf); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
878 | |
|
17672
a5c4e192659a
Add mnemonics to prpl provided account options, from OpenSolaris patch
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
17654
diff
changeset
|
879 | title = g_strdup_printf("_%s:", |
| 15884 | 880 | purple_account_option_get_text(option)); |
| 5774 | 881 | add_pref_box(dialog, vbox, title, entry); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
882 | g_free(title); |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
883 | break; |
|
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
884 | |
| 15884 | 885 | case PURPLE_PREF_STRING: |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
886 | if (account == NULL || |
| 15884 | 887 | strcmp(purple_account_get_protocol_id(account), |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
888 | dialog->protocol_id)) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
889 | { |
| 15884 | 890 | str_value = purple_account_option_get_default_string(option); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
891 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
892 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
893 | { |
| 15884 | 894 | str_value = purple_account_get_string(account, |
| 895 | purple_account_option_get_setting(option), | |
| 896 | purple_account_option_get_default_string(option)); | |
| 7956 | 897 | } |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
898 | |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
899 | opt_entry->widget = entry = gtk_entry_new(); |
| 15884 | 900 | if (purple_account_option_get_masked(option)) |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
901 | { |
|
10658
6223ea383921
[gaim-migrate @ 12190]
Richard Laager <rlaager@pidgin.im>
parents:
10649
diff
changeset
|
902 | gtk_entry_set_visibility(GTK_ENTRY(entry), FALSE); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
903 | #if !GTK_CHECK_VERSION(2,16,0) |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15352
diff
changeset
|
904 | if (gtk_entry_get_invisible_char(GTK_ENTRY(entry)) == '*') |
| 15882 | 905 | gtk_entry_set_invisible_char(GTK_ENTRY(entry), PIDGIN_INVISIBLE_CHAR); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
906 | #endif /* Less than GTK+ 2.16 */ |
|
11986
21d2ab6421a7
[gaim-migrate @ 14279]
Mark Doliner <markdoliner@pidgin.im>
parents:
11985
diff
changeset
|
907 | } |
|
5663
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
908 | |
|
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
909 | if (str_value != NULL) |
|
05c9effe5b5f
[gaim-migrate @ 6077]
Christian Hammond <chipx86@chipx86.com>
parents:
5662
diff
changeset
|
910 | gtk_entry_set_text(GTK_ENTRY(entry), 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 | 913 | purple_account_option_get_text(option)); |
| 5774 | 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 | 918 | case PURPLE_PREF_STRING_LIST: |
| 12106 | 919 | i = 0; |
|
12172
717fa0ec02c4
[gaim-migrate @ 14474]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12152
diff
changeset
|
920 | idx = 0; |
| 12106 | 921 | |
| 922 | if (account == NULL || | |
| 15884 | 923 | strcmp(purple_account_get_protocol_id(account), |
| 12106 | 924 | dialog->protocol_id)) |
| 925 | { | |
| 15884 | 926 | str_value = purple_account_option_get_default_list_value(option); |
| 12106 | 927 | } |
| 928 | else | |
| 929 | { | |
| 15884 | 930 | str_value = purple_account_get_string(account, |
| 931 | purple_account_option_get_setting(option), | |
| 932 | purple_account_option_get_default_list_value(option)); | |
| 12106 | 933 | } |
| 934 | ||
| 15884 | 935 | list = purple_account_option_get_list(option); |
| 12106 | 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 | 938 | |
| 15884 | 939 | /* Loop through list of PurpleKeyValuePair items */ |
| 12106 | 940 | for (node = list; node != NULL; node = node->next) { |
| 941 | if (node->data != NULL) { | |
| 15884 | 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 | 946 | |
| 947 | gtk_list_store_append(model, &iter); | |
| 948 | gtk_list_store_set(model, &iter, | |
| 949 | 0, kvp->key, | |
| 950 | 1, kvp->value, | |
| 951 | -1); | |
| 952 | } | |
| 953 | ||
| 954 | i++; | |
| 955 | } | |
| 956 | ||
| 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 | 959 | |
| 960 | /* Define renderer */ | |
| 961 | renderer = gtk_cell_renderer_text_new(); | |
| 962 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, | |
| 963 | TRUE); | |
| 964 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(combo), | |
| 965 | renderer, "text", 0, NULL); | |
| 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 | 968 | purple_account_option_get_text(option)); |
| 12106 | 969 | add_pref_box(dialog, vbox, title, combo); |
| 970 | g_free(title); | |
| 971 | break; | |
| 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 | 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 | 991 | GtkListStore *model; |
| 992 | GtkTreeIter iter; | |
| 993 | GtkCellRenderer *renderer; | |
| 994 | ||
| 995 | model = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT); | |
| 996 | dropdown = gtk_combo_box_new_with_model(GTK_TREE_MODEL(model)); | |
| 997 | ||
| 998 | gtk_list_store_append(model, &iter); | |
| 999 | gtk_list_store_set(model, &iter, | |
| 15884 | 1000 | 0, purple_running_gnome() ? _("Use GNOME Proxy Settings") |
| 15109 | 1001 | :_("Use Global Proxy Settings"), |
| 15884 | 1002 | 1, PURPLE_PROXY_USE_GLOBAL, |
| 8555 | 1003 | -1); |
| 1004 | ||
| 1005 | gtk_list_store_append(model, &iter); | |
| 1006 | gtk_list_store_set(model, &iter, | |
| 1007 | 0, _("No Proxy"), | |
| 15884 | 1008 | 1, PURPLE_PROXY_NONE, |
| 8555 | 1009 | -1); |
| 1010 | ||
| 1011 | gtk_list_store_append(model, &iter); | |
| 1012 | gtk_list_store_set(model, &iter, | |
| 1013 | 0, _("HTTP"), | |
| 15884 | 1014 | 1, PURPLE_PROXY_HTTP, |
| 8555 | 1015 | -1); |
| 1016 | ||
| 1017 | gtk_list_store_append(model, &iter); | |
| 1018 | gtk_list_store_set(model, &iter, | |
| 1019 | 0, _("SOCKS 4"), | |
| 15884 | 1020 | 1, PURPLE_PROXY_SOCKS4, |
| 8555 | 1021 | -1); |
| 1022 | ||
| 1023 | gtk_list_store_append(model, &iter); | |
| 1024 | gtk_list_store_set(model, &iter, | |
| 1025 | 0, _("SOCKS 5"), | |
| 15884 | 1026 | 1, PURPLE_PROXY_SOCKS5, |
| 8555 | 1027 | -1); |
| 1028 | ||
| 1029 | gtk_list_store_append(model, &iter); | |
| 1030 | gtk_list_store_set(model, &iter, | |
| 1031 | 0, _("Use Environmental Settings"), | |
| 15884 | 1032 | 1, PURPLE_PROXY_USE_ENVVAR, |
| 8555 | 1033 | -1); |
| 1034 | ||
| 1035 | renderer = gtk_cell_renderer_text_new(); | |
| 1036 | gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(dropdown), renderer, TRUE); | |
| 1037 | gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(dropdown), renderer, | |
| 1038 | "text", 0, NULL); | |
| 1039 | ||
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1040 | return dropdown; |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1041 | } |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1042 | |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1043 | static void |
| 8555 | 1044 | proxy_type_changed_cb(GtkWidget *menu, AccountPrefsDialog *dialog) |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1045 | { |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1046 | dialog->new_proxy_type = |
| 8555 | 1047 | gtk_combo_box_get_active(GTK_COMBO_BOX(menu)) - 1; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1048 | |
| 15884 | 1049 | if (dialog->new_proxy_type == PURPLE_PROXY_USE_GLOBAL || |
| 1050 | dialog->new_proxy_type == PURPLE_PROXY_NONE || | |
| 1051 | dialog->new_proxy_type == PURPLE_PROXY_USE_ENVVAR) { | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1052 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1053 | gtk_widget_hide_all(dialog->proxy_vbox); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1054 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1055 | else |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1056 | gtk_widget_show_all(dialog->proxy_vbox); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1057 | } |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1058 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1059 | static void |
| 5774 | 1060 | port_popup_cb(GtkWidget *w, GtkMenu *menu, gpointer data) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1061 | { |
|
13702
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1062 | GtkWidget *item1; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1063 | GtkWidget *item2; |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1064 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1065 | /* This is an easter egg. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1066 | It means one of two things, both intended as humourus: |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1067 | 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
|
1068 | look at butterflies. |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1069 | 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
|
1070 | 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
|
1071 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1072 | /* 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
|
1073 | 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
|
1074 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1075 | gtk_widget_show(item1); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1076 | gtk_widget_show(item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1077 | |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1078 | /* Prepend these in reverse order so they appear correctly. */ |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1079 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item2); |
|
35310965f38a
[gaim-migrate @ 16103]
Richard Laager <rlaager@pidgin.im>
parents:
13640
diff
changeset
|
1080 | gtk_menu_shell_prepend(GTK_MENU_SHELL(menu), item1); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1081 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1082 | |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1083 | static void |
| 5774 | 1084 | add_proxy_options(AccountPrefsDialog *dialog, GtkWidget *parent) |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1085 | { |
| 15884 | 1086 | PurpleProxyInfo *proxy_info; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1087 | GtkWidget *vbox; |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1088 | GtkWidget *vbox2; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1089 | |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1090 | if (dialog->proxy_frame != NULL) |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1091 | gtk_widget_destroy(dialog->proxy_frame); |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1092 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1093 | /* Main vbox */ |
|
26543
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1094 | dialog->proxy_frame = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1095 | gtk_container_add(GTK_CONTAINER(parent), vbox); |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1096 | gtk_widget_show(vbox); |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1097 | |
|
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1098 | /* Proxy Type drop-down. */ |
| 5774 | 1099 | dialog->proxy_dropdown = make_proxy_dropdown(); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1100 | |
| 5774 | 1101 | add_pref_box(dialog, vbox, _("Proxy _type:"), dialog->proxy_dropdown); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1102 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1103 | /* Setup the second vbox, which may be hidden at times. */ |
| 15882 | 1104 | dialog->proxy_vbox = vbox2 = gtk_vbox_new(FALSE, PIDGIN_HIG_BOX_SPACE); |
| 1105 | 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
|
1106 | gtk_widget_show(vbox2); |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1107 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1108 | /* Host */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1109 | dialog->proxy_host_entry = gtk_entry_new(); |
| 5774 | 1110 | add_pref_box(dialog, vbox2, _("_Host:"), dialog->proxy_host_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1111 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1112 | /* Port */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1113 | dialog->proxy_port_entry = gtk_entry_new(); |
| 5774 | 1114 | add_pref_box(dialog, vbox2, _("_Port:"), dialog->proxy_port_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1115 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1116 | g_signal_connect(G_OBJECT(dialog->proxy_port_entry), "populate-popup", |
| 5774 | 1117 | G_CALLBACK(port_popup_cb), NULL); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1118 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1119 | /* User */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1120 | dialog->proxy_user_entry = gtk_entry_new(); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1121 | |
| 5774 | 1122 | add_pref_box(dialog, vbox2, _("_Username:"), dialog->proxy_user_entry); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1123 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1124 | /* Password */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1125 | dialog->proxy_pass_entry = gtk_entry_new(); |
|
5700
8a0df68ba664
[gaim-migrate @ 6121]
Christian Hammond <chipx86@chipx86.com>
parents:
5699
diff
changeset
|
1126 | gtk_entry_set_visibility(GTK_ENTRY(dialog->proxy_pass_entry), FALSE); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
1127 | #if !GTK_CHECK_VERSION(2,16,0) |
|
15390
d429e03fc755
[gaim-migrate @ 18119]
Mark Doliner <markdoliner@pidgin.im>
parents:
15352
diff
changeset
|
1128 | if (gtk_entry_get_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry)) == '*') |
| 15882 | 1129 | gtk_entry_set_invisible_char(GTK_ENTRY(dialog->proxy_pass_entry), PIDGIN_INVISIBLE_CHAR); |
|
25457
477f84ff0a7e
GTK+ 2.16.0 will set the invisible character to a nice bullet instead of
Mark Doliner <markdoliner@pidgin.im>
parents:
25450
diff
changeset
|
1130 | #endif /* Less than GTK+ 2.16 */ |
| 5774 | 1131 | 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
|
1132 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1133 | if (dialog->account != NULL && |
| 15884 | 1134 | (proxy_info = purple_account_get_proxy_info(dialog->account)) != NULL) { |
| 1135 | ||
| 1136 | PurpleProxyType type = purple_proxy_info_get_type(proxy_info); | |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1137 | const char *value; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1138 | int int_val; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1139 | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1140 | /* Hah! */ |
|
6621
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6581
diff
changeset
|
1141 | /* I dunno what you're laughing about, fuzz ball. */ |
|
2a18ef3e5224
[gaim-migrate @ 7145]
Robert McQueen <robot101@debian.org>
parents:
6581
diff
changeset
|
1142 | dialog->new_proxy_type = type; |
| 8555 | 1143 | gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->proxy_dropdown), |
| 9662 | 1144 | type + 1); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1145 | |
| 15884 | 1146 | if (type == PURPLE_PROXY_USE_GLOBAL || type == PURPLE_PROXY_NONE || |
| 1147 | type == PURPLE_PROXY_USE_ENVVAR) | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1148 | gtk_widget_hide_all(vbox2); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1149 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1150 | |
| 15884 | 1151 | if ((value = purple_proxy_info_get_host(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1152 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_host_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1153 | |
| 15884 | 1154 | 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
|
1155 | char buf[11]; |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1156 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1157 | g_snprintf(buf, sizeof(buf), "%d", int_val); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1158 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1159 | 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
|
1160 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1161 | |
| 15884 | 1162 | if ((value = purple_proxy_info_get_username(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1163 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_user_entry), value); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1164 | |
| 15884 | 1165 | if ((value = purple_proxy_info_get_password(proxy_info)) != NULL) |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1166 | gtk_entry_set_text(GTK_ENTRY(dialog->proxy_pass_entry), value); |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1167 | } |
|
6856
5ed6b8356ebc
[gaim-migrate @ 7401]
Mark Doliner <markdoliner@pidgin.im>
parents:
6751
diff
changeset
|
1168 | else { |
| 15884 | 1169 | dialog->new_proxy_type = PURPLE_PROXY_USE_GLOBAL; |
| 8555 | 1170 | gtk_combo_box_set_active(GTK_COMBO_BOX(dialog->proxy_dropdown), |
| 1171 | dialog->new_proxy_type + 1); | |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1172 | gtk_widget_hide_all(vbox2); |
|
6856
5ed6b8356ebc
[gaim-migrate @ 7401]
Mark Doliner <markdoliner@pidgin.im>
parents:
6751
diff
changeset
|
1173 | } |
|
5687
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1174 | |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1175 | /* Connect signals. */ |
|
2c8a3137f1b8
[gaim-migrate @ 6108]
Christian Hammond <chipx86@chipx86.com>
parents:
5686
diff
changeset
|
1176 | g_signal_connect(G_OBJECT(dialog->proxy_dropdown), "changed", |
| 5774 | 1177 | G_CALLBACK(proxy_type_changed_cb), dialog); |
|
5681
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1178 | } |
|
514fbc5374dc
[gaim-migrate @ 6100]
Christian Hammond <chipx86@chipx86.com>
parents:
5664
diff
changeset
|
1179 | |
|
22032
8136dd5eeda3
Make some more event handlers return appropriate gboolean values. This turns
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22023
diff
changeset
|
1180 | static gboolean |
| 5774 | 1181 | account_win_destroy_cb(GtkWidget *w, GdkEvent *event, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1182 | AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1183 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1184 | g_hash_table_remove(account_pref_wins, dialog->account); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1185 | |
| 7450 | 1186 | gtk_widget_destroy(dialog->window); |
| 1187 | ||
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1188 | g_list_free(dialog->user_split_entries); |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1189 | while (dialog->protocol_opt_entries != NULL) { |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1190 | ProtocolOptEntry *opt_entry = dialog->protocol_opt_entries->data; |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1191 | 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
|
1192 | 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
|
1193 | dialog->protocol_opt_entries = g_list_delete_link(dialog->protocol_opt_entries, dialog->protocol_opt_entries); |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1194 | } |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
1195 | g_free(dialog->protocol_id); |
|
21123
7dbce8723eff
Fix a leak of a GtkSizeGroup.
Daniel Atallah <datallah@pidgin.im>
parents:
20228
diff
changeset
|
1196 | g_object_unref(dialog->sg); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1197 | |
|
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
|
1198 | purple_imgstore_unref(dialog->icon_img); |
|
10519
80801a34a246
[gaim-migrate @ 11833]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10432
diff
changeset
|
1199 | |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
1200 | if (dialog->icon_filesel) |
|
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
1201 | gtk_widget_destroy(dialog->icon_filesel); |
| 5826 | 1202 | |
| 15884 | 1203 | purple_signals_disconnect_by_handle(dialog); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
1204 | |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1205 | 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
|
1206 | return FALSE; |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1207 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1208 | |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1209 | static void |
| 5774 | 1210 | cancel_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1211 | { |
| 5774 | 1212 | account_win_destroy_cb(NULL, NULL, dialog); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1213 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1214 | |
|
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
|
1215 | static void |
| 5774 | 1216 | ok_account_prefs_cb(GtkWidget *w, AccountPrefsDialog *dialog) |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1217 | { |
| 15884 | 1218 | PurpleProxyInfo *proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1219 | GList *l, *l2; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1220 | const char *value; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1221 | char *username; |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1222 | 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
|
1223 | gboolean new_acct = FALSE, icon_change = FALSE; |
| 15884 | 1224 | PurpleAccount *account; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1225 | |
|
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
|
1226 | /* 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
|
1227 | 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
|
1228 | |
|
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
|
1229 | if (dialog->prpl_info != 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
|
1230 | { |
|
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
|
1231 | for (l = dialog->prpl_info->user_splits, |
|
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
|
1232 | 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
|
1233 | 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
|
1234 | 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
|
1235 | { |
|
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
|
1236 | 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
|
1237 | 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
|
1238 | 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
|
1239 | |
|
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
|
1240 | value = gtk_entry_get_text(entry); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1241 | |
|
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
|
1242 | *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
|
1243 | |
|
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
|
1244 | 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
|
1245 | (*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
|
1246 | 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
|
1247 | 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
|
1248 | |
|
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
|
1249 | 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
|
1250 | 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
|
1251 | } |
|
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
|
1252 | } |
|
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
|
1253 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1254 | if (dialog->account == NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1255 | { |
|
19669
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1256 | 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
|
1257 | 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
|
1258 | 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
|
1259 | |
|
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 | purple_notify_error(NULL, NULL, _("Unable to save new account"), |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1261 | _("An account already exists with the specified criteria.")); |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1262 | |
|
999fdd697e69
Don't allow duplicate accounts to be added. Ideally some of these checks should be in the core, but I don't see a way of doing that without forcing 3.0.0. Fixes #2269 (the part that was actually broken).
Daniel Atallah <datallah@pidgin.im>
parents:
19575
diff
changeset
|
1263 | 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
|
1264 | 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
|
1265 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1266 | |
|
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
|
1267 | 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
|
1268 | /* We're adding our first account. Be polite and show the buddy list */ |
|
63cbab1c4036
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <markdoliner@pidgin.im>
parents:
18841
diff
changeset
|
1269 | purple_blist_set_visible(TRUE); |
|
63cbab1c4036
When a new user starts Pidgin we hide the buddy list so that they only
Mark Doliner <markdoliner@pidgin.im>
parents:
18841
diff
changeset
|
1270 | } |
|
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
|
1271 | |
|
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
|
1272 | 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
|
1273 | new_acct = TRUE; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1274 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1275 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1276 | { |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1277 | account = dialog->account; |
|
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1278 | |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1279 | /* Protocol */ |
| 15884 | 1280 | purple_account_set_protocol_id(account, dialog->protocol_id); |
|
5699
b47a3b7d1247
[gaim-migrate @ 6120]
Christian Hammond <chipx86@chipx86.com>
parents:
5698
diff
changeset
|
1281 | } |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1282 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1283 | /* Alias */ |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1284 | value = gtk_entry_get_text(GTK_ENTRY(dialog->alias_entry)); |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1285 | |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1286 | if (*value != '\0') |
| 15884 | 1287 | purple_account_set_alias(account, value); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1288 | else |
| 15884 | 1289 | purple_account_set_alias(account, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1290 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1291 | /* Buddy Icon */ |
|
23880
087566fba156
Fix a crash that occurs when you try to edit an account and no prpls are available. Fixes #6355.
Daniel Atallah <datallah@pidgin.im>
parents:
23376
diff
changeset
|
1292 | if (dialog->prpl_info != NULL && dialog->prpl_info->icon_spec.format != NULL) |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1293 | { |
|
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
|
1294 | 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
|
1295 | |
|
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 | 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
|
1297 | gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->icon_check))) |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1298 | { |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1299 | icon_change = TRUE; |
|
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1300 | } |
| 15884 | 1301 | 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
|
1302 | |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1303 | 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
|
1304 | { |
|
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
|
1305 | 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
|
1306 | { |
|
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
|
1307 | size_t len = purple_imgstore_get_size(dialog->icon_img); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1308 | purple_buddy_icons_set_account_icon(account, |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1309 | g_memdup(purple_imgstore_get_data(dialog->icon_img), len), |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1310 | 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
|
1311 | purple_account_set_buddy_icon_path(account, purple_imgstore_get_filename(dialog->icon_img)); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1312 | } |
|
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
|
1313 | 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
|
1314 | { |
|
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
|
1315 | 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
|
1316 | 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
|
1317 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1318 | } |
|
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
|
1319 | 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
|
1320 | { |
|
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
|
1321 | size_t len; |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
1322 | gpointer data = pidgin_convert_buddy_icon(dialog->plugin, filename, &len); |
| 15884 | 1323 | 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
|
1324 | purple_buddy_icons_set_account_icon(account, data, len); |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1325 | } |
| 14195 | 1326 | } |
|
14313
c766ccc907f7
[gaim-migrate @ 16933]
Mark Doliner <markdoliner@pidgin.im>
parents:
14258
diff
changeset
|
1327 | |
|
10432
da2df724be56
[gaim-migrate @ 11684]
Mark Doliner <markdoliner@pidgin.im>
parents:
10420
diff
changeset
|
1328 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1329 | /* Remember Password */ |
| 15884 | 1330 | purple_account_set_remember_password(account, |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1331 | gtk_toggle_button_get_active( |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1332 | GTK_TOGGLE_BUTTON(dialog->remember_pass_check))); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1333 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1334 | /* Check Mail */ |
| 7208 | 1335 | if (dialog->prpl_info && dialog->prpl_info->options & OPT_PROTO_MAIL_CHECK) |
| 15884 | 1336 | purple_account_set_check_mail(account, |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1337 | gtk_toggle_button_get_active( |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1338 | GTK_TOGGLE_BUTTON(dialog->new_mail_check))); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1339 | |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1340 | /* Password */ |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1341 | value = gtk_entry_get_text(GTK_ENTRY(dialog->password_entry)); |
|
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1342 | |
|
11985
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1343 | /* |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1344 | * 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
|
1345 | * 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
|
1346 | * 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
|
1347 | * don't want to prompt them. |
|
d4a210fb43e9
[gaim-migrate @ 14278]
Mark Doliner <markdoliner@pidgin.im>
parents:
11789
diff
changeset
|
1348 | */ |
|
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
|
1349 | if ((purple_account_get_remember_password(account) || new_acct) && (*value != '\0')) |
| 15884 | 1350 | purple_account_set_password(account, value); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1351 | else |
| 15884 | 1352 | purple_account_set_password(account, NULL); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1353 | |
| 15884 | 1354 | purple_account_set_username(account, username); |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1355 | g_free(username); |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1356 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1357 | /* Add the protocol settings */ |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1358 | if (dialog->prpl_info) { |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1359 | 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
|
1360 | 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
|
1361 | 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
|
1362 | 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
|
1363 | 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
|
1364 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1365 | 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
|
1366 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1367 | 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
|
1368 | |
|
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1369 | switch (opt_entry->type) { |
| 15884 | 1370 | case PURPLE_PREF_STRING: |
|
25450
0ae013105e09
When saving the account settings, use the protocol options that were present at
Daniel Atallah <datallah@pidgin.im>
parents:
25390
diff
changeset
|
1371 | value = 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
|
1372 | purple_account_set_string(account, opt_entry->setting, value); |
| 7208 | 1373 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1374 | |
| 15884 | 1375 | 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
|
1376 | 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
|
1377 | purple_account_set_int(account, opt_entry->setting, int_value); |
| 7208 | 1378 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1379 | |
| 15884 | 1380 | case PURPLE_PREF_BOOLEAN: |
| 7208 | 1381 | 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
|
1382 | 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
|
1383 | purple_account_set_bool(account, opt_entry->setting, bool_value); |
| 7208 | 1384 | break; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1385 | |
| 15884 | 1386 | case PURPLE_PREF_STRING_LIST: |
|
20228
ce019944d765
applied changes from 9d35dde0c779cca73548172223ba557f27d61882
Luke Schierer <lschiere@pidgin.im>
parents:
20147
diff
changeset
|
1387 | 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
|
1388 | 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
|
1389 | 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
|
1390 | purple_account_set_string(account, opt_entry->setting, value2); |
| 12106 | 1391 | break; |
| 1392 | ||
| 7208 | 1393 | default: |
| 1394 | break; | |
| 1395 | } | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1396 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1397 | } |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1398 | |
|
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1399 | /* Set the proxy stuff. */ |
| 15884 | 1400 | proxy_info = purple_account_get_proxy_info(account); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1401 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1402 | /* Create the proxy info if it doesn't exist. */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1403 | if (proxy_info == NULL) { |
| 15884 | 1404 | proxy_info = purple_proxy_info_new(); |
| 1405 | purple_account_set_proxy_info(account, proxy_info); | |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1406 | } |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1407 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1408 | /* Set the proxy info type. */ |
| 15884 | 1409 | purple_proxy_info_set_type(proxy_info, dialog->new_proxy_type); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1410 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1411 | /* Host */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1412 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_host_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1413 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1414 | if (*value != '\0') |
| 15884 | 1415 | purple_proxy_info_set_host(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1416 | else |
| 15884 | 1417 | purple_proxy_info_set_host(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1418 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1419 | /* Port */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1420 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_port_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1421 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1422 | if (*value != '\0') |
| 15884 | 1423 | purple_proxy_info_set_port(proxy_info, atoi(value)); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1424 | else |
| 15884 | 1425 | purple_proxy_info_set_port(proxy_info, 0); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1426 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1427 | /* Username */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1428 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_user_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1429 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1430 | if (*value != '\0') |
| 15884 | 1431 | purple_proxy_info_set_username(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1432 | else |
| 15884 | 1433 | purple_proxy_info_set_username(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1434 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1435 | /* Password */ |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1436 | value = gtk_entry_get_text(GTK_ENTRY(dialog->proxy_pass_entry)); |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1437 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1438 | if (*value != '\0') |
| 15884 | 1439 | purple_proxy_info_set_password(proxy_info, value); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1440 | else |
| 15884 | 1441 | purple_proxy_info_set_password(proxy_info, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1442 | |
|
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1443 | /* If there are no values set then proxy_info NULL */ |
| 15884 | 1444 | if ((purple_proxy_info_get_type(proxy_info) == PURPLE_PROXY_USE_GLOBAL) && |
| 1445 | (purple_proxy_info_get_host(proxy_info) == NULL) && | |
| 1446 | (purple_proxy_info_get_port(proxy_info) == 0) && | |
| 1447 | (purple_proxy_info_get_username(proxy_info) == NULL) && | |
| 1448 | (purple_proxy_info_get_password(proxy_info) == NULL)) | |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1449 | { |
| 15884 | 1450 | purple_account_set_proxy_info(account, NULL); |
|
15041
18a6f6cdce33
[gaim-migrate @ 17758]
Daniel Atallah <datallah@pidgin.im>
parents:
14921
diff
changeset
|
1451 | proxy_info = NULL; |
|
5696
3f0ee30f10ff
[gaim-migrate @ 6117]
Christian Hammond <chipx86@chipx86.com>
parents:
5693
diff
changeset
|
1452 | } |
|
5697
146c609c3733
[gaim-migrate @ 6118]
Christian Hammond <chipx86@chipx86.com>
parents:
5696
diff
changeset
|
1453 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1454 | /* 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
|
1455 | if (new_acct) |
| 15884 | 1456 | purple_accounts_add(account); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1457 | else |
| 15884 | 1458 | purple_signal_emit(pidgin_account_get_handle(), "account-modified", account); |
|
11739
cc15987b3937
[gaim-migrate @ 14030]
Mark Doliner <markdoliner@pidgin.im>
parents:
11733
diff
changeset
|
1459 | |
|
11987
a6eb4a3f1136
[gaim-migrate @ 14280]
Mark Doliner <markdoliner@pidgin.im>
parents:
11986
diff
changeset
|
1460 | /* 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
|
1461 | if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(dialog->register_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
|
1462 | 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
|
1463 | } else if (new_acct) { |
| 15884 | 1464 | const PurpleSavedStatus *saved_status; |
| 1465 | ||
| 1466 | saved_status = purple_savedstatus_get_current(); | |
|
12125
c1e55f812ded
[gaim-migrate @ 14425]
Mark Doliner <markdoliner@pidgin.im>
parents:
12123
diff
changeset
|
1467 | if (saved_status != NULL) { |
| 15884 | 1468 | purple_savedstatus_activate_for_account(saved_status, account); |
| 1469 | purple_account_set_enabled(account, PIDGIN_UI, TRUE); | |
|
12121
cc63210cdc8b
[gaim-migrate @ 14421]
Daniel Atallah <datallah@pidgin.im>
parents:
12106
diff
changeset
|
1470 | } |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1471 | } |
|
10932
a38fb730e964
[gaim-migrate @ 12711]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
10931
diff
changeset
|
1472 | |
| 16889 | 1473 | /* We no longer need the data from the dialog window */ |
| 1474 | account_win_destroy_cb(NULL, NULL, dialog); | |
| 1475 | ||
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1476 | } |
|
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1477 | |
| 9314 | 1478 | 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
|
1479 | {"text/plain", 0, 0}, |
| 9314 | 1480 | {"text/uri-list", 0, 1}, |
| 1481 | {"STRING", 0, 2} | |
| 1482 | }; | |
| 1483 | ||
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1484 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1485 | pidgin_account_dialog_show(PidginAccountDialogType type, |
| 15884 | 1486 | PurpleAccount *account) |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1487 | { |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1488 | AccountPrefsDialog *dialog; |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1489 | GtkWidget *win; |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1490 | GtkWidget *main_vbox; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1491 | GtkWidget *vbox; |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1492 | GtkWidget *dbox; |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1493 | GtkWidget *notebook; |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1494 | GtkWidget *button; |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1495 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1496 | if (accounts_window != NULL && account != NULL && |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1497 | (dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1498 | { |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1499 | gtk_window_present(GTK_WINDOW(dialog->window)); |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1500 | return; |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1501 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1502 | |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1503 | dialog = g_new0(AccountPrefsDialog, 1); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1504 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1505 | if (accounts_window != NULL && account != NULL) |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1506 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1507 | g_hash_table_insert(account_pref_wins, account, dialog); |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1508 | } |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1509 | |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1510 | dialog->account = account; |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1511 | dialog->type = type; |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1512 | dialog->sg = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1513 | |
|
9971
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1514 | if (dialog->account == NULL) { |
|
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1515 | /* Select the first prpl in the list*/ |
| 15884 | 1516 | GList *prpl_list = purple_plugins_get_protocols(); |
|
9971
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1517 | if (prpl_list != NULL) |
| 15884 | 1518 | dialog->protocol_id = g_strdup(((PurplePlugin *) prpl_list->data)->info->id); |
|
9971
8291bafb0025
[gaim-migrate @ 10882]
Daniel Atallah <datallah@pidgin.im>
parents:
9944
diff
changeset
|
1519 | } |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1520 | else |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1521 | { |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1522 | dialog->protocol_id = |
| 15884 | 1523 | g_strdup(purple_account_get_protocol_id(dialog->account)); |
|
5978
e9bbb1ec8c89
[gaim-migrate @ 6425]
Christian Hammond <chipx86@chipx86.com>
parents:
5966
diff
changeset
|
1524 | } |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1525 | |
| 15884 | 1526 | if ((dialog->plugin = purple_find_prpl(dialog->protocol_id)) != NULL) |
| 1527 | dialog->prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(dialog->plugin); | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1528 | |
|
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
|
1529 | 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
|
1530 | PIDGIN_HIG_BOX_SPACE, "account", FALSE); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1531 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1532 | g_signal_connect(G_OBJECT(win), "delete_event", |
| 5774 | 1533 | G_CALLBACK(account_win_destroy_cb), dialog); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1534 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1535 | /* 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
|
1536 | 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
|
1537 | |
|
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
|
1538 | dialog->notebook = notebook = gtk_notebook_new(); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1539 | 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
|
1540 | gtk_widget_show(GTK_WIDGET(notebook)); |
|
11008
35900a535c11
[gaim-migrate @ 12868]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
10967
diff
changeset
|
1541 | |
|
5686
45ae373be142
[gaim-migrate @ 6107]
Christian Hammond <chipx86@chipx86.com>
parents:
5681
diff
changeset
|
1542 | /* Setup the inner vbox */ |
| 15882 | 1543 | dialog->top_vbox = vbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 1544 | 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
|
1545 | 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
|
1546 | gtk_label_new_with_mnemonic(_("_Basic"))); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1547 | gtk_widget_show(vbox); |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1548 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1549 | /* Setup the top frames. */ |
| 5774 | 1550 | add_login_options(dialog, vbox); |
| 1551 | add_user_options(dialog, vbox); | |
|
5658
c50a2c4faf9c
[gaim-migrate @ 6072]
Christian Hammond <chipx86@chipx86.com>
parents:
5657
diff
changeset
|
1552 | |
|
23266
4abc3fc944da
Add a mnemonic to "Create this new account on the server".
Will Thompson <resiak@pidgin.im>
parents:
22982
diff
changeset
|
1553 | 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
|
1554 | _("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
|
1555 | 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
|
1556 | 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
|
1557 | dialog->register_button = 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
|
1558 | 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
|
1559 | 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
|
1560 | |
|
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
|
1561 | if (!dialog->prpl_info || !dialog->prpl_info->register_user) |
|
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
|
1562 | 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
|
1563 | |
|
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
|
1564 | /* Setup the page with 'Advanced' (protocol options). */ |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1565 | add_protocol_options(dialog); |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1566 | |
|
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
|
1567 | /* Setup the page with 'Proxy'. */ |
|
2ff0a924a18e
Break the New Account dialog into three tabs. Move proxy options to the new
Michael Terry <michael.terry@canonical.com>
parents:
26475
diff
changeset
|
1568 | dbox = gtk_vbox_new(FALSE, PIDGIN_HIG_BORDER); |
| 15882 | 1569 | 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
|
1570 | 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
|
1571 | gtk_label_new_with_mnemonic(_("P_roxy"))); |
|
11638
1821b40269a3
[gaim-migrate @ 13914]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
11358
diff
changeset
|
1572 | gtk_widget_show(dbox); |
| 5774 | 1573 | add_proxy_options(dialog, dbox); |
|
5660
90787278c739
[gaim-migrate @ 6074]
Christian Hammond <chipx86@chipx86.com>
parents:
5658
diff
changeset
|
1574 | |
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1575 | /* Cancel button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
1576 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CANCEL, G_CALLBACK(cancel_account_prefs_cb), dialog); |
|
5692
0ec004b516c2
[gaim-migrate @ 6113]
Christian Hammond <chipx86@chipx86.com>
parents:
5690
diff
changeset
|
1577 | |
|
5850
9537237a7a87
[gaim-migrate @ 6281]
Christian Hammond <chipx86@chipx86.com>
parents:
5842
diff
changeset
|
1578 | /* 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
|
1579 | button = pidgin_dialog_add_button(GTK_DIALOG(win), |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1580 | (type == PIDGIN_ADD_ACCOUNT_DIALOG) ? GTK_STOCK_ADD : GTK_STOCK_SAVE, |
|
02100938b030
Make dialogs that double as add and save dialogs indicate the current action
Etan Reisner <deryni@pidgin.im>
parents:
25318
diff
changeset
|
1581 | 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
|
1582 | dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1583 | if (dialog->account == NULL) |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1584 | gtk_widget_set_sensitive(button, FALSE); |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1585 | dialog->ok_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
1586 | |
| 9314 | 1587 | /* Set up DND */ |
| 1588 | gtk_drag_dest_set(dialog->window, | |
| 1589 | GTK_DEST_DEFAULT_MOTION | | |
| 1590 | GTK_DEST_DEFAULT_DROP, | |
| 1591 | dnd_targets, | |
| 1592 | sizeof(dnd_targets) / sizeof(GtkTargetEntry), | |
| 1593 | GDK_ACTION_COPY); | |
| 1594 | ||
| 1595 | g_signal_connect(G_OBJECT(dialog->window), "drag_data_received", | |
| 1596 | G_CALLBACK(account_dnd_recv), dialog); | |
| 1597 | ||
|
5657
6c1febf7aca1
[gaim-migrate @ 6071]
Christian Hammond <chipx86@chipx86.com>
parents:
5656
diff
changeset
|
1598 | /* Show the window. */ |
|
5641
a9d1f7917dd4
[gaim-migrate @ 6054]
Christian Hammond <chipx86@chipx86.com>
parents:
5638
diff
changeset
|
1599 | 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
|
1600 | 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
|
1601 | gtk_widget_grab_focus(dialog->protocol_menu); |
|
5638
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1602 | } |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1603 | |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1604 | /************************************************************************** |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1605 | * Accounts Dialog |
|
53e752c88ea1
[gaim-migrate @ 6047]
Christian Hammond <chipx86@chipx86.com>
parents:
5637
diff
changeset
|
1606 | **************************************************************************/ |
|
7179
1769277c6e15
[gaim-migrate @ 7747]
Christian Hammond <chipx86@chipx86.com>
parents:
7159
diff
changeset
|
1607 | static void |
| 15884 | 1608 | signed_on_off_cb(PurpleConnection *gc, gpointer user_data) |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1609 | { |
| 15884 | 1610 | PurpleAccount *account; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1611 | GtkTreeModel *model; |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1612 | GtkTreeIter iter; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1613 | GdkPixbuf *pixbuf; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1614 | size_t index; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1615 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1616 | /* 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
|
1617 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1618 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1619 | |
| 15884 | 1620 | account = purple_connection_get_account(gc); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1621 | model = GTK_TREE_MODEL(accounts_window->model); |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1622 | index = g_list_index(purple_accounts_get_all(), account); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1623 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1624 | if (gtk_tree_model_iter_nth_child(model, &iter, NULL, index)) |
|
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1625 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1626 | pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
| 15884 | 1627 | if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1628 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1629 | |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1630 | gtk_list_store_set(accounts_window->model, &iter, |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1631 | COLUMN_ICON, pixbuf, |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1632 | -1); |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1633 | |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
1634 | if (pixbuf != NULL) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
1635 | g_object_unref(G_OBJECT(pixbuf)); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1636 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1637 | } |
|
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
1638 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1639 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1640 | * Get the GtkTreeIter of the specified account in the |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1641 | * GtkListStore |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1642 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1643 | static gboolean |
| 15884 | 1644 | accounts_window_find_account_in_treemodel(GtkTreeIter *iter, PurpleAccount *account) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1645 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1646 | GtkTreeModel *model; |
| 15884 | 1647 | PurpleAccount *cur; |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1648 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1649 | g_return_val_if_fail(account != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1650 | g_return_val_if_fail(accounts_window != NULL, FALSE); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1651 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1652 | model = GTK_TREE_MODEL(accounts_window->model); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1653 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1654 | if (!gtk_tree_model_get_iter_first(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1655 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1656 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1657 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1658 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1659 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1660 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1661 | while (gtk_tree_model_iter_next(model, iter)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1662 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1663 | gtk_tree_model_get(model, iter, COLUMN_DATA, &cur, -1); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1664 | if (cur == account) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1665 | return TRUE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1666 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1667 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1668 | return FALSE; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1669 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1670 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1671 | static void |
| 15884 | 1672 | account_removed_cb(PurpleAccount *account, gpointer user_data) |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1673 | { |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1674 | AccountPrefsDialog *dialog; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1675 | GtkTreeIter iter; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1676 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1677 | /* If the account was being modified, close the edit window */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1678 | if ((dialog = g_hash_table_lookup(account_pref_wins, account)) != NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1679 | account_win_destroy_cb(NULL, NULL, dialog); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1680 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1681 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1682 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1683 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1684 | /* Remove the account from the GtkListStore */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1685 | if (accounts_window_find_account_in_treemodel(&iter, account)) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1686 | 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
|
1687 | |
| 15884 | 1688 | if (purple_accounts_get_all() == NULL) |
| 15053 | 1689 | 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
|
1690 | } |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
1691 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1692 | static void |
| 15884 | 1693 | account_abled_cb(PurpleAccount *account, gpointer user_data) |
| 12070 | 1694 | { |
| 1695 | GtkTreeIter iter; | |
| 1696 | ||
| 1697 | if (accounts_window == NULL) | |
| 1698 | return; | |
| 1699 | ||
| 1700 | /* update the account in the GtkListStore */ | |
| 1701 | if (accounts_window_find_account_in_treemodel(&iter, account)) | |
| 1702 | gtk_list_store_set(accounts_window->model, &iter, | |
| 1703 | COLUMN_ENABLED, GPOINTER_TO_INT(user_data), | |
| 1704 | -1); | |
| 1705 | } | |
| 1706 | ||
| 1707 | static void | |
| 5774 | 1708 | drag_data_get_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1709 | GtkSelectionData *data, guint info, guint time, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1710 | AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1711 | { |
| 15884 | 1712 | if (data->target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE)) { |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1713 | GtkTreeRowReference *ref; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1714 | GtkTreePath *source_row; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1715 | GtkTreeIter iter; |
| 15884 | 1716 | PurpleAccount *account = NULL; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1717 | GValue val; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1718 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1719 | 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
|
1720 | source_row = gtk_tree_row_reference_get_path(ref); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1721 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1722 | if (source_row == NULL) |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1723 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1724 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1725 | gtk_tree_model_get_iter(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1726 | source_row); |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1727 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1728 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1729 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1730 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1731 | dialog->drag_iter = iter; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1732 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1733 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1734 | |
| 15884 | 1735 | 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
|
1736 | 8, (void *)&account, sizeof(account)); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1737 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1738 | gtk_tree_path_free(source_row); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1739 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1740 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1741 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1742 | static void |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1743 | move_account_after(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1744 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1745 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1746 | GtkTreeIter new_iter; |
| 15884 | 1747 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1748 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1749 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1750 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1751 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1752 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1753 | gtk_list_store_insert_after(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1754 | |
|
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
|
1755 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1756 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1757 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1758 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1759 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1760 | static void |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1761 | move_account_before(GtkListStore *store, GtkTreeIter *iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1762 | GtkTreeIter *position) |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1763 | { |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1764 | GtkTreeIter new_iter; |
| 15884 | 1765 | PurpleAccount *account; |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1766 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1767 | gtk_tree_model_get(GTK_TREE_MODEL(store), iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1768 | COLUMN_DATA, &account, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1769 | -1); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1770 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1771 | gtk_list_store_insert_before(store, &new_iter, position); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1772 | |
|
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
|
1773 | set_account(store, &new_iter, account, NULL); |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1774 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1775 | gtk_list_store_remove(store, iter); |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1776 | } |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1777 | |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1778 | static void |
| 5774 | 1779 | drag_data_received_cb(GtkWidget *widget, GdkDragContext *ctx, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1780 | guint x, guint y, GtkSelectionData *sd, |
|
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1781 | guint info, guint t, AccountsWindow *dialog) |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1782 | { |
| 15884 | 1783 | if (sd->target == gdk_atom_intern("PURPLE_ACCOUNT", FALSE) && sd->data) { |
|
12420
00bd43a1ac8a
[gaim-migrate @ 14727]
Richard Laager <rlaager@pidgin.im>
parents:
12376
diff
changeset
|
1784 | gint dest_index; |
| 15884 | 1785 | PurpleAccount *a = NULL; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1786 | GtkTreePath *path = NULL; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1787 | GtkTreeViewDropPosition position; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1788 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1789 | memcpy(&a, sd->data, sizeof(a)); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1790 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1791 | 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
|
1792 | &path, &position)) { |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1793 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1794 | GtkTreeIter iter; |
| 15884 | 1795 | PurpleAccount *account; |
|
12600
7ecd4441fdc7
[gaim-migrate @ 14934]
Richard Laager <rlaager@pidgin.im>
parents:
12555
diff
changeset
|
1796 | GValue val; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1797 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1798 | 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
|
1799 | val.g_type = 0; |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1800 | gtk_tree_model_get_value(GTK_TREE_MODEL(dialog->model), &iter, |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1801 | COLUMN_DATA, &val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1802 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1803 | account = g_value_get_pointer(&val); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1804 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1805 | switch (position) { |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1806 | case GTK_TREE_VIEW_DROP_AFTER: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1807 | case GTK_TREE_VIEW_DROP_INTO_OR_AFTER: |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1808 | move_account_after(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1809 | &iter); |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1810 | dest_index = g_list_index(purple_accounts_get_all(), |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1811 | account) + 1; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1812 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1813 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1814 | case GTK_TREE_VIEW_DROP_BEFORE: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1815 | case GTK_TREE_VIEW_DROP_INTO_OR_BEFORE: |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
1816 | dest_index = g_list_index(purple_accounts_get_all(), |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1817 | account); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1818 | |
|
5802
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1819 | move_account_before(dialog->model, &dialog->drag_iter, |
|
3f6144df9d97
[gaim-migrate @ 6232]
Christian Hammond <chipx86@chipx86.com>
parents:
5783
diff
changeset
|
1820 | &iter); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1821 | break; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1822 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1823 | default: |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1824 | return; |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1825 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1826 | |
| 15884 | 1827 | purple_accounts_reorder(a, dest_index); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1828 | } |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
1829 | } |
|
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 | |
|
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
|
1832 | static gboolean |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1833 | accedit_win_destroy_cb(GtkWidget *w, GdkEvent *event, AccountsWindow *dialog) |
| 5563 | 1834 | { |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
1835 | 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
|
1836 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1837 | pidgin_accounts_window_hide(); |
|
7159
7b8db8de4054
[gaim-migrate @ 7726]
Mark Doliner <markdoliner@pidgin.im>
parents:
7107
diff
changeset
|
1838 | |
| 5563 | 1839 | return FALSE; |
| 1840 | } | |
| 1841 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1842 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1843 | add_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1844 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1845 | pidgin_account_dialog_show(PIDGIN_ADD_ACCOUNT_DIALOG, NULL); |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1846 | } |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1847 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1848 | static void |
| 5774 | 1849 | modify_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1850 | GtkTreeIter *iter, gpointer data) |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1851 | { |
| 15884 | 1852 | PurpleAccount *account; |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1853 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1854 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1855 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1856 | if (account != NULL) |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1857 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1858 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1859 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1860 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1861 | modify_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1862 | { |
|
5651
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1863 | GtkTreeSelection *selection; |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1864 | |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1865 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
ae0744d896bc
[gaim-migrate @ 6065]
Christian Hammond <chipx86@chipx86.com>
parents:
5648
diff
changeset
|
1866 | |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1867 | gtk_tree_selection_selected_foreach(selection, modify_account_sel, dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1868 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1869 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1870 | static void |
| 15884 | 1871 | delete_account_cb(PurpleAccount *account) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1872 | { |
| 15884 | 1873 | purple_accounts_delete(account); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1874 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1875 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1876 | static void |
| 5774 | 1877 | ask_delete_account_sel(GtkTreeModel *model, GtkTreePath *path, |
|
8405
1893bfff3b82
[gaim-migrate @ 9135]
Christian Hammond <chipx86@chipx86.com>
parents:
8363
diff
changeset
|
1878 | GtkTreeIter *iter, gpointer data) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1879 | { |
| 15884 | 1880 | PurpleAccount *account; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1881 | |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1882 | gtk_tree_model_get(model, iter, COLUMN_DATA, &account, -1); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1883 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1884 | if (account != NULL) { |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
1885 | char *buf; |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1886 | |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
1887 | buf = g_strdup_printf(_("Are you sure you want to delete %s?"), |
| 15884 | 1888 | purple_account_get_username(account)); |
| 1889 | ||
| 1890 | 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
|
1891 | purple_request_action(account, NULL, buf, NULL, |
|
d14ac3ae2007
The Gnome Human Interface Guidelines say, "if pressing this button by
Mark Doliner <markdoliner@pidgin.im>
parents:
22214
diff
changeset
|
1892 | PURPLE_DEFAULT_ACTION_NONE, |
|
16490
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16412
diff
changeset
|
1893 | account, NULL, NULL, |
|
68c22924d66b
Added account, who, and conversation parameters to the request API calls, and updated all code to match. I can't compile the Perl module, so I'd appreciate it if someone who knows it would verify that this doesn't break Perl.
Evan Schoenberg <evands@pidgin.im>
parents:
16412
diff
changeset
|
1894 | account, 2, |
| 5774 | 1895 | _("Delete"), delete_account_cb, |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1896 | _("Cancel"), NULL); |
|
7677
4f40f17e1ad9
[gaim-migrate @ 8321]
Mark Doliner <markdoliner@pidgin.im>
parents:
7480
diff
changeset
|
1897 | g_free(buf); |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1898 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1899 | } |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1900 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1901 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1902 | ask_delete_account_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1903 | { |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1904 | GtkTreeSelection *selection; |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1905 | |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1906 | selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dialog->treeview)); |
|
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1907 | |
| 5774 | 1908 | gtk_tree_selection_selected_foreach(selection, ask_delete_account_sel, |
|
5701
4b941cc008c5
[gaim-migrate @ 6122]
Christian Hammond <chipx86@chipx86.com>
parents:
5700
diff
changeset
|
1909 | dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1910 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1911 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1912 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1913 | close_accounts_cb(GtkWidget *w, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1914 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
1915 | pidgin_accounts_window_hide(); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1916 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1917 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1918 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1919 | static void |
| 10400 | 1920 | enabled_cb(GtkCellRendererToggle *renderer, gchar *path_str, |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1921 | gpointer data) |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1922 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1923 | AccountsWindow *dialog = (AccountsWindow *)data; |
| 15884 | 1924 | PurpleAccount *account; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1925 | GtkTreeModel *model = GTK_TREE_MODEL(dialog->model); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1926 | GtkTreeIter iter; |
| 10400 | 1927 | gboolean enabled; |
| 15884 | 1928 | const PurpleSavedStatus *saved_status; |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1929 | |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1930 | gtk_tree_model_get_iter_from_string(model, &iter, path_str); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1931 | gtk_tree_model_get(model, &iter, |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1932 | COLUMN_DATA, &account, |
| 10400 | 1933 | COLUMN_ENABLED, &enabled, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1934 | -1); |
|
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1935 | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1936 | /* |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1937 | * If we just enabled the account, then set the statuses |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1938 | * to the current status. |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1939 | */ |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1940 | if (!enabled) |
|
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1941 | { |
| 15884 | 1942 | saved_status = purple_savedstatus_get_current(); |
| 1943 | purple_savedstatus_activate_for_account(saved_status, account); | |
|
14044
024d74b6bb08
[gaim-migrate @ 16550]
Mark Doliner <markdoliner@pidgin.im>
parents:
13775
diff
changeset
|
1944 | } |
|
11724
d3f71bc34b4f
[gaim-migrate @ 14015]
Mark Doliner <markdoliner@pidgin.im>
parents:
11654
diff
changeset
|
1945 | |
| 15884 | 1946 | purple_account_set_enabled(account, PIDGIN_UI, !enabled); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1947 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1948 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1949 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
1950 | add_columns(GtkWidget *treeview, AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1951 | { |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1952 | GtkCellRenderer *renderer; |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1953 | GtkTreeViewColumn *column; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1954 | |
| 15240 | 1955 | /* Enabled */ |
| 1956 | renderer = gtk_cell_renderer_toggle_new(); | |
| 1957 | ||
| 1958 | g_signal_connect(G_OBJECT(renderer), "toggled", | |
| 1959 | G_CALLBACK(enabled_cb), dialog); | |
| 1960 | ||
| 1961 | column = gtk_tree_view_column_new_with_attributes(_("Enabled"), | |
| 1962 | renderer, "active", COLUMN_ENABLED, NULL); | |
| 1963 | ||
|
23292
4ffd6137ef9b
Change how the columns in the account-manager window are resized.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
23289
diff
changeset
|
1964 | 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
|
1965 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 1966 | |
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
1967 | /* Username column */ |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1968 | 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
|
1969 | gtk_tree_view_column_set_title(column, _("Username")); |
| 9519 | 1970 | 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
|
1971 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1972 | |
|
15496
76b5ca00a36c
I think this takes care of protocol icons. Note there are still places
Sean Egan <seanegan@pidgin.im>
parents:
15435
diff
changeset
|
1973 | /* Buddy Icon */ |
| 15240 | 1974 | renderer = gtk_cell_renderer_pixbuf_new(); |
| 1975 | gtk_tree_view_column_pack_start(column, renderer, FALSE); | |
| 1976 | gtk_tree_view_column_add_attribute(column, renderer, | |
| 1977 | "pixbuf", COLUMN_BUDDYICON); | |
| 1978 | ||
|
25889
26d9ca30335c
Change "screen name" to "username" or "buddy name" in a whole bunch of
Mark Doliner <markdoliner@pidgin.im>
parents:
25888
diff
changeset
|
1979 | /* Username */ |
| 15240 | 1980 | renderer = gtk_cell_renderer_text_new(); |
| 1981 | gtk_tree_view_column_pack_start(column, renderer, TRUE); | |
| 1982 | 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
|
1983 | "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
|
1984 | dialog->username_col = column; |
| 15240 | 1985 | |
| 1986 | ||
| 1987 | /* Protocol name */ | |
| 1988 | column = gtk_tree_view_column_new(); | |
| 1989 | 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
|
1990 | 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
|
1991 | gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), column); |
| 15240 | 1992 | |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
1993 | /* Icon */ |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
1994 | renderer = gtk_cell_renderer_pixbuf_new(); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1995 | gtk_tree_view_column_pack_start(column, renderer, FALSE); |
|
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1996 | gtk_tree_view_column_add_attribute(column, renderer, |
| 5693 | 1997 | "pixbuf", COLUMN_ICON); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
1998 | |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
1999 | renderer = gtk_cell_renderer_text_new(); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2000 | gtk_tree_view_column_pack_start(column, renderer, TRUE); |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2001 | gtk_tree_view_column_add_attribute(column, renderer, |
|
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2002 | "text", COLUMN_PROTOCOL); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2003 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2004 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2005 | static void |
| 15884 | 2006 | 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
|
2007 | { |
|
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
|
2008 | GdkPixbuf *pixbuf, *buddyicon = NULL; |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2009 | PurpleStoredImage *img = 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
|
2010 | PurplePlugin *prpl; |
|
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
|
2011 | PurplePluginProtocolInfo *prpl_info = NULL; |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2012 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2013 | pixbuf = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM); |
| 15884 | 2014 | if ((pixbuf != NULL) && purple_account_is_disconnected(account)) |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2015 | gdk_pixbuf_saturate_and_pixelate(pixbuf, pixbuf, 0.0, FALSE); |
|
6751
0edfd15b9f10
[gaim-migrate @ 7283]
Christian Hammond <chipx86@chipx86.com>
parents:
6732
diff
changeset
|
2016 | |
|
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
|
2017 | prpl = purple_find_prpl(purple_account_get_protocol_id(account)); |
|
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
|
2018 | if (prpl != NULL) |
|
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2019 | prpl_info = PURPLE_PLUGIN_PROTOCOL_INFO(prpl); |
|
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
|
2020 | if (prpl_info != NULL && prpl_info->icon_spec.format != NULL) { |
|
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2021 | 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
|
2022 | if (global_buddyicon != NULL) |
|
9e134e98b42c
Don't display the buddy icon for accounts that don't support buddy icons. Fixes #1414. This also includes a fix for crashing caused by the gtalk hackery (the crashing is fixed, but the hackery still doesn't work).
Daniel Atallah <datallah@pidgin.im>
parents:
17416
diff
changeset
|
2023 | buddyicon = g_object_ref(G_OBJECT(global_buddyicon)); |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2024 | else { |
|
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2025 | /* 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
|
2026 | 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
|
2027 | 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
|
2028 | if ((path != NULL) && (*path != '\0')) { |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2029 | img = purple_imgstore_new_from_file(path); |
|
27581
c9711347326d
Don't try to load an image from an empty path. It just spews to the debug log.
Etan Reisner <deryni@pidgin.im>
parents:
26820
diff
changeset
|
2030 | } |
|
25529
6e7e5c40d3a9
Fix a bug where the thumbnail buddy icon in the Accounts dialog would
Mark Doliner <markdoliner@pidgin.im>
parents:
25457
diff
changeset
|
2031 | } |
|
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
|
2032 | } 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
|
2033 | 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
|
2034 | } |
|
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
|
2035 | } |
|
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
|
2036 | |
|
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
|
2037 | 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
|
2038 | GdkPixbuf *buddyicon_pixbuf; |
|
22897
93d7ad160755
Add a utility function to create a pixbuf from a stored image.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22455
diff
changeset
|
2039 | buddyicon_pixbuf = pidgin_pixbuf_from_imgstore(img); |
|
16538
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2040 | purple_imgstore_unref(img); |
|
c7e61e2917c9
Updates for the account buddy icon stuff. This doesn't yet work fully (and maybe not even partly), but it compiles.
Richard Laager <rlaager@pidgin.im>
parents:
16446
diff
changeset
|
2041 | |
|
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
|
2042 | 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
|
2043 | 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
|
2044 | 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
|
2045 | } |
| 15240 | 2046 | } |
| 2047 | ||
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2048 | gtk_list_store_set(store, iter, |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2049 | 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
|
2050 | 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
|
2051 | COLUMN_USERNAME, purple_account_get_username(account), |
| 15884 | 2052 | COLUMN_ENABLED, purple_account_get_enabled(account, PIDGIN_UI), |
| 2053 | COLUMN_PROTOCOL, purple_account_get_protocol_name(account), | |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2054 | COLUMN_DATA, account, |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2055 | -1); |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2056 | |
|
13091
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2057 | if (pixbuf != NULL) |
|
b5ed878998dd
[gaim-migrate @ 15452]
Mark Doliner <markdoliner@pidgin.im>
parents:
13014
diff
changeset
|
2058 | 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
|
2059 | 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
|
2060 | g_object_unref(G_OBJECT(buddyicon)); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2061 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2062 | |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2063 | static void |
| 15884 | 2064 | add_account_to_liststore(PurpleAccount *account, gpointer user_data) |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2065 | { |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2066 | 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
|
2067 | GdkPixbuf *global_buddyicon = user_data; |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2068 | |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2069 | if (accounts_window == NULL) |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2070 | return; |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2071 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2072 | gtk_list_store_append(accounts_window->model, &iter); |
| 15053 | 2073 | 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
|
2074 | |
|
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
|
2075 | set_account(accounts_window->model, &iter, account, global_buddyicon); |
|
5698
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2076 | } |
|
3066afeab46d
[gaim-migrate @ 6119]
Christian Hammond <chipx86@chipx86.com>
parents:
5697
diff
changeset
|
2077 | |
| 15053 | 2078 | static gboolean |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2079 | populate_accounts_list(AccountsWindow *dialog) |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2080 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2081 | GList *l; |
| 15053 | 2082 | gboolean ret = FALSE; |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2083 | 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
|
2084 | 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
|
2085 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2086 | gtk_list_store_clear(dialog->model); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2087 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2088 | if ((path = purple_prefs_get_path(PIDGIN_PREFS_ROOT "/accounts/buddyicon")) != NULL) { |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2089 | GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(path, 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
|
2090 | 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
|
2091 | 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
|
2092 | 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
|
2093 | } |
|
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
|
2094 | } |
|
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
|
2095 | |
| 15884 | 2096 | for (l = purple_accounts_get_all(); l != NULL; l = l->next) { |
| 15053 | 2097 | ret = TRUE; |
| 15884 | 2098 | add_account_to_liststore((PurpleAccount *)l->data, global_buddyicon); |
| 15053 | 2099 | } |
| 2100 | ||
|
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
|
2101 | 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
|
2102 | 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
|
2103 | |
| 15053 | 2104 | return ret; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2105 | } |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2106 | |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2107 | static void |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2108 | account_selected_cb(GtkTreeSelection *sel, AccountsWindow *dialog) |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2109 | { |
|
8406
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2110 | gboolean selected = FALSE; |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2111 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2112 | selected = (gtk_tree_selection_count_selected_rows(sel) > 0); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2113 | |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2114 | gtk_widget_set_sensitive(dialog->modify_button, selected); |
|
4c764d24f29d
[gaim-migrate @ 9136]
Christian Hammond <chipx86@chipx86.com>
parents:
8405
diff
changeset
|
2115 | gtk_widget_set_sensitive(dialog->delete_button, selected); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2116 | } |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2117 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2118 | static gboolean |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2119 | 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
|
2120 | { |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2121 | AccountsWindow *dialog; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2122 | GtkTreePath *path; |
| 11113 | 2123 | GtkTreeViewColumn *column; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2124 | GtkTreeIter iter; |
| 15884 | 2125 | PurpleAccount *account; |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2126 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2127 | dialog = (AccountsWindow *)user_data; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2128 | |
|
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
|
2129 | 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
|
2130 | 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
|
2131 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2132 | /* Figure out which node was clicked */ |
| 11113 | 2133 | 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
|
2134 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2135 | 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
|
2136 | 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
|
2137 | return FALSE; |
|
22455
1e4f21a50bc6
Plug some leaks caused by GtkTreePaths not being freed.
Daniel Atallah <datallah@pidgin.im>
parents:
22385
diff
changeset
|
2138 | } |
|
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
|
2139 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2140 | 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
|
2141 | gtk_tree_path_free(path); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2142 | 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
|
2143 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2144 | if ((account != NULL) && (event->button == 1) && |
|
22056
d652ea774f31
Double clicking the column header/divider, or in the 'enabled' column shouldn't bring up the account-modify window. Fixes #3733.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22032
diff
changeset
|
2145 | (event->type == GDK_2BUTTON_PRESS)) |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2146 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2147 | pidgin_account_dialog_show(PIDGIN_MODIFY_ACCOUNT_DIALOG, account); |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2148 | return TRUE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2149 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2150 | |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2151 | return FALSE; |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2152 | } |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2153 | |
| 5563 | 2154 | static GtkWidget * |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2155 | create_accounts_list(AccountsWindow *dialog) |
| 5563 | 2156 | { |
| 15053 | 2157 | GtkWidget *frame; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2158 | GtkWidget *sw; |
| 15053 | 2159 | GtkWidget *label; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2160 | GtkWidget *treeview; |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2161 | GtkTreeSelection *sel; |
| 15884 | 2162 | GtkTargetEntry gte[] = {{"PURPLE_ACCOUNT", GTK_TARGET_SAME_APP, 0}}; |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2163 | char *pretty, *tmp; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2164 | |
| 15053 | 2165 | frame = gtk_frame_new(NULL); |
| 2166 | gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_IN); | |
| 2167 | ||
| 2168 | accounts_window->notebook = gtk_notebook_new(); | |
| 2169 | gtk_notebook_set_show_tabs(GTK_NOTEBOOK(accounts_window->notebook), FALSE); | |
| 2170 | gtk_notebook_set_show_border(GTK_NOTEBOOK(accounts_window->notebook), FALSE); | |
| 2171 | gtk_container_add(GTK_CONTAINER(frame), accounts_window->notebook); | |
| 2172 | ||
| 2173 | /* 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
|
2174 | label = gtk_label_new(NULL); |
| 15084 | 2175 | /* Translators: Please maintain the use of -> or <- to represent the menu heirarchy */ |
|
16071
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2176 | tmp = g_strdup_printf(_( |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2177 | "<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
|
2178 | |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2179 | "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
|
2180 | "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
|
2181 | "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
|
2182 | "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
|
2183 | |
| 15053 | 2184 | "You can come back to this window to add, edit, or remove " |
|
24136
9921664cfa6d
It's not "Accounts->Add/Edit" any more, it's now "Accounts->Manage Accounts".
Richard Laager <rlaager@pidgin.im>
parents:
23880
diff
changeset
|
2185 | "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
|
2186 | "List window"), PIDGIN_NAME, PIDGIN_NAME, PIDGIN_NAME); |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2187 | pretty = pidgin_make_pretty_arrows(tmp); |
|
044392e01c96
make things cleaner for translators
Nathan Walp <nwalp@pidgin.im>
parents:
15999
diff
changeset
|
2188 | g_free(tmp); |
| 15086 | 2189 | gtk_label_set_markup(GTK_LABEL(label), pretty); |
| 2190 | g_free(pretty); | |
| 2191 | ||
| 15053 | 2192 | gtk_label_set_line_wrap(GTK_LABEL(label), TRUE); |
| 2193 | gtk_widget_show(label); | |
| 2194 | ||
| 2195 | gtk_misc_set_alignment(GTK_MISC(label), 0.5, 0.5); | |
| 2196 | gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), label, NULL); | |
| 2197 | ||
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2198 | /* Create the scrolled window. */ |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2199 | sw = gtk_scrolled_window_new(0, 0); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2200 | gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), |
| 13775 | 2201 | GTK_POLICY_AUTOMATIC, |
| 2202 | GTK_POLICY_AUTOMATIC); | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2203 | gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw), |
| 15053 | 2204 | GTK_SHADOW_NONE); |
| 2205 | gtk_notebook_append_page(GTK_NOTEBOOK(accounts_window->notebook), sw, NULL); | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2206 | gtk_widget_show(sw); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2207 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2208 | /* Create the list model. */ |
|
5781
7c5b3e132a6d
[gaim-migrate @ 6206]
Christian Hammond <chipx86@chipx86.com>
parents:
5779
diff
changeset
|
2209 | dialog->model = gtk_list_store_new(NUM_COLUMNS, |
| 14921 | 2210 | GDK_TYPE_PIXBUF, /* COLUMN_ICON */ |
| 15240 | 2211 | 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
|
2212 | G_TYPE_STRING, /* COLUMN_USERNAME */ |
| 14921 | 2213 | G_TYPE_BOOLEAN, /* COLUMN_ENABLED */ |
| 2214 | 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
|
2215 | G_TYPE_POINTER /* COLUMN_DATA */ |
| 14921 | 2216 | ); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2217 | |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2218 | /* And now the actual treeview */ |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2219 | 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
|
2220 | dialog->treeview = treeview; |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2221 | gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE); |
|
22214
e8a9916cb99e
It turns out the tree-models need to be unref'ed.
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22177
diff
changeset
|
2222 | g_object_unref(G_OBJECT(dialog->model)); |
|
10418
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2223 | |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2224 | sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(treeview)); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2225 | gtk_tree_selection_set_mode(sel, GTK_SELECTION_MULTIPLE); |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2226 | g_signal_connect(G_OBJECT(sel), "changed", |
|
7b632343a29c
[gaim-migrate @ 11669]
Mark Doliner <markdoliner@pidgin.im>
parents:
10413
diff
changeset
|
2227 | G_CALLBACK(account_selected_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2228 | |
|
10640
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2229 | /* Handle double-clicking */ |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2230 | g_signal_connect(G_OBJECT(treeview), "button_press_event", |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2231 | G_CALLBACK(account_treeview_double_click_cb), dialog); |
|
440a5c056725
[gaim-migrate @ 12145]
Cestonaro Thilo <ephraim@users.sourceforge.net>
parents:
10605
diff
changeset
|
2232 | |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2233 | gtk_container_add(GTK_CONTAINER(sw), treeview); |
|
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2234 | |
| 5774 | 2235 | 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
|
2236 | gtk_tree_view_columns_autosize(GTK_TREE_VIEW(treeview)); |
|
5581
646cda748437
[gaim-migrate @ 5985]
Christian Hammond <chipx86@chipx86.com>
parents:
5573
diff
changeset
|
2237 | |
| 15053 | 2238 | if (populate_accounts_list(dialog)) |
| 2239 | 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
|
2240 | else |
| 15053 | 2241 | 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
|
2242 | |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2243 | /* Setup DND. I wanna be an orc! */ |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2244 | gtk_tree_view_enable_model_drag_source( |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2245 | GTK_TREE_VIEW(treeview), GDK_BUTTON1_MASK, gte, |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2246 | 1, GDK_ACTION_COPY); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2247 | gtk_tree_view_enable_model_drag_dest( |
|
5779
8c8b8c8139c2
[gaim-migrate @ 6204]
Christian Hammond <chipx86@chipx86.com>
parents:
5774
diff
changeset
|
2248 | GTK_TREE_VIEW(treeview), gte, 1, |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2249 | GDK_ACTION_COPY | GDK_ACTION_MOVE); |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2250 | |
|
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2251 | g_signal_connect(G_OBJECT(treeview), "drag-data-received", |
| 5774 | 2252 | G_CALLBACK(drag_data_received_cb), dialog); |
|
5620
c5f0a3c434fd
[gaim-migrate @ 6027]
Christian Hammond <chipx86@chipx86.com>
parents:
5617
diff
changeset
|
2253 | g_signal_connect(G_OBJECT(treeview), "drag-data-get", |
| 5774 | 2254 | 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
|
2255 | |
| 15053 | 2256 | gtk_widget_show_all(frame); |
| 2257 | return frame; | |
| 5563 | 2258 | } |
| 2259 | ||
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2260 | static void |
| 15884 | 2261 | account_modified_cb(PurpleAccount *account, AccountsWindow *window) |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2262 | { |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2263 | GtkTreeIter iter; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2264 | |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2265 | if (!accounts_window_find_account_in_treemodel(&iter, account)) |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2266 | return; |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2267 | |
|
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
|
2268 | set_account(window->model, &iter, account, NULL); |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2269 | } |
|
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2270 | |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2271 | static void |
| 15884 | 2272 | global_buddyicon_changed(const char *name, PurplePrefType type, |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2273 | gconstpointer value, gpointer window) |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2274 | { |
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2275 | GList *list; |
| 15884 | 2276 | for (list = purple_accounts_get_all(); list; list = list->next) { |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2277 | account_modified_cb(list->data, window); |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2278 | } |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2279 | } |
|
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2280 | |
| 5563 | 2281 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2282 | pidgin_accounts_window_show(void) |
| 5563 | 2283 | { |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2284 | AccountsWindow *dialog; |
| 5563 | 2285 | GtkWidget *win; |
| 2286 | GtkWidget *vbox; | |
| 2287 | GtkWidget *sw; | |
| 2288 | GtkWidget *button; | |
| 2289 | int width, height; | |
| 2290 | ||
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2291 | if (accounts_window != NULL) { |
|
9482
8ade66642b6e
[gaim-migrate @ 10307]
Mark Doliner <markdoliner@pidgin.im>
parents:
9337
diff
changeset
|
2292 | gtk_window_present(GTK_WINDOW(accounts_window->window)); |
| 5563 | 2293 | return; |
|
6371
e92b66ee5518
[gaim-migrate @ 6876]
Christian Hammond <chipx86@chipx86.com>
parents:
6368
diff
changeset
|
2294 | } |
| 5563 | 2295 | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2296 | accounts_window = dialog = g_new0(AccountsWindow, 1); |
| 5563 | 2297 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2298 | 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
|
2299 | height = purple_prefs_get_int(PIDGIN_PREFS_ROOT "/accounts/dialog/height"); |
| 5563 | 2300 | |
|
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
|
2301 | dialog->window = win = pidgin_create_dialog(_("Accounts"), PIDGIN_HIG_BORDER, "accounts", TRUE); |
| 5563 | 2302 | gtk_window_set_default_size(GTK_WINDOW(win), width, height); |
| 2303 | ||
| 2304 | g_signal_connect(G_OBJECT(win), "delete_event", | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2305 | G_CALLBACK(accedit_win_destroy_cb), accounts_window); |
| 5563 | 2306 | |
| 2307 | /* 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
|
2308 | vbox = pidgin_dialog_get_vbox_with_properties(GTK_DIALOG(win), FALSE, PIDGIN_HIG_BORDER); |
| 5563 | 2309 | |
| 2310 | /* Setup the scrolled window that will contain the list of accounts. */ | |
| 5774 | 2311 | sw = create_accounts_list(dialog); |
| 5563 | 2312 | gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0); |
| 2313 | gtk_widget_show(sw); | |
| 2314 | ||
| 2315 | /* Add button */ | |
|
24594
b2da1decae23
Add an ellipsis to the "Add" and "Modify" buttons in the accounts, pounces, and
Alex Willmer <alex@moreati.org.uk>
parents:
24578
diff
changeset
|
2316 | pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_ADD, G_CALLBACK(add_account_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2317 | |
| 5563 | 2318 | /* Modify button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2319 | button = pidgin_dialog_add_button(GTK_DIALOG(win), PIDGIN_STOCK_MODIFY, G_CALLBACK(modify_account_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2320 | dialog->modify_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2321 | gtk_widget_set_sensitive(button, FALSE); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2322 | |
| 5563 | 2323 | /* Delete button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2324 | button = pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_DELETE, G_CALLBACK(ask_delete_account_cb), dialog); |
|
5703
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2325 | dialog->delete_button = button; |
|
3d4600423773
[gaim-migrate @ 6124]
Christian Hammond <chipx86@chipx86.com>
parents:
5702
diff
changeset
|
2326 | gtk_widget_set_sensitive(button, FALSE); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2327 | |
| 5563 | 2328 | /* Close button */ |
|
22005
0183020ba2cc
Add a utility function pidgin_dialog_add_button to add buttons to a dialog
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
22000
diff
changeset
|
2329 | pidgin_dialog_add_button(GTK_DIALOG(win), GTK_STOCK_CLOSE, G_CALLBACK(close_accounts_cb), dialog); |
|
5569
c0e413ace539
[gaim-migrate @ 5971]
Christian Hammond <chipx86@chipx86.com>
parents:
5567
diff
changeset
|
2330 | |
| 15884 | 2331 | purple_signal_connect(pidgin_account_get_handle(), "account-modified", |
|
12521
0284088b422d
[gaim-migrate @ 14833]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
12493
diff
changeset
|
2332 | accounts_window, |
| 15884 | 2333 | PURPLE_CALLBACK(account_modified_cb), accounts_window); |
| 2334 | 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
|
2335 | PIDGIN_PREFS_ROOT "/accounts/buddyicon", |
|
15352
81a10752d5e0
[gaim-migrate @ 18080]
Sadrul Habib Chowdhury <sadrul@pidgin.im>
parents:
15301
diff
changeset
|
2336 | global_buddyicon_changed, accounts_window); |
|
5615
2eb715cbbd9b
[gaim-migrate @ 6022]
Christian Hammond <chipx86@chipx86.com>
parents:
5592
diff
changeset
|
2337 | |
| 5563 | 2338 | gtk_widget_show(win); |
| 2339 | } | |
| 2340 | ||
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2341 | void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2342 | pidgin_accounts_window_hide(void) |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2343 | { |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2344 | if (accounts_window == NULL) |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2345 | return; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2346 | |
|
18841
71c4218684cb
pidgin_accounts_window_hide() should actually dispose of the window. Fixes #2193.
Daniel Atallah <datallah@pidgin.im>
parents:
18706
diff
changeset
|
2347 | 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
|
2348 | 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
|
2349 | |
| 15884 | 2350 | purple_signals_disconnect_by_handle(accounts_window); |
| 2351 | purple_prefs_disconnect_by_handle(accounts_window); | |
|
6119
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2352 | |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2353 | g_free(accounts_window); |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2354 | accounts_window = NULL; |
|
5b4c66789a8c
[gaim-migrate @ 6588]
Christian Hammond <chipx86@chipx86.com>
parents:
6092
diff
changeset
|
2355 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2356 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2357 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2358 | free_add_user_data(PidginAccountAddUserData *data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2359 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2360 | g_free(data->username); |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2361 | g_free(data->alias); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2362 | g_free(data); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2363 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2364 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2365 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2366 | add_user_cb(PidginAccountAddUserData *data) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2367 | { |
| 15884 | 2368 | PurpleConnection *gc = purple_account_get_connection(data->account); |
| 2369 | ||
|
18122
9bf9970c1b6a
disapproval of revision '2d8ea56b90971e7851442d96b7d74ecb4f052126'
Richard Laager <rlaager@pidgin.im>
parents:
18121
diff
changeset
|
2370 | if (g_list_find(purple_connections_get_all(), gc)) |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2371 | { |
| 15884 | 2372 | purple_blist_request_add_buddy(data->account, data->username, |
|
7060
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2373 | NULL, data->alias); |
|
717cbeb22b6d
[gaim-migrate @ 7623]
Christian Hammond <chipx86@chipx86.com>
parents:
7015
diff
changeset
|
2374 | } |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2375 | |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2376 | free_add_user_data(data); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2377 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2378 | |
| 12285 | 2379 | static char * |
| 15884 | 2380 | make_info(PurpleAccount *account, PurpleConnection *gc, const char *remote_user, |
| 12285 | 2381 | const char *id, const char *alias, const char *msg) |
| 2382 | { | |
|
12976
aedbdb6f9adb
[gaim-migrate @ 15329]
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
12960
diff
changeset
|
2383 | if (msg != NULL && *msg == '\0') |
|
12960
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2384 | msg = NULL; |
|
69571cc82fda
[gaim-migrate @ 15313]
Richard Laager <rlaager@pidgin.im>
parents:
12843
diff
changeset
|
2385 | |
| 12286 | 2386 | return g_strdup_printf(_("%s%s%s%s has made %s his or her buddy%s%s"), |
| 12285 | 2387 | remote_user, |
| 2388 | (alias != NULL ? " (" : ""), | |
| 2389 | (alias != NULL ? alias : ""), | |
| 2390 | (alias != NULL ? ")" : ""), | |
| 2391 | (id != NULL | |
| 2392 | ? id | |
| 15884 | 2393 | : (purple_connection_get_display_name(gc) != NULL |
| 2394 | ? purple_connection_get_display_name(gc) | |
| 2395 | : purple_account_get_username(account))), | |
| 15096 | 2396 | (msg != NULL ? ": " : "."), |
| 12285 | 2397 | (msg != NULL ? msg : "")); |
| 2398 | } | |
| 2399 | ||
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2400 | static void |
| 15884 | 2401 | pidgin_accounts_notify_added(PurpleAccount *account, const char *remote_user, |
| 12285 | 2402 | const char *id, const char *alias, |
| 2403 | const char *msg) | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2404 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2405 | char *buffer; |
| 15884 | 2406 | PurpleConnection *gc; |
| 15094 | 2407 | GtkWidget *alert; |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2408 | |
| 15884 | 2409 | gc = purple_account_get_connection(account); |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2410 | |
| 12285 | 2411 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2412 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_INFO, buffer, |
| 15094 | 2413 | NULL, NULL, _("Close"), NULL, NULL); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2414 | pidgin_blist_add_alert(alert); |
| 12285 | 2415 | |
| 2416 | g_free(buffer); | |
| 2417 | } | |
| 2418 | ||
| 2419 | static void | |
| 15884 | 2420 | pidgin_accounts_request_add(PurpleAccount *account, const char *remote_user, |
| 12285 | 2421 | const char *id, const char *alias, |
| 2422 | const char *msg) | |
| 2423 | { | |
| 2424 | char *buffer; | |
| 15884 | 2425 | PurpleConnection *gc; |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2426 | PidginAccountAddUserData *data; |
| 15094 | 2427 | GtkWidget *alert; |
| 12285 | 2428 | |
| 15884 | 2429 | gc = purple_account_get_connection(account); |
| 12285 | 2430 | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2431 | data = g_new0(PidginAccountAddUserData, 1); |
| 12285 | 2432 | data->account = account; |
| 2433 | data->username = g_strdup(remote_user); | |
|
14097
0c340861ab79
[gaim-migrate @ 16638]
Mark Doliner <markdoliner@pidgin.im>
parents:
14087
diff
changeset
|
2434 | 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
|
2435 | |
| 12285 | 2436 | buffer = make_info(account, gc, remote_user, id, alias, msg); |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2437 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION, |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2438 | _("Add buddy to your list?"), buffer, data, |
| 15119 | 2439 | _("Add"), G_CALLBACK(add_user_cb), |
| 2440 | _("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
|
2441 | 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
|
2442 | |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2443 | g_free(buffer); |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2444 | } |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2445 | |
| 15119 | 2446 | struct auth_and_add { |
| 15884 | 2447 | PurpleAccountRequestAuthorizationCb auth_cb; |
| 2448 | PurpleAccountRequestAuthorizationCb deny_cb; | |
| 15119 | 2449 | void *data; |
| 2450 | char *username; | |
| 2451 | char *alias; | |
| 15884 | 2452 | PurpleAccount *account; |
| 15119 | 2453 | }; |
| 2454 | ||
| 2455 | static void | |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2456 | free_auth_and_add(struct auth_and_add *aa) |
| 15119 | 2457 | { |
| 2458 | g_free(aa->username); | |
| 2459 | g_free(aa->alias); | |
| 2460 | g_free(aa); | |
| 2461 | } | |
| 2462 | ||
| 2463 | static void | |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2464 | authorize_and_add_cb(struct auth_and_add *aa) |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2465 | { |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2466 | aa->auth_cb(aa->data); |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2467 | purple_blist_request_add_buddy(aa->account, aa->username, |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2468 | NULL, aa->alias); |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2469 | } |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2470 | |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2471 | static void |
| 15119 | 2472 | deny_no_add_cb(struct auth_and_add *aa) |
| 2473 | { | |
| 2474 | aa->deny_cb(aa->data); | |
| 2475 | } | |
| 2476 | ||
|
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
|
2477 | 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
|
2478 | 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
|
2479 | 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
|
2480 | 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
|
2481 | 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
|
2482 | 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
|
2483 | 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
|
2484 | 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
|
2485 | 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
|
2486 | void *user_data) |
| 15119 | 2487 | { |
| 2488 | char *buffer; | |
| 15884 | 2489 | PurpleConnection *gc; |
| 15119 | 2490 | GtkWidget *alert; |
| 2491 | ||
| 15884 | 2492 | gc = purple_account_get_connection(account); |
| 15119 | 2493 | if (message != NULL && *message == '\0') |
| 2494 | message = NULL; | |
|
15518
234684c3ed08
Avoid scaling the global buddy icon for each account when populating the Accounts dialog list.
Daniel Atallah <datallah@pidgin.im>
parents:
15498
diff
changeset
|
2495 | |
| 15119 | 2496 | buffer = g_strdup_printf(_("%s%s%s%s wants to add %s to his or her buddy list%s%s"), |
| 2497 | remote_user, | |
| 2498 | (alias != NULL ? " (" : ""), | |
| 2499 | (alias != NULL ? alias : ""), | |
| 2500 | (alias != NULL ? ")" : ""), | |
| 2501 | (id != NULL | |
| 2502 | ? id | |
| 15884 | 2503 | : (purple_connection_get_display_name(gc) != NULL |
| 2504 | ? purple_connection_get_display_name(gc) | |
| 2505 | : purple_account_get_username(account))), | |
| 15119 | 2506 | (message != NULL ? ": " : "."), |
| 2507 | (message != NULL ? message : "")); | |
| 2508 | ||
| 2509 | ||
| 15197 | 2510 | if (!on_list) { |
| 15119 | 2511 | struct auth_and_add *aa = g_new0(struct auth_and_add, 1); |
|
19125
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2512 | aa->auth_cb = auth_cb; |
|
d92cd58cc6ba
Correct the types of the authorize_cb and deny_cb parameters of
Will Thompson <resiak@pidgin.im>
parents:
19049
diff
changeset
|
2513 | aa->deny_cb = deny_cb; |
| 15119 | 2514 | aa->data = user_data; |
| 2515 | aa->username = g_strdup(remote_user); | |
| 2516 | aa->alias = g_strdup(alias); | |
| 2517 | aa->account = account; | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2518 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION, |
| 15119 | 2519 | _("Authorize buddy?"), buffer, aa, |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2520 | _("Authorize"), authorize_and_add_cb, |
|
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2521 | _("Deny"), deny_no_add_cb, |
| 15119 | 2522 | NULL); |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2523 | g_signal_connect_swapped(G_OBJECT(alert), "destroy", G_CALLBACK(free_auth_and_add), aa); |
| 15119 | 2524 | } else { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2525 | alert = pidgin_make_mini_dialog(gc, PIDGIN_STOCK_DIALOG_QUESTION, |
| 15119 | 2526 | _("Authorize buddy?"), buffer, user_data, |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2527 | _("Authorize"), auth_cb, |
|
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2528 | _("Deny"), deny_cb, |
| 15119 | 2529 | NULL); |
| 2530 | } | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2531 | pidgin_blist_add_alert(alert); |
|
24861
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2532 | g_signal_connect(G_OBJECT(alert), "destroy", |
|
482524bb3e81
A patch to clean up authorization request related stuff. Fixes #7695.
Paul Aurich <darkrain42@pidgin.im>
parents:
24672
diff
changeset
|
2533 | G_CALLBACK(purple_account_request_close), NULL); |
| 15119 | 2534 | |
| 2535 | g_free(buffer); | |
|
15999
77ac8981199b
Some pixmap path fixes and win32 fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15931
diff
changeset
|
2536 | |
|
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
|
2537 | 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
|
2538 | } |
|
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
|
2539 | |
|
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
|
2540 | static void |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2541 | 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
|
2542 | { |
|
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
|
2543 | gtk_widget_destroy(GTK_WIDGET(ui_handle)); |
| 15119 | 2544 | } |
| 2545 | ||
| 15884 | 2546 | static PurpleAccountUiOps ui_ops = |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2547 | { |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2548 | pidgin_accounts_notify_added, |
| 12285 | 2549 | NULL, |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2550 | pidgin_accounts_request_add, |
|
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2551 | 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
|
2552 | 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
|
2553 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16658
diff
changeset
|
2554 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16658
diff
changeset
|
2555 | NULL, |
|
e6bcb1628c57
Patch from John 'rekkanoryo' Bailey to add the padding struct members in pidgin
Gary Kramlich <grim@reaperworld.com>
parents:
16658
diff
changeset
|
2556 | NULL |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2557 | }; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2558 | |
| 15884 | 2559 | PurpleAccountUiOps * |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2560 | pidgin_accounts_get_ui_ops(void) |
|
7015
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2561 | { |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2562 | return &ui_ops; |
|
bea9111282b3
[gaim-migrate @ 7578]
Christian Hammond <chipx86@chipx86.com>
parents:
6856
diff
changeset
|
2563 | } |
| 9609 | 2564 | |
| 2565 | void * | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2566 | pidgin_account_get_handle(void) { |
| 9609 | 2567 | static int handle; |
| 2568 | ||
| 2569 | return &handle; | |
| 2570 | } | |
| 2571 | ||
| 2572 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2573 | pidgin_account_init(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2574 | { |
|
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
|
2575 | 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
|
2576 | 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
|
2577 | 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
|
2578 | 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
|
2579 | 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
|
2580 | 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
|
2581 | 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
|
2582 | 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
|
2583 | 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
|
2584 | 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
|
2585 | 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
|
2586 | 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
|
2587 | } |
|
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
|
2588 | } |
|
15785
97587447d0bf
Leak fix and printf removal.
Daniel Atallah <datallah@pidgin.im>
parents:
15779
diff
changeset
|
2589 | |
|
16123
8b98683319e7
Rename /purple/gtk preferences back to /gaim/gtk to allow for smooth upgrades
Stu Tomlinson <nosnilmot@pidgin.im>
parents:
16071
diff
changeset
|
2590 | 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
|
2591 | g_free(default_avatar); |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2592 | |
| 15884 | 2593 | purple_signal_register(pidgin_account_get_handle(), "account-modified", |
| 2594 | purple_marshal_VOID__POINTER, NULL, 1, | |
| 2595 | purple_value_new(PURPLE_TYPE_SUBTYPE, | |
| 2596 | PURPLE_SUBTYPE_ACCOUNT)); | |
| 2597 | ||
| 2598 | /* Setup some purple signal handlers. */ | |
| 2599 | purple_signal_connect(purple_connections_get_handle(), "signed-on", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2600 | pidgin_account_get_handle(), |
| 15884 | 2601 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2602 | purple_signal_connect(purple_connections_get_handle(), "signed-off", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2603 | pidgin_account_get_handle(), |
| 15884 | 2604 | PURPLE_CALLBACK(signed_on_off_cb), NULL); |
| 2605 | purple_signal_connect(purple_accounts_get_handle(), "account-added", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2606 | pidgin_account_get_handle(), |
| 15884 | 2607 | PURPLE_CALLBACK(add_account_to_liststore), NULL); |
| 2608 | purple_signal_connect(purple_accounts_get_handle(), "account-removed", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2609 | pidgin_account_get_handle(), |
| 15884 | 2610 | PURPLE_CALLBACK(account_removed_cb), NULL); |
| 2611 | purple_signal_connect(purple_accounts_get_handle(), "account-disabled", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2612 | pidgin_account_get_handle(), |
| 15884 | 2613 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(FALSE)); |
| 2614 | purple_signal_connect(purple_accounts_get_handle(), "account-enabled", | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2615 | pidgin_account_get_handle(), |
| 15884 | 2616 | PURPLE_CALLBACK(account_abled_cb), GINT_TO_POINTER(TRUE)); |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2617 | |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2618 | account_pref_wins = |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2619 | g_hash_table_new_full(g_direct_hash, g_direct_equal, NULL, NULL); |
| 9609 | 2620 | } |
| 2621 | ||
| 2622 | void | |
|
15562
8c8249fe5e3c
gaim_gtk to pidgin. I hope
Sean Egan <seanegan@pidgin.im>
parents:
15537
diff
changeset
|
2623 | pidgin_account_uninit(void) |
|
10163
a916c8d1ee5c
[gaim-migrate @ 11249]
Mark Doliner <markdoliner@pidgin.im>
parents:
10159
diff
changeset
|
2624 | { |
|
11789
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2625 | /* |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2626 | * 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
|
2627 | * a callback function to use for the free-some-data-function |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2628 | * parameter of g_hash_table_new_full, above. |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2629 | */ |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2630 | g_hash_table_destroy(account_pref_wins); |
|
a3310d5f454c
[gaim-migrate @ 14080]
Mark Doliner <markdoliner@pidgin.im>
parents:
11784
diff
changeset
|
2631 | |
| 15884 | 2632 | purple_signals_disconnect_by_handle(pidgin_account_get_handle()); |
| 2633 | purple_signals_unregister_by_instance(pidgin_account_get_handle()); | |
| 9609 | 2634 | } |