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